cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Knecht" <felix.kne...@payserv.ch>
Subject SSL - Update for LDAPTransformer
Date Thu, 01 Nov 2001 15:42:16 GMT
This is my first try to send a diff-file, hope it's the correct way to do
this.

Felix


Index: LDAPTransformer.java
===================================================================
RCS file:
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/transformation/LDAPTransfo
rmer.java,v
retrieving revision 1.8
diff -r1.8 LDAPTransformer.java
10a11
> import org.apache.avalon.excalibur.pool.Recyclable;
45,46c46,47
<  * &lt;!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)&gt;<br/>
<  * &lt;!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)&gt;<br/>
---
>  * &lt;!ELEMENT execute-query (attribute+ | show-attribute? | scope? |
initializer? | security? | authentication? | error-element? | sax-error?
doc-element? | row-element? | version? | serverurl? | rootdn? | password? |
deref-link? | count-limit? | searchbase, filter)&gt;<br/>
>  * &lt;!ELEMENT execute-increment (attribute | show-attribute? | scope? |
initializer? | security? | authentication? | error-element? | sax-error? |
doc-element? | row-element? | version? | serverurl? | rootdn? | password? |
deref-link? | count-limit? | searchbase, filter)&gt;<br/>
53a55
>  * &lt;!ELEMENT security (#PCDATA)&gt;*<br/>
77c79
< public class LDAPTransformer extends AbstractTransformer implements
Poolable {
---
> public class LDAPTransformer extends AbstractTransformer implements
Poolable, Recyclable {
93a96
>     public static final String MAGIC_SECURITY_ELEMENT = "security";
131a135
>     public static final int STATE_INSIDE_SECURITY_ELEMENT = 24;
136,138d139
<     /** The name of the value element we're currently receiving **/
<     protected String current_name;
<
176a178,182
>        // Check the security
>        parameter =
parameters.getParameter(LDAPTransformer.MAGIC_SECURITY_ELEMENT,null);
>        if (parameter != null) {
>            default_properties.setProperty(MAGIC_SECURITY_ELEMENT,
parameter);
>        }
257d262
<         this.contentHandler.startPrefixMapping("",
LDAPTransformer.my_uri);
269,270d273
<
<         this.contentHandler.endPrefixMapping("");
444a448,475
>     protected void startSecurityElement(Attributes attributes) {
>         switch (current_state) {
>             case STATE_INSIDE_EXECUTE_QUERY:
>                 current_value.setLength(0);
>                 current_state =
LDAPTransformer.STATE_INSIDE_SECURITY_ELEMENT;
> 		getCurrentQuery().current_state =
LDAPTransformer.STATE_INSIDE_AUTHENTICATION_ELEMENT;
>                 break;
>             case STATE_INSIDE_EXECUTE_INCREMENT:
>                 current_value.setLength(0);
>                 current_state =
LDAPTransformer.STATE_INSIDE_SECURITY_ELEMENT;
> 		getCurrentQuery().current_state =
LDAPTransformer.STATE_INSIDE_SECURITY_ELEMENT;
>                 break;
>             default:
>                 throwIllegalStateException("Not expecting a start SECURITY
element");
>         }
>     }
>
>     protected void endSecurityElement() {
>         switch (current_state) {
>             case LDAPTransformer.STATE_INSIDE_SECURITY_ELEMENT:
> 		    getCurrentQuery().secure = current_value.toString();
>                     current_state = getCurrentQuery().toDo;
>                 break;
>             default:
>                 throwIllegalStateException("Not expecting a end security
element");
>         }
>     }
>
930a962,963
>         } else if (name.equals(LDAPTransformer.MAGIC_SECURITY_ELEMENT)) {
>             startSecurityElement(attributes);
985a1019,1020
>         } else if (name.equals(LDAPTransformer.MAGIC_SECURITY_ELEMENT)) {
>             endSecurityElement();
1027a1063
>             current_state != LDAPTransformer.STATE_INSIDE_SECURITY_ELEMENT
&&
1086a1123,1134
>     /**
>      * Recycle this component
>      */
>     public void recycle() {
>         super.recycle();
>         this.queries = new Vector();
>         this.current_value = new StringBuffer();
>         this.default_properties = new Properties();
>         this.current_state = LDAPTransformer.STATE_OUTSIDE;
>         this.current_query_index = -1;
>     }
>
1104a1153
>     protected String secure = "";
1137c1186
<         	port =
Integer.parseInt(transformer.default_properties.getProperty(transformer.MAGI
C_INITIALIZER_ELEMENT));
---
>         	port =
Integer.parseInt(transformer.default_properties.getProperty(transformer.MAGI
C_PORT_ELEMENT));
1153a1203,1205
>         if (null !=
transformer.default_properties.getProperty(transformer.MAGIC_SECURITY_ELEMEN
T)) {
>         	secure =
transformer.default_properties.getProperty(transformer.MAGIC_SECURITY_ELEMEN
T);
>         }
1367c1419,1420
<         env.put( Context.PROVIDER_URL, new StringBuffer(
serverurl ).append( ":" ).append( port ).toString() );
---
>         env.put(Context.PROVIDER_URL, new StringBuffer(
serverurl ).append( ":" ).append( port ).toString() );
>         env.put(Context.SECURITY_PROTOCOL, secure);
1392a1446
> 	transformer.getTheLogger().debug("[LDAPTransformer] security: " +
secure);


*****CVS exited normally with code 1*****


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message