org.apache.cocoon.transformation
Class DASLTransformer

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.xml.AbstractXMLPipe
              extended byorg.apache.cocoon.transformation.AbstractTransformer
                  extended byorg.apache.cocoon.transformation.AbstractSAXTransformer
                      extended byorg.apache.cocoon.transformation.DASLTransformer
All Implemented Interfaces:
Configurable, ContentHandler, Disposable, LexicalHandler, LogEnabled, Poolable, Recyclable, Serviceable, SitemapModelComponent, Transformer, XMLConsumer, XMLConsumer, XMLPipe, XMLProducer

public class DASLTransformer
extends AbstractSAXTransformer

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.

Version:
$Id: DASLTransformer.java 164829 2005-04-26 16:46:15Z vgritsenko $
Author:
Gianugo Rabellino,
Field Summary
protected static String PATH_NODE_NAME
           
protected static String RESOURCE_NODE_NAME
           
 
Fields inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
context, defaultNamespaceURI, EMPTY_ATTRIBUTES, ignoreEmptyCharacters, ignoreEventsCount, ignoreHooksCount, ignoreWhitespaces, manager, namespaceURI, objectModel, parameters, recorderStack, request, resolver, response, source, stack
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
 
Constructor Summary
DASLTransformer()
           
 
Method Summary
 void endElement(String uri, String name, String raw)
          Intercept the end tag, convert buffered input to a String, build and execute the DASL query.
protected  void performSearchMethod(String query)
           
 void startElement(String uri, String name, String raw, Attributes attr)
          Intercept the start tag.
 
Methods inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
addRecorder, characters, comment, configure, dispose, endCDATA, endDocument, endDTD, 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, startDocument, startDTD, startEntity, startParametersRecording, startPrefixMapping, startRecording, startSAXRecording, startSerializedXMLRecording, startTextRecording, startTransformingElement
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
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
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

PATH_NODE_NAME

protected static final String PATH_NODE_NAME
See Also:
Constant Field Values

RESOURCE_NODE_NAME

protected static final String RESOURCE_NODE_NAME
See Also:
Constant Field Values
Constructor Detail

DASLTransformer

public DASLTransformer()
Method Detail

startElement

public void startElement(String uri,
                         String name,
                         String raw,
                         Attributes attr)
                  throws SAXException
Intercept the start tag.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class AbstractSAXTransformer
Throws:
SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

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.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class AbstractSAXTransformer
Throws:
SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

performSearchMethod

protected void performSearchMethod(String query)
                            throws SAXException
Throws:
SAXException


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.