Java Doc for TemplateManager.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » ui » 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 » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ecyrd.jspwiki.modules.ModuleManager
      com.ecyrd.jspwiki.ui.TemplateManager

TemplateManager
public class TemplateManager extends ModuleManager (Code)
This class takes care of managing JSPWiki templates. This class also provides the ResourceRequest mechanism.
since:
   2.1.62
author:
   Janne Jalkanen


Field Summary
final public static  StringDEFAULT_TEMPLATE
     The name of the default template.
final public static  StringDIRECTORY
     The default directory for the properties.
final public static  StringPROPERTYFILE
     Name of the file that contains the properties.
final public static  StringRESOURCE_HTTPHEADER
     Requests a HTTP header.
final public static  StringRESOURCE_INCLUDES
     The name under which the resource includes map is stored in the WikiContext.
final public static  StringRESOURCE_INLINECSS
     Requests inlined CSS.
final public static  StringRESOURCE_JSFUNCTION
     Requests a JavaScript function to be called during window.onload.
final public static  StringRESOURCE_JSLOCALIZEDSTRINGS
     Requests a JavaScript associative array with all localized strings.
final public static  StringRESOURCE_SCRIPT
     Requests a script to be loaded.
final public static  StringRESOURCE_STYLESHEET
     Requests a stylesheet to be inserted.
final protected static  Loggerlog
    

Constructor Summary
public  TemplateManager(WikiEngine engine, Properties properties)
     Creates a new TemplateManager.

Method Summary
public static  voidaddResourceRequest(WikiContext ctx, String type, String resource)
     Adds a resource request to the current request context. The content will be added at the resource-type marker (see IncludeResourcesTag) in WikiJSPFilter.

The resources can be of different types.

public  StringfindJSP(PageContext pageContext, String name)
     An utility method for finding a JSP page.
public  StringfindJSP(PageContext pageContext, String template, String name)
     Attempts to locate a resource under the given template.
public  StringfindResource(WikiContext ctx, String template, String name)
     Attempts to locate a resource under the given template.
public static  StringgetMarker(WikiContext context, String type)
     Returns the include resources marker for a given type.
public static  String[]getResourceRequests(WikiContext ctx, String type)
     Returns resource requests for a particular type.
public static  String[]getResourceTypes(WikiContext ctx)
     Returns all those types that have been requested so far.
public  SetlistSkins(PageContext pageContext, String template)
     Lists the skins available under this template.
public  Collectionmodules()
     Returns an empty collection, since at the moment the TemplateManager does not manage any modules.
public  booleantemplateExists(String templateName)
     Check the existence of a template.

Field Detail
DEFAULT_TEMPLATE
final public static String DEFAULT_TEMPLATE(Code)
The name of the default template. Value is .



DIRECTORY
final public static String DIRECTORY(Code)
The default directory for the properties. Value is .



PROPERTYFILE
final public static String PROPERTYFILE(Code)
Name of the file that contains the properties.



RESOURCE_HTTPHEADER
final public static String RESOURCE_HTTPHEADER(Code)
Requests a HTTP header. Value is .



RESOURCE_INCLUDES
final public static String RESOURCE_INCLUDES(Code)
The name under which the resource includes map is stored in the WikiContext.



RESOURCE_INLINECSS
final public static String RESOURCE_INLINECSS(Code)
Requests inlined CSS. Value is .



RESOURCE_JSFUNCTION
final public static String RESOURCE_JSFUNCTION(Code)
Requests a JavaScript function to be called during window.onload. Value is .



RESOURCE_JSLOCALIZEDSTRINGS
final public static String RESOURCE_JSLOCALIZEDSTRINGS(Code)
Requests a JavaScript associative array with all localized strings.



RESOURCE_SCRIPT
final public static String RESOURCE_SCRIPT(Code)
Requests a script to be loaded. Value is .



RESOURCE_STYLESHEET
final public static String RESOURCE_STYLESHEET(Code)
Requests a stylesheet to be inserted. Value is .



log
final protected static Logger log(Code)




Constructor Detail
TemplateManager
public TemplateManager(WikiEngine engine, Properties properties)(Code)
Creates a new TemplateManager. There is typically one manager per engine.
Parameters:
  engine - The owning engine.
Parameters:
  properties - The property list used to initialize this.




