Source Code Cross Referenced for TurbineTemplate.java in  » Web-Framework » TURBINE » org » apache » turbine » services » 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 » Web Framework » TURBINE » org.apache.turbine.services.template 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.turbine.services.template;
002:
003:        /*
004:         * Licensed to the Apache Software Foundation (ASF) under one
005:         * or more contributor license agreements.  See the NOTICE file
006:         * distributed with this work for additional information
007:         * regarding copyright ownership.  The ASF licenses this file
008:         * to you under the Apache License, Version 2.0 (the
009:         * "License"); you may not use this file except in compliance
010:         * with the License.  You may obtain a copy of the License at
011:         *
012:         *   http://www.apache.org/licenses/LICENSE-2.0
013:         *
014:         * Unless required by applicable law or agreed to in writing,
015:         * software distributed under the License is distributed on an
016:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017:         * KIND, either express or implied.  See the License for the
018:         * specific language governing permissions and limitations
019:         * under the License.
020:         */
021:
022:        import org.apache.turbine.services.TurbineServices;
023:
024:        import org.apache.turbine.util.RunData;
025:
026:        /**
027:         * This is a simple static accessor to common TemplateService tasks such as
028:         * getting a Screen that is associated with a screen template.
029:         *
030:         * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
031:         * @version $Id: TurbineTemplate.java 534527 2007-05-02 16:10:59Z tv $
032:         */
033:        public abstract class TurbineTemplate {
034:            /**
035:             * Utility method for accessing the service
036:             * implementation
037:             *
038:             * @return a TemplateService implementation instance
039:             */
040:            public static TemplateService getService() {
041:                return (TemplateService) TurbineServices.getInstance()
042:                        .getService(TemplateService.SERVICE_NAME);
043:            }
044:
045:            /**
046:             * Returns true if the Template Service has caching activated
047:             *
048:             * @return true if Caching is active.
049:             */
050:            public static final boolean isCaching() {
051:                return getService().isCaching();
052:            }
053:
054:            /**
055:             * Get the default extension given in the properties file.
056:             *
057:             * @return A String with the extension.
058:             */
059:            public static final String getDefaultExtension() {
060:                return getService().getDefaultExtension();
061:            }
062:
063:            /**
064:             * Return Extension for a supplied template
065:             *
066:             * @param template The template name
067:             *
068:             * @return extension The extension for the supplied template
069:             */
070:            public static final String getExtension(String template) {
071:                return getService().getExtension(template);
072:            }
073:
074:            /**
075:             * Returns the Default Template Name with the Default Extension.
076:             * If the extension is unset, return only the template name
077:             *
078:             * @return The default template Name
079:             */
080:            public static final String getDefaultTemplate() {
081:                return getService().getDefaultTemplate();
082:            }
083:
084:            /**
085:             * Get the default page module name of the template engine
086:             * service corresponding to the default template name extension.
087:             *
088:             * @return The default page module name.
089:             */
090:            public static final String getDefaultPage() {
091:                return getService().getDefaultPage();
092:            }
093:
094:            /**
095:             * Get the Screen template given in the properties file.
096:             *
097:             * @return A String which is the value of the TemplateService
098:             * default.screen property.
099:             */
100:            public static final String getDefaultScreen() {
101:                return getService().getDefaultScreen();
102:            }
103:
104:            /**
105:             * Get the default layout module name of the template engine
106:             * service corresponding to the default template name extension.
107:             *
108:             * @return The default layout module name.
109:             */
110:            public static final String getDefaultLayout() {
111:                return getService().getDefaultLayout();
112:            }
113:
114:            /**
115:             * Get the default Navigation given in the properties file.
116:             *
117:             * @return A String which is the value of the TemplateService
118:             * default.navigation property.
119:             */
120:            public static final String getDefaultNavigation() {
121:                return getService().getDefaultNavigation();
122:            }
123:
124:            /**
125:             * Get the default layout template given in the properties file.
126:             *
127:             * @return A String which is the value of the TemplateService
128:             * default.layout.template property.
129:             */
130:            public static final String getDefaultLayoutTemplate() {
131:                return getService().getDefaultLayoutTemplate();
132:            }
133:
134:            /**
135:             * Get the default page module name of the template engine
136:             * service corresponding to the template name extension of
137:             * the named template.
138:             *
139:             * @param template The template name.
140:             * @return The default page module name.
141:             */
142:            public static final String getDefaultPageName(String template) {
143:                return getService().getDefaultPageName(template);
144:            }
145:
146:            /**
147:             * Get the default screen module name of the template engine
148:             * service corresponding to the template name extension of
149:             * the named template.
150:             *
151:             * @param template The template name.
152:             * @return The default screen module name.
153:             */
154:            public static final String getDefaultScreenName(String template) {
155:                return getService().getDefaultScreenName(template);
156:            }
157:
158:            /**
159:             * Get the default layout module name of the template engine
160:             * service corresponding to the template name extension of
161:             * the named template.
162:             *
163:             * @param template The template name.
164:             * @return The default layout module name.
165:             */
166:            public static final String getDefaultLayoutName(String template) {
167:                return getService().getDefaultLayoutName(template);
168:            }
169:
170:            /**
171:             * Get the default navigation module name of the template engine
172:             * service corresponding to the template name extension of
173:             * the named template.
174:             *
175:             * @param template The template name.
176:             * @return The default navigation module name.
177:             */
178:            public static final String getDefaultNavigationName(String template) {
179:                return getService().getDefaultNavigationName(template);
180:            }
181:
182:            /**
183:             * Get the default layout template name of the template engine
184:             * service corresponding to the template name extension of
185:             * the named template.
186:             *
187:             * @param template The template name.
188:             * @return The default layout template name.
189:             */
190:            public static final String getDefaultLayoutTemplateName(
191:                    String template) {
192:                return getService().getDefaultLayoutTemplateName(template);
193:            }
194:
195:            /**
196:             * Find the default page module name for the given request.
197:             *
198:             * @param data The encapsulation of the request to retrieve the
199:             *             default page for.
200:             * @return The default page module name.
201:             */
202:            public static final String getDefaultPageName(RunData data) {
203:                return getService().getDefaultPageName(data);
204:            }
205:
206:            /**
207:             * Find the default layout module name for the given request.
208:             *
209:             * @param data The encapsulation of the request to retrieve the
210:             *             default layout for.
211:             * @return The default layout module name.
212:             */
213:            public static final String getDefaultLayoutName(RunData data) {
214:                return getService().getDefaultLayoutName(data);
215:            }
216:
217:            /**
218:             * Locate and return the name of a Screen module.
219:             *
220:             * @param name A String with the name of the template.
221:             * @return A String with the name of the screen.
222:             * @exception Exception, a generic exception.
223:             */
224:            public static final String getScreenName(String name)
225:                    throws Exception {
226:                return getService().getScreenName(name);
227:            }
228:
229:            /**
230:             * Locate and return the name of the layout module to be used
231:             * with the named layout template.
232:             *
233:             * @param template The layout template name.
234:             * @return The found layout module name.
235:             * @exception Exception, a generic exception.
236:             */
237:            public static final String getLayoutName(String template)
238:                    throws Exception {
239:                return getService().getLayoutName(template);
240:            }
241:
242:            /**
243:             * Locate and return the name of the navigation module to be used
244:             * with the named navigation template.
245:             *
246:             * @param template The navigation template name.
247:             * @return The found navigation module name.
248:             * @exception Exception, a generic exception.
249:             */
250:            public static final String getNavigationName(String template)
251:                    throws Exception {
252:                return getService().getNavigationName(template);
253:            }
254:
255:            /**
256:             * Locate and return the name of a screen template.
257:             *
258:             * @param key A String which is the key to the template.
259:             * @return A String with the screen template path.
260:             * @exception Exception, a generic exception.
261:             */
262:            public static final String getScreenTemplateName(String key)
263:                    throws Exception {
264:                return getService().getScreenTemplateName(key);
265:            }
266:
267:            /**
268:             * Locate and return the name of a layout template.
269:             *
270:             * @param name A String with the name of the template.
271:             * @return A String with the layout template path.
272:             * @exception Exception, a generic exception.
273:             */
274:            public static final String getLayoutTemplateName(String name)
275:                    throws Exception {
276:                return getService().getLayoutTemplateName(name);
277:            }
278:
279:            /**
280:             * Locate and return the name of a navigation template.
281:             *
282:             * @param key A String which is the key to the template.
283:             * @return A String with the navigation template path.
284:             * @exception Exception, a generic exception.
285:             */
286:            public static final String getNavigationTemplateName(String key)
287:                    throws Exception {
288:                return getService().getNavigationTemplateName(key);
289:            }
290:
291:            /**
292:             * Translates the supplied template paths into their Turbine-canonical
293:             * equivalent (probably absolute paths).
294:             *
295:             * @param templatePaths An array of template paths.
296:             * @return An array of translated template paths.
297:             * @deprecated Each template engine service should know how to translate
298:             *             a request onto a file.
299:             */
300:            public static final String[] translateTemplatePaths(
301:                    String[] templatePaths) {
302:                return getService().translateTemplatePaths(templatePaths);
303:            }
304:
305:            /**
306:             * Delegates to the appropriate {@link
307:             * org.apache.turbine.services.template.TemplateEngineService} to
308:             * check the existance of the specified template.
309:             *
310:             * @param template The template to check for the existance of.
311:             * @param templatePaths The paths to check for the template.
312:             * @deprecated Use templateExists from the various Templating Engines
313:             */
314:            public static final boolean templateExists(String template,
315:                    String[] templatePaths) {
316:                return getService().templateExists(template, templatePaths);
317:            }
318:
319:            /**
320:             * Registers the provided template engine for use by the
321:             * <code>TemplateService</code>.
322:             *
323:             * @param service The <code>TemplateEngineService</code> to register.
324:             */
325:            public static final void registerTemplateEngineService(
326:                    TemplateEngineService service) {
327:                getService().registerTemplateEngineService(service);
328:            }
329:
330:            /**
331:             * The {@link org.apache.turbine.services.template.TemplateEngineService}
332:             * associated with the specified template's file extension.
333:             *
334:             * @param template The template name.
335:             * @return The template engine service.
336:             */
337:            public static final TemplateEngineService getTemplateEngineService(
338:                    String template) {
339:                return getService().getTemplateEngineService(template);
340:            }
341:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.