* @version 0.0.0 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @todo This template engine does not make use of setTemplateType() * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * 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, see . */ class XmlRequestNodeListTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable { // Constants for array elements const REQUEST_DATA_ACCEPTED_OBJECT_TYPES = 'accepted-object-types'; const REQUEST_DATA_SESSION_ID = 'session-id'; /** * Protected constructor * * @return void */ protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); // Init sub nodes $this->subNodes = array( self::REQUEST_DATA_ACCEPTED_OBJECT_TYPES, self::REQUEST_DATA_SESSION_ID, ); } /** * Creates an instance of the class TemplateEngine and prepares it for usage * * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string * @throws BasePathIsNoDirectoryException If $templateBasePath is no * directory or not found * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ public static final function createXmlRequestNodeListTemplateEngine () { // Get a new instance $templateInstance = new XmlRequestNodeListTemplateEngine(); // Init template instance $templateInstance->initXmlTemplateEngine('node', 'request_node_list'); // Return the prepared instance return $templateInstance; } /** * Currently not used * * @param $resource XML parser resource (currently ignored) * @param $characters Characters to handle * @return void * @todo Find something useful with this! */ public function characterHandler ($resource, $characters) { // Trim all spaces away $characters = trim($characters); // Is this string empty? if (empty($characters)) { // Then skip it silently return; } // END - if // Assign data with matching variable here parent::assignVariable($this->getStackInstance()->getNamed('node_request_node_list'), $characters); } /** * Getter for cache file (FQFN) * * @return $fqfn Full-qualified file name of the menu cache */ public function getRequestNodeListCacheFqfn () { $this->partialStub('Please implement this method.'); } /** * Starts the node-request-node-list * * @return void */ protected function startRequestNodeList () { // Push the node name on the stacker $this->getStackInstance()->pushNamed('node_request_node_list', 'node-request-node-list'); } /** * Starts the accepted-object-types * * @return void */ protected function startAcceptedObjectTypes () { // Push the node name on the stacker $this->getStackInstance()->pushNamed('node_request_node_list', self::REQUEST_DATA_ACCEPTED_OBJECT_TYPES); } /** * Starts the session-id * * @return void */ protected function startSessionId () { // Push the node name on the stacker $this->getStackInstance()->pushNamed('node_request_node_list', self::REQUEST_DATA_SESSION_ID); } /** * Finishes the session-id * * @return void */ protected function finishSessionId () { // Pop the last entry $this->getStackInstance()->popNamed('node_request_node_list'); } /** * Finishes the accepted-object-types * * @return void */ protected function finishAcceptedObjectTypes () { // Pop the last entry $this->getStackInstance()->popNamed('node_request_node_list'); } /** * Finishes the node-request-node-list * * @return void */ protected function finishRequestNodeList () { // Pop the last entry $this->getStackInstance()->popNamed('node_request_node_list'); } } // [EOF] ?>