org.apache.lenya.cms.cocoon.components.modules.input
Class ResourceTypeModule

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.modules.input.AbstractInputModule
          extended by org.apache.lenya.cms.cocoon.components.modules.input.ResourceTypeModule
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.components.modules.input.InputModule

public class ResourceTypeModule
extends org.apache.cocoon.components.modules.input.AbstractInputModule
implements org.apache.avalon.framework.service.Serviceable

Resource type module.

The syntax is either {resource-type:<attribute>} (which uses the resource type of the currenlty requested document) or {resource-type:<name>:<attribute>} (which allows to access an arbitrary resource type).

Attributes:


Field Summary
protected static java.lang.String EXPIRES
           
protected static java.lang.String HTTP_SCHEMA_URI
           
protected  org.apache.avalon.framework.service.ServiceManager manager
           
protected static java.lang.String SCHEMA_URI
           
protected static java.lang.String SUPPORTS_FORMAT
           
 
Fields inherited from class org.apache.cocoon.components.modules.input.AbstractInputModule
settings
 
Fields inherited from interface org.apache.cocoon.components.modules.input.InputModule
ROLE
 
Constructor Summary
ResourceTypeModule()
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name, org.apache.avalon.framework.configuration.Configuration modeConf, java.util.Map objectModel)
           
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
protected  java.lang.String transformFallbackUriToHttp(java.lang.String pubid, java.lang.String uri)
          Transforms a fallback URI for resources into a HTTP URL.
 
Methods inherited from class org.apache.cocoon.components.modules.input.AbstractInputModule
configure, dispose, getAttributeNames, getAttributeValues
 
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

SCHEMA_URI

protected static final java.lang.String SCHEMA_URI
See Also:
Constant Field Values

HTTP_SCHEMA_URI

protected static final java.lang.String HTTP_SCHEMA_URI
See Also:
Constant Field Values

EXPIRES

protected static final java.lang.String EXPIRES
See Also:
Constant Field Values

SUPPORTS_FORMAT

protected static final java.lang.String SUPPORTS_FORMAT
See Also:
Constant Field Values

manager

protected org.apache.avalon.framework.service.ServiceManager manager
Constructor Detail

ResourceTypeModule

public ResourceTypeModule()
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name,
                                     org.apache.avalon.framework.configuration.Configuration modeConf,
                                     java.util.Map objectModel)
                              throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
getAttribute in interface org.apache.cocoon.components.modules.input.InputModule
Overrides:
getAttribute in class org.apache.cocoon.components.modules.input.AbstractInputModule
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

transformFallbackUriToHttp

protected java.lang.String transformFallbackUriToHttp(java.lang.String pubid,
                                                      java.lang.String uri)
                                               throws org.apache.avalon.framework.configuration.ConfigurationException
Transforms a fallback URI for resources into a HTTP URL. Currently only supports module urls: fallback://lenya/modules/foo/resources/schemas/bar.rng -> prefix/pubid/modules/foo/schemas/bar.rng FIXME: allow other kind of fallback URIs

Parameters:
pubid - publication id of the current document
prefix - prefix which will be prepended to the resulting URL
uri - fallback uri, must start with fallback://
Returns:
A string.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.