directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r527164 - in /directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2: ./ engine/ reponse/ request/
Date Tue, 10 Apr 2007 15:50:23 GMT
Author: pamarcelot
Date: Tue Apr 10 08:50:21 2007
New Revision: 527164

URL: http://svn.apache.org/viewvc?view=rev&rev=527164
Log:
Changed the way XML Wrapper uses the LDAPMessage given in parameter of the constructor.

Added:
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponseDsml.java
Modified:
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/engine/Dsmlv2Engine.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AddResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AuthResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/BatchResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/CompareResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/DelResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ExtendedResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModDNResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModifyResponseDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultDoneDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultEntryDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultReferenceDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AbandonRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AddRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AuthRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/BatchRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/CompareRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/DelRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ExtendedRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyDNRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyRequestDsml.java
    directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/SearchRequestDsml.java

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/ParserUtils.java Tue Apr 10 08:50:21 2007
@@ -23,15 +23,25 @@
 
 import java.util.List;
 
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.directory.ldapstudio.dsmlv2.engine.Dsmlv2Engine;
 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest;
 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.Processing;
 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.ResponseOrder;
 import org.apache.directory.shared.ldap.codec.Control;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.util.Base64;
+import org.dom4j.Document;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
 import org.dom4j.QName;
+import org.dom4j.io.DocumentResult;
+import org.dom4j.io.DocumentSource;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
@@ -251,5 +261,47 @@
         }
 
         return ( ( batchRequest.getProcessing() == Processing.PARALLEL ) && ( batchRequest.getResponseOrder() == ResponseOrder.UNORDERED ) );
+    }
+
+
+    /**
+     * XML Pretty Printer XSLT Tranformation
+     * 
+     * @param document
+     *      the Dom4j Document
+     * @return
+     */
+    public static Document styleDocument( Document document )
+    {
+        // load the transformer using JAXP
+        TransformerFactory factory = TransformerFactory.newInstance();
+        Transformer transformer = null;
+        try
+        {
+            transformer = factory.newTransformer( new StreamSource( Dsmlv2Engine.class
+                .getResourceAsStream( "DSMLv2.xslt" ) ) );
+        }
+        catch ( TransformerConfigurationException e1 )
+        {
+            // TODO Auto-generated catch block
+            e1.printStackTrace();
+        }
+
+        // now lets style the given document
+        DocumentSource source = new DocumentSource( document );
+        DocumentResult result = new DocumentResult();
+        try
+        {
+            transformer.transform( source, result );
+        }
+        catch ( TransformerException e )
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        // return the transformed document
+        Document transformedDoc = result.getDocument();
+        return transformedDoc;
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/engine/Dsmlv2Engine.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/engine/Dsmlv2Engine.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/engine/Dsmlv2Engine.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/engine/Dsmlv2Engine.java Tue Apr 10 08:50:21 2007
@@ -31,21 +31,18 @@
 import java.nio.channels.SocketChannel;
 
 import javax.naming.NamingException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamSource;
 
 import org.apache.directory.ldapstudio.dsmlv2.Dsmlv2Parser;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.AddResponseDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.AuthResponseDsml;
+import org.apache.directory.ldapstudio.dsmlv2.reponse.BatchResponseDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.CompareResponseDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.DelResponseDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.ErrorResponse;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.ExtendedResponseDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.ModDNResponseDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.ModifyResponseDsml;
+import org.apache.directory.ldapstudio.dsmlv2.reponse.SearchResponseDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.SearchResultDoneDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.SearchResultEntryDsml;
 import org.apache.directory.ldapstudio.dsmlv2.reponse.SearchResultReferenceDsml;
@@ -59,24 +56,28 @@
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
+import org.apache.directory.shared.ldap.codec.Control;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponse;
+import org.apache.directory.shared.ldap.codec.add.AddResponse;
 import org.apache.directory.shared.ldap.codec.bind.BindRequest;
 import org.apache.directory.shared.ldap.codec.bind.BindResponse;
 import org.apache.directory.shared.ldap.codec.bind.LdapAuthentication;
 import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
+import org.apache.directory.shared.ldap.codec.compare.CompareResponse;
+import org.apache.directory.shared.ldap.codec.del.DelResponse;
 import org.apache.directory.shared.ldap.codec.extended.ExtendedResponse;
+import org.apache.directory.shared.ldap.codec.modify.ModifyResponse;
+import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNResponse;
+import org.apache.directory.shared.ldap.codec.search.SearchResultDone;
+import org.apache.directory.shared.ldap.codec.search.SearchResultEntry;
+import org.apache.directory.shared.ldap.codec.search.SearchResultReference;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
-import org.dom4j.Document;
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-import org.dom4j.io.DocumentResult;
-import org.dom4j.io.DocumentSource;
 import org.xmlpull.v1.XmlPullParserException;
 
 
@@ -111,8 +112,8 @@
     private int bbLimit;
 
     private int bbposition;
-    private Document xmlResponse;
     private BatchRequest batchRequest;
+    private BatchResponseDsml batchResponse;
 
 
     /**
@@ -202,9 +203,7 @@
      */
     private String processDSML()
     {
-        // Creating XML Document and root Element 'batchResponse'
-        xmlResponse = DocumentHelper.createDocument();
-        xmlResponse.addElement( "batchResponse" );
+        batchResponse = new BatchResponseDsml();
 
         // Binding to LDAP Server
         try
@@ -216,9 +215,8 @@
             // Unable to connect to server
             // We create a new ErrorResponse and return the XML response.
             ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.COULD_NOT_CONNECT, e.getMessage() );
-
-            errorResponse.toDsml( xmlResponse.getRootElement() );
-            return styleDocument( xmlResponse, "DSMLv2.xslt" ).asXML();
+            batchResponse.addResponse( errorResponse );
+            return batchResponse.toDsml();
         }
 
         // Processing BatchRequest:
@@ -233,9 +231,8 @@
             // We create a new ErrorResponse and return the XML response.
             ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, e.getMessage()
                 + " - Line " + e.getLineNumber() + " - Column " + e.getColumnNumber() );
-
-            errorResponse.toDsml( xmlResponse.getRootElement() );
-            return styleDocument( xmlResponse, "DSMLv2.xslt" ).asXML();
+            batchResponse.addResponse( errorResponse );
+            return batchResponse.toDsml();
         }
 
         // Processing each request:
@@ -254,9 +251,8 @@
             // We create a new ErrorResponse and return the XML response.
             ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, e.getMessage()
                 + " - Line " + e.getLineNumber() + " - Column " + e.getColumnNumber() );
-
-            errorResponse.toDsml( xmlResponse.getRootElement() );
-            return styleDocument( xmlResponse, "DSMLv2.xslt" ).asXML();
+            batchResponse.addResponse( errorResponse );
+            return batchResponse.toDsml();
         }
 
         while ( request != null ) // (Request == null when there's no more request to process)
@@ -269,9 +265,8 @@
                 // Then we have to send an errorResponse
                 ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST,
                     "A requestID must be specified to each request when Processing is Parallel and ReponseOrder is Unordered." );
-
-                errorResponse.toDsml( xmlResponse.getRootElement() );
-                return xmlResponse.asXML();
+                batchResponse.addResponse( errorResponse );
+                return batchResponse.toDsml();
             }
 
             try
@@ -283,9 +278,8 @@
                 // We create a new ErrorResponse and return the XML response.
                 ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.GATEWAY_INTERNAL_ERROR,
                     "Internal Error: " + e.getMessage() );
-
-                errorResponse.toDsml( xmlResponse.getRootElement() );
-                return styleDocument( xmlResponse, "DSMLv2.xslt" ).asXML();
+                batchResponse.addResponse( errorResponse );
+                return batchResponse.toDsml();
             }
 
             // Checking if we need to exit processing (if an error has ocurred if onError == Exit)
@@ -304,13 +298,12 @@
                 // We create a new ErrorResponse and return the XML response.
                 ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, e.getMessage()
                     + " - Line " + e.getLineNumber() + " - Column " + e.getColumnNumber() );
-
-                errorResponse.toDsml( xmlResponse.getRootElement() );
-                return styleDocument( xmlResponse, "DSMLv2.xslt" ).asXML();
+                batchResponse.addResponse( errorResponse );
+                return batchResponse.toDsml();
             }
         }
 
-        return styleDocument( xmlResponse, "DSMLv2.xslt" ).asXML();
+        return batchResponse.toDsml();
     }
 
 