Method Detail
addResourceRequest
public static void addResourceRequest(WikiContext ctx, String type, String resource)(Code)
Adds a resource request to the current request context. The content will be added at the resource-type marker (see IncludeResourcesTag) in WikiJSPFilter.

The resources can be of different types. For RESOURCE_SCRIPT and RESOURCE_STYLESHEET this is an URI path to the resource (a script file or an external stylesheet) that needs to be included. For RESOURCE_INLINECSS the resource should be something that can be added between <style></style> in the header file (commonheader.jsp). For RESOURCE_JSFUNCTION it is the name of the Javascript function that should be run at page load.

The IncludeResourceTag inserts code in the template files, which is then filled by the WikiFilter after the request has been rendered but not yet sent to the recipient.

Note that ALL resource requests get rendered, so this method does not check if the request already exists in the resources. Therefore, if you have a plugin which makes a new resource request every time, you'll end up with multiple resource requests rendered. It's thus a good idea to make this request only once during the page life cycle.
Parameters:
  ctx - The current wiki context
Parameters:
  type - What kind of a request should be added?
Parameters:
  resource - The resource to add.




findJSP
public String findJSP(PageContext pageContext, String name)(Code)
An utility method for finding a JSP page. It searches only under either current context or by the absolute name.
Parameters:
  pageContext - the JSP PageContext
Parameters:
  name - The name of the JSP page to look for (e.g "Wiki.jsp") The context path to the resource



findJSP
public String findJSP(PageContext pageContext, String template, String name)(Code)
Attempts to locate a resource under the given template. If that template does not exist, or the page does not exist under that template, will attempt to locate a similarly named file under the default template.

Even though the name suggests only JSP files can be located, but in fact this method can find also other resources than JSP files.
Parameters:
  pageContext - The JSP PageContext
Parameters:
  template - From which template we should seek initially?
Parameters:
  name - Which resource are we looking for (e.g. "ViewTemplate.jsp") path to the JSP page; null, if it was not found.




findResource
public String findResource(WikiContext ctx, String template, String name)(Code)
Attempts to locate a resource under the given template. This matches the functionality findJSP(), but uses the WikiContext as the argument. If there is no servlet context (i.e. this is embedded), will just simply return a best-guess.

This method is typically used to locate any resource, including JSP pages, images, scripts, etc.
since:
   2.6
Parameters:
  ctx - the wiki context
Parameters:
  template - the name of the template to use
Parameters:
  name - the name of the resource to fine the path to the resource




getMarker
public static String getMarker(WikiContext context, String type)(Code)
Returns the include resources marker for a given type. This is in a HTML or Javascript comment format.
Parameters:
  wiki - context
Parameters:
  type - the marker the generated marker comment



getResourceRequests
public static String[] getResourceRequests(WikiContext ctx, String type)(Code)
Returns resource requests for a particular type. If there are no resources, returns an empty array.
Parameters:
  ctx - WikiContext
Parameters:
  type - The resource request type a String array for the resource requests



getResourceTypes
public static String[] getResourceTypes(WikiContext ctx)(Code)
Returns all those types that have been requested so far.
Parameters:
  ctx - the wiki context the array of types requested



listSkins
public Set listSkins(PageContext pageContext, String template)(Code)
Lists the skins available under this template. Returns an empty Set, if there are no extra skins available. Note that this method does not check whether there is anything actually in the directories, it just lists them. This may change in the future.
Parameters:
  pageContext - the JSP PageContext
Parameters:
  template - The template to search Set of Strings with the skin names.
since:
   2.3.26



modules
public Collection modules()(Code)
Returns an empty collection, since at the moment the TemplateManager does not manage any modules.



templateExists
public boolean templateExists(String templateName)(Code)
Check the existence of a template.



Fields inherited from com.ecyrd.jspwiki.modules.ModuleManager
final public static String LOAD_INCOMPATIBLE_MODULES(Code)(Java Doc)
final public static String PLUGIN_RESOURCE_LOCATION(Code)(Java Doc)
protected WikiEngine m_engine(Code)(Java Doc)

Methods inherited from com.ecyrd.jspwiki.modules.ModuleManager
public boolean checkCompatibility(WikiModuleInfo info)(Code)(Java Doc)
abstract public Collection modules()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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