org.apache.lenya.cms.cocoon.source
Class DocumentSourceFactory

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.cocoon.source.DocumentSourceFactory
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.excalibur.source.SourceFactory

public class DocumentSourceFactory
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.excalibur.source.SourceFactory, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.configuration.Configurable

This source factory allows to access documents using the link syntax of the LinkResolver.

Additional optional parameters, separated using ...?f=foo&b=bar:


Field Summary
static java.lang.String SCHEME
          The URI scheme.
 
Fields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE
 
Constructor Summary
DocumentSourceFactory()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void contextualize(org.apache.avalon.framework.context.Context context)
          Used for resolving the object model.
protected  void contextualize(Link link, java.lang.String webappUrl)
          If the link doesn't contain context information (publication ID, area), provide it.
protected  org.apache.excalibur.source.Source getFormatSource(org.apache.lenya.cms.publication.Document doc, java.lang.String format)
           
 org.apache.excalibur.source.Source getSource(java.lang.String location, java.util.Map parameters)
           
 void release(org.apache.excalibur.source.Source source)
           
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
 
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

SCHEME

public static final java.lang.String SCHEME
The URI scheme.

See Also:
Constant Field Values
Constructor Detail

DocumentSourceFactory

public DocumentSourceFactory()
Method Detail

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Used for resolving the object model.

Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

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
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               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
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

getSource

public org.apache.excalibur.source.Source getSource(java.lang.String location,
                                                    java.util.Map parameters)
                                             throws java.net.MalformedURLException,
                                                    java.io.IOException,
                                                    org.apache.excalibur.source.SourceException
Specified by:
getSource in interface org.apache.excalibur.source.SourceFactory
Throws:
java.net.MalformedURLException
java.io.IOException
org.apache.excalibur.source.SourceException
See Also:
SourceFactory.getSource(java.lang.String, java.util.Map)

contextualize

protected void contextualize(Link link,
                             java.lang.String webappUrl)
If the link doesn't contain context information (publication ID, area), provide it.

Parameters:
link - The link.
webappUrl - The web application URL to extract the context information from..

getFormatSource

protected org.apache.excalibur.source.Source getFormatSource(org.apache.lenya.cms.publication.Document doc,
                                                             java.lang.String format)
                                                      throws org.apache.lenya.cms.publication.DocumentException,
                                                             org.apache.avalon.framework.service.ServiceException,
                                                             java.io.IOException
Throws:
org.apache.lenya.cms.publication.DocumentException
org.apache.avalon.framework.service.ServiceException
java.io.IOException

release

public void release(org.apache.excalibur.source.Source source)
Specified by:
release in interface org.apache.excalibur.source.SourceFactory
See Also:
SourceFactory.release(org.apache.excalibur.source.Source)


Copyright © $ Apache Software Foundation. All Rights Reserved.