Save This Page
Home » cocoon-2.1.11-src » org.apache » cocoon » transformation » [javadoc | source]
org.apache.cocoon.transformation
public class: DASLTransformer [javadoc | source]
java.lang.Object
   org.apache.avalon.framework.logger.AbstractLogEnabled
      org.apache.cocoon.xml.AbstractXMLProducer
         org.apache.cocoon.xml.AbstractXMLPipe
            org.apache.cocoon.transformation.AbstractTransformer
               org.apache.cocoon.transformation.AbstractSAXTransformer
                  org.apache.cocoon.transformation.DASLTransformer

All Implemented Interfaces:
    CacheableProcessingComponent, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.configuration.Configurable, Transformer, XMLPipe, org.apache.avalon.excalibur.pool.Recyclable, XMLProducer

This transformer performs DASL queries on DASL-enabled WebDAV servers. It expects a "query" element in the "http://cocoon.apache.org/webdav/dasl/1.0" namespace containing the DASL query to execute, with a "target" attribute specifiyng the webdav:// or http:// URL for the target WebDAV server. It will then replace it with a "query-result" element containing the WebDAV results. Each result will be contained in a "result" element with a "path" attribute pointing at it and all WebDAV properties presented as (namespaced) children elements. Sample invocation: lt;dasl:query xmlns:dasl="http://cocoon.apache.org/webdav/dasl/1.0" target="webdav://localhost/repos/"gt; lt;D:searchrequest xmlns:D="DAV:"gt; lt;D:basicsearchgt; lt;D:selectgt; lt;D:allprop/gt; lt;/D:selectgt; lt;D:fromgt; lt;D:scopegt; lt;D:hrefgt;/repos/lt;/D:hrefgt; lt;D:depthgt;infinitylt;/D:depthgt; lt;/D:scopegt; lt;/D:fromgt; lt;D:wheregt; lt;D:eqgt; lt;D:propgt;lt;D:getcontenttype/gt;lt;/D:propgt; lt;D:literalgt;text/htmllt;/D:literalgt; lt;/D:eqgt; lt;/D:wheregt; lt;D:orderbygt; lt;D:ordergt; lt;D:propgt; lt;D:getcontentlength/gt; lt;/D:propgt; lt;D:ascending/gt; lt;/D:ordergt; lt;D:ordergt; lt;D:propgt; lt;D:href/gt; lt;/D:propgt; lt;D:ascending/gt; lt;/D:ordergt; lt;/D:orderbygt; lt;/D:basicsearchgt; lt;/D:searchrequestgt; lt;/dasl:querygt; Features - Substitution of a value: with this feature it's possible to pass value from sitemap that are substituted into a query. sitemap example: lt;map:transformer type="dasl"gt; lt;parameter name="repos" value="/repos/"gt; lt;/map:transformergt; query example: .... lt;D:hrefgt;lt;substitute-value name="repos"/gt;lt;/D:hrefgt; .... This feature is like substitute-value of SQLTransformer TODO: the SWCL Search method doesn't preserve the result order, which makes order-by clauses useless. TODO: *much* better error handling.
Field Summary
static final  String PREFIX    The prefix for tag 
static final  String QUERY_TAG    The tag name identifying the query 
static final  String DASL_QUERY_NS    The tag namespace 
static final  String TARGET_URL    The URL namespace 
static final  String WEBDAV_SCHEME    The WebDAV scheme 
static final  String RESULT_ROOT_TAG    The tag name of root_tag for result 
static final  String ERROR_ROOT_TAG    The tag name of root_tag for errors 
static final  String SUBSTITUTE_TAG    The tag name for substitution of query parameter 
static final  String SUBSTITUTE_TAG_NAME_ATTRIBUTE    The tag name for substitution of query parameter 
protected static final  String PATH_NODE_NAME     
protected static final  String RESOURCE_NODE_NAME     
 String targetUrl    The target HTTP URL 
Fields inherited from org.apache.cocoon.transformation.AbstractSAXTransformer:
EMPTY_ATTRIBUTES,  ignoreWhitespaces,  ignoreEmptyCharacters,  ignoreEventsCount,  ignoreHooksCount,  namespaceURI,  defaultNamespaceURI,  stack,  recorderStack,  request,  response,  context,  objectModel,  parameters,  source,  manager,  resolver,  emptyAttributes
Fields inherited from org.apache.cocoon.xml.AbstractXMLProducer:
EMPTY_CONTENT_HANDLER,  xmlConsumer,  contentHandler,  lexicalHandler
Method from org.apache.cocoon.transformation.DASLTransformer Summary:
endElement,   getKey,   getValidity,   performSearchMethod,   recycle,   setup,   startElement
Methods from org.apache.cocoon.transformation.AbstractSAXTransformer:
addRecorder,   characters,   comment,   configure,   dispose,   endCDATA,   endDTD,   endDocument,   endElement,   endEntity,   endParametersRecording,   endParametersRecording,   endPrefixMapping,   endRecording,   endSAXRecording,   endSerializedXMLRecording,   endTextRecording,   endTransformingElement,   findPrefixMapping,   getMutableAttributes,   ignorableWhitespace,   processingInstruction,   recycle,   removeRecorder,   sendEndElementEvent,   sendEndElementEventNS,   sendEndPrefixMapping,   sendEvents,   sendParametersEvents,   sendStartElementEvent,   sendStartElementEvent,   sendStartElementEventNS,   sendStartElementEventNS,   sendStartPrefixMapping,   sendTextEvent,   service,   setDocumentLocator,   setup,   setupTransforming,   skippedEntity,   startCDATA,   startDTD,   startDocument,   startElement,   startEntity,   startParametersRecording,   startPrefixMapping,   startRecording,   startSAXRecording,   startSerializedXMLRecording,   startTextRecording,   startTransformingElement
Methods from org.apache.cocoon.xml.AbstractXMLPipe:
characters,   comment,   endCDATA,   endDTD,   endDocument,   endElement,   endEntity,   endPrefixMapping,   ignorableWhitespace,   processingInstruction,   setDocumentLocator,   skippedEntity,   startCDATA,   startDTD,   startDocument,   startElement,   startEntity,   startPrefixMapping
Methods from org.apache.cocoon.xml.AbstractXMLProducer:
recycle,   setConsumer,   setContentHandler,   setLexicalHandler
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.transformation.DASLTransformer Detail:
 public  void endElement(String uri,
    String name,
    String raw) throws SAXException 
    Intercept the end tag, convert buffered input to a String, build and execute the DASL query.
 public Serializable getKey() 
    generates the cachekey, which is the classname plus any possible COCOON parameters
 public SourceValidity getValidity() 
    returns the validity which will be filled during processing of the requests
 protected  void performSearchMethod(String query) throws SAXException 
 public  void recycle() 
    Forget about previous aggregated validity object
 public  void setup(SourceResolver resolver,
    Map objectModel,
    String src,
    Parameters par) throws IOException, SAXException, ProcessingException 
 public  void startElement(String uri,
    String name,
    String raw,
    Attributes attr) throws SAXException 
    Intercept the start tag.