Java Doc for LinkTransformer.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » portal » transformation » 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 » apache lenya 2.0 » org.apache.cocoon.portal.transformation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.transformation.AbstractTransformer
   org.apache.cocoon.portal.transformation.LinkTransformer

LinkTransformer
public class LinkTransformer extends AbstractTransformer implements Serviceable(Code)
This Transformer deals with tags containing links to external applications that need to be converted so that not the external application will be called directly but the request gets routed via the cocoon portal (either via proxy transformer or proxy reader). The link transformer therefore cooperates with the event link transformer. Tags that include a link for which a link event needs to be generated will be converted to <eventlink> elements. Examples:

 <img src="images/logo.jpg"> will be converted to use the proxy reader:
 <img src="proxy-images/logo.jpg&cocoon-portal-copletid=xxx&cocoon-portal-portalname=yyy
 
<form action="/submitted.jsp"> will be converted to be processed by the event link transformer <eventlink action="/submitted.jsp" attribute="action" element="form">

author:
   Gernot Koller
author:
   Friedrich Klenner
version:
   CVS $Id: LinkTransformer.java 433543 2006-08-22 06:22:54Z crossley $


Field Summary
final public static  StringNAMESPACE_PREFIX
    
protected  StringcopletIdParamString
    
protected  CopletInstanceDatacopletInstanceData
    
protected  StringdocumentBase
    
protected  StackelementStack
     Used to store elements' name between startTransformingElement and endTransformingElement.
protected  booleanignoreTargetSelf
    
protected  ServiceManagermanager
    
protected  StringportalNameParamString
    
protected  Stringprefix
    


Method Summary
protected  StringbuildUrlString(String uri, boolean applyPrefixAndPortalParams)
    
public  voidendDocument()
    
public  voidendElement(String uri, String name, String raw)
    
public  voidhandleTag(String attributeName, String uri, String elementName, String raw, Attributes attributes, boolean eventLink, boolean direct)
     The handleTag method is responsible for preparing tags so that they can either be conveted to link events by the event link transformer or that the proxy reader is called directly.
protected  AttributesmodifyLinkAttribute(String attribute, String remoteURI, Attributes attributes)
     Replaces the link of given attribute whith the new uri.
public  voidrecycle()
     Recycle this component.
public  voidservice(ServiceManager manager)
    
public  voidsetup(SourceResolver resolver, Map objectModel, String src, Parameters par)
    
public  voidstartDocument()
    
public  voidstartElement(String uri, String name, String raw, Attributes attributes)
    
protected  voidstartEventLinkElement(String element, String attribute, Attributes attributes)
     Replaces the given element with an eventlink element adding the attribute and element attribute within the SAX stream.

Field Detail
NAMESPACE_PREFIX
final public static String NAMESPACE_PREFIX(Code)
Namespace prefix usef vor NewEventLinkTransformer-Namespace



copletIdParamString
protected String copletIdParamString(Code)
Used for appending a request parameter containing the coplet id



copletInstanceData
protected CopletInstanceData copletInstanceData(Code)
The coplet instance data



documentBase
protected String documentBase(Code)
The html document base uri



elementStack
protected Stack elementStack(Code)
Used to store elements' name between startTransformingElement and endTransformingElement.



ignoreTargetSelf
protected boolean ignoreTargetSelf(Code)
Handle target self as no target?



manager
protected ServiceManager manager(Code)
The avalon service manager



portalNameParamString
protected String portalNameParamString(Code)
Used for appending a request parameter containing the portal name



prefix
protected String prefix(Code)
The prefix





Method Detail
buildUrlString
protected String buildUrlString(String uri, boolean applyPrefixAndPortalParams)(Code)
Retrieves and stores any session token, appends proxy reader prefix and parameters if necessary
Parameters:
  uri - the url to be converted
Parameters:
  applyPrefixAndPortalParams - true signals that the url should be converted to call the proxy-reader the converted uriFIXME: anchors (#) should be treated right!



endDocument
public void endDocument() throws SAXException(Code)

See Also:   org.xml.sax.ContentHandler.endDocument



endElement
public void endElement(String uri, String name, String raw) throws SAXException(Code)

See Also:   org.xml.sax.ContentHandler.endElement(StringStringString)



handleTag
public void handleTag(String attributeName, String uri, String elementName, String raw, Attributes attributes, boolean eventLink, boolean direct) throws SAXException(Code)
The handleTag method is responsible for preparing tags so that they can either be conveted to link events by the event link transformer or that the proxy reader is called directly. Tags with absolute links (starting with "http://", "ftp://", etc.) will not be touched. Tags which contain a target attribute will be modified to call the uri directly (no proxy reader or proxy transformer involved). Tags (like <a href="uri"&ht; or <form action="uri">, etc.) that require a link event will be converted to <eventlink> elements, so that the event link transformer can create the necessary link event and the proxy transformer will be used. Tags (like <img src="uri">) that shoud call the proxy reader will be converted to do so. Examples:

 <a href="http://www.somewhere.com"> will not be converted because of absolute url
 
<img src="images/logo.jpg"> will be converted to use the proxy reader: <img src="proxy-images/logo.jpg&cocoon-portal-copletid=xxx&cocoon-portal-portalname=yyy
<form action="/submitted.jsp"> will be converted to use proxy transformer: <eventlink action="/submitted.jsp" attribute="action" element="form">

Parameters:
  attributeName - Name oft the attribute containing the link to be converted
Parameters:
  uri - Namespace URI
Parameters:
  elementName - Name of the element (tag)
Parameters:
  raw - Raw name of the element (including namespace prefix)
Parameters:
  attributes - Attributes of the element
Parameters:
  eventLink - True signals that the tag sould be converted to an event link tag.
Parameters:
  direct - True signals that the uri should point directly to the external resource (no proxys)
throws:
  SAXException - if an invalid URL was detected.



modifyLinkAttribute
protected Attributes modifyLinkAttribute(String attribute, String remoteURI, Attributes attributes)(Code)
Replaces the link of given attribute whith the new uri.
Parameters:
  attribute - Name of the attribute containing the link
Parameters:
  remoteURI - The new uri
Parameters:
  attributes - List of attributes The modified List of attributes



recycle
public void recycle()(Code)
Recycle this component. All instance variables are set to null.



service
public void service(ServiceManager manager) throws ServiceException(Code)



setup
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)

See Also:   AbstractTransformer.setup(SourceResolverMapStringParameters)



startDocument
public void startDocument() throws SAXException(Code)

See Also:   org.xml.sax.ContentHandler.startDocument



startElement
public void startElement(String uri, String name, String raw, Attributes attributes) throws SAXException(Code)

See Also:   org.xml.sax.ContentHandler.startElement(StringStringStringAttributes)



startEventLinkElement
protected void startEventLinkElement(String element, String attribute, Attributes attributes) throws SAXException(Code)
Replaces the given element with an eventlink element adding the attribute and element attribute within the SAX stream.
Parameters:
  element - Original name of the element
Parameters:
  attribute - Name of the attribute containing the link
Parameters:
  attributes - Original list of attributes
throws:
  SAXException -




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