| org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.AbstractSAXTransformer org.apache.cocoon.transformation.DASLTransformer
DASLTransformer | public class DASLTransformer extends AbstractSAXTransformer implements CacheableProcessingComponent(Code) | | 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.
author: Gianugo Rabellino author: String | DASL_QUERY_NS | final static String | ERROR_ROOT_TAG | final protected static String | PATH_NODE_NAME | final static String | PREFIX | final static String | QUERY_TAG | final protected static String | RESOURCE_NODE_NAME | final static String | RESULT_ROOT_TAG | final static String | SUBSTITUTE_TAG | final static String | SUBSTITUTE_TAG_NAME_ATTRIBUTE | final static String | TARGET_URL | final static String | WEBDAV_SCHEME | String | targetUrl |
Method Summary | |
public void | endElement(String uri, String name, String raw) Intercept the end tag, convert buffered input to a String, build and execute the
DASL query. | public Serializable | getKey() | public SourceValidity | getValidity() | protected void | performSearchMethod(String query) | public void | recycle() | public void | setup(SourceResolver resolver, Map objectModel, String src, Parameters par) | public void | startElement(String uri, String name, String raw, Attributes attr) Intercept the start tag. |
DASL_QUERY_NS | final static String DASL_QUERY_NS(Code) | | The tag namespace
|
ERROR_ROOT_TAG | final static String ERROR_ROOT_TAG(Code) | | The tag name of root_tag for errors
|
PATH_NODE_NAME | final protected static String PATH_NODE_NAME(Code) | | |
QUERY_TAG | final static String QUERY_TAG(Code) | | The tag name identifying the query
|
RESOURCE_NODE_NAME | final protected static String RESOURCE_NODE_NAME(Code) | | |
RESULT_ROOT_TAG | final static String RESULT_ROOT_TAG(Code) | | The tag name of root_tag for result
|
SUBSTITUTE_TAG | final static String SUBSTITUTE_TAG(Code) | | The tag name for substitution of query parameter
|
SUBSTITUTE_TAG_NAME_ATTRIBUTE | final static String SUBSTITUTE_TAG_NAME_ATTRIBUTE(Code) | | The tag name for substitution of query parameter
|
TARGET_URL | final static String TARGET_URL(Code) | | The URL namespace
|
WEBDAV_SCHEME | final static String WEBDAV_SCHEME(Code) | | The WebDAV scheme
|
getKey | public Serializable getKey()(Code) | | generates the cachekey, which is the classname plus any possible COCOON parameters
|
getValidity | public SourceValidity getValidity()(Code) | | returns the validity which will be filled during processing of the requests
|
recycle | public void recycle()(Code) | | Forget about previous aggregated validity object
|
Methods inherited from org.apache.cocoon.transformation.AbstractSAXTransformer | protected void addRecorder(XMLConsumer recorder)(Code)(Java Doc) public void characters(char[] p0, int p1, int p2) throws SAXException(Code)(Java Doc) public void comment(char ary, int start, int length) throws SAXException(Code)(Java Doc) public void configure(Configuration configuration) throws ConfigurationException(Code)(Java Doc) public void dispose()(Code)(Java Doc) public void endCDATA() throws SAXException(Code)(Java Doc) public void endDTD() throws SAXException(Code)(Java Doc) public void endDocument() throws SAXException(Code)(Java Doc) public void endElement(String uri, String name, String raw) throws SAXException(Code)(Java Doc) public void endEntity(String name) throws SAXException(Code)(Java Doc) public SourceParameters endParametersRecording(Parameters source) throws SAXException(Code)(Java Doc) public SourceParameters endParametersRecording(SourceParameters source) throws SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc) public DocumentFragment endRecording() throws SAXException(Code)(Java Doc) public XMLizable endSAXRecording() throws SAXException(Code)(Java Doc) public String endSerializedXMLRecording() throws SAXException, ProcessingException(Code)(Java Doc) public String endTextRecording() throws SAXException(Code)(Java Doc) public void endTransformingElement(String uri, String name, String raw) throws ProcessingException, IOException, SAXException(Code)(Java Doc) protected String findPrefixMapping(String uri)(Code)(Java Doc) protected AttributesImpl getMutableAttributes(Attributes a)(Code)(Java Doc) public void ignorableWhitespace(char[] p0, int p1, int p2) throws SAXException(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public void recycle()(Code)(Java Doc) protected Object removeRecorder()(Code)(Java Doc) public void sendEndElementEvent(String localname) throws SAXException(Code)(Java Doc) public void sendEndElementEventNS(String localname) throws SAXException(Code)(Java Doc) protected void sendEndPrefixMapping() throws SAXException(Code)(Java Doc) public void sendEvents(Node node) throws SAXException(Code)(Java Doc) public void sendParametersEvents(SourceParameters pars) throws SAXException(Code)(Java Doc) public void sendStartElementEvent(String localname) throws SAXException(Code)(Java Doc) public void sendStartElementEvent(String localname, Attributes attr) throws SAXException(Code)(Java Doc) public void sendStartElementEventNS(String localname) throws SAXException(Code)(Java Doc) public void sendStartElementEventNS(String localname, Attributes attr) throws SAXException(Code)(Java Doc) protected void sendStartPrefixMapping() throws SAXException(Code)(Java Doc) public void sendTextEvent(String text) throws SAXException(Code)(Java Doc) public void service(ServiceManager manager) throws ServiceException(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void setup(SourceResolver resolver, Map objectModel, String src, Parameters params) throws ProcessingException, SAXException, IOException(Code)(Java Doc) public void setupTransforming() throws IOException, ProcessingException, SAXException(Code)(Java Doc) public void skippedEntity(String name) throws SAXException(Code)(Java Doc) public void startCDATA() throws SAXException(Code)(Java Doc) public void startDTD(String name, String public_id, String system_id) throws SAXException(Code)(Java Doc) public void startDocument() throws SAXException(Code)(Java Doc) public void startElement(String uri, String name, String raw, Attributes attr) throws SAXException(Code)(Java Doc) public void startEntity(String name) throws SAXException(Code)(Java Doc) public void startParametersRecording() throws SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc) public void startRecording() throws SAXException(Code)(Java Doc) public void startSAXRecording() throws SAXException(Code)(Java Doc) public void startSerializedXMLRecording(Properties format) throws SAXException(Code)(Java Doc) public void startTextRecording() throws SAXException(Code)(Java Doc) public void startTransformingElement(String uri, String name, String raw, Attributes attr) throws ProcessingException, IOException, SAXException(Code)(Java Doc)
|
|
|