|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.LDAPTransformer
public class LDAPTransformer
The LDAPTransformer
can be plugged into a pipeline to transform
the SAX events into queries and 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"/>
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 | |
---|---|
LDAPTransformer()
|
Method Summary | |
---|---|
void |
characters(char[] ary,
int start,
int length)
Receive notification of character data. |
protected void |
data(String data)
|
protected void |
end(String name)
|
protected void |
endAttributeElement()
|
protected void |
endAuthenticationElement()
|
protected void |
endCountLimitElement()
|
protected void |
endDebugElement()
|
protected void |
endDerefLinkElement()
|
protected void |
endDnAttribute()
|
protected void |
endDocElement()
|
void |
endElement(String uri,
String name,
String raw)
Receive notification of the end of an element. |
protected void |
endErrorElement()
|
protected void |
endExecuteElement(int state,
String name)
|
protected void |
endFilterElement()
|
protected void |
endInitialContextElement()
|
protected void |
endInitializerElement()
|
protected void |
endPasswordElement()
|
protected void |
endPortElement()
|
protected void |
endRootDnElement()
|
protected void |
endRowElement()
|
protected void |
endSaxError()
|
protected void |
endScopeElement()
|
protected void |
endSearchbaseElement()
|
protected void |
endServerurlElement()
|
protected void |
endShowAttributeElement()
|
protected void |
endTimeLimitElement()
|
protected void |
endVersionElement()
|
protected void |
executeQuery(int index)
This will be the meat of LDAPTransformer, where the query is run. |
protected org.apache.cocoon.transformation.LDAPTransformer.LDAPQuery |
getCurrentQuery()
|
protected org.apache.cocoon.transformation.LDAPTransformer.LDAPQuery |
getQuery(int i)
|
protected static String |
getStringValue(Object object)
|
Logger |
getTheLogger()
|
protected void |
setDefaultProperty(Parameters parameters,
String propertyName)
My very own methods |
void |
setDocumentLocator(Locator locator)
BEGIN SAX ContentHandler handlers |
void |
setup(SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
SitemapComponent methods |
protected void |
start(String name,
AttributesImpl attr)
|
protected void |
startAttributeElement(Attributes attributes)
|
void |
startElement(String uri,
String name,
String raw,
Attributes attributes)
Receive notification of the beginning of an element. |
protected void |
startExecuteElement()
|
protected void |
startExecuteElement(int state,
String name)
|
protected void |
startFilterElement(Attributes attributes)
|
protected void |
startInitialContextElement(Attributes attributes)
|
protected void |
startParameterElement(int state,
String name)
|
protected void |
startQueryParameterElement(int state,
String name)
|
protected void |
startShowAttributeElement(Attributes attributes)
|
protected void |
storeQuery(int nextState)
|
protected static void |
throwIllegalStateException(String message)
|
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 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.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 |
---|
public static final String my_uri
public static final String my_name
public static final String MAGIC_ATTRIBUTE_ELEMENT
public static final String MAGIC_ATTRIBUTE_ELEMENT_ATTRIBUTE
public static final String MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE
public static final String MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE_DEFAULT
public static final String MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE_VALUE_A
public static final String MAGIC_AUTHENTICATION_ELEMENT
public static final String MAGIC_COUNT_LIMIT_ELEMENT
public static final String MAGIC_DEBUG_ELEMENT
public static final String MAGIC_DEREF_LINK_ELEMENT
public static final String MAGIC_DOC_ELEMENT
public static final String MAGIC_ENCODING_ELEMENT
public static final String MAGIC_ERROR_ELEMENT
public static final String MAGIC_EXECUTE_ADD
public static final String MAGIC_EXECUTE_INCREMENT
public static final String MAGIC_EXECUTE_QUERY
public static final String MAGIC_EXECUTE_REPLACE
public static final String MAGIC_FILTER_ELEMENT
public static final String MAGIC_INITIALIZER_ELEMENT
public static final String MAGIC_INITIAL_CONTEXT_ELEMENT
public static final String MAGIC_INITIAL_CONTEXT_NAME_ATTRIBUTE
public static final String MAGIC_INITIAL_CONTEXT_VALUE_ATTRIBUTE
public static final String MAGIC_PASSWORD_ELEMENT
public static final String MAGIC_PORT_ELEMENT
public static final String MAGIC_ROOT_DN_ELEMENT
public static final String MAGIC_ROW_ELEMENT
public static final String MAGIC_DN_ATTRIBUTE
public static final String MAGIC_SAX_ERROR
public static final String MAGIC_SCOPE_ELEMENT
public static final String MAGIC_SEARCHBASE_ELEMENT
public static final String MAGIC_SERVERURL_ELEMENT
public static final String MAGIC_SHOW_ATTRIBUTE_ELEMENT
public static final String MAGIC_TIME_LIMIT_ELEMENT
public static final String MAGIC_VERSION_ELEMENT
public static final int STATE_OUTSIDE
public static final int STATE_INSIDE_EXECUTE_QUERY
public static final int STATE_INSIDE_EXECUTE_INCREMENT
public static final int STATE_INSIDE_EXECUTE_ELEMENT
public static final int STATE_INSIDE_INITIALIZER_ELEMENT
public static final int STATE_INSIDE_SERVERURL_ELEMENT
public static final int STATE_INSIDE_PORT_ELEMENT
public static final int STATE_INSIDE_SCOPE_ELEMENT
public static final int STATE_INSIDE_VERSION_ELEMENT
public static final int STATE_INSIDE_AUTHENTICATION_ELEMENT
public static final int STATE_INSIDE_ROOT_DN_ELEMENT
public static final int STATE_INSIDE_PASSWORD_ELEMENT
public static final int STATE_INSIDE_SEARCHBASE_ELEMENT
public static final int STATE_INSIDE_DOC_ELEMENT
public static final int STATE_INSIDE_ROW_ELEMENT
public static final int STATE_INSIDE_ATTRIBUTE_ELEMENT
public static final int STATE_INSIDE_SHOW_ATTRIBUTE_ELEMENT
public static final int STATE_INSIDE_ERROR_ELEMENT
public static final int STATE_INSIDE_FILTER_ELEMENT
public static final int STATE_INSIDE_DEREF_LINK_ELEMENT
public static final int STATE_INSIDE_COUNT_LIMIT_ELEMENT
public static final int STATE_INSIDE_TIME_LIMIT_ELEMENT
public static final int STATE_INSIDE_DEBUG_ELEMENT
public static final int STATE_INSIDE_SAX_ERROR_ELEMENT
public static final int STATE_INSIDE_EXECUTE_REPLACE
public static final int STATE_INSIDE_EXECUTE_ADD
public static final int STATE_INSIDE_DN_ATTRIBUTE
public static final int STATE_INSIDE_INITIAL_CONTEXT_ELEMENT
protected HashMap default_properties
protected String current_name
protected int current_state
protected StringBuffer current_value
protected Vector queries
protected int current_query_index
protected XMLConsumer xml_consumer
protected LexicalHandler lexical_handler
Constructor Detail |
---|
public LDAPTransformer()
Method Detail |
---|
public void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws ProcessingException, SAXException, IOException
ProcessingException
SAXException
IOException
protected void setDefaultProperty(Parameters parameters, String propertyName)
protected void storeQuery(int nextState)
protected void executeQuery(int index) throws SAXException
SAXException
protected static void throwIllegalStateException(String message)
protected void startExecuteElement()
protected void startExecuteElement(int state, String name)
protected void endExecuteElement(int state, String name) throws SAXException
SAXException
protected void startQueryParameterElement(int state, String name)
protected void startParameterElement(int state, String name)
protected void endInitializerElement()
protected void endScopeElement()
protected void endAuthenticationElement()
protected void endServerurlElement()
protected void endPortElement()
protected void startShowAttributeElement(Attributes attributes)
protected void endShowAttributeElement()
protected void endSearchbaseElement()
protected void endDocElement()
protected void endRowElement()
protected void endDnAttribute()
protected void endErrorElement()
protected void endSaxError()
protected void endRootDnElement()
protected void endPasswordElement()
protected void startAttributeElement(Attributes attributes)
protected void endAttributeElement()
protected void startInitialContextElement(Attributes attributes)
protected void endInitialContextElement()
protected void endVersionElement()
protected void startFilterElement(Attributes attributes)
protected void endFilterElement()
protected void endDerefLinkElement()
protected void endCountLimitElement()
protected void endTimeLimitElement()
protected void endDebugElement()
protected org.apache.cocoon.transformation.LDAPTransformer.LDAPQuery getCurrentQuery()
protected org.apache.cocoon.transformation.LDAPTransformer.LDAPQuery getQuery(int i)
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class AbstractXMLPipe
locator
- An object that can return the location of any SAX
document event.public void startElement(String uri, String name, String raw, Attributes attributes) throws SAXException
AbstractXMLPipe
startElement
in interface ContentHandler
startElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.attributes
- The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
SAXException
public void endElement(String uri, String name, String raw) throws SAXException
AbstractXMLPipe
endElement
in interface ContentHandler
endElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.
SAXException
public void characters(char[] ary, int start, int length) throws SAXException
AbstractXMLPipe
characters
in interface ContentHandler
characters
in class AbstractXMLPipe
ary
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
SAXException
protected void start(String name, AttributesImpl attr) throws SAXException
SAXException
protected void end(String name) throws SAXException
SAXException
protected void data(String data) throws SAXException
SAXException
protected static String getStringValue(Object object)
public final Logger getTheLogger()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |