From: Roland Häder Date: Sat, 26 May 2012 22:45:27 +0000 (+0000) Subject: Use 'my_' prefix for 'my' (local) node's data X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2ec5e34a177a926b25d70c46d965b6fcd0e5178d;p=hub.git Use 'my_' prefix for 'my' (local) node's data --- diff --git a/application/hub/main/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php b/application/hub/main/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php index f0d6bf520..12e12a0cd 100644 --- a/application/hub/main/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php +++ b/application/hub/main/filter/tags/answer/class_PackageAnnouncementAnswerTagFilter.php @@ -38,12 +38,12 @@ class PackageAnnouncementAnswerTagFilter extends BaseFilter implements Filterabl // Init array $this->dataXmlNodes = array( - XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '', - XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '', - XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '', - XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => '', - XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT => 9060, - XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT => 9060 + XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_EXTERNAL_IP => '', + XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_INTERNAL_IP => '', + XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_NODE_STATUS => '', + XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID => '', + XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_TCP_PORT => 9060, + XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_UDP_PORT => 9060 ); } diff --git a/application/hub/main/helper/hub/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php b/application/hub/main/helper/hub/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php index a02daae18..80a72381e 100644 --- a/application/hub/main/helper/hub/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php +++ b/application/hub/main/helper/hub/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php @@ -47,7 +47,7 @@ class NodeAnnouncementMessageAnswerHelper extends BaseHubAnswerHelper implements $helperInstance = new NodeAnnouncementMessageAnswerHelper(); // Set session id of other peer as recipient - $helperInstance->setRecipientType($messageData[XmlAnnouncementTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID]); + $helperInstance->setRecipientType($messageData[XmlAnnouncementAnswerTemplateEngine::ANNOUNCEMENT_DATA_SESSION_ID]); // Set message data $helperInstance->setMessageData($messageData); diff --git a/application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php b/application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php index 3ec35f132..a1e28a948 100644 --- a/application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php +++ b/application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php @@ -23,6 +23,16 @@ * along with this program. If not, see . */ class XmlAnnouncementAnswerTemplateEngine extends BaseTemplateEngine implements CompileableTemplate, Registerable { + /** + * Some XML nodes must be available for later data extraction + */ + const ANNOUNCEMENT_DATA_SESSION_ID = 'my-session-id'; + const ANNOUNCEMENT_DATA_NODE_STATUS = 'my-status'; + const ANNOUNCEMENT_DATA_EXTERNAL_IP = 'my-external-ip'; + const ANNOUNCEMENT_DATA_INTERNAL_IP = 'my-internal-ip'; + const ANNOUNCEMENT_DATA_TCP_PORT = 'my-tcp-port'; + const ANNOUNCEMENT_DATA_UDP_PORT = 'my-udp-port'; + /** * Main nodes in the XML tree */ diff --git a/application/hub/templates/xml/answer/announcement/announcement_answer.xml b/application/hub/templates/xml/answer/announcement/announcement_answer.xml index 7694b4449..647ad9825 100644 --- a/application/hub/templates/xml/answer/announcement/announcement_answer.xml +++ b/application/hub/templates/xml/answer/announcement/announcement_answer.xml @@ -30,27 +30,27 @@ along with this program. If not, see - {?external_ip?} + {?my_external_ip?} - {?internal_ip?} + {?my_internal_ip?} - {?node_tcp_listen_port?} + {?my_tcp_port?} - {?node_udp_listen_port?} + {?my_udp_port?} - {?session_id?} + {?my_session_id?} - {?node_status?} + {?my_status?}