|
|||||||||
| Home >> All >> org >> apache >> cocoon >> [ transformation overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.cocoon.transformation
Class LDAPTransformer

java.lang.ObjectAbstractLoggable
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
org.apache.cocoon.transformation.AbstractTransformer
org.apache.cocoon.transformation.LDAPTransformer
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, org.apache.cocoon.sitemap.SitemapModelComponent, Transformer, org.apache.cocoon.xml.XMLConsumer, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer
- public class LDAPTransformer
- extends AbstractTransformer
The LDAPTransformer is a class that can be plugged into a pipeline
to transform the SAX events which passes thru this transformer into queries
an responses to/from a ldap interface.
The file will be specified in a parameter tag in the sitemap pipeline to the
transformer as follows:
<map:transform type="ldap"/>
The following DTD is valid:
<!ELEMENT execute-query (attribute+ | show-attribute? | scope? | initializer? | authentication? | error-element? | sax-error? doc-element? | row-element? | version? | serverurl? | rootdn? | password? | deref-link? | count-limit? | searchbase, filter)>
<!ELEMENT execute-increment (attribute | show-attribute? | scope? | initializer? | authentication? | error-element? | sax-error? | doc-element? | row-element? | version? | serverurl? | rootdn? | password? | deref-link? | count-limit? | searchbase, filter)>
increments (+1) an integer attribute on a directory-server (ldap)
<!ELEMENT initializer (#PCDATA)>+ (default: "com.sun.jndi.ldap.LdapCtxFactory")
<!ELEMENT authentication (#PCDATA)>+ (default: "simple")
<!ELEMENT version (#PCDATA)>+ (default: "2")
<!ELEMENT serverurl (#PCDATA)>+
<!ELEMENT port (#PCDATA)>+ (default: 389)
<!ELEMENT rootdn (#PCDATA)>+
<!ELEMENT password (#PCDATA)>+
<!ELEMENT scope (ONELEVEL_SCOPE | SUBTREE_SCOPE | OBJECT_SCOPE)>+ (default: ONELEVEL_SCOPE)
<!ELEMENT searchbase (#PCDATA)>+
<!ELEMENT doc-element (#PCDATA)>+ (default: "doc-element")
<!ELEMENT row-element (#PCDATA)>+ (default: "row-element")
<!ELEMENT error-element (#PCDATA)>+ (default: "ldap-error") (in case of error returned error tag)
<!ELEMENT sax_error (TRUE | FALSE)>+; (default: FALSE) (throws SAX-Exception instead of error tag)
<!ELEMENT attribute (#PCDATA)>
<!ELEMENT show-attribute (TRUE | FALSE)> (default: TRUE)
<!ELEMENT filter (#PCDATA | execute-query)>
<!ELEMENT deref-link (TRUE | FALSE)> (default: FALSE)
<!ELEMENT count-limit (#PCDATA)> (integer default: 0 -> no limit)
<!ELEMENT time-limit (#PCDATA)> (integer default: 0 -> infinite)
<!ELEMENT debug (TRUE | FALSE)>+; (default: FALSE)
+ can also be defined as parameter in the sitemap.
- Version:
- CVS $Id: LDAPTransformer.java,v 1.6.2.1 2002/10/03 04:51:47 vgritsenko Exp $
| Nested Class Summary | |
(package private) class |
LDAPTransformer.LDAPQuery
|
| Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, lexicalHandler, xmlConsumer |
| Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
| Constructor Summary | |
LDAPTransformer()
|
|
| Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
| Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
recycle, setConsumer, setContentHandler, setLexicalHandler |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xml.sax.ContentHandler |
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping |
| Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
| Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
setConsumer |
| Field Detail |
my_uri
public static final java.lang.String my_uri
- The LDAP namespace ("http://apache.org/cocoon/LDAP/1.0")
- See Also:
- Constant Field Values
my_name
public static final java.lang.String my_name
- See Also:
- Constant Field Values
MAGIC_EXECUTE_QUERY
public static final java.lang.String MAGIC_EXECUTE_QUERY
- The LDAP namespace element names
- See Also:
- Constant Field Values
MAGIC_EXECUTE_INCREMENT
public static final java.lang.String MAGIC_EXECUTE_INCREMENT
- See Also:
- Constant Field Values
MAGIC_INITIALIZER_ELEMENT
public static final java.lang.String MAGIC_INITIALIZER_ELEMENT
- See Also:
- Constant Field Values
MAGIC_DOC_ELEMENT
public static final java.lang.String MAGIC_DOC_ELEMENT
- See Also:
- Constant Field Values
MAGIC_ROW_ELEMENT
public static final java.lang.String MAGIC_ROW_ELEMENT
- See Also:
- Constant Field Values
MAGIC_ERROR_ELEMENT
public static final java.lang.String MAGIC_ERROR_ELEMENT
- See Also:
- Constant Field Values
MAGIC_SAX_ERROR
public static final java.lang.String MAGIC_SAX_ERROR
- See Also:
- Constant Field Values
MAGIC_ATTRIBUTE_ELEMENT
public static final java.lang.String MAGIC_ATTRIBUTE_ELEMENT
- See Also:
- Constant Field Values
MAGIC_SERVERURL_ELEMENT
public static final java.lang.String MAGIC_SERVERURL_ELEMENT
- See Also:
- Constant Field Values
MAGIC_PORT_ELEMENT
public static final java.lang.String MAGIC_PORT_ELEMENT
- See Also:
- Constant Field Values
MAGIC_SEARCHBASE_ELEMENT
public static final java.lang.String MAGIC_SEARCHBASE_ELEMENT
- See Also:
- Constant Field Values
MAGIC_FILTER_ELEMENT
public static final java.lang.String MAGIC_FILTER_ELEMENT
- See Also:
- Constant Field Values
MAGIC_ROOT_DN_ELEMENT
public static final java.lang.String MAGIC_ROOT_DN_ELEMENT
- See Also:
- Constant Field Values
MAGIC_PASSWORD_ELEMENT
public static final java.lang.String MAGIC_PASSWORD_ELEMENT
- See Also:
- Constant Field Values
MAGIC_SHOW_ATTRIBUTE_ELEMENT
public static final java.lang.String MAGIC_SHOW_ATTRIBUTE_ELEMENT
- See Also:
- Constant Field Values
MAGIC_SCOPE_ELEMENT
public static final java.lang.String MAGIC_SCOPE_ELEMENT
- See Also:
- Constant Field Values
MAGIC_VERSION_ELEMENT
public static final java.lang.String MAGIC_VERSION_ELEMENT
- See Also:
- Constant Field Values
MAGIC_AUTHENTICATION_ELEMENT
public static final java.lang.String MAGIC_AUTHENTICATION_ELEMENT
- See Also:
- Constant Field Values
MAGIC_DEREF_LINK_ELEMENT
public static final java.lang.String MAGIC_DEREF_LINK_ELEMENT
- See Also:
- Constant Field Values
MAGIC_COUNT_LIMIT_ELEMENT
public static final java.lang.String MAGIC_COUNT_LIMIT_ELEMENT
- See Also:
- Constant Field Values
MAGIC_TIME_LIMIT_ELEMENT
public static final java.lang.String MAGIC_TIME_LIMIT_ELEMENT
- See Also:
- Constant Field Values
MAGIC_DEBUG_ELEMENT
public static final java.lang.String MAGIC_DEBUG_ELEMENT
- See Also:
- Constant Field Values
STATE_OUTSIDE
public static final int STATE_OUTSIDE
- The states we are allowed to be in
- See Also:
- Constant Field Values
STATE_INSIDE_EXECUTE_QUERY
public static final int STATE_INSIDE_EXECUTE_QUERY
- See Also:
- Constant Field Values
STATE_INSIDE_EXECUTE_INCREMENT
public static final int STATE_INSIDE_EXECUTE_INCREMENT
- See Also:
- Constant Field Values
STATE_INSIDE_EXECUTE_ELEMENT
public static final int STATE_INSIDE_EXECUTE_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_INITIALIZER_ELEMENT
public static final int STATE_INSIDE_INITIALIZER_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_SERVERURL_ELEMENT
public static final int STATE_INSIDE_SERVERURL_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_PORT_ELEMENT
public static final int STATE_INSIDE_PORT_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_SCOPE_ELEMENT
public static final int STATE_INSIDE_SCOPE_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_VERSION_ELEMENT
public static final int STATE_INSIDE_VERSION_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_AUTHENTICATION_ELEMENT
public static final int STATE_INSIDE_AUTHENTICATION_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_ROOT_DN_ELEMENT
public static final int STATE_INSIDE_ROOT_DN_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_PASSWORD_ELEMENT
public static final int STATE_INSIDE_PASSWORD_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_SEARCHBASE_ELEMENT
public static final int STATE_INSIDE_SEARCHBASE_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_DOC_ELEMENT
public static final int STATE_INSIDE_DOC_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_ROW_ELEMENT
public static final int STATE_INSIDE_ROW_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_ATTRIBUTE_ELEMENT
public static final int STATE_INSIDE_ATTRIBUTE_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_SHOW_ATTRIBUTE_ELEMENT
public static final int STATE_INSIDE_SHOW_ATTRIBUTE_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_ERROR_ELEMENT
public static final int STATE_INSIDE_ERROR_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_FILTER_ELEMENT
public static final int STATE_INSIDE_FILTER_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_DEREF_LINK_ELEMENT
public static final int STATE_INSIDE_DEREF_LINK_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_COUNT_LIMIT_ELEMENT
public static final int STATE_INSIDE_COUNT_LIMIT_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_TIME_LIMIT_ELEMENT
public static final int STATE_INSIDE_TIME_LIMIT_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_DEBUG_ELEMENT
public static final int STATE_INSIDE_DEBUG_ELEMENT
- See Also:
- Constant Field Values
STATE_INSIDE_SAX_ERROR_ELEMENT
public static final int STATE_INSIDE_SAX_ERROR_ELEMENT
- See Also:
- Constant Field Values
default_properties
protected java.util.Properties default_properties
- Default parameters that might apply to all queries
current_name
protected java.lang.String current_name
- The name of the value element we're currently receiving
current_state
protected int current_state
- The current state of the event receiving FSM
current_value
protected java.lang.StringBuffer current_value
- The value of the value element we're currently receiving
queries
protected java.util.Vector queries
- The list of queries that we're currently working on
current_query_index
protected int current_query_index
- The offset of the current query in the queries list
xml_consumer
protected org.apache.cocoon.xml.XMLConsumer xml_consumer
- SAX producing state information
lexical_handler
protected org.xml.sax.ext.LexicalHandler lexical_handler
| Constructor Detail |
LDAPTransformer
public LDAPTransformer()
| Method Detail |
setup
public void setup(org.apache.cocoon.environment.SourceResolver resolver, java.util.Map objectModel, java.lang.String source, Parameters parameters) throws org.apache.cocoon.ProcessingException, org.xml.sax.SAXException, java.io.IOException
- BEGIN SitemapComponent methods
executeQuery
protected void executeQuery(int index)
throws org.xml.sax.SAXException
- This will be the meat of LDAPTransformer, where the query is run.
throwIllegalStateException
protected static void throwIllegalStateException(java.lang.String message)
startExecuteQuery
protected void startExecuteQuery(org.xml.sax.Attributes attributes)
endExecuteQuery
protected void endExecuteQuery()
throws org.xml.sax.SAXException
startExecuteIncrement
protected void startExecuteIncrement(org.xml.sax.Attributes attributes)
endExecuteIncrement
protected void endExecuteIncrement()
throws org.xml.sax.SAXException
startInitializerElement
protected void startInitializerElement(org.xml.sax.Attributes attributes)
endInitializerElement
protected void endInitializerElement()
startScopeElement
protected void startScopeElement(org.xml.sax.Attributes attributes)
endScopeElement
protected void endScopeElement()
startAuthenticationElement
protected void startAuthenticationElement(org.xml.sax.Attributes attributes)
endAuthenticationElement
protected void endAuthenticationElement()
startServerurlElement
protected void startServerurlElement(org.xml.sax.Attributes attributes)
endServerurlElement
protected void endServerurlElement()
startPortElement
protected void startPortElement(org.xml.sax.Attributes attributes)
endPortElement
protected void endPortElement()
startShowAttributeElement
protected void startShowAttributeElement(org.xml.sax.Attributes attributes)
endShowAttributeElement
protected void endShowAttributeElement()
startSearchbaseElement
protected void startSearchbaseElement(org.xml.sax.Attributes attributes)
endSearchbaseElement
protected void endSearchbaseElement()
startDocElement
protected void startDocElement(org.xml.sax.Attributes attributes)
endDocElement
protected void endDocElement()
startRowElement
protected void startRowElement(org.xml.sax.Attributes attributes)
endRowElement
protected void endRowElement()
startErrorElement
protected void startErrorElement(org.xml.sax.Attributes attributes)
endErrorElement
protected void endErrorElement()
startSaxError
protected void startSaxError(org.xml.sax.Attributes attributes)
endSaxError
protected void endSaxError()
startRootDnElement
protected void startRootDnElement(org.xml.sax.Attributes attributes)
endRootDnElement
protected void endRootDnElement()
startPasswordElement
protected void startPasswordElement(org.xml.sax.Attributes attributes)
endPasswordElement
protected void endPasswordElement()
startAttributeElement
protected void startAttributeElement(org.xml.sax.Attributes attributes)
endAttributeElement
protected void endAttributeElement()
startVersionElement
protected void startVersionElement(org.xml.sax.Attributes attributes)
endVersionElement
protected void endVersionElement()
startFilterElement
protected void startFilterElement(org.xml.sax.Attributes attributes)
endFilterElement
protected void endFilterElement()
startDerefLinkElement
protected void startDerefLinkElement(org.xml.sax.Attributes attributes)
endDerefLinkElement
protected void endDerefLinkElement()
startCountLimitElement
protected void startCountLimitElement(org.xml.sax.Attributes attributes)
endCountLimitElement
protected void endCountLimitElement()
startTimeLimitElement
protected void startTimeLimitElement(org.xml.sax.Attributes attributes)
endTimeLimitElement
protected void endTimeLimitElement()
startDebugElement
protected void startDebugElement(org.xml.sax.Attributes attributes)
endDebugElement
protected void endDebugElement()
getCurrentQuery
protected LDAPTransformer.LDAPQuery getCurrentQuery()
getQuery
protected LDAPTransformer.LDAPQuery getQuery(int i)
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- BEGIN SAX ContentHandler handlers
startElement
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String raw, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
- Description copied from interface:
org.xml.sax.ContentHandler - Receive notification of the beginning of an element.
The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement 55 event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.
This event allows up to three name components for each element:
- the Namespace URI;
- the local name; and
- the qualified (prefixed) name.
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
- the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
- the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).
Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the
http://xml.org/sax/features/namespace-prefixesproperty is true (it is false by default, and support for a true value is optional).Like characters() 55 , attribute values may have characters that need more than one
charvalue.
endElement
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String raw) throws org.xml.sax.SAXException
- Description copied from interface:
org.xml.sax.ContentHandler - Receive notification of the end of an element.
The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement 55 event for every endElement event (even when the element is empty).
For information on the names, see startElement.
characters
public void characters(char[] ary,
int start,
int length)
throws org.xml.sax.SAXException
- Description copied from interface:
org.xml.sax.ContentHandler - Receive notification of character data.
The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
The application must not attempt to read from the array outside of the specified range.
Individual characters may consist of more than one Java
charvalue. There are two important cases where this happens, because characters can't be represented in just sixteen bits. In one case, characters are represented in a Surrogate Pair, using two special Unicode values. Such characters are in the so-called "Astral Planes", with a code point above U+FFFF. A second case involves composite characters, such as a base character combining with one or more accent characters.Your code should not assume that algorithms using
char-at-a-time idioms will be working in character units; in some cases they will split characters. This is relevant wherever XML permits arbitrary characters, such as attribute values, processing instruction data, and comments as well as in data reported from this method. It's also generally relevant whenever Java code manipulates internationalized text; the issue isn't unique to XML.Note that some parsers will report whitespace in element content using the ignorableWhitespace 55 method rather than this one (validating parsers must do so).
attribute
private void attribute(org.xml.sax.helpers.AttributesImpl attr, java.lang.String name, java.lang.String value)
start
private void start(java.lang.String name, org.xml.sax.helpers.AttributesImpl attr) throws org.xml.sax.SAXException
end
private void end(java.lang.String name) throws org.xml.sax.SAXException
data
private void data(java.lang.String data) throws org.xml.sax.SAXException
getStringValue
protected static java.lang.String getStringValue(java.lang.Object object)
getTheLogger
public final Logger getTheLogger()
|
|||||||||
| Home >> All >> org >> apache >> cocoon >> [ transformation overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
AbstractLoggable