org.apache.lenya.cms.linking
Class UrlToUuidRewriter

java.lang.Object
  extended by org.apache.lenya.cms.linking.UrlToUuidRewriter
All Implemented Interfaces:
LinkRewriter

public class UrlToUuidRewriter
extends java.lang.Object
implements LinkRewriter

Converts webapp URLs to UUID-based internal links. If the URL doesn't refer to a document, the original URL is returned.

Objects of this class are not thread-safe.


Constructor Summary
UrlToUuidRewriter(org.apache.lenya.cms.publication.Area area)
           
 
Method Summary
protected  java.lang.String getUuidBasedUri(org.apache.lenya.cms.publication.Document targetDocument, java.lang.String anchor, java.lang.String queryString)
          Rewrites a link.
 boolean matches(java.lang.String url)
           
 java.lang.String rewrite(java.lang.String webappUrl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlToUuidRewriter

public UrlToUuidRewriter(org.apache.lenya.cms.publication.Area area)
Parameters:
area - The area to operate in.
Method Detail

matches

public boolean matches(java.lang.String url)
Specified by:
matches in interface LinkRewriter
Parameters:
url - The URL.
Returns:
If this rewriter feels responsible for the URL.

rewrite

public java.lang.String rewrite(java.lang.String webappUrl)
Specified by:
rewrite in interface LinkRewriter
Parameters:
webappUrl - The original URL.
Returns:
The rewritten URL.

getUuidBasedUri

protected java.lang.String getUuidBasedUri(org.apache.lenya.cms.publication.Document targetDocument,
                                           java.lang.String anchor,
                                           java.lang.String queryString)
Rewrites a link.

Parameters:
targetDocument - The target document.
anchor - The anchor (the string after the # character in the URL).
queryString - The query string without question mark.
Returns:
A UUID-based link URI.


Copyright © $ Apache Software Foundation. All Rights Reserved.