ozeigermann    2004/02/26 07:45:56

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        OptionsMethod.java SubscribeMethod.java
                        PropFindMethod.java SearchMethod.java
                        LockMethod.java AbstractWebdavMethod.java
                        UpdateMethod.java PollMethod.java ReportMethod.java
                        PropPatchMethod.java
               .        build.xml
               src/webdav/server/org/apache/slide/webdav/logger
                        XMLTestCaseGenerator.java
               src/stores/org/apache/slide/store/txfile
                        XMLResourceDescriptor.java
               src/webdav/server/org/apache/slide/webdav/method/report
                        PrincipalPropertySearchReport.java
                        PrincipalMatchReport.java
               src/doc  changelog.xml
  Added:       lib      jdom-20040226-.jar
  Removed:     lib      jdom-b9.jar
  Log:
  Replaced JDOM b9 with JDOM HEAD version checked out at 26th, February, 2004. 

  Adapted XMLOutputter code to this.
  
  Revision  Changes    Path
  1.41      +7 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java
  
  Index: OptionsMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- OptionsMethod.java        24 Feb 2004 17:03:33 -0000      1.40
  +++ OptionsMethod.java        26 Feb 2004 15:45:54 -0000      1.41
  @@ -61,7 +61,7 @@
       implements DeltavConstants, AclConstants, BindConstants {
       
       // An XML outputter
  -    private XMLOutputter xmlOut = new XMLOutputter(XML_RESPONSE_INDENT, true, 
"UTF-8" );
  +    private XMLOutputter xmlOut;
       //  private Namespace xmlNs = Namespace.getNamespace(DEFAULT_NAMESPACE);
       
       // the collections which may contain VH or workspace resources are requested
  @@ -81,6 +81,9 @@
       public OptionsMethod(NamespaceAccessToken token,
                            WebdavServletConfig config) {
           super(token, config);
  +        org.jdom.output.Format format = org.jdom.output.Format.getPrettyFormat();
  +        format.setIndent(XML_RESPONSE_INDENT);
  +        xmlOut = new XMLOutputter(format);
       }
       
       protected void parseRequest() throws WebdavException {
  
  
  
  1.3       +7 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SubscribeMethod.java
  
  Index: SubscribeMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SubscribeMethod.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SubscribeMethod.java      25 Feb 2004 11:09:12 -0000      1.2
  +++ SubscribeMethod.java      26 Feb 2004 15:45:54 -0000      1.3
  @@ -52,7 +52,7 @@
       private final static int DEFAULT_SUBSCRIPTION_LIFETIME = 3600;
   
       // An XML outputter
  -    private XMLOutputter xmlOut = new XMLOutputter(XML_RESPONSE_INDENT, true, 
"UTF-8" );
  +    private XMLOutputter xmlOut;
   
       // ----------------------------------------------------------- Constructors
       
  @@ -66,6 +66,9 @@
       public SubscribeMethod(NamespaceAccessToken token,
                            WebdavServletConfig config) {
           super(token, config);
  +        org.jdom.output.Format format = org.jdom.output.Format.getPrettyFormat();
  +        format.setIndent(XML_RESPONSE_INDENT);
  +        xmlOut = new XMLOutputter(format);
       }
       
       protected void parseRequest() throws WebdavException {
  
  
  
  1.99      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java
  
  Index: PropFindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- PropFindMethod.java       24 Feb 2004 17:03:33 -0000      1.98
  +++ PropFindMethod.java       26 Feb 2004 15:45:54 -0000      1.99
  @@ -284,7 +284,9 @@
           
           // Create multistatus object
           Element multistatusElement = new Element(E_MULTISTATUS, DNSP);
  -        XMLOutputter xmlOutputter = new XMLOutputter(XML_RESPONSE_INDENT, true);
  +        org.jdom.output.Format format = org.jdom.output.Format.getPrettyFormat();
  +        format.setIndent(XML_RESPONSE_INDENT);
  +        XMLOutputter xmlOutputter = new XMLOutputter(format);
           
           if (resource != null) {
               if (depth == 0) {
  
  
  
  1.40      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java
  
  Index: SearchMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- SearchMethod.java 24 Feb 2004 17:03:34 -0000      1.39
  +++ SearchMethod.java 26 Feb 2004 15:45:55 -0000      1.40
  @@ -292,7 +292,9 @@
       private void  sendResult (org.jdom.Document responseDoc)
           throws org.jdom.JDOMException, IOException
       {
  -        XMLOutputter xmlWriter = new XMLOutputter (XML_RESPONSE_INDENT, true);
  +        org.jdom.output.Format format = org.jdom.output.Format.getPrettyFormat();
  +        format.setIndent(XML_RESPONSE_INDENT);
  +        XMLOutputter xmlWriter = new XMLOutputter (format);
           xmlWriter.output (responseDoc, resp.getWriter());
       }
       
  
  
  
  1.58      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
  
  Index: LockMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- LockMethod.java   24 Feb 2004 17:03:33 -0000      1.57
  +++ LockMethod.java   26 Feb 2004 15:45:55 -0000      1.58
  @@ -520,7 +520,9 @@
               //System.out.println(generatedXML.toString());
               resp.setContentType(TEXT_XML_UTF_8);
               Writer writer = resp.getWriter();
  -            new org.jdom.output.XMLOutputter(XML_RESPONSE_INDENT, true).output(new 
org.jdom.Document(prop), writer);
  +            org.jdom.output.Format format = 
org.jdom.output.Format.getPrettyFormat();
  +            format.setIndent(XML_RESPONSE_INDENT);
  +            new org.jdom.output.XMLOutputter(format).output(new 
org.jdom.Document(prop), writer);
               writer.flush();
           } catch (Exception e) {
               int statusCode = WebdavStatus.SC_INTERNAL_SERVER_ERROR;
  
  
  
  1.23      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
  
  Index: AbstractWebdavMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- AbstractWebdavMethod.java 24 Feb 2004 17:03:33 -0000      1.22
  +++ AbstractWebdavMethod.java 26 Feb 2004 15:45:55 -0000      1.23
  @@ -647,7 +647,9 @@
   
               resp.setContentType(TEXT_XML_UTF_8);
   
  -            new XMLOutputter(XML_RESPONSE_INDENT, true).
  +            org.jdom.output.Format format = 
org.jdom.output.Format.getPrettyFormat();
  +            format.setIndent(XML_RESPONSE_INDENT);
  +            new XMLOutputter(format).
                   output(new 
Document(MethodUtil.getPreconditionViolationError(pve.getViolatedPrecondition())), 
resp.getWriter());
           }
       }
  
  
  
  1.27      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java
  
  Index: UpdateMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- UpdateMethod.java 24 Feb 2004 17:03:34 -0000      1.26
  +++ UpdateMethod.java 26 Feb 2004 15:45:55 -0000      1.27
  @@ -264,7 +264,9 @@
           try {
               resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
               resp.setContentType(TEXT_XML_UTF_8);
  -            new XMLOutputter(XML_RESPONSE_INDENT, true).
  +            org.jdom.output.Format format = 
org.jdom.output.Format.getPrettyFormat();
  +            format.setIndent(XML_RESPONSE_INDENT);
  +            new XMLOutputter(format).
                   output(new Document(multistatusElement), resp.getWriter());
           }
           catch (Exception e) {
  
  
  
  1.3       +7 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PollMethod.java
  
  Index: PollMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PollMethod.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PollMethod.java   25 Feb 2004 11:09:12 -0000      1.2
  +++ PollMethod.java   26 Feb 2004 15:45:55 -0000      1.3
  @@ -55,7 +55,7 @@
       protected final static Namespace NNSP = Namespace.getNamespace(N_PREFIX, N_URI);
   
       // An XML outputter
  -    private XMLOutputter xmlOut = new XMLOutputter(XML_RESPONSE_INDENT, true, 
"UTF-8" );
  +    private XMLOutputter xmlOut;
   
   
       // ----------------------------------------------------------- Constructors
  @@ -69,6 +69,9 @@
        */
       public PollMethod(NamespaceAccessToken token, WebdavServletConfig config) {
           super(token, config);
  +        org.jdom.output.Format format = org.jdom.output.Format.getPrettyFormat();
  +        format.setIndent(XML_RESPONSE_INDENT);
  +        xmlOut = new XMLOutputter(format);
       }
       
       protected void parseRequest() throws WebdavException {
  
  
  
  1.65      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
  
  Index: ReportMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- ReportMethod.java 24 Feb 2004 17:03:34 -0000      1.64
  +++ ReportMethod.java 26 Feb 2004 15:45:55 -0000      1.65
  @@ -223,7 +223,9 @@
                   reportWorker.execute(resourcePath, rootElm, getDepth());
                   resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
               }
  -            new XMLOutputter(XML_RESPONSE_INDENT, true).
  +            org.jdom.output.Format format = 
org.jdom.output.Format.getPrettyFormat();
  +            format.setIndent(XML_RESPONSE_INDENT);
  +            new XMLOutputter(format).
                   output(new Document(rootElm), resp.getWriter());
           }
           catch (PreconditionViolationException e) {
  
  
  
  1.77      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java
  
  Index: PropPatchMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- PropPatchMethod.java      24 Feb 2004 17:03:33 -0000      1.76
  +++ PropPatchMethod.java      26 Feb 2004 15:45:55 -0000      1.77
  @@ -477,7 +477,9 @@
           try {
               resp.setContentType(TEXT_XML_UTF_8);
               Writer writer = resp.getWriter();
  -            new XMLOutputter(XML_RESPONSE_INDENT, true).
  +            org.jdom.output.Format format = 
org.jdom.output.Format.getPrettyFormat();
  +            format.setIndent(XML_RESPONSE_INDENT);
  +            new XMLOutputter(format).
                   output(new Document(multistatus), writer);
               writer.flush();
           } catch (Exception e) {
  
  
  
  1.197     +1 -1      jakarta-slide/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/build.xml,v
  retrieving revision 1.196
  retrieving revision 1.197
  diff -u -r1.196 -r1.197
  --- build.xml 26 Feb 2004 14:50:59 -0000      1.196
  +++ build.xml 26 Feb 2004 15:45:55 -0000      1.197
  @@ -29,7 +29,7 @@
       <!-- =================================================================== -->
       <property name="lib.dir" value="./lib"/>
       <property name="servlet.jar" value="servlet-2.3.jar"/>
  -    <property name="jdom.jar" value="jdom-b9.jar"/>
  +    <property name="jdom.jar" value="jdom-20040226-.jar"/>
       <property name="saxpath.jar" value="saxpath.jar"/>
       <property name="jaxen-core.jar" value="jaxen-core.jar"/>
       <property name="jaxen-jdom.jar" value="jaxen-jdom.jar"/>
  
  
  
  1.11      +1 -1      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/logger/XMLTestCaseGenerator.java
  
  Index: XMLTestCaseGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/logger/XMLTestCaseGenerator.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- XMLTestCaseGenerator.java 11 Feb 2004 11:30:28 -0000      1.10
  +++ XMLTestCaseGenerator.java 26 Feb 2004 15:45:55 -0000      1.11
  @@ -43,7 +43,7 @@
       
   
       /** The XML outputter */
  -    private XMLOutputter xmlOut = new XMLOutputter( "  ", true, "UTF-8" ); // 
indent: 2 spaces, newlines=true
  +    private XMLOutputter xmlOut = new 
XMLOutputter(org.jdom.output.Format.getPrettyFormat()); // indent: 2 spaces, 
newlines=true
   
       
       private XHttpServletRequestFacade request;
  
  
  
  1.9       +20 -21    
jakarta-slide/src/stores/org/apache/slide/store/txfile/XMLResourceDescriptor.java
  
  Index: XMLResourceDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/stores/org/apache/slide/store/txfile/XMLResourceDescriptor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLResourceDescriptor.java        26 Feb 2004 13:40:54 -0000      1.8
  +++ XMLResourceDescriptor.java        26 Feb 2004 15:45:55 -0000      1.9
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2004 The Apache Software Foundation 
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -57,9 +57,21 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Oliver Zeigermann</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Marc D�cugis</a>
    * @see FileResourceManager
  + * @see TxXMLFileDescriptorsStore
    */
   public class XMLResourceDescriptor {
   
  +    protected static final String PATH_EXTENSION = ".def.xml";
  +    
  +    protected final FileResourceManager rm;
  +    protected final TxXMLFileDescriptorsStore store;
  +    protected final Format outputFormat;
  +    protected Object txId;
  +    protected String uri;
  +    protected final String loadPath;
  +    protected StoreLogger logger;
  +    protected SimpleDateFormat dateFormat;
  +
       /** Stored object.*/
       protected ObjectNode object;
   
  @@ -75,17 +87,6 @@
       /** Revision descriptor hashtable.*/
       protected Hashtable descriptor;
   
  -    protected static final String PATH_EXTENSION = ".def.xml";
  -    protected final FileResourceManager rm;
  -    protected final TxXMLFileDescriptorsStore store;
  -    protected final String characterEncoding;
  -    protected volatile Object txId;
  -    protected volatile String uri;
  -    protected final String loadPath;
  -
  -    protected StoreLogger logger;
  -
  -    protected SimpleDateFormat dateFormat;
   
       protected static String booleanToString(boolean aBoolean) {
           return aBoolean ? "true" : "false";
  @@ -274,12 +275,14 @@
           String characterEncoding)
           throws ServiceAccessException, ObjectNotFoundException {
   
  +        outputFormat = Format.getPrettyFormat();
  +        outputFormat.setEncoding(characterEncoding);
  +
           dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss Z");
           logger = 
rm.getLogger().cloneWithNewLogChannel(XMLResourceDescriptor.class.getName());
   
           this.rm = rm;
           this.store = store;
  -        this.characterEncoding = characterEncoding;
           this.txId = txId;
   
           if (uri == null) {
  @@ -701,11 +704,7 @@
           Element aRoot = encode();
           Document aDocument = new Document(aRoot);
   
  -        XMLOutputter aOutputter = new XMLOutputter();
  -        aOutputter.setEncoding(characterEncoding);
  -        aOutputter.setNewlines(true);
  -        aOutputter.setIndent("  ");
  -        aOutputter.setLineSeparator("\n");
  +        XMLOutputter aOutputter = new XMLOutputter(outputFormat);
           try {
               aOutputter.output(aDocument, os);
               os.flush();
  
  
  
  1.1                  jakarta-slide/lib/jdom-20040226-.jar
  
        <<Binary file>>
  
  
  1.5       +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/report/PrincipalPropertySearchReport.java
  
  Index: PrincipalPropertySearchReport.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/report/PrincipalPropertySearchReport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PrincipalPropertySearchReport.java        11 Feb 2004 11:30:33 -0000      1.4
  +++ PrincipalPropertySearchReport.java        26 Feb 2004 15:45:55 -0000      1.5
  @@ -161,7 +161,7 @@
       public void execute(String resourcePath, Element multistatusElm, int depth) 
throws SlideException, IOException {
           SubjectNode currentUserNode = 
(SubjectNode)security.getPrincipal(slideToken);
           Element queryElm = getQueryElement(resourcePath, currentUserNode);
  -        new XMLOutputter("  ", true).output(queryElm, System.out);
  +        new XMLOutputter(org.jdom.output.Format.getPrettyFormat()).output(queryElm, 
System.out);
           
           String absUri = WebdavUtils.getAbsolutePath (resourcePath, contextPath,
                                                        serverUrl, config);
  
  
  
  1.5       +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/report/PrincipalMatchReport.java
  
  Index: PrincipalMatchReport.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/report/PrincipalMatchReport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PrincipalMatchReport.java 11 Feb 2004 11:30:33 -0000      1.4
  +++ PrincipalMatchReport.java 26 Feb 2004 15:45:55 -0000      1.5
  @@ -152,7 +152,7 @@
       public void execute(String resourcePath, Element multistatusElm, int depth) 
throws SlideException, IOException {
           SubjectNode currentUserNode = 
(SubjectNode)security.getPrincipal(slideToken);
           Element queryElm = getQueryElement(resourcePath, currentUserNode);
  -        new XMLOutputter("  ", true).output(queryElm, System.out);
  +        new XMLOutputter(org.jdom.output.Format.getPrettyFormat()).output(queryElm, 
System.out);
           
           String absUri = WebdavUtils.getAbsolutePath (resourcePath, contextPath, 
serverUrl, config);
           
  
  
  
  1.90      +1 -0      jakarta-slide/src/doc/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/doc/changelog.xml,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- changelog.xml     26 Feb 2004 14:36:29 -0000      1.89
  +++ changelog.xml     26 Feb 2004 15:45:55 -0000      1.90
  @@ -15,6 +15,7 @@
   release.
        
         <changelog>
  +        <update date="February 26, 2004" author="ozeigermann">Replaced JDOM b9 with 
JDOM HEAD version checked out at 26th, February, 2004. Adapted XMLOutputter code to 
this.</update>
           <update date="February 26, 2004" author="ozeigermann">Refactored and 
cleaned up XMLResourceDescriptor to be standalone and removed now obsolete classes 
from filestore package.</update>
           <fix date="February 02, 2004" author="mholz">Handle unknown actions in 
SecurityImpl.</fix>
           <add date="February 01, 2004" author="mholz">Added JDBC adapter, which 
provides backward compatibility with Slide 1.x JDBC store.</add>    
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to