| |
|
| org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.LDAPTransformer
LDAPTransformer | public class LDAPTransformer extends AbstractTransformer (Code) | | 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"/>
The following DTD is valid:
<!ELEMENT execute-query (attribute+ | show-attribute? | scope? | initializer? | initial-context? | 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? | initial-context? | 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 execute-replace (attribute | show-attribute? | scope? | initializer? | initial-context? | authentication? | error-element? | sax-error? | doc-element? | row-element? | version? | serverurl? | rootdn? | password? | deref-link? | count-limit? | searchbase, filter)>
replace attribute on a directory-server (ldap)
<!ELEMENT execute-add (attribute | show-attribute? | scope? | initializer? | initial-context? | authentication? | error-element? | sax-error? | doc-element? | row-element? | version? | serverurl? | rootdn? | password? | deref-link? | count-limit? | searchbase, filter)>
add attribute on a directory-server (ldap)
<!ELEMENT initializer (#PCDATA)>+ (default: "com.sun.jndi.ldap.LdapCtxFactory")
<!ELEMENT initial-context (#EMPTY)>
<!ATTLIST initial-context name CDATA #REQUIRED
value CDATA #REQUIRED >
<!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 dn-attribute (#PCDATA)>+ (default: "" meaning no DN attribute)
<!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)>
<!ATTLIST attribute name CDATA #IMPLIED
mode (append|replace) 'replace' #IMPLIED > (in case execute-replace or execute-add elements using)
<!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: $Id: LDAPTransformer.java 433543 2006-08-22 06:22:54Z crossley $ |
Inner Class :static class LDAPQuery | |
Method Summary | |
public void | characters(char ary, int start, int length) | 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() | public void | endElement(String uri, String name, String raw) | 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 LDAPQuery | getCurrentQuery() | protected LDAPQuery | getQuery(int i) | protected static String | getStringValue(Object object) | final public Logger | getTheLogger() | protected void | setDefaultProperty(Parameters parameters, String propertyName) | public void | setDocumentLocator(Locator locator) | public void | setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) | protected void | start(String name, AttributesImpl attr) | protected void | startAttributeElement(Attributes attributes) | public void | startElement(String uri, String name, String raw, Attributes attributes) | 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) |
MAGIC_ATTRIBUTE_ELEMENT | final public static String MAGIC_ATTRIBUTE_ELEMENT(Code) | | The LDAP namespace element names
|
MAGIC_ATTRIBUTE_ELEMENT_ATTRIBUTE | final public static String MAGIC_ATTRIBUTE_ELEMENT_ATTRIBUTE(Code) | | |
MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE | final public static String MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE(Code) | | |
MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE_DEFAULT | final public static String MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE_DEFAULT(Code) | | |
MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE_VALUE_A | final public static String MAGIC_ATTRIBUTE_ELEMENT_MODE_ATTRIBUTE_VALUE_A(Code) | | |
MAGIC_AUTHENTICATION_ELEMENT | final public static String MAGIC_AUTHENTICATION_ELEMENT(Code) | | |
MAGIC_COUNT_LIMIT_ELEMENT | final public static String MAGIC_COUNT_LIMIT_ELEMENT(Code) | | |
MAGIC_DEBUG_ELEMENT | final public static String MAGIC_DEBUG_ELEMENT(Code) | | |
MAGIC_DEREF_LINK_ELEMENT | final public static String MAGIC_DEREF_LINK_ELEMENT(Code) | | |
MAGIC_DN_ATTRIBUTE | final public static String MAGIC_DN_ATTRIBUTE(Code) | | |
MAGIC_DOC_ELEMENT | final public static String MAGIC_DOC_ELEMENT(Code) | | |
MAGIC_ENCODING_ELEMENT | final public static String MAGIC_ENCODING_ELEMENT(Code) | | |
MAGIC_ERROR_ELEMENT | final public static String MAGIC_ERROR_ELEMENT(Code) | | |
MAGIC_EXECUTE_ADD | final public static String MAGIC_EXECUTE_ADD(Code) | | |
MAGIC_EXECUTE_INCREMENT | final public static String MAGIC_EXECUTE_INCREMENT(Code) | | |
MAGIC_EXECUTE_QUERY | final public static String MAGIC_EXECUTE_QUERY(Code) | | |
MAGIC_EXECUTE_REPLACE | final public static String MAGIC_EXECUTE_REPLACE(Code) | | |
MAGIC_FILTER_ELEMENT | final public static String MAGIC_FILTER_ELEMENT(Code) | | |
MAGIC_INITIALIZER_ELEMENT | final public static String MAGIC_INITIALIZER_ELEMENT(Code) | | |
MAGIC_INITIAL_CONTEXT_ELEMENT | final public static String MAGIC_INITIAL_CONTEXT_ELEMENT(Code) | | |
MAGIC_INITIAL_CONTEXT_NAME_ATTRIBUTE | final public static String MAGIC_INITIAL_CONTEXT_NAME_ATTRIBUTE(Code) | | |
MAGIC_INITIAL_CONTEXT_VALUE_ATTRIBUTE | final public static String MAGIC_INITIAL_CONTEXT_VALUE_ATTRIBUTE(Code) | | |
MAGIC_PASSWORD_ELEMENT | final public static String MAGIC_PASSWORD_ELEMENT(Code) | | |
MAGIC_PORT_ELEMENT | final public static String MAGIC_PORT_ELEMENT(Code) | | |
MAGIC_ROOT_DN_ELEMENT | final public static String MAGIC_ROOT_DN_ELEMENT(Code) | | |
MAGIC_ROW_ELEMENT | final public static String MAGIC_ROW_ELEMENT(Code) | | |
MAGIC_SAX_ERROR | final public static String MAGIC_SAX_ERROR(Code) | | |
MAGIC_SCOPE_ELEMENT | final public static String MAGIC_SCOPE_ELEMENT(Code) | | |
MAGIC_SEARCHBASE_ELEMENT | final public static String MAGIC_SEARCHBASE_ELEMENT(Code) | | |
MAGIC_SERVERURL_ELEMENT | final public static String MAGIC_SERVERURL_ELEMENT(Code) | | |
MAGIC_SHOW_ATTRIBUTE_ELEMENT | final public static String MAGIC_SHOW_ATTRIBUTE_ELEMENT(Code) | | |
MAGIC_TIME_LIMIT_ELEMENT | final public static String MAGIC_TIME_LIMIT_ELEMENT(Code) | | |
MAGIC_VERSION_ELEMENT | final public static String MAGIC_VERSION_ELEMENT(Code) | | |
STATE_INSIDE_ATTRIBUTE_ELEMENT | final public static int STATE_INSIDE_ATTRIBUTE_ELEMENT(Code) | | |
STATE_INSIDE_AUTHENTICATION_ELEMENT | final public static int STATE_INSIDE_AUTHENTICATION_ELEMENT(Code) | | |
STATE_INSIDE_COUNT_LIMIT_ELEMENT | final public static int STATE_INSIDE_COUNT_LIMIT_ELEMENT(Code) | | |
STATE_INSIDE_DEBUG_ELEMENT | final public static int STATE_INSIDE_DEBUG_ELEMENT(Code) | | |
STATE_INSIDE_DEREF_LINK_ELEMENT | final public static int STATE_INSIDE_DEREF_LINK_ELEMENT(Code) | | |
STATE_INSIDE_DN_ATTRIBUTE | final public static int STATE_INSIDE_DN_ATTRIBUTE(Code) | | |
STATE_INSIDE_DOC_ELEMENT | final public static int STATE_INSIDE_DOC_ELEMENT(Code) | | |
STATE_INSIDE_ERROR_ELEMENT | final public static int STATE_INSIDE_ERROR_ELEMENT(Code) | | |
STATE_INSIDE_EXECUTE_ADD | final public static int STATE_INSIDE_EXECUTE_ADD(Code) | | |
STATE_INSIDE_EXECUTE_ELEMENT | final public static int STATE_INSIDE_EXECUTE_ELEMENT(Code) | | |
STATE_INSIDE_EXECUTE_INCREMENT | final public static int STATE_INSIDE_EXECUTE_INCREMENT(Code) | | |
STATE_INSIDE_EXECUTE_QUERY | final public static int STATE_INSIDE_EXECUTE_QUERY(Code) | | |
STATE_INSIDE_EXECUTE_REPLACE | final public static int STATE_INSIDE_EXECUTE_REPLACE(Code) | | |
STATE_INSIDE_FILTER_ELEMENT | final public static int STATE_INSIDE_FILTER_ELEMENT(Code) | | |
STATE_INSIDE_INITIALIZER_ELEMENT | final public static int STATE_INSIDE_INITIALIZER_ELEMENT(Code) | | |
STATE_INSIDE_INITIAL_CONTEXT_ELEMENT | final public static int STATE_INSIDE_INITIAL_CONTEXT_ELEMENT(Code) | | |
STATE_INSIDE_PASSWORD_ELEMENT | final public static int STATE_INSIDE_PASSWORD_ELEMENT(Code) | | |
STATE_INSIDE_PORT_ELEMENT | final public static int STATE_INSIDE_PORT_ELEMENT(Code) | | |
STATE_INSIDE_ROOT_DN_ELEMENT | final public static int STATE_INSIDE_ROOT_DN_ELEMENT(Code) | | |
STATE_INSIDE_ROW_ELEMENT | final public static int STATE_INSIDE_ROW_ELEMENT(Code) | | |
STATE_INSIDE_SAX_ERROR_ELEMENT | final public static int STATE_INSIDE_SAX_ERROR_ELEMENT(Code) | | |
STATE_INSIDE_SCOPE_ELEMENT | final public static int STATE_INSIDE_SCOPE_ELEMENT(Code) | | |
STATE_INSIDE_SEARCHBASE_ELEMENT | final public static int STATE_INSIDE_SEARCHBASE_ELEMENT(Code) | | |
STATE_INSIDE_SERVERURL_ELEMENT | final public static int STATE_INSIDE_SERVERURL_ELEMENT(Code) | | |
STATE_INSIDE_SHOW_ATTRIBUTE_ELEMENT | final public static int STATE_INSIDE_SHOW_ATTRIBUTE_ELEMENT(Code) | | |
STATE_INSIDE_TIME_LIMIT_ELEMENT | final public static int STATE_INSIDE_TIME_LIMIT_ELEMENT(Code) | | |
STATE_INSIDE_VERSION_ELEMENT | final public static int STATE_INSIDE_VERSION_ELEMENT(Code) | | |
STATE_OUTSIDE | final public static int STATE_OUTSIDE(Code) | | The states we are allowed to be in
|
current_name | protected String current_name(Code) | | The name of the value element we're currently receiving
|
current_query_index | protected int current_query_index(Code) | | The offset of the current query in the queries list
|
current_state | protected int current_state(Code) | | The current state of the event receiving FSM
|
current_value | protected StringBuffer current_value(Code) | | The value of the value element we're currently receiving
|
default_properties | protected HashMap default_properties(Code) | | Default parameters that might apply to all queries
|
my_uri | final public static String my_uri(Code) | | The LDAP namespace ("http://apache.org/cocoon/LDAP/1.0")
|
queries | protected Vector queries(Code) | | The list of queries that we're currently working on
|
characters | public void characters(char ary, int start, int length) throws SAXException(Code) | | |
endAttributeElement | protected void endAttributeElement()(Code) | | |
endAuthenticationElement | protected void endAuthenticationElement()(Code) | | |
endCountLimitElement | protected void endCountLimitElement()(Code) | | |
endDebugElement | protected void endDebugElement()(Code) | | |
endDerefLinkElement | protected void endDerefLinkElement()(Code) | | |
endDnAttribute | protected void endDnAttribute()(Code) | | |
endDocElement | protected void endDocElement()(Code) | | |
endErrorElement | protected void endErrorElement()(Code) | | |
endFilterElement | protected void endFilterElement()(Code) | | |
endInitialContextElement | protected void endInitialContextElement()(Code) | | |
endInitializerElement | protected void endInitializerElement()(Code) | | |
endPasswordElement | protected void endPasswordElement()(Code) | | |
endPortElement | protected void endPortElement()(Code) | | |
endRootDnElement | protected void endRootDnElement()(Code) | | |
endRowElement | protected void endRowElement()(Code) | | |
endSaxError | protected void endSaxError()(Code) | | |
endScopeElement | protected void endScopeElement()(Code) | | |
endSearchbaseElement | protected void endSearchbaseElement()(Code) | | |
endServerurlElement | protected void endServerurlElement()(Code) | | |
endShowAttributeElement | protected void endShowAttributeElement()(Code) | | |
endTimeLimitElement | protected void endTimeLimitElement()(Code) | | |
endVersionElement | protected void endVersionElement()(Code) | | |
executeQuery | protected void executeQuery(int index) throws SAXException(Code) | | This will be the meat of LDAPTransformer, where the query is run.
|
getCurrentQuery | protected LDAPQuery getCurrentQuery()(Code) | | |
getQuery | protected LDAPQuery getQuery(int i)(Code) | | |
getTheLogger | final public Logger getTheLogger()(Code) | | |
setDefaultProperty | protected void setDefaultProperty(Parameters parameters, String propertyName)(Code) | | My very own methods
|
setDocumentLocator | public void setDocumentLocator(Locator locator)(Code) | | BEGIN SAX ContentHandler handlers
|
startAttributeElement | protected void startAttributeElement(Attributes attributes)(Code) | | |
startExecuteElement | protected void startExecuteElement()(Code) | | |
startExecuteElement | protected void startExecuteElement(int state, String name)(Code) | | |
startFilterElement | protected void startFilterElement(Attributes attributes)(Code) | | |
startInitialContextElement | protected void startInitialContextElement(Attributes attributes)(Code) | | |
startParameterElement | protected void startParameterElement(int state, String name)(Code) | | |
startQueryParameterElement | protected void startQueryParameterElement(int state, String name)(Code) | | |
startShowAttributeElement | protected void startShowAttributeElement(Attributes attributes)(Code) | | |
storeQuery | protected void storeQuery(int nextState)(Code) | | |
throwIllegalStateException | protected static void throwIllegalStateException(String message)(Code) | | |
|
|
|