@@ -324,7 +317,8 @@
      * @throws NamingException 
      * @throws DecoderException 
      */
-    private void processRequest( LdapMessage request ) throws EncoderException, IOException, DecoderException, NamingException
+    private void processRequest( LdapMessage request ) throws EncoderException, IOException, DecoderException,
+        NamingException
     {
         LdapMessage message = new LdapMessage();
 
@@ -349,38 +343,59 @@
 
         if ( LdapConstants.ADD_RESPONSE == response.getMessageType() )
         {
-            AddResponseDsml addResponseDsml = new AddResponseDsml( response );
-            addResponseDsml.toDsml( xmlResponse.getRootElement() );
+            AddResponse addResponse = response.getAddResponse();
+            copyMessageIdAndControls( response, addResponse );
+
+            AddResponseDsml addResponseDsml = new AddResponseDsml( addResponse );
+            batchResponse.addResponse( addResponseDsml );
         }
         else if ( LdapConstants.BIND_RESPONSE == response.getMessageType() )
         {
-            AuthResponseDsml authResponseDsml = new AuthResponseDsml( response );
-            authResponseDsml.toDsml( xmlResponse.getRootElement() );
+            BindResponse bindResponse = response.getBindResponse();
+            copyMessageIdAndControls( response, bindResponse );
+
+            AuthResponseDsml authResponseDsml = new AuthResponseDsml( bindResponse );
+            batchResponse.addResponse( authResponseDsml );
         }
         else if ( LdapConstants.COMPARE_RESPONSE == response.getMessageType() )
         {
-            CompareResponseDsml authResponseDsml = new CompareResponseDsml( response );
-            authResponseDsml.toDsml( xmlResponse.getRootElement() );
+            CompareResponse compareResponse = response.getCompareResponse();
+            copyMessageIdAndControls( response, compareResponse );
+
+            CompareResponseDsml authResponseDsml = new CompareResponseDsml( compareResponse );
+            batchResponse.addResponse( authResponseDsml );
         }
         else if ( LdapConstants.DEL_RESPONSE == response.getMessageType() )
         {
-            DelResponseDsml delResponseDsml = new DelResponseDsml( response );
-            delResponseDsml.toDsml( xmlResponse.getRootElement() );
+            DelResponse delResponse = response.getDelResponse();
+            copyMessageIdAndControls( response, delResponse );
+
+            DelResponseDsml delResponseDsml = new DelResponseDsml( delResponse );
+            batchResponse.addResponse( delResponseDsml );
         }
         else if ( LdapConstants.MODIFY_RESPONSE == response.getMessageType() )
         {
-            ModifyResponseDsml modifyResponseDsml = new ModifyResponseDsml( response );
-            modifyResponseDsml.toDsml( xmlResponse.getRootElement() );
+            ModifyResponse modifyResponse = response.getModifyResponse();
+            copyMessageIdAndControls( response, modifyResponse );
+
+            ModifyResponseDsml modifyResponseDsml = new ModifyResponseDsml( modifyResponse );
+            batchResponse.addResponse( modifyResponseDsml );
         }
         else if ( LdapConstants.MODIFYDN_RESPONSE == response.getMessageType() )
         {
-            ModDNResponseDsml modDNResponseDsml = new ModDNResponseDsml( response );
-            modDNResponseDsml.toDsml( xmlResponse.getRootElement() );
+            ModifyDNResponse modifyDNResponse = response.getModifyDNResponse();
+            copyMessageIdAndControls( response, modifyDNResponse );
+
+            ModDNResponseDsml modDNResponseDsml = new ModDNResponseDsml( modifyDNResponse );
+            batchResponse.addResponse( modDNResponseDsml );
         }
         else if ( LdapConstants.EXTENDED_RESPONSE == response.getMessageType() )
         {
-            ExtendedResponseDsml extendedResponseDsml = new ExtendedResponseDsml( response );
-            extendedResponseDsml.toDsml( xmlResponse.getRootElement() );
+            ExtendedResponse extendedResponse = response.getExtendedResponse();
+            copyMessageIdAndControls( response, extendedResponse );
+
+            ExtendedResponseDsml extendedResponseDsml = new ExtendedResponseDsml( extendedResponse );
+            batchResponse.addResponse( extendedResponseDsml );
         }
         else if ( ( LdapConstants.SEARCH_RESULT_ENTRY == response.getMessageType() )
             || ( LdapConstants.SEARCH_RESULT_REFERENCE == response.getMessageType() )
@@ -391,33 +406,43 @@
             //     - O to n SearchResultReference
             //     - 1 (only) SearchResultDone
             // So we have to include those individual reponses in a "General" SearchResponse
-            Element searchResponse = xmlResponse.getRootElement().addElement( "searchResponse" );
+            //            Element searchResponse = xmlResponse.getRootElement().addElement( "searchResponse" );
+            SearchResponseDsml searchResponseDsml = new SearchResponseDsml();
 
             // RequestID
             int requestID = response.getMessageId();
             if ( requestID != 0 )
             {
-                searchResponse.addAttribute( "requestID", "" + requestID );
+                searchResponseDsml.setMessageId( requestID );
             }
 
             while ( LdapConstants.SEARCH_RESULT_DONE != response.getMessageType() )
             {
                 if ( LdapConstants.SEARCH_RESULT_ENTRY == response.getMessageType() )
                 {
-                    SearchResultEntryDsml searchResultEntryDsml = new SearchResultEntryDsml( response );
-                    searchResultEntryDsml.toDsml( searchResponse );
+                    SearchResultEntry sre = response.getSearchResultEntry();
+                    copyMessageIdAndControls( response, sre );
+
+                    SearchResultEntryDsml searchResultEntryDsml = new SearchResultEntryDsml( sre );
+                    searchResponseDsml.addResponse( searchResultEntryDsml );
                 }
                 else if ( LdapConstants.SEARCH_RESULT_REFERENCE == response.getMessageType() )
                 {
-                    SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml( response );
-                    searchResultReferenceDsml.toDsml( searchResponse );
+                    SearchResultReference srr = response.getSearchResultReference();
+                    copyMessageIdAndControls( response, srr );
+
+                    SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml( srr );
+                    searchResponseDsml.addResponse( searchResultReferenceDsml );
                 }
 
                 response = readResponse( bb );
             }
 
+            SearchResultDone srd = response.getSearchResultDone();
+            copyMessageIdAndControls( response, srd );
+
             SearchResultDoneDsml searchResultDoneDsml = new SearchResultDoneDsml( response );
-            searchResultDoneDsml.toDsml( searchResponse );
+            searchResponseDsml.addResponse( searchResultDoneDsml );
         }
 
         LdapResponse realResponse = response.getLdapResponse();
@@ -437,6 +462,16 @@
     }
 
 
