3 * An ??? template engine class for XML templates
5 * @author Roland Haeder <webmaster@ship-simu.org>
7 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
8 * @license GNU GPL 3.0 or any newer version
9 * @link http://www.ship-simu.org
10 * @todo This template engine does not make use of setTemplateType()
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 class XmlRequestNodeListAnswerTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
27 * Some XML nodes must be available for later data extraction
29 const ANNOUNCEMENT_DATA_SESSION_ID = 'my-session-id';
32 * Protected constructor
36 protected function __construct () {
37 // Call parent constructor
38 parent::__construct(__CLASS__);
40 // Init sub-nodes array
41 $this->subNodes = array(
42 self::ANNOUNCEMENT_DATA_SESSION_ID,
47 * Creates an instance of the class TemplateEngine and prepares it for usage
49 * @return $templateInstance An instance of TemplateEngine
50 * @throws BasePathIsEmptyException If the provided $templateBasePath is empty
51 * @throws InvalidBasePathStringException If $templateBasePath is no string
52 * @throws BasePathIsNoDirectoryException If $templateBasePath is no
53 * directory or not found
54 * @throws BasePathReadProtectedException If $templateBasePath is
57 public static final function createXmlRequestNodeListAnswerTemplateEngine () {
59 $templateInstance = new XmlRequestNodeListAnswerTemplateEngine();
62 $templateInstance->initXmlTemplateEngine('node', 'request_node_list_answer');
64 // Return the prepared instance
65 return $templateInstance;
71 * @param $resource XML parser resource (currently ignored)
72 * @param $characters Characters to handle
74 * @todo Find something useful with this!
76 public function characterHandler ($resource, $characters) {
77 // Trim all spaces away
78 $characters = trim($characters);
80 // Is this string empty?
81 if (empty($characters)) {
82 // Then skip it silently
87 * Assign the found characters to variable and use the last entry from
90 parent::assignVariable($this->getStackerInstance()->getNamed('request_node_list_answer'), $characters);
94 * Getter for cache file (FQFN)
96 * @return $fqfn Full-qualified file name of the menu cache
98 public function getRequestNodeListAnswerCacheFqfn () {
99 $this->partialStub('Please implement this method.');
103 * Starts the announcement-answer
107 protected function startRequestNodeListAnswer () {
108 // Push the node name on the stacker
109 $this->getStackerInstance()->pushNamed('request_node_list_answer', 'announcement-answer');
113 * Finishes the announcement-answer
117 protected function finishRequestNodeListAnswer () {
118 // Pop the last entry
119 $this->getStackerInstance()->popNamed('request_node_list_answer');