diff --git a/setup/wizard/lib/services/unixScheduler.php b/setup/wizard/lib/services/unixScheduler.php index d3e912f..e3613b4 100644 --- a/setup/wizard/lib/services/unixScheduler.php +++ b/setup/wizard/lib/services/unixScheduler.php @@ -150,7 +150,6 @@ class unixScheduler extends unixService { function start() { // TODO : Write sh on the fly? Not sure the reasoning here $source = $this->getSchedulerSourceLoc(); - return ; if($source) { // Source $cmd = "nohup ".$source." > ".SYS_LOG_DIR."scheduler.log 2>&1 & echo $!"; $response = $this->util->pexec($cmd); diff --git a/setup/wizard/lib/services/windowsAgent.php b/setup/wizard/lib/services/windowsAgent.php index 80d99f6..19b2bf2 100644 --- a/setup/wizard/lib/services/windowsAgent.php +++ b/setup/wizard/lib/services/windowsAgent.php @@ -42,10 +42,16 @@ class windowsAgent extends windowsService { - - public function __construct() { - $this->name = "KTAgentTest"; - } + /** + * Service name + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ + public $name = "KTAgentTest"; + } ?> \ No newline at end of file diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php index 986a417..6dab5b0 100644 --- a/setup/wizard/lib/services/windowsLucene.php +++ b/setup/wizard/lib/services/windowsLucene.php @@ -122,6 +122,16 @@ class windowsLucene extends windowsService { private $luceneDir; /** + * Service name + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ + public $name = "KTLuceneTest"; + + /** * Load defaults needed by service * * @author KnowledgeTree Team @@ -130,7 +140,7 @@ class windowsLucene extends windowsService { * @return void */ public function load() { - $this->name = "KTLuceneTest"; +// $this->name = "KTLuceneTest"; $this->javaSystem = new Java('java.lang.System'); $this->setJavaBin($this->javaSystem->getProperty('java.home').DS."bin"); $this->setLuceneDIR(SYSTEM_DIR."bin".DS."luceneserver"); @@ -352,11 +362,12 @@ class windowsLucene extends windowsService { * @author KnowledgeTree Team * @access public * @param none - * @return array + * @return string */ - function install() { + public function install() { $state = $this->status(); if($state == '') { + $this->writeLuceneProperties(); $luceneExe = $this->getLuceneExe(); $luceneSource = $this->getLuceneSource(); $luceneDir = $this->getluceneDir(); @@ -371,5 +382,29 @@ class windowsLucene extends windowsService { return $state; } + /** + * Write Lucene Service property file + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ + private function writeLuceneProperties() { + // Check if bin is readable and writable + if(is_readable(SYS_BIN_DIR) && is_writable(SYS_BIN_DIR)) { + if($this->getluceneDir()) { + $fp = fopen($this->getluceneDir()."KnowledgeTreeIndexer.properties", "w+"); + $content = "server.port=8875\n"; + $content .= "server.paranoid=false\n"; + $content .= "server.accept=127.0.0.1\n"; + $content .= "server.deny=\n"; + $content .= "indexer.directory=../../var/indexes\n"; + $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n"; + fwrite($fp, $content); + fclose($fp); + } + } + } } ?> \ No newline at end of file diff --git a/setup/wizard/lib/services/windowsOpenOffice.php b/setup/wizard/lib/services/windowsOpenOffice.php index f06afb8..5f03a87 100644 --- a/setup/wizard/lib/services/windowsOpenOffice.php +++ b/setup/wizard/lib/services/windowsOpenOffice.php @@ -42,42 +42,118 @@ class windowsOpenOffice extends windowsService { - // utility + /** + * Reference to utility object + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ public $util; - // path to office + + /** + * Path to office executable + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ private $path; - // host + + /** + * Web server + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ private $host; - // pid running + + /** + * Path to temp pid file + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ private $pidFile; - // port to bind to + + /** + * Web server Port + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ private $port; - // bin folder + + /** + * Web server + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ private $bin; - // office executable + + /** + * Office executable name + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ private $soffice; - // office log file + + /** + * Log file + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ private $log; - private $options; - private $winservice; - public function __construct() { - $this->name = "openoffice"; - $this->util = new InstallUtil(); - } + /** + * Open office options + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ + private $options; + /** + * Path to win service + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ + private $winservice; + + /** + * Service name + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ + public $name = "KTOpenOfficeTest"; + public function load() { // hack for testing $this->setPort("8100"); $this->setHost("127.0.0.1"); $this->setLog("openoffice.log"); - $this->setBin("C:\Program Files (x86)\OpenOffice.org 3\program\soffice.bin"); - $this->setBin("C:\Program Files (x86)\ktdms\openoffice\program\soffice.bin"); - $this->setBin("C:\Program Files (x86)\ktdms\openoffice.2.4\program\soffice.bin"); +// $this->setBin("C:\Program Files (x86)\OpenOffice.org 3\program\soffice.bin"); +// $this->setBin("C:\Program Files (x86)\ktdms\openoffice\program\soffice.bin"); +// $this->setBin("C:\Program Files (x86)\ktdms\openoffice.2.4\program\soffice.bin"); $this->setWinservice("winserv.exe"); - $this->setOption(); +// $this->setOption(); } - + #rem "%INSTALL_PATH%\bin\winserv.exe" install %OpenofficeServiceName% -displayname "%OpenofficeServiceName%" -start auto %SOFFICE_BIN% -headless -invisible -accept=pipe,name=pypipe;urp; private function setPort($port = "8100") { $this->port = $port; } @@ -139,24 +215,5 @@ class windowsOpenOffice extends windowsService { return $status; } } - -// public function start() { -// $state = $this->status(); -// if($state != 'STARTED') { -// $cmd = 'sc start ' . $this->name; -// $response = $this->util->pexec($cmd); -// -// return $response; -// } elseif ($state == '') { -// // Start Service -// return true; -// } else { -// // Service Running Already -// return true; -// } -// -// return false; -// } - } ?> \ No newline at end of file diff --git a/setup/wizard/lib/services/windowsScheduler.php b/setup/wizard/lib/services/windowsScheduler.php index a71378e..bb2d85a 100644 --- a/setup/wizard/lib/services/windowsScheduler.php +++ b/setup/wizard/lib/services/windowsScheduler.php @@ -66,6 +66,16 @@ class windowsScheduler extends windowsService { * @var string */ private $schedulerDir; + + /** + * Service name + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ + public $name = "KTSchedulerTest"; /** * Load defaults needed by service @@ -76,62 +86,61 @@ class windowsScheduler extends windowsService { * @return void */ function load() { - $this->name = "KTSchedulerTest"; $this->setSchedulerDIR(SYSTEM_DIR."bin".DS."win32"); -// $this->setSchedulerScriptPath("taskrunner_test.bat"); $this->setSchedulerScriptPath("taskrunner.bat"); $this->setSchedulerSource("schedulerService.php"); + } /** - * Set Batch Script path + * Set Scheduler Directory path * * @author KnowledgeTree Team * @access private - * @param string - * @return void + * @param none + * @return string */ - private function setSchedulerScriptPath($schedulerScriptPath) { - $this->schedulerScriptPath = "{$this->getSchedulerDir()}".DS."$schedulerScriptPath"; + private function setSchedulerDIR($schedulerDIR) { + $this->schedulerDir = $schedulerDIR; } /** - * Retrieve Batch Script path + * Retrieve Scheduler Directory path * * @author KnowledgeTree Team * @access public * @param none * @return string */ - public function getSchedulerScriptPath() { - if(file_exists($this->schedulerScriptPath)) - return $this->schedulerScriptPath; + public function getSchedulerDir() { + if(file_exists($this->schedulerDir)) + return $this->schedulerDir; return false; } /** - * Set Scheduler Directory path + * Set Batch Script path * * @author KnowledgeTree Team * @access private - * @param none - * @return string + * @param string + * @return void */ - private function setSchedulerDIR($schedulerDIR) { - $this->schedulerDir = $schedulerDIR; + private function setSchedulerScriptPath($schedulerScriptPath) { + $this->schedulerScriptPath = "{$this->getSchedulerDir()}".DS."$schedulerScriptPath"; } /** - * Retrieve Scheduler Directory path + * Retrieve Batch Script path * * @author KnowledgeTree Team * @access public * @param none * @return string */ - public function getSchedulerDir() { - if(file_exists($this->schedulerDir)) - return $this->schedulerDir; + public function getSchedulerScriptPath() { + if(file_exists($this->schedulerScriptPath)) + return $this->schedulerScriptPath; return false; } @@ -172,28 +181,33 @@ class windowsScheduler extends windowsService { public function install() { $state = $this->status(); if($state == '') { - if(is_readable(SYS_BIN_DIR) && is_writable(SYS_BIN_DIR)) { - if(!file_exists($this->getSchedulerScriptPath())) { - $fp = fopen($this->getSchedulerScriptPath(), "w+"); - $content = "@echo off\n"; - $content .= "\"".PHP_DIR."php.exe\" "."\"{$this->getSchedulerSource()}\""; - fwrite($fp, $content); - fclose($fp); - } - } - + $this->writeSchedulerTask(); // TODO what if it does not exist? check how the dmsctl.bat does this - if (function_exists('win32_create_service')) - { + if (function_exists('win32_create_service')) { $response = win32_create_service(array( 'service' => $this->name, 'display' => $this->name, 'path' => $this->getSchedulerScriptPath() )); return $response; + } else { // Attempt to use the winserv + } } return $state; } + + private function writeSchedulerTask() { + // Check if bin is readable and writable + if(is_readable(SYS_BIN_DIR) && is_writable(SYS_BIN_DIR)) { + if(!$this->getSchedulerScriptPath()) { + $fp = fopen($this->getSchedulerScriptPath(), "w+"); + $content = "@echo off\n"; + $content .= "\"".PHP_DIR."php.exe\" "."\"{$this->getSchedulerSource()}\""; + fwrite($fp, $content); + fclose($fp); + } + } + } } ?> \ No newline at end of file diff --git a/setup/wizard/lib/services/windowsService.php b/setup/wizard/lib/services/windowsService.php index bca2f15..fcde6bd 100644 --- a/setup/wizard/lib/services/windowsService.php +++ b/setup/wizard/lib/services/windowsService.php @@ -41,7 +41,25 @@ */ class windowsService extends Service { + /** + * Service name + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ public $name; + + /** + * Reference to utility object + * + * @author KnowledgeTree Team + * @access public + * @param none + * @return string + */ + public $util; public function __construct() { diff --git a/setup/wizard/path.php b/setup/wizard/path.php index 214398a..e431689 100644 --- a/setup/wizard/path.php +++ b/setup/wizard/path.php @@ -40,6 +40,7 @@ * @version Version 0.1 */ // Define installer environment + define('DEBUG', 1); if (substr(php_uname(), 0, 7) == "Windows"){ define('WINDOWS_OS', true); define('UNIX_OS', false); diff --git a/setup/wizard/resources/form.js b/setup/wizard/resources/form.js new file mode 100644 index 0000000..f8240bd --- /dev/null +++ b/setup/wizard/resources/form.js @@ -0,0 +1,46 @@ +/* jQuery */ + +// prepare the form when the DOM is ready +$(document).ready(function() { + var options = { + target: '#content_container', // target element(s) to be updated with server response + beforeSubmit: showRequest, // pre-submit callback + success: showResponse // post-submit callback + + // other available options: + //url: url // override for form's 'action' attribute + //type: type // 'get' or 'post', override for form's 'method' attribute + //dataType: null // 'xml', 'script', or 'json' (expected server response type) + //clearForm: true // clear all form fields after successful submit + //resetForm: true // reset the form after successful submit + + // $.ajax options can be used here too, for example: + //timeout: 3000 + }; + $.blockUI.defaults.css = {}; + var override = $('form').attr('onsubmit'); + if(override == undefined) { // check if ajax form submit is overridden + $('form').ajaxForm(options); // bind form using 'ajaxForm' to all forms + w.adjustMenu($('form').attr('id')); // adjust the side menu accordingly + } else { + var options = { + target: '#content_container', // target element(s) to be updated with server response + beforeSubmit: w.validateRegistration, // pre-submit callback + success: w.adjustMenu($('form').attr('id')) // post-submit callback + }; + $('form').ajaxForm(options); // bind form using 'ajaxForm' to all forms + } +}); + +// pre-submit callback +function showRequest(formData, jqForm, options) { + $.blockUI(); + $('#loading').attr('style', 'display:block;'); +} + +// post-submit callback +function showResponse(responseText, statusText) { + $.unblockUI(); + $('#loading').attr('style', 'display:none;'); +} + diff --git a/setup/wizard/resources/graphics/loading.gif b/setup/wizard/resources/graphics/loading.gif new file mode 100644 index 0000000..d42f72c --- /dev/null +++ b/setup/wizard/resources/graphics/loading.gif diff --git a/setup/wizard/resources/jquery-tooltip/changelog.txt b/setup/wizard/resources/jquery-tooltip/changelog.txt deleted file mode 100644 index 510a791..0000000 --- a/setup/wizard/resources/jquery-tooltip/changelog.txt +++ /dev/null @@ -1,38 +0,0 @@ -1.3 ---- - -* Added fade option (duration in ms) for fading in/out tooltips; IE <= 6 is excluded when bgiframe plugin is included -* Fixed imagemaps in IE, added back example -* Added positionLeft-option - positions the tooltip to the left of the cursor -* Remove deprecated $.fn.Tooltip in favor of $.fn.tooltip - -1.2 ---- - -* Improved bodyHandler option to accept HTML strings, DOM elements and jQuery objects as the return value -* Fixed bug in Safari 3 where to tooltip is initially visible, by first appending to DOM then hiding it -* Improvement for viewport-border-positioning: Add the classes "viewport-right" and "viewport-bottom" when the element is moved at the viewport border. -* Moved and enhanced documentation to docs.jquery.com -* Added examples for bodyHandler: footnote-tooltip and thumbnail -* Added id option, defaults to "tooltip", override to use a different id in your stylesheet -* Moved demo tooltip style to screen.css -* Moved demo files to demo folder and dependencies to lib folder -* Dropped image map example - completely incompatible with IE; image maps aren't supported anymore - -1.1 ---- - -* Use bgiframe-plugin if available -* Use dimensions-plugin to calculate viewport -* Expose global blocked-property via $.Tooltip.blocked to programmatically disable all tooltips -* Fixed image maps in IE by setting the alt-attribute to an empty string -* Removed event-option (only hover-tooltips now) -* Simplified event-handling (using hover instead of mouseover und mouseout) -* Added another "pretty" example -* Added top and left options to specify tooltip offset -* Reworked example page: New layout, code examples - -1.0 ---- - -* first release considered stable \ No newline at end of file diff --git a/setup/wizard/resources/jquery-tooltip/demo/bg.gif b/setup/wizard/resources/jquery-tooltip/demo/bg.gif deleted file mode 100644 index 846add0..0000000 --- a/setup/wizard/resources/jquery-tooltip/demo/bg.gif +++ /dev/null diff --git a/setup/wizard/resources/jquery-tooltip/demo/chili-1.7.pack.js b/setup/wizard/resources/jquery-tooltip/demo/chili-1.7.pack.js deleted file mode 100644 index 90e7735..0000000 --- a/setup/wizard/resources/jquery-tooltip/demo/chili-1.7.pack.js +++ /dev/null @@ -1 +0,0 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('8={3b:"1.6",2o:"1B.1Y,1B.23,1B.2e",2i:"",2H:1a,12:"",2C:1a,Z:"",2a:\'$$\',R:"&#F;",1j:"&#F;&#F;&#F;&#F;",1f:"&#F;<1W/>",3c:5(){9 $(y).39("1k")[0]},I:{},N:{}};(5($){$(5(){5 1J(l,a){5 2I(A,h){4 3=(1v h.3=="1h")?h.3:h.3.1w;k.1m({A:A,3:"("+3+")",u:1+(3.c(/\\\\./g,"%").c(/\\[.*?\\]/g,"%").3a(/\\((?!\\?)/g)||[]).u,z:(h.z)?h.z:8.2a})}5 2z(){4 1E=0;4 1x=x 2A;Q(4 i=0;i\';8.N[X]=1H;7($.31.34){4 W=J.1L(Y);4 $W=$(W);$("2d").1O($W)}v{$("2d").1O(Y)}}}5 1q(e,a){4 l=e&&e.1g&&e.1g[0]&&e.1g[0].37;7(!l)l="";l=l.c(/\\r\\n?/g,"\\n");4 C=1J(l,a);7(8.1j){C=C.c(/\\t/g,8.1j)}7(8.1f){C=C.c(/\\n/g,8.1f)}$(e).38(C)}5 1o(q,13){4 1l={12:8.12,2x:q+".1d",Z:8.Z,2w:q+".2u"};4 B;7(13&&1v 13=="2l")B=$.35(1l,13);v B=1l;9{a:B.12+B.2x,1p:B.Z+B.2w}}7($.2q)$.2q({36:"2l.15"});4 2n=x 1u("\\\\b"+8.2i+"\\\\b","2j");4 1e=[];$(8.2o).2D(5(){4 e=y;4 1n=$(e).3i("V");7(!1n){9}4 q=$.3u(1n.c(2n,""));7(\'\'!=q){1e.1m(e);4 f=1o(q,e.15);7(8.2H||e.15){7(!8.N[f.a]){1D{8.N[f.a]=1H;$.3v(f.a,5(M){M.f=f.a;8.I[f.a]=M;7(8.2C){2B(f.1p)}$("."+q).2D(5(){4 f=1o(q,y.15);7(M.f==f.a){1q(y,M)}})})}1I(3s){3t("a 3w Q: "+q+\'@\'+3z)}}}v{4 a=8.I[f.a];7(a){1q(e,a)}}}});7(J.1i&&J.1i.29){5 22(p){7(\'\'==p){9""}1z{4 16=(x 3A()).2k()}19(p.3x(16)>-1);p=p.c(/\\<1W[^>]*?\\>/3y,16);4 e=J.1L(\'<1k>\');e.3l=p;p=e.3m.c(x 1u(16,"g"),\'\\r\\n\');9 p}4 T="";4 18=1G;$(1e).3j().G("1k").U("2c",5(){18=y}).U("1M",5(){7(18==y)T=J.1i.29().3k});$("3n").U("3q",5(){7(\'\'!=T){2p.3r.3o(\'3p\',22(T));2V.2R=1a}}).U("2c",5(){T=""}).U("1M",5(){18=1G})}})})(1Z);8.I["1Y.1d"]={k:{2M:{3:/\\/\\*[^*]*\\*+(?:[^\\/][^*]*\\*+)*\\//},25:{3:/\\ @@ -118,4 +117,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/setup/wizard/templates/configuration_confirm.tpl b/setup/wizard/templates/configuration_confirm.tpl index d98990b..a21ff10 100644 --- a/setup/wizard/templates/configuration_confirm.tpl +++ b/setup/wizard/templates/configuration_confirm.tpl @@ -1,4 +1,4 @@ -
+

System Configuration

$path){ ?>
'>
: - + Refresh @@ -82,4 +87,5 @@ -
\ No newline at end of file + + \ No newline at end of file diff --git a/setup/wizard/templates/database.tpl b/setup/wizard/templates/database.tpl index fa9bb10..361b8ec 100644 --- a/setup/wizard/templates/database.tpl +++ b/setup/wizard/templates/database.tpl @@ -1,4 +1,4 @@ -
+

Confirming Database Configurations

@@ -137,4 +137,5 @@ An second user is required for normal database interaction, the reading and writ -
\ No newline at end of file + + \ No newline at end of file diff --git a/setup/wizard/templates/database_confirm.tpl b/setup/wizard/templates/database_confirm.tpl index 99d6344..19e78b2 100644 --- a/setup/wizard/templates/database_confirm.tpl +++ b/setup/wizard/templates/database_confirm.tpl @@ -1,4 +1,4 @@ -
+

Confirming Database Configurations

@@ -100,4 +100,5 @@
-
\ No newline at end of file + + \ No newline at end of file diff --git a/setup/wizard/templates/dependencies.tpl b/setup/wizard/templates/dependencies.tpl index 00c459d..dd1668b 100644 --- a/setup/wizard/templates/dependencies.tpl +++ b/setup/wizard/templates/dependencies.tpl @@ -1,4 +1,4 @@ -
+

Checking PHP Dependencies

The wizard will review your system to determine whether you have the right PHP components in place to run KnowledgeTree.
@@ -132,6 +132,7 @@ - + -

\ No newline at end of file + + \ No newline at end of file diff --git a/setup/wizard/templates/error.tpl b/setup/wizard/templates/error.tpl index f1b9a26..2c1a7cb 100644 --- a/setup/wizard/templates/error.tpl +++ b/setup/wizard/templates/error.tpl @@ -8,7 +8,7 @@ - +