Module: nagvis
Branch: master
Commit: 642fcdd79645f9c850f5529767edc3db2ee1c036
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=642fcdd79645f9c850f5529767edc3db2ee1c036

Author: Lars Michelsen <[email protected]>
Date:   Fri Oct  9 19:00:49 2009 +0200

Added reg of Url module; Added several comments for improvements

---

 .../frontend/nagvis-js/classes/FrontendModMap.php  |    3 +
 .../classes/controller/GlobalControllerAutomap.php |   58 --------------------
 share/frontend/nagvis-js/index.php                 |    1 +
 share/frontend/nagvis-js/js/frontend.js            |   19 +++++++
 .../core}/classes/NagVisUrl.php                    |   20 +-------
 5 files changed, 24 insertions(+), 77 deletions(-)

diff --git a/share/frontend/nagvis-js/classes/FrontendModMap.php 
b/share/frontend/nagvis-js/classes/FrontendModMap.php
index f7d6073..e270777 100644
--- a/share/frontend/nagvis-js/classes/FrontendModMap.php
+++ b/share/frontend/nagvis-js/classes/FrontendModMap.php
@@ -34,6 +34,9 @@ class FrontendModMap extends FrontendModule {
        }
 
        private function getMapOptions(CoreUriHandler $UHANDLER) {
+               // FIXME: The array should contain orders for validating the 
given value
+               // the options should be validated by the uri handler
+               
                // Parse view specific uri params
                $aKeys = Array('search' => '');
                
diff --git 
a/share/frontend/nagvis-js/classes/controller/GlobalControllerAutomap.php 
b/share/frontend/nagvis-js/classes/controller/GlobalControllerAutomap.php
deleted file mode 100644
index 98d48d6..0000000
--- a/share/frontend/nagvis-js/classes/controller/GlobalControllerAutomap.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/*****************************************************************************
- *
- * GlobalControllerAutomap.php - Global automap controller for nagvis
- *
- * Copyright (c) 2004-2008 NagVis Project (Contact: [email protected])
- *
- * License:
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *****************************************************************************/
-
-/**
- * class GlobalControllerAutomap
- *
- * @author  Michael Luebben <[email protected]>
- */
-class GlobalControllerAutomap {
-
-       public function __construct($automapEnv) {
-
-               // Load the core
-               $CORE = new GlobalCore();
-
-               // Initialize map configuration
-               $MAPCFG = new NagVisAutomapCfg($CORE, $automapEnv['automap']);
-
-               // Read the map configuration file
-               $MAPCFG->readMapConfig();
-
-               // Initialize backend(s)
-               $BACKEND = new GlobalBackendMgmt($CORE);
-
-               // Initialize the frontend
-               $FRONTEND = new NagVisFrontend($CORE, $MAPCFG, $BACKEND);
-
-               // Build the page
-               $FRONTEND->addBodyLines($FRONTEND->parseJs('oRotationProperties 
= '.$FRONTEND->getRotationPropertiesJson(1).';'));
-               $FRONTEND->getHeaderMenu($MAPCFG->getValue('global',0 
,'header_menu'), $MAPCFG->getValue('global',0 ,'header_template'));
-               $FRONTEND->getAutoMap($automapEnv);
-
-               // Print the page
-               $FRONTEND->printPage();
-       }
-}
-?>
diff --git a/share/frontend/nagvis-js/index.php 
b/share/frontend/nagvis-js/index.php
index 1d27b1f..b5a3b25 100644
--- a/share/frontend/nagvis-js/index.php
+++ b/share/frontend/nagvis-js/index.php
@@ -96,6 +96,7 @@ $MHANDLER->regModule('LogonDialog');
 $MHANDLER->regModule('Info');
 $MHANDLER->regModule('Auth');
 $MHANDLER->regModule('Map');
+$MHANDLER->regModule('Url');
 $MHANDLER->regModule('Automap');
 $MHANDLER->regModule('Overview');
 
diff --git a/share/frontend/nagvis-js/js/frontend.js 
b/share/frontend/nagvis-js/js/frontend.js
index 28f8f95..a590a65 100755
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -1439,6 +1439,20 @@ function parseMap(iMapCfgAge, mapName) {
 }
 
 /**
+ * Fetches the contents of the given url and prints it on the current page
+ *
+ * @param   String   The url to fetch
+ * @author  Lars Michelsen <[email protected]>
+ */
+function parseUrl(sUrl) {
+       // FIXME: Fetch contents from server
+       
+       // FIXME: Clear the current contents
+       
+       // FIMXE: Add the contents to the page
+}
+
+/**
  * runWorker()
  *
  * This function is the heart of the new NagVis frontend. It's called worker.
@@ -1546,6 +1560,11 @@ function runWorker(iCount, sType, sIdentifier) {
                        //parseContextMenus(aMaps);
                        
                        eventlog("worker", "info", "Finished parsing overview");
+               } else if(sType === 'url') {
+                       // Fetches the contents from the server and prints it 
to the page
+                       parseUrl(sIdentifier);
+               } else {
+                       eventlog("worker", "error", "Unknown view type: 
"+sType);
                }
                
                // Close the status message window
diff --git a/share/frontend/nagvis-js/classes/NagVisUrl.php 
b/share/server/core/classes/NagVisUrl.php
similarity index 81%
rename from share/frontend/nagvis-js/classes/NagVisUrl.php
rename to share/server/core/classes/NagVisUrl.php
index f83dd2f..33c4c26 100644
--- a/share/frontend/nagvis-js/classes/NagVisUrl.php
+++ b/share/server/core/classes/NagVisUrl.php
@@ -38,7 +38,7 @@ class NagVisUrl {
         * @param   String      URL
         * @author  Lars Michelsen <[email protected]>
         */
-       public function __construct($CORE, $strUrl) {
+       public function __construct(GlobalCore $CORE, $strUrl) {
                $this->CORE = $CORE;
                
                $this->strUrl = $strUrl;
@@ -86,23 +86,5 @@ class NagVisUrl {
                
                return $this->strContents;
        }
-
-       /**
-   * Parses some option and initializes the worker
-   *
-   * @return  String  String with Html Code
-   * @author  Lars Michelsen <[email protected]>
-   */
-  public function parseJson() {
-    $ret = '';
-    $ret .= 
'oGeneralProperties='.$this->CORE->MAINCFG->parseGeneralProperties().';'."\n";
-    $ret .= 
'oWorkerProperties='.$this->CORE->MAINCFG->parseWorkerProperties().';'."\n";
-    //$ret .= 'var oFileAges='.$this->parseFileAges().';'."\n";
-
-    // Kick of the worker
-    $ret .= 'addDOMLoadEvent(function(){runWorker(0, \'url\')});';
-
-    return $ret;
-  }
 }
 ?>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to