+    private void copyMessageIdAndControls( LdapMessage from, LdapMessage to )
+    {
+        to.setMessageId( from.getMessageId() );
+        for ( Control control : from.getControls() )
+        {
+            to.addControl( control );
+        }
+    }
+
+
     /**
      * Processes the BatchRequest
      * <ul>
@@ -466,52 +501,8 @@
 
         if ( batchRequest.getRequestID() != 0 )
         {
-            xmlResponse.getRootElement().addAttribute( "requestID", "" + batchRequest.getRequestID() );
+            batchResponse.setRequestID( batchRequest.getRequestID() );
         }
-    }
-
-
-    /**
-     * XML Pretty Printer XSLT Tranformation
-     * 
-     * @param document
-     *      the Dom4j Document
-     * @param stylesheet
-     *      the stylesheet to use
-     * @return
-     */
-    public Document styleDocument( Document document, String stylesheet )
-    {
-        // load the transformer using JAXP
-        TransformerFactory factory = TransformerFactory.newInstance();
-        Transformer transformer = null;
-        try
-        {
-            transformer = factory
-                .newTransformer( new StreamSource( Dsmlv2Engine.class.getResourceAsStream( stylesheet ) ) );
-        }
-        catch ( TransformerConfigurationException e1 )
-        {
-            // TODO Auto-generated catch block
-            e1.printStackTrace();
-        }
-
-        // now lets style the given document
-        DocumentSource source = new DocumentSource( document );
-        DocumentResult result = new DocumentResult();
-        try
-        {
-            transformer.transform( source, result );
-        }
-        catch ( TransformerException e )
-        {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-
-        // return the transformed document
-        Document transformedDoc = result.getDocument();
-        return transformedDoc;
     }
 
 

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AddResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AddResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AddResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AddResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -23,6 +23,7 @@
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.add.AddResponse;
 import org.dom4j.Element;
 
 
@@ -41,7 +42,7 @@
      *      the message to decorate
      */
     public AddResponseDsml( LdapMessage ldapMessage )
-    {
+    {        
         super( ldapMessage );
     }
 
@@ -51,7 +52,7 @@
      */
     public int getMessageType()
     {
-        return instance.getAddResponse().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -62,7 +63,7 @@
     {
         Element element = root.addElement( "addResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( instance.getAddResponse().getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( AddResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AuthResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AuthResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AuthResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/AuthResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -23,6 +23,7 @@
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.bind.BindResponse;
 import org.dom4j.Element;
 
 
@@ -51,7 +52,7 @@
      */
     public int getMessageType()
     {
-        return instance.getBindResponse().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -62,7 +63,7 @@
     {
         Element element = root.addElement( "authResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( instance.getBindResponse().getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( BindResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/BatchResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/BatchResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/BatchResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/BatchResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
+import org.apache.directory.ldapstudio.dsmlv2.ParserUtils;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
 import org.dom4j.Element;
@@ -40,6 +41,9 @@
     /** The Responses list */
     private List<DsmlDecorator> responses;
 
+    /** The ID of the response */
+    private int requestID;
+
 
     /**
      * Creates a new instance of BatchResponseDsml.
@@ -79,6 +83,29 @@
 
 
     /**
+     * Gets the ID of the response
+     * @return
+     *      the ID of the response
+     */
+    public int getRequestID()
+    {
+        return requestID;
+    }
+
+
+    /**
+     * Sets the ID of the response
+     *
+     * @param requestID
+     *      the ID to set
+     */
+    public void setRequestID( int requestID )
+    {
+        this.requestID = requestID;
+    }
+
+
+    /**
      * Converts the Batch Response to its XML representation in the DSMLv2 format.
      */
     public String toDsml()
@@ -86,11 +113,17 @@
         Document document = DocumentHelper.createDocument();
         Element element = document.addElement( "batchResponse" );
 
+        // RequestID
+        if ( requestID != 0 )
+        {
+            element.addAttribute( "requestID", "" + requestID );
+        }
+
         for ( DsmlDecorator response : responses )
         {
             response.toDsml( element );
         }
 
-        return document.asXML();
+        return ParserUtils.styleDocument( document ).asXML();
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/CompareResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/CompareResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/CompareResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/CompareResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -23,6 +23,7 @@
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.compare.CompareResponse;
 import org.dom4j.Element;
 
 
@@ -51,7 +52,7 @@
      */
     public int getMessageType()
     {
-        return instance.getCompareResponse().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -62,7 +63,7 @@
     {
         Element element = root.addElement( "compareResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( instance.getCompareResponse().getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( CompareResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/DelResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/DelResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/DelResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/DelResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -23,6 +23,7 @@
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.del.DelResponse;
 import org.dom4j.Element;
 
 
@@ -51,7 +52,7 @@
      */
     public int getMessageType()
     {
-        return instance.getDelResponse().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -62,7 +63,7 @@
     {
         Element element = root.addElement( "delResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( instance.getDelResponse().getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( DelResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ExtendedResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ExtendedResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ExtendedResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ExtendedResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -54,7 +54,7 @@
      */
     public int getMessageType()
     {
-        return instance.getExtendedResponse().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -64,7 +64,7 @@
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "extendedResponse" );
-        ExtendedResponse extendedResponse = instance.getExtendedResponse();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) instance;
 
         // LDAP Result
         LdapResultDsml ldapResultDsml = new LdapResultDsml( extendedResponse.getLdapResult(), instance );

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModDNResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModDNResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModDNResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModDNResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -23,6 +23,7 @@
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNResponse;
 import org.dom4j.Element;
 
 
@@ -51,7 +52,7 @@
      */
     public int getMessageType()
     {
-        return instance.getModifyDNResponse().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -62,7 +63,7 @@
     {
         Element element = root.addElement( "modDNResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( instance.getModifyDNResponse().getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyDNResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModifyResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModifyResponseDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModifyResponseDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/ModifyResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -23,6 +23,7 @@
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.modify.ModifyResponse;
 import org.dom4j.Element;
 
 
@@ -51,7 +52,7 @@
      */
     public int getMessageType()
     {
-        return instance.getModifyResponse().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -62,7 +63,7 @@
     {
         Element element = root.addElement( "modifyResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( instance.getModifyResponse().getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Added: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponseDsml.java?view=auto&rev=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponseDsml.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResponseDsml.java Tue Apr 10 08:50:21 2007
@@ -0,0 +1,102 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.ldapstudio.dsmlv2.reponse;
+
+
+import java.util.List;
+
+import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
+import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.dom4j.Element;
+
+
+/**
+ * This class represents the Search Response Dsml Container. 
+ * It is used to store Search Responses (Search Result Entry, 
+ * Search Result Reference and SearchResultDone).
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchResponseDsml extends LdapResponseDecorator implements DsmlDecorator
+{
+    /** The responses */
+    private List<DsmlDecorator> responses;
+
+
+    /**
+     * Creates a new instance of SearchResponseDsml.
+     */
+    public SearchResponseDsml()
+    {
+        super( new LdapMessage() );
+    }
+
+
+    /**
+     * Adds a response.
+     *
+     * @param response
+     *      the response to add
+     * @return
+     *      true (as per the general contract of the Collection.add method).
+     */
+    public boolean addResponse( DsmlDecorator response )
+    {
+        return responses.add( response );
+    }
+
+
+    /**
+     * Removes a response.
+     *
+     * @param response
+     *      the response to remove
+     * @return
+     *      true if this list contained the specified element.
+     */
+    public boolean removeResponse( DsmlDecorator response )
+    {
+        return responses.remove( response );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator#toDsml(org.dom4j.Element)
+     */
+    public Element toDsml( Element root )
+    {
+        Element element = root.addElement( "searchResponse" );
+
+        // RequestID
+        int requestID = instance.getMessageId();
+        if ( requestID != 0 )
+        {
+            element.addAttribute( "requestID", "" + requestID );
+        }
+
+        for ( DsmlDecorator response : responses )
+        {
+            response.toDsml( element );
+        }
+
+        return element;
+    }
+}

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultDoneDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultDoneDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultDoneDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultDoneDsml.java Tue Apr 10 08:50:21 2007
@@ -23,6 +23,7 @@
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.codec.search.SearchResultDone;
 import org.dom4j.Element;
 
 
@@ -51,7 +52,7 @@
      */
     public int getMessageType()
     {
-        return instance.getSearchResultDone().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -62,7 +63,7 @@
     {
         Element element = root.addElement( "searchResultDone" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( instance.getSearchResultDone().getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( SearchResultDone ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultEntryDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultEntryDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultEntryDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultEntryDsml.java Tue Apr 10 08:50:21 2007
@@ -60,7 +60,7 @@
      */
     public int getMessageType()
     {
-        return instance.getSearchResultEntry().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -70,7 +70,7 @@
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "searchResultEntry" );
-        SearchResultEntry searchResultEntry = instance.getSearchResultEntry();
+        SearchResultEntry searchResultEntry = ( SearchResultEntry ) instance;
         element.addAttribute( "dn", searchResultEntry.getObjectName().toString() );
 
         Attributes attributes = searchResultEntry.getPartialAttributeList();

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultReferenceDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultReferenceDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultReferenceDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/reponse/SearchResultReferenceDsml.java Tue Apr 10 08:50:21 2007
@@ -55,7 +55,7 @@
      */
     public int getMessageType()
     {
-        return instance.getSearchResultReference().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -65,7 +65,7 @@
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "searchResultReference" );
-        SearchResultReference searchResultReference = instance.getSearchResultReference();
+        SearchResultReference searchResultReference = ( SearchResultReference ) instance;
 
         // Adding References
         List<LdapURL> refsList = searchResultReference.getSearchResultReferences();

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AbandonRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AbandonRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AbandonRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AbandonRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -48,7 +48,7 @@
      */
     public int getMessageType()
     {
-        return instance.getAbandonRequest().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -59,7 +59,7 @@
     {
         Element element = super.toDsml( root );
         
-        AbandonRequest request = instance.getAbandonRequest();
+        AbandonRequest request = ( AbandonRequest ) instance;
         
         // AbandonID
         if ( request.getAbandonedMessageId() != 0 )

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AddRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AddRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AddRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AddRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -58,7 +58,7 @@
      */
     public int getMessageType()
     {
-        return instance.getAddRequest().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -69,7 +69,7 @@
     {
         Element element = super.toDsml( root );
 
-        AddRequest request = instance.getAddRequest();
+        AddRequest request = ( AddRequest ) instance;
 
         // DN
         if ( request.getEntry() != null )

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AuthRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AuthRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AuthRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/AuthRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -48,7 +48,7 @@
      */
     public int getMessageType()
     {
-        return instance.getBindRequest().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -59,7 +59,7 @@
     {
         Element element = super.toDsml( root );
         
-        BindRequest request = instance.getBindRequest();
+        BindRequest request = ( BindRequest ) instance;
         
         // AbandonID
         String name = request.getName().toString();

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/BatchRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/BatchRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/BatchRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/BatchRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.apache.directory.ldapstudio.dsmlv2.DsmlDecorator;
+import org.apache.directory.ldapstudio.dsmlv2.ParserUtils;
 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.OnError;
 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.Processing;
 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.ResponseOrder;
@@ -230,6 +231,6 @@
             request.toDsml( element );
         }
 
-        return document.asXML();
+        return ParserUtils.styleDocument( document ).asXML();
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/CompareRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/CompareRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/CompareRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/CompareRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -48,7 +48,7 @@
      */
     public int getMessageType()
     {
-        return instance.getCompareRequest().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -59,7 +59,7 @@
     {
         Element element = super.toDsml( root );
         
-        CompareRequest request = instance.getCompareRequest();
+        CompareRequest request = ( CompareRequest ) instance;
         
         // DN
         if ( request.getEntry() != null )

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/DelRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/DelRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/DelRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/DelRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -48,7 +48,7 @@
      */
     public int getMessageType()
     {
-        return instance.getDelRequest().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -59,7 +59,7 @@
     {
         Element element = super.toDsml( root );
         
-        DelRequest request = instance.getDelRequest();
+        DelRequest request = ( DelRequest ) instance;
         
         // DN
         if ( request.getEntry() != null )

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ExtendedRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ExtendedRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ExtendedRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ExtendedRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -51,7 +51,7 @@
      */
     public int getMessageType()
     {
-        return instance.getExtendedRequest().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -62,7 +62,7 @@
     {
         Element element = super.toDsml( root );
         
-        ExtendedRequest request = instance.getExtendedRequest();
+        ExtendedRequest request = ( ExtendedRequest ) instance;
         
         // Request Name
         if ( request.getRequestName() != null )

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyDNRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyDNRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyDNRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyDNRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -48,7 +48,7 @@
      */
     public int getMessageType()
     {
-        return instance.getModifyDNRequest().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -59,7 +59,7 @@
     {
         Element element = super.toDsml( root );
         
-        ModifyDNRequest request = instance.getModifyDNRequest();
+        ModifyDNRequest request = ( ModifyDNRequest ) instance;
         
         // DN
         if ( request.getEntry() != null )

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/ModifyRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -58,7 +58,7 @@
      */
     public int getMessageType()
     {
-        return instance.getModifyRequest().getMessageType();
+        return instance.getMessageType();
     }
 
     
@@ -69,7 +69,7 @@
     {
         Element element = super.toDsml( root );
         
-        ModifyRequest request = instance.getModifyRequest();
+        ModifyRequest request = ( ModifyRequest ) instance;
         
         // DN
         if ( request.getObject() != null )

Modified: directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/SearchRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/SearchRequestDsml.java?view=diff&rev=527164&r1=527163&r2=527164
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/SearchRequestDsml.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-dsml-parser/src/main/java/org/apache/directory/ldapstudio/dsmlv2/request/SearchRequestDsml.java Tue Apr 10 08:50:21 2007
@@ -69,7 +69,7 @@
      */
     public int getMessageType()
     {
-        return instance.getSearchRequest().getMessageType();
+        return instance.getMessageType();
     }
 
 
@@ -80,7 +80,7 @@
     {
         Element element = super.toDsml( root );
 
-        SearchRequest request = instance.getSearchRequest();
+        SearchRequest request = ( SearchRequest ) instance;
 
         // DN
         if ( request.getBaseObject() != null )



Mime
View raw message