]> git.mxchange.org Git - hub.git/commitdiff
In 'core' introduced XmlTemplateEngineFactory used:
authorRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 00:16:48 +0000 (00:16 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 00:16:48 +0000 (00:16 +0000)
- Rewrite to new XmlTemplateEngineFactory (which saves code where some required
  steps could be forgotten)
- Added a method in test unit producer for initialization
- TODOs.txt updated

application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php
application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php
application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php
application/hub/main/tags/package/class_PackageTags.php
application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php
application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php
application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php
docs/TODOs.txt

index f8c090366c335983248aa4f94a03aa754038b377..4db7e06973ab523ca4fda7e3477dbab494587892 100644 (file)
@@ -68,20 +68,8 @@ class HubDescriptorHelper extends BaseHubHelper implements HelpableHub {
                // Debug message
                $this->debugOutput('HELPER: Starting with announcement to upper hubs...');
 
-               // Get the application instance
-               $applicationInstance = Registry::getRegistry()->getInstance('app');
-
                // Get a XML template instance
-               $templateInstance = ObjectFactory::createObjectByConfiguredName('node_announcement_template_class');
-
-               // Disable language support
-               $templateInstance->enableLanguageSupport(false);
-
-               /*
-                * Enable compacting/rewriting of the  XML to save bandwidth from XML
-                * comments. This is expensive and should be avoided in general.
-                */
-               $templateInstance->enableXmlCompacting();
+               $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_template_class');
 
                // Set it for later use
                $this->setTemplateInstance($templateInstance);
index 552e031a0658992b9261e077679cf7f8345bb257..8d9131db88a937b5d5df0febabb132548ac6a0f0 100644 (file)
@@ -67,20 +67,8 @@ class HubSelfConnectHelper extends BaseHubHelper implements HelpableHub {
                // Debug message
                $this->debugOutput('HELPER: Attempting self-connect...');
 
-               // Get the application instance
-               $applicationInstance = Registry::getRegistry()->getInstance('app');
-
                // Get a XML template instance
-               $templateInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_template_class');
-
-               // Disable language support
-               $templateInstance->enableLanguageSupport(false);
-
-               /*
-                * Enable compacting/rewriting of the  XML to save bandwidth from XML
-                * comments. This is expensive and should be avoided in general.
-                */
-               $templateInstance->enableXmlCompacting();
+               $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_self_connect_template_class');
 
                // Set it for later use
                $this->setTemplateInstance($templateInstance);
index 7683868322131e8152d8b2b5961b474e94edd0a1..cfb288e3c06fa2ff0be84fadc14a37951ab9691b 100644 (file)
@@ -41,6 +41,9 @@ class CruncherTestUnitProducer extends BaseProducer implements UnitProducer, Reg
                // Get new instance
                $producerInstance = new CruncherTestUnitProducer();
 
+               // Initialize this producer
+               $this->initProducer();
+
                // Return the prepared instance
                return $producerInstance;
        }
@@ -54,6 +57,14 @@ class CruncherTestUnitProducer extends BaseProducer implements UnitProducer, Reg
        public function produceUnits () {
                $this->partialStub('Please implement this method.');
        }
+
+       /**
+        * Initializes the producer
+        *
+        * @return      void
+        */
+       private function initProducer () {
+       }
 }
 
 // [EOF]
index c809c417697d18dedbb2e013ae1c1a00c70cd0b4..a21511b28baf1ed2f23ff4fc908202e0c7ac5420 100644 (file)
@@ -74,16 +74,7 @@ class PackageTags extends BaseTags implements Tagable {
                $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Get a XML template instance
-               $templateInstance = ObjectFactory::createObjectByConfiguredName('node_object_registry_template_class');
-
-               // Disable language support
-               $templateInstance->enableLanguageSupport(false);
-
-               /*
-                * Enable compacting/rewriting of the  XML to save bandwidth from XML
-                * comments. This is expensive and should be avoided in general.
-                */
-               $templateInstance->enableXmlCompacting();
+               $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_object_registry_template_class');
 
                // Set it for later use
                $this->setTemplateInstance($templateInstance);
index 7e952d8b27d946d490b8b1e82546c786e0ab3807..621afe2c29490af4daa2d097da246c33f2fa4e8c 100644 (file)
@@ -272,7 +272,7 @@ class XmlAnnouncementTemplateEngine extends BaseTemplateEngine implements Compil
                // Is the template dependency set?
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
                        // Get a temporay template instance
-                       $templateInstance = ObjectFactory::createObjectByConfiguredName('node_announcement_template_class');
+                       $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_template_class');
 
                        // Then load it
                        $templateInstance->loadAnnouncementTemplate($templateDependency);
index ccb4a84c534fc44214f857469e06baebb40a7342..bd2b4611864204aeaa85d8e81667ec8b7870fee9 100644 (file)
@@ -265,7 +265,7 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile
                // Is the template dependency set?
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
                        // Get a temporay template instance
-                       $templateInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_template_class');
+                       $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_self_connect_template_class');
 
                        // Then load it
                        $templateInstance->loadSelfConnectTemplate($templateDependency);
index 81b5cba743505ad3f5e3409c181be7152742fc03..f614717eade811a9a191e5bb316ac45f36c2e955 100644 (file)
@@ -284,7 +284,7 @@ class XmlObjectRegistryTemplateEngine extends BaseTemplateEngine implements Comp
                // Is the template dependency set?
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
                        // Get a temporay template instance
-                       $templateInstance = ObjectFactory::createObjectByConfiguredName('node_object_registry_template_class');
+                       $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_object_registry_template_class');
 
                        // Then load it
                        $templateInstance->loadObjectRegistryTemplate($templateDependency);
index 18ea404ef3002a37516b0026ec1cb21e78c55176..babba44a4ce174932cffcaac1d626f649dbda85e 100644 (file)
@@ -70,7 +70,7 @@
 ./application/hub/main/package/class_NetworkPackage.php:383:                   // @TODO Add some logging here
 ./application/hub/main/package/class_NetworkPackage.php:409:                   // @TODO Add some logging here
 ./application/hub/main/pools/peer/class_DefaultPeerPool.php:148:                       // @TODO Check for IP
-./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:52:      * @todo        0% done
+./application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php:55:      * @todo        0% done
 ./application/hub/main/resolver/state/network/class_NetworkStateResolver.php:68:        * @todo        ~30% done
 ./application/hub/main/resolver/state/network/class_NetworkStateResolver.php:80:                       // @TODO On some systems it is 134, on some 107?
 ./application/hub/main/tasks/cruncher/class_CruncherTestUnitProducerTask.php:53:        * @todo        Maybe visit some sub-objects
 ./application/hub/main/tasks/hub/ping/class_HubPingTask.php:73:         * @todo        0% done
 ./application/hub/main/tasks/hub/update/class_HubUpdateCheckTask.php:53:        * @todo        0%
 ./application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php:10: * @todo               This template engine does not make use of setTemplateType()
-./application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php:245:       * @todo        Find something useful with this!
+./application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php:247:       * @todo        Find something useful with this!
 ./application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php:10: * @todo             This template engine does not make use of setTemplateType()
-./application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php:238:     * @todo        Find something useful with this!
+./application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php:240:     * @todo        Find something useful with this!
 ./application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php:10: * @todo          This template engine does not make use of setTemplateType()
-./application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php:249:  * @todo        Find something useful with this!
+./application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php:251:  * @todo        Find something useful with this!
 ./application/hub/main/tools/class_HubTools.php:128:                           // @TODO We may want to encapsulate this PHP call into an own class
 ./application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php:105:   * @todo        Does a query needs to perform some actions as an active task?
 ./application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php:116:   * @todo        Does a queue needs to perform some actions as an active task?
 ./inc/classes/main/template/class_BaseTemplateEngine.php:961:   * @todo        Unfinished work or don't die here.
 ./inc/classes/main/template/class_BaseTemplateEngine.php:978:                          // @TODO Non-string found so we need some deeper analysis...
 ./inc/classes/main/template/console/class_ConsoleTemplateEngine.php:10: * @todo                This template engine does not make use of setTemplateType()
-./inc/classes/main/template/image/class_ImageTemplateEngine.php:213:    * @todo        Find something usefull with this!
-./inc/classes/main/template/image/class_ImageTemplateEngine.php:233:    * @todo        Add cache creation here
+./inc/classes/main/template/image/class_ImageTemplateEngine.php:215:    * @todo        Find something usefull with this!
+./inc/classes/main/template/image/class_ImageTemplateEngine.php:235:    * @todo        Add cache creation here
 ./inc/classes/main/template/mail/class_MailTemplateEngine.php:10: * @todo              This template engine does not make use of setTemplateType()
-./inc/classes/main/template/mail/class_MailTemplateEngine.php:226:      * @todo        Add cache creation here
-./inc/classes/main/template/mail/class_MailTemplateEngine.php:236:      * @todo        Should we call back the mailer class here?
-./inc/classes/main/template/mail/class_MailTemplateEngine.php:317:      * @todo        0% done
-./inc/classes/main/template/menu/class_MenuTemplateEngine.php:265:      * @todo        Find something useful with this!
-./inc/classes/main/template/menu/class_MenuTemplateEngine.php:311:      * @todo        Add cache creation here
+./inc/classes/main/template/mail/class_MailTemplateEngine.php:228:      * @todo        Add cache creation here
+./inc/classes/main/template/mail/class_MailTemplateEngine.php:238:      * @todo        Should we call back the mailer class here?
+./inc/classes/main/template/mail/class_MailTemplateEngine.php:319:      * @todo        0% done
+./inc/classes/main/template/menu/class_MenuTemplateEngine.php:267:      * @todo        Find something useful with this!
+./inc/classes/main/template/menu/class_MenuTemplateEngine.php:313:      * @todo        Add cache creation here
 ./inc/classes/main/user/class_BaseUser.php:308:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
 ./inc/classes/main/user/class_BaseUser.php:80:  * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
 ./inc/classes/main/user/member/class_Member.php:84:     * @todo        Add more ways over creating user classes