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


org.apache.lenya.cms.cocoon.transformation.AbstractLinkTransformer
   org.apache.lenya.cms.cocoon.transformation.UuidToUrlTransformer

UuidToUrlTransformer
public class UuidToUrlTransformer extends AbstractLinkTransformer implements Disposable(Code)

UUID to URL transformer.

This transformer is applied to an XHMTL document. It processes all links following the LinkResolver syntax which are configured using <transform/> elements (see below).

These links are resolved using the following rules:

  • The current area (obtained from the page envelope) is used.
  • A URL prefix is added depending on the proxy configuration of the publication.
  • If the target document does not exist and is in the authoring area, the href attribute is removed and a class="brokenlink" attribute is added to the <a/> element.
  • If the target document does not exist and is in the live area, the <a/> element is removed to disable the link.

You can add the query parameter uuid2url.extension to lenya-document: URLs to set a specific link extension.

The resulting URLs are absolute web application URLs (without the servlet context path).

$Id: LinkRewritingTransformer.java,v 1.7 2004/03/16 11:12:16 gregor


Field Summary
final protected static  StringBROKEN_ATTRIB
    
final protected static  StringBROKEN_VALUE
    
final protected static  StringEXTENSION_PARAM
    


Method Summary
public  voiddispose()
    
protected  LinkgetAbsoluteLink(URLInformation info, String linkUri)
     The link is constructed from the linkUri string.
protected  StringgetExtension(Document targetDocument, String requiredExtension)
     Get the extension of a document.
protected  LinkRewritergetLinkRewriter()
    
protected  voidhandleLink(String linkUrl, AttributeConfiguration config, AttributesImpl newAttrs)
    
protected  voidmarkBrokenLink(AttributesImpl newAttrs, String attrName, String brokenUrl)
     Marks a <a/> element as broken and removes href attribute.
public  voidrecycle()
    
protected  voidrewriteLink(AttributesImpl newAttrs, String attributeName, Document targetDocument, String anchor, String queryString, String extension)
     Rewrites a link.
protected  voidsetAttribute(AttributesImpl attr, String name, String value)
     Sets the value of the href attribute.
public  voidsetup(SourceResolver _resolver, Map _objectModel, String _source, Parameters _parameters)
    

Field Detail
BROKEN_ATTRIB
final protected static String BROKEN_ATTRIB(Code)



BROKEN_VALUE
final protected static String BROKEN_VALUE(Code)



EXTENSION_PARAM
final protected static String EXTENSION_PARAM(Code)





Method Detail
dispose
public void dispose()(Code)

See Also:   org.apache.avalon.framework.activity.Disposable.dispose



getAbsoluteLink
protected Link getAbsoluteLink(URLInformation info, String linkUri) throws MalformedURLException(Code)
The link is constructed from the linkUri string. If it lacks the area or publication ID information, these are obtained from the current URL information.
Parameters:
  info - The current URL information.
Parameters:
  linkUri - The link URI to use. A link.
throws:
  MalformedURLException - if the linkUri parameter is malformed.



getExtension
protected String getExtension(Document targetDocument, String requiredExtension)(Code)
Get the extension of a document. Caution: resolving the extension is expensive!
Parameters:
  targetDocument - The document.
Parameters:
  requiredExtension - The required extension. The required extension or, if it is null, the document's default extension.



getLinkRewriter
protected LinkRewriter getLinkRewriter()(Code)



handleLink
protected void handleLink(String linkUrl, AttributeConfiguration config, AttributesImpl newAttrs) throws Exception(Code)



markBrokenLink
protected void markBrokenLink(AttributesImpl newAttrs, String attrName, String brokenUrl) throws AccessControlException(Code)
Marks a <a/> element as broken and removes href attribute.
Parameters:
  newAttrs - The new attributes.
Parameters:
  attrName - The attribute name.
Parameters:
  brokenUrl - The broken link URI.
throws:
  AccessControlException - when something went wrong.



recycle
public void recycle()(Code)

See Also:   org.apache.avalon.excalibur.pool.Recyclable.recycle



rewriteLink
protected void rewriteLink(AttributesImpl newAttrs, String attributeName, Document targetDocument, String anchor, String queryString, String extension) throws AccessControlException(Code)
Rewrites a link.
Parameters:
  newAttrs - The new attributes.
Parameters:
  attributeName - The name of the attribute to rewrite.
Parameters:
  targetDocument - The target document.
Parameters:
  anchor - The anchor (the string after the # character in the URL).
Parameters:
  queryString - The query string without question mark.
Parameters:
  extension - The extension to use.
throws:
  AccessControlException - when something went wrong.



setAttribute
protected void setAttribute(AttributesImpl attr, String name, String value)(Code)
Sets the value of the href attribute.
Parameters:
  attr - The attributes.
Parameters:
  name - The attribute name.
Parameters:
  value - The value.
throws:
  IllegalArgumentException - if the href attribute is not contained in this attributes.



setup
public void setup(SourceResolver _resolver, Map _objectModel, String _source, Parameters _parameters) throws ProcessingException, SAXException, IOException(Code)

See Also:   org.apache.cocoon.sitemap.SitemapModelComponent.setup(org.apache.cocoon.environment.SourceResolverjava.util.Mapjava.lang.Stringorg.apache.avalon.framework.parameters.Parameters)



Fields inherited from org.apache.lenya.cms.cocoon.transformation.AbstractLinkTransformer
protected boolean ignoreLinkElement(Code)(Java Doc)
protected String indent(Code)(Java Doc)

Methods inherited from org.apache.lenya.cms.cocoon.transformation.AbstractLinkTransformer
public void configure(Configuration config) throws ConfigurationException(Code)(Java Doc)
public void endElement(String uri, String name, String qname) throws SAXException(Code)(Java Doc)
protected boolean existsMatchingConfiguration(String namespace, String localName)(Code)(Java Doc)
protected String getCacheKey(String namespace, String localName)(Code)(Java Doc)
abstract protected LinkRewriter getLinkRewriter()(Code)(Java Doc)
protected Set getMatchingConfigurations(String namespace, String localName, Attributes attrs)(Code)(Java Doc)
protected void handleLink(String linkUrl, AttributeConfiguration config, AttributesImpl newAttrs) throws Exception(Code)(Java Doc)
protected void setAttribute(AttributesImpl attr, String name, String value)(Code)(Java Doc)
public void startElement(String uri, String name, String qname, Attributes attrs) throws SAXException(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.