Java Doc for PortletAppAddResource.java in  » Workflow-Engines » wfmopen-2.1.1 » de » danet » an » util » jsf » 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 » Workflow Engines » wfmopen 2.1.1 » de.danet.an.util.jsf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.danet.an.util.jsf.PortletAppAddResource

PortletAppAddResource
public class PortletAppAddResource implements AddResource(Code)
This class provides an adapted AddResource implementation.
author:
   Michael Lipp




Method Summary
public  voidaddInlineScriptAtPosition(FacesContext context, ResourcePosition position, String inlineScript)
     Adds the given Inline Script at the specified document position.
public  voidaddInlineStyleAtPosition(FacesContext context, ResourcePosition position, String inlineStyle)
     Adds the given Inline Style at the specified document position.
public  voidaddJavaScriptAtPosition(FacesContext context, ResourcePosition position, ResourceHandler resourceHandler)
     Adds the given Javascript resource to the document header at the specified document positioy by supplying a resourcehandler instance.
public  voidaddJavaScriptAtPosition(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName)
     Insert a [script src="url"] entry into the document header at the specified document position.
public  voidaddJavaScriptAtPosition(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName, boolean defer)
     Insert a [script src="url"] entry into the document header at the specified document position.
public  voidaddJavaScriptAtPosition(FacesContext context, ResourcePosition position, String uri)
     Insert a [script src="url"] entry into the document header at the specified document position.
public  voidaddJavaScriptAtPosition(FacesContext context, ResourcePosition position, String uri, boolean defer)
     Adds the given Javascript resource at the specified document position.
public  voidaddJavaScriptAtPosition(FacesContext context, ResourcePosition position, ResourceHandler resourceHandler, boolean defer)
     Adds the given Javascript resource at the specified document position.
public  voidaddJavaScriptAtPositionPlain(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName)
    
public  voidaddJavaScriptHere(FacesContext context, Class myfacesCustomComponent, String resourceName)
     Insert a [script src="url"] entry at the current location in the response.
public  voidaddJavaScriptHere(FacesContext context, String uri)
     Insert a [script src="url"] entry at the current location in the response.
public  voidaddJavaScriptHere(FacesContext context, ResourceHandler resourceHandler)
     Insert a [script src="url"] entry at the current location in the response.
Parameters:
  context -
Parameters:
  resourceHandler - is an object which specifies exactly how to build the url thatis emitted into the script tag.
public  voidaddJavaScriptHerePlain(FacesContext context, String uri)
    
public  voidaddJavaScriptToBodyTag(FacesContext context, String javascriptEventName, String addedJavaScript)
    
public  voidaddResourceHere(FacesContext context, ResourceHandler resourceHandler)
    
public  voidaddStyleSheet(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName)
     Adds the given Style Sheet at the specified document position.
public  voidaddStyleSheet(FacesContext context, ResourcePosition position, String uri)
     Adds the given Style Sheet at the specified document position.
public  voidaddStyleSheet(FacesContext context, ResourcePosition position, ResourceHandler resourceHandler)
     Adds the given Style Sheet at the specified document position.
protected  longgetCacheKey(FacesContext context)
     Return a value used in the {cacheKey} part of a generated URL for a resource reference.

Caching in browsers normally works by having files served to them include last-modified and expiry-time http headers.

public  StringgetResourceUri(FacesContext context, Class myfacesCustomComponent, String resource, boolean withContextPath)
    
public  StringgetResourceUri(FacesContext context, Class myfacesCustomComponent, String resource)
    
public  StringgetResourceUri(FacesContext context, ResourceHandler resourceHandler)
     Get the Path used to retrieve an resource.
public  StringgetResourceUri(FacesContext context, ResourceHandler resourceHandler, boolean withContextPath)
     Get the Path used to retrieve an resource.
public  StringgetResourceUri(FacesContext context, String uri)
     Get the Path used to retrieve an resource.
public  StringgetResourceUri(FacesContext context, String uri, boolean withContextPath)
     Get the Path used to retrieve an resource.
protected  StringgetResourceUri(FacesContext context, Class resourceLoader, boolean withContextPath)
     Get the Path used to retrieve an resource.
public  booleanhasHeaderBeginInfos()
    
public  booleanisResourceUri(HttpServletRequest request)
    
public  voidparseResponse(HttpServletRequest request, String bufferedResponse, HttpServletResponse response)
    
public  voidprocessAppendices(RenderRequest request, RenderResponse response, FacesContext facesContext)
    
public  booleanrequiresBuffer()
    
public  voidresponseFinished()
    
public  voidresponseStarted()
    
public  voidserveResource(ServletContext context, HttpServletRequest request, HttpServletResponse response)
    
public  voidsetContextPath(String contextPath)
    
protected  voidvalidateResourceHandler(ResourceHandler resourceHandler)
     Verify that the resource handler is acceptable.
protected  voidvalidateResourceLoader(Class resourceloader)
     Given a Class object, verify that the instances of that class implement the ResourceLoader interface.
public  voidwriteMyFacesJavascriptBeforeBodyEnd(HttpServletRequest request, HttpServletResponse response)
    
public  voidwriteResponse(HttpServletRequest request, HttpServletResponse response)
    
public  voidwriteWithFullHeader(HttpServletRequest request, HttpServletResponse response)
    



Method Detail
addInlineScriptAtPosition
public void addInlineScriptAtPosition(FacesContext context, ResourcePosition position, String inlineScript)(Code)
Adds the given Inline Script at the specified document position.



addInlineStyleAtPosition
public void addInlineStyleAtPosition(FacesContext context, ResourcePosition position, String inlineStyle)(Code)
Adds the given Inline Style at the specified document position.



addJavaScriptAtPosition
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, ResourceHandler resourceHandler)(Code)
Adds the given Javascript resource to the document header at the specified document positioy by supplying a resourcehandler instance.

Use this method to have full control about building the reference url to identify the resource and to customize how the resource is written to the response. In most cases, however, one of the convenience methods on this class can be used without requiring a custom ResourceHandler to be provided.

If the script has already been referenced, it's added only once.

Note that this method queues the javascript for insertion, and that the script is inserted into the buffered response by the ExtensionsFilter after the page is complete.




addJavaScriptAtPosition
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName)(Code)
Insert a [script src="url"] entry into the document header at the specified document position. If the script has already been referenced, it's added only once.

The resource is expected to be in the classpath, at the same location as the specified component + "/resource".

Example: when customComponent is class example.Widget, and resourceName is script.js, the resource will be retrieved from "example/Widget/resource/script.js" in the classpath.




addJavaScriptAtPosition
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName, boolean defer)(Code)
Insert a [script src="url"] entry into the document header at the specified document position. If the script has already been referenced, it's added only once.
Parameters:
  defer - specifies whether the html attribute "defer" is set on thegenerated script tag. If this is true then the browser willcontinue processing the html page without waiting for thespecified script to load and be run.



addJavaScriptAtPosition
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, String uri)(Code)
Insert a [script src="url"] entry into the document header at the specified document position. If the script has already been referenced, it's added only once.
Parameters:
  uri - is the location of the desired resource, relative to the basedirectory of the webapp (ie its contextPath).



addJavaScriptAtPosition
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, String uri, boolean defer)(Code)
Adds the given Javascript resource at the specified document position. If the script has already been referenced, it's added only once.



addJavaScriptAtPosition
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, ResourceHandler resourceHandler, boolean defer)(Code)
Adds the given Javascript resource at the specified document position. If the script has already been referenced, it's added only once.



addJavaScriptAtPositionPlain
public void addJavaScriptAtPositionPlain(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName)(Code)



addJavaScriptHere
public void addJavaScriptHere(FacesContext context, Class myfacesCustomComponent, String resourceName) throws IOException(Code)
Insert a [script src="url"] entry at the current location in the response. The resource is expected to be in the classpath, at the same location as the specified component + "/resource".

Example: when customComponent is class example.Widget, and resourceName is script.js, the resource will be retrieved from "example/Widget/resource/script.js" in the classpath.




addJavaScriptHere
public void addJavaScriptHere(FacesContext context, String uri) throws IOException(Code)
Insert a [script src="url"] entry at the current location in the response.
Parameters:
  uri - is the location of the desired resource, relative to the basedirectory of the webapp (ie its contextPath).



addJavaScriptHere
public void addJavaScriptHere(FacesContext context, ResourceHandler resourceHandler) throws IOException(Code)
Insert a [script src="url"] entry at the current location in the response.
Parameters:
  context -
Parameters:
  resourceHandler - is an object which specifies exactly how to build the url thatis emitted into the script tag. Code which needs to generateURLs in ways that this class does not support by default canimplement a custom ResourceHandler.
throws:
  IOException -



addJavaScriptHerePlain
public void addJavaScriptHerePlain(FacesContext context, String uri) throws IOException(Code)



addJavaScriptToBodyTag
public void addJavaScriptToBodyTag(FacesContext context, String javascriptEventName, String addedJavaScript)(Code)



addResourceHere
public void addResourceHere(FacesContext context, ResourceHandler resourceHandler) throws IOException(Code)



addStyleSheet
public void addStyleSheet(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName)(Code)
Adds the given Style Sheet at the specified document position. If the style sheet has already been referenced, it's added only once.



addStyleSheet
public void addStyleSheet(FacesContext context, ResourcePosition position, String uri)(Code)
Adds the given Style Sheet at the specified document position. If the style sheet has already been referenced, it's added only once.



addStyleSheet
public void addStyleSheet(FacesContext context, ResourcePosition position, ResourceHandler resourceHandler)(Code)
Adds the given Style Sheet at the specified document position. If the style sheet has already been referenced, it's added only once.



getCacheKey
protected long getCacheKey(FacesContext context)(Code)
Return a value used in the {cacheKey} part of a generated URL for a resource reference.

Caching in browsers normally works by having files served to them include last-modified and expiry-time http headers. Until the expiry time is reached, a browser will silently use its cached version. After the expiry time, it will send a "get if modified since {time}" message, where {time} is the last-modified header from the version it has cached.

Unfortunately this scheme only works well for resources represented as plain files on disk, where the webserver can easily and efficiently see the last-modified time of the resource file. When that query has to be processed by a servlet that doesn't scale well, even when it is possible to determine the resource's last-modified date from servlet code.

Fortunately, for the AddResource class a static resource is only ever accessed because a URL was embedded by this class in a dynamic page. This makes it possible to implement caching by instead marking every resource served with a very long expiry time, but forcing the URL that points to the resource to change whenever the old cached version becomes invalid; the browser effectively thinks it is fetching a different resource that it hasn't seen before. This is implemented by embedding a "cache key" in the generated URL.

Rather than using the actual modification date of a resource as the cache key, we simply use the webapp deployment time. This means that all data cached by browsers will become invalid after a webapp deploy (all the urls to the resources change). It also means that changes that occur to a resource without a webapp redeploy will not be seen by browsers.




getResourceUri
public String getResourceUri(FacesContext context, Class myfacesCustomComponent, String resource, boolean withContextPath)(Code)



getResourceUri
public String getResourceUri(FacesContext context, Class myfacesCustomComponent, String resource)(Code)



getResourceUri
public String getResourceUri(FacesContext context, ResourceHandler resourceHandler)(Code)
Get the Path used to retrieve an resource.



getResourceUri
public String getResourceUri(FacesContext context, ResourceHandler resourceHandler, boolean withContextPath)(Code)
Get the Path used to retrieve an resource.



getResourceUri
public String getResourceUri(FacesContext context, String uri)(Code)
Get the Path used to retrieve an resource.



getResourceUri
public String getResourceUri(FacesContext context, String uri, boolean withContextPath)(Code)
Get the Path used to retrieve an resource.



getResourceUri
protected String getResourceUri(FacesContext context, Class resourceLoader, boolean withContextPath)(Code)
Get the Path used to retrieve an resource.



hasHeaderBeginInfos
public boolean hasHeaderBeginInfos()(Code)



isResourceUri
public boolean isResourceUri(HttpServletRequest request)(Code)



parseResponse
public void parseResponse(HttpServletRequest request, String bufferedResponse, HttpServletResponse response) throws IOException(Code)



processAppendices
public void processAppendices(RenderRequest request, RenderResponse response, FacesContext facesContext) throws IOException(Code)



requiresBuffer
public boolean requiresBuffer()(Code)



responseFinished
public void responseFinished()(Code)



responseStarted
public void responseStarted()(Code)



serveResource
public void serveResource(ServletContext context, HttpServletRequest request, HttpServletResponse response) throws IOException(Code)



setContextPath
public void setContextPath(String contextPath)(Code)



validateResourceHandler
protected void validateResourceHandler(ResourceHandler resourceHandler)(Code)
Verify that the resource handler is acceptable. Null is not valid, and the getResourceLoaderClass method must return a Class object whose instances implements the ResourceLoader interface.
Parameters:
  resourceHandler -



validateResourceLoader
protected void validateResourceLoader(Class resourceloader)(Code)
Given a Class object, verify that the instances of that class implement the ResourceLoader interface.
Parameters:
  resourceloader -



writeMyFacesJavascriptBeforeBodyEnd
public void writeMyFacesJavascriptBeforeBodyEnd(HttpServletRequest request, HttpServletResponse response) throws IOException(Code)



writeResponse
public void writeResponse(HttpServletRequest request, HttpServletResponse response) throws IOException(Code)



writeWithFullHeader
public void writeWithFullHeader(HttpServletRequest request, HttpServletResponse response) throws IOException(Code)



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.