Java Doc for TemplateController.java in  » Content-Management-System » riotfamily » org » riotfamily » website » template » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » riotfamily » org.riotfamily.website.template 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.riotfamily.website.template.TemplateController

All known Subclasses:   org.riotfamily.website.template.PushUpTemplateController,
TemplateController
public class TemplateController extends AbstractController implements InitializingBean(Code)
Controller that passes a map of URLs to it's view (the template). The view is responsible for including the URLs (using a RequestDispatcher) at the right place.

The most simple way to achieve this is to use a JSTL view that contains a <c:import value="${slotname}" /> tag for each slot, where slotname has to be one of the keys present in the controllers configuration map.

You may extend existing template configurations by setting the TemplateController.setParent(TemplateController) parent property to another TemplateController. The local configuration will then be merged with the one of the parent, overriding previously defined URLs.

Additionally the controller supports nested templates, i.e. the URL of a slot may in turn map to another TemplateController. These nested structures are taken into account when configurations are merged. When extending a parent you may also override URLs defined in nested templates.

Let's say Template A has two slots, left and right. The right slot includes another Template B which also has two slots top and bottom, where top contains the URL /foo.html.

We can now define a third TemplateController A2 which extends A:
 <template:definition name="A2" parent="A">
 <template:insert slot="right.top" url="/bar.html" />
 </template:definition>
 

The syntax above makes use of the Spring 2.0 namespace support. See org.riotfamily.website.template.config.TemplateNamespaceHandler for more information.


author:
   Alf Werder
author:
   Felix Gnass


Field Summary
final protected static  StringSLOTS_CONFIGURATION_ATTRIBUTE
     NOTE: The DispatcherServlet class name prefix forces an attribute cleanup to be performed after an include, regardless of the servlet's cleanupAfterIncludes setting.
final protected static  StringSLOT_PARAMETER
    
final protected static  StringSLOT_PATH_ATTRIBUTE
    


Method Summary
final public  voidafterPropertiesSet()
     Initializes the controller after all properties have been set.
protected  voidapplyOverrides(Map config, HttpServletRequest request)
     Applies the overrides defined by surrounding templates.
protected  MapbuildUrlMap(Map config)
     Builds a map of URLs that is used as model for the template view.
public  MapgetConfiguration()
    
public static  StringgetFullSlotName(HttpServletRequest request)
     Returns the fully qualified slot-name for the given request or null if the current request was not included via a TemplateController.
protected  MapgetMergedConfiguration()
    
public  TemplateControllergetParent()
    
protected  StringgetSlotUrl(String location, String slot)
     Returns the include URL for the given location and slot.
protected  ObjectgetUrlMapValue(Object value, String slot)
     Returns either a single String or a list of URLs.
public  StringgetViewName()
    
protected  ModelAndViewhandleRequestInternal(HttpServletRequest request, HttpServletResponse response)
    
protected  voidinheritConfiguration()
     Merges the configuration map with the ones defined by ancestors.
protected  voidinitController()
     Subclasses may overwrite this method to perform initialization tasks after all properties have been set.
public  voidsetConfiguration(Map configuration)
    
public  voidsetParent(TemplateController parent)
    
public  voidsetSession(boolean session)
    
public  voidsetViewName(String view)
    

Field Detail
SLOTS_CONFIGURATION_ATTRIBUTE
final protected static String SLOTS_CONFIGURATION_ATTRIBUTE(Code)
NOTE: The DispatcherServlet class name prefix forces an attribute cleanup to be performed after an include, regardless of the servlet's cleanupAfterIncludes setting.



SLOT_PARAMETER
final protected static String SLOT_PARAMETER(Code)



SLOT_PATH_ATTRIBUTE
final protected static String SLOT_PATH_ATTRIBUTE(Code)





Method Detail
afterPropertiesSet
final public void afterPropertiesSet() throws Exception(Code)
Initializes the controller after all properties have been set. If a parent controller is set the view will be inherited (if not set locally).



applyOverrides
protected void applyOverrides(Map config, HttpServletRequest request)(Code)
Applies the overrides defined by surrounding templates.



buildUrlMap
protected Map buildUrlMap(Map config)(Code)
Builds a map of URLs that is used as model for the template view.



getConfiguration
public Map getConfiguration()(Code)



getFullSlotName
public static String getFullSlotName(HttpServletRequest request)(Code)
Returns the fully qualified slot-name for the given request or null if the current request was not included via a TemplateController. If the slot contains multiple URLs, the index (+1) of the current URL is appended to the returned name.



getMergedConfiguration
protected Map getMergedConfiguration()(Code)



getParent
public TemplateController getParent()(Code)



getSlotUrl
protected String getSlotUrl(String location, String slot)(Code)
Returns the include URL for the given location and slot. By default SLOT_REQUEST_PARAMETER_NAME is appended, containing the given slot name.



getUrlMapValue
protected Object getUrlMapValue(Object value, String slot)(Code)
Returns either a single String or a list of URLs.



getViewName
public String getViewName()(Code)



handleRequestInternal
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception(Code)



inheritConfiguration
protected void inheritConfiguration()(Code)
Merges the configuration map with the ones defined by ancestors.



initController
protected void initController()(Code)
Subclasses may overwrite this method to perform initialization tasks after all properties have been set. The default implementation does nothing.



setConfiguration
public void setConfiguration(Map configuration)(Code)



setParent
public void setParent(TemplateController parent)(Code)



setSession
public void setSession(boolean session)(Code)



setViewName
public void setViewName(String view)(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.