org.apache.lenya.cms.linking
Class LinkResolverImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.linking.LinkResolverImpl
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, LinkResolver

public class LinkResolverImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements LinkResolver, org.apache.avalon.framework.configuration.Configurable

Link resolver implementation.


Field Summary
protected static java.lang.String ELEMENT_FALLBACK
           
static java.lang.String ROLE
          The Avalon role.
 
Fields inherited from interface org.apache.lenya.cms.linking.LinkResolver
MODE_DEFAULT_LANGUAGE, MODE_FAIL, SCHEME
 
Constructor Summary
LinkResolverImpl()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration config)
           
 int getFallbackMode()
           
protected  java.lang.String getValue(java.lang.String value, java.lang.String defaultValue)
           
 LinkTarget resolve(org.apache.lenya.cms.publication.DocumentFactory factory, java.lang.String linkUri)
          Resolve a link.
protected  LinkTarget resolve(org.apache.lenya.cms.publication.DocumentFactory factory, java.lang.String pubId, java.lang.String area, java.lang.String uuid, java.lang.String language, java.lang.String revisionString)
           
 LinkTarget resolve(org.apache.lenya.cms.publication.Document currentDoc, java.lang.String linkUri)
          Resolve a link.
 void setFallbackMode(int mode)
          Sets the fallback mode.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE

public static final java.lang.String ROLE
The Avalon role.


ELEMENT_FALLBACK

protected static final java.lang.String ELEMENT_FALLBACK
See Also:
Constant Field Values
Constructor Detail

LinkResolverImpl

public LinkResolverImpl()
Method Detail

resolve

public LinkTarget resolve(org.apache.lenya.cms.publication.Document currentDoc,
                          java.lang.String linkUri)
                   throws java.net.MalformedURLException
Description copied from interface: LinkResolver
Resolve a link.

Specified by:
resolve in interface LinkResolver
Parameters:
currentDoc - The document which contains the link.
linkUri - The link URI.
Returns:
A link target.
Throws:
java.net.MalformedURLException - if the URI is invalid.

getValue

protected java.lang.String getValue(java.lang.String value,
                                    java.lang.String defaultValue)

getFallbackMode

public int getFallbackMode()
Specified by:
getFallbackMode in interface LinkResolver
Returns:
the fallback mode.

setFallbackMode

public void setFallbackMode(int mode)
Description copied from interface: LinkResolver
Sets the fallback mode.

Specified by:
setFallbackMode in interface LinkResolver
Parameters:
mode - one of LinkResolver.MODE_FAIL and LinkResolver.MODE_DEFAULT_LANGUAGE.

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

resolve

public LinkTarget resolve(org.apache.lenya.cms.publication.DocumentFactory factory,
                          java.lang.String linkUri)
                   throws java.net.MalformedURLException
Description copied from interface: LinkResolver
Resolve a link. The link URI has to contain the UUID, language, area and publication ID.

Specified by:
resolve in interface LinkResolver
Parameters:
factory - The document factory to use.
linkUri - The link URI.
Returns:
A link target.
Throws:
java.net.MalformedURLException - if the URI is invalid.

resolve

protected LinkTarget resolve(org.apache.lenya.cms.publication.DocumentFactory factory,
                             java.lang.String pubId,
                             java.lang.String area,
                             java.lang.String uuid,
                             java.lang.String language,
                             java.lang.String revisionString)


Copyright © $ Apache Software Foundation. All Rights Reserved.