* HTML client *
******************************************************************************/
+// CFG: DEFAULT-HTML-COMMAND
+$cfg->setConfigEntry('default_html_command', 'home');
+
// CFG: DEFAULT-CITY-HTML-COMMAND
$cfg->setConfigEntry('default_city_html_command', 'home');
-// CFG: CITY-HTML-CMD-HOME-RESOLVER-CLASS
-$cfg->setConfigEntry('city_html_cmd_home_resolver_class', 'CityHtmlCommandResolver');
+// CFG: HTML-CMD-HOME-RESOLVER-CLASS
+$cfg->setConfigEntry('html_cmd_home_resolver_class', 'CityHtmlCommandResolver');
+
+// CFG: HTML-CMD-REGISTER-RESOLVER-CLASS
+$cfg->setConfigEntry('html_cmd_register_resolver_class', 'CityHtmlCommandResolver');
+
+// CFG: NEWS-READER-REGISTER-CLASS
+$cfg->setConfigEntry('news_reader_register_class', 'DefaultNewsReader');
// CFG: NEWS-HOME-LIMIT
$cfg->setConfigEntry('news_home_limit', 10);
+// CFG: NEWS-REGISTER-LIMIT
+$cfg->setConfigEntry('news_register_limit', 5);
+
// CFG: CITY-HOME-MENU-CLASS
$cfg->setConfigEntry('city_home_menu_class', 'CityHomeMenu');
* @param $requestInstance An instance of a class with an Requestable interface
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
- * @todo ~10% done?
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // Get the application instance
- $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+ // This command doesn't handle any POST requests, so only handle get request
+ if ($requestInstance->isPostRequestMethod()) {
+ // Don't handle this here
+ $response->sendRequestMethodNotAllowed();
- // Prepare a template instance
- $templateInstance = $this->prepareTemplateInstance($applicationInstance);
-
- // Transfer application data
- $templateInstance->assignApplicationData($applicationInstance);
-
- // Load the master template
- $masterTemplate = $applicationInstance->buildMasterTemplateName();
-
- // Load header template
- $templateInstance->loadCodeTemplate('header');
-
- // Compile and assign it with a variable
- $templateInstance->compileTemplate();
- $templateInstance->assignTemplateWithVariable('header', 'header');
-
- // Load footer template
- $templateInstance->loadCodeTemplate('footer');
-
- // Compile and assign it with a variable
- $templateInstance->compileTemplate();
- $templateInstance->assignTemplateWithVariable('footer', 'footer');
-
- // Load the home template
- $templateInstance->loadCodeTemplate('home');
-
- // Assign the home template with the master template as a content ... ;)
- $templateInstance->assignTemplateWithVariable('city_home', 'main_content');
-
- // Load the master template
- $templateInstance->loadCodeTemplate($masterTemplate);
-
- // Set title
- $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_city_home_title'));
-
- // Construct the menu in every command. We could do this in BaseCommand class. But this means
- // *every* command has a navigation system and that is want we don't want.
- $menuInstance = ObjectFactory::createObjectByConfiguredName('city_home_menu_class', array($applicationInstance));
-
- // Render the menu
- $menuInstance->renderMenu();
-
- // Transfer it to the template engine instance
- $menuInstance->transferContentToTemplateEngine($templateInstance);
+ // Bail out
+ exit();
+ } // END - if
/*
- * ... and all variables. This should be merged together in a pattern
- * to make things easier. A cache mechanism should be added between
- * these two calls to cache compiled templates.
+ * This is a generic HTML request, this means that a regular page with
+ * header, menu, content and footer shall be send to the client.
*/
- $templateInstance->compileVariables();
-
- // Get the content back from the template engine and put it in response class
- $templateInstance->transferToResponse($responseInstance);
+ $this->sendGenericGetResponse($requestInstance, $responseInstance);
}
/**