You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2007/04/28 13:00:15 UTC

[jira] Created: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly

XML export (stream) doesn't initialize TransformerHandler properly
------------------------------------------------------------------

                 Key: JCR-892
                 URL: https://issues.apache.org/jira/browse/JCR-892
             Project: Jackrabbit
          Issue Type: Bug
          Components: core
            Reporter: Julian Reschke
         Assigned To: Julian Reschke
            Priority: Minor


For instance, in SessionImpl.java:

    public void exportSystemView(String absPath, OutputStream out,
                                 boolean skipBinary, boolean noRecurse)
            throws IOException, PathNotFoundException, RepositoryException {

        SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
        try {
            TransformerHandler th = stf.newTransformerHandler();
            th.setResult(new StreamResult(out));
            th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
            th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
            th.getTransformer().setParameter(OutputKeys.INDENT, "no");

            exportSystemView(absPath, th, skipBinary, noRecurse);
        } catch (TransformerException te) {
            throw new RepositoryException(te);
        } catch (SAXException se) {
            throw new RepositoryException(se);
        }
    }

(1) It should be "setOutputProperty()", not "setParameter()",

(2) My tests show that setting the parameters only has an effect when done before calling setResult()

That being said, the effect is minor, as the default settings for the TransformerHandler seem to be correct anway.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-892:
------------------------------

          Component/s:     (was: contrib PMs)
                       core
    Affects Version/s: 1.1
                       1.1.1
                       1.2.1
                       1.2.2
                       1.2.3
                       1.3

For the record, this issue was introduced by JCR-367 in Jackrabbit release 1.1.

> XML export (stream) doesn't initialize TransformerHandler properly
> ------------------------------------------------------------------
>
>                 Key: JCR-892
>                 URL: https://issues.apache.org/jira/browse/JCR-892
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1, 1.1.1, 1.2.1, 1.2.2, 1.2.3, 1.3
>            Reporter: Julian Reschke
>         Assigned To: Julian Reschke
>            Priority: Minor
>             Fix For: 1.4
>
>
> For instance, in SessionImpl.java:
>     public void exportSystemView(String absPath, OutputStream out,
>                                  boolean skipBinary, boolean noRecurse)
>             throws IOException, PathNotFoundException, RepositoryException {
>         SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
>         try {
>             TransformerHandler th = stf.newTransformerHandler();
>             th.setResult(new StreamResult(out));
>             th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
>             th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
>             th.getTransformer().setParameter(OutputKeys.INDENT, "no");
>             exportSystemView(absPath, th, skipBinary, noRecurse);
>         } catch (TransformerException te) {
>             throw new RepositoryException(te);
>         } catch (SAXException se) {
>             throw new RepositoryException(se);
>         }
>     }
> (1) It should be "setOutputProperty()", not "setParameter()",
> (2) My tests show that setting the parameters only has an effect when done before calling setResult()
> That being said, the effect is minor, as the default settings for the TransformerHandler seem to be correct anway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-892.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4
         Assignee: Julian Reschke

Thanks for the fixes! I'm aplied the same change also to contrib/backup in revision 540525.

Resolved as Fixed.

> XML export (stream) doesn't initialize TransformerHandler properly
> ------------------------------------------------------------------
>
>                 Key: JCR-892
>                 URL: https://issues.apache.org/jira/browse/JCR-892
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: contrib PMs
>            Reporter: Julian Reschke
>         Assigned To: Julian Reschke
>            Priority: Minor
>             Fix For: 1.4
>
>
> For instance, in SessionImpl.java:
>     public void exportSystemView(String absPath, OutputStream out,
>                                  boolean skipBinary, boolean noRecurse)
>             throws IOException, PathNotFoundException, RepositoryException {
>         SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
>         try {
>             TransformerHandler th = stf.newTransformerHandler();
>             th.setResult(new StreamResult(out));
>             th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
>             th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
>             th.getTransformer().setParameter(OutputKeys.INDENT, "no");
>             exportSystemView(absPath, th, skipBinary, noRecurse);
>         } catch (TransformerException te) {
>             throw new RepositoryException(te);
>         } catch (SAXException se) {
>             throw new RepositoryException(se);
>         }
>     }
> (1) It should be "setOutputProperty()", not "setParameter()",
> (2) My tests show that setting the parameters only has an effect when done before calling setResult()
> That being said, the effect is minor, as the default settings for the TransformerHandler seem to be correct anway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke updated JCR-892:
-------------------------------

    Component/s:     (was: core)
                 contrib PMs

Same fix should probably applied to contrib/backup/src/main/java/org/apache/jackrabbit/backup/WorkspaceBackup.java.

> XML export (stream) doesn't initialize TransformerHandler properly
> ------------------------------------------------------------------
>
>                 Key: JCR-892
>                 URL: https://issues.apache.org/jira/browse/JCR-892
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: contrib PMs
>            Reporter: Julian Reschke
>            Priority: Minor
>
> For instance, in SessionImpl.java:
>     public void exportSystemView(String absPath, OutputStream out,
>                                  boolean skipBinary, boolean noRecurse)
>             throws IOException, PathNotFoundException, RepositoryException {
>         SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
>         try {
>             TransformerHandler th = stf.newTransformerHandler();
>             th.setResult(new StreamResult(out));
>             th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
>             th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
>             th.getTransformer().setParameter(OutputKeys.INDENT, "no");
>             exportSystemView(absPath, th, skipBinary, noRecurse);
>         } catch (TransformerException te) {
>             throw new RepositoryException(te);
>         } catch (SAXException se) {
>             throw new RepositoryException(se);
>         }
>     }
> (1) It should be "setOutputProperty()", not "setParameter()",
> (2) My tests show that setting the parameters only has an effect when done before calling setResult()
> That being said, the effect is minor, as the default settings for the TransformerHandler seem to be correct anway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke reassigned JCR-892:
----------------------------------

    Assignee:     (was: Julian Reschke)

> XML export (stream) doesn't initialize TransformerHandler properly
> ------------------------------------------------------------------
>
>                 Key: JCR-892
>                 URL: https://issues.apache.org/jira/browse/JCR-892
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>            Reporter: Julian Reschke
>            Priority: Minor
>
> For instance, in SessionImpl.java:
>     public void exportSystemView(String absPath, OutputStream out,
>                                  boolean skipBinary, boolean noRecurse)
>             throws IOException, PathNotFoundException, RepositoryException {
>         SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
>         try {
>             TransformerHandler th = stf.newTransformerHandler();
>             th.setResult(new StreamResult(out));
>             th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
>             th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
>             th.getTransformer().setParameter(OutputKeys.INDENT, "no");
>             exportSystemView(absPath, th, skipBinary, noRecurse);
>         } catch (TransformerException te) {
>             throw new RepositoryException(te);
>         } catch (SAXException se) {
>             throw new RepositoryException(se);
>         }
>     }
> (1) It should be "setOutputProperty()", not "setParameter()",
> (2) My tests show that setting the parameters only has an effect when done before calling setResult()
> That being said, the effect is minor, as the default settings for the TransformerHandler seem to be correct anway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-892:
------------------------------

    Fix Version/s:     (was: 1.4)
                   1.3.1

Merged to the 1.3 branch in revision 544284.

> XML export (stream) doesn't initialize TransformerHandler properly
> ------------------------------------------------------------------
>
>                 Key: JCR-892
>                 URL: https://issues.apache.org/jira/browse/JCR-892
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1, 1.1.1, 1.2.1, 1.2.2, 1.2.3, 1.3
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>             Fix For: 1.3.1
>
>
> For instance, in SessionImpl.java:
>     public void exportSystemView(String absPath, OutputStream out,
>                                  boolean skipBinary, boolean noRecurse)
>             throws IOException, PathNotFoundException, RepositoryException {
>         SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
>         try {
>             TransformerHandler th = stf.newTransformerHandler();
>             th.setResult(new StreamResult(out));
>             th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
>             th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
>             th.getTransformer().setParameter(OutputKeys.INDENT, "no");
>             exportSystemView(absPath, th, skipBinary, noRecurse);
>         } catch (TransformerException te) {
>             throw new RepositoryException(te);
>         } catch (SAXException se) {
>             throw new RepositoryException(se);
>         }
>     }
> (1) It should be "setOutputProperty()", not "setParameter()",
> (2) My tests show that setting the parameters only has an effect when done before calling setResult()
> That being said, the effect is minor, as the default settings for the TransformerHandler seem to be correct anway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-892) XML export (stream) doesn't initialize TransformerHandler properly

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492576 ] 

Julian Reschke commented on JCR-892:
------------------------------------

Fixed in several places with revision 533508. I didn't want to touch contrib/backup/src/main/java/org/apache/jackrabbit/backup/WorkspaceBackup.java; any takers for that?

> XML export (stream) doesn't initialize TransformerHandler properly
> ------------------------------------------------------------------
>
>                 Key: JCR-892
>                 URL: https://issues.apache.org/jira/browse/JCR-892
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>            Reporter: Julian Reschke
>         Assigned To: Julian Reschke
>            Priority: Minor
>
> For instance, in SessionImpl.java:
>     public void exportSystemView(String absPath, OutputStream out,
>                                  boolean skipBinary, boolean noRecurse)
>             throws IOException, PathNotFoundException, RepositoryException {
>         SAXTransformerFactory stf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
>         try {
>             TransformerHandler th = stf.newTransformerHandler();
>             th.setResult(new StreamResult(out));
>             th.getTransformer().setParameter(OutputKeys.METHOD, "xml");
>             th.getTransformer().setParameter(OutputKeys.ENCODING, "UTF-8");
>             th.getTransformer().setParameter(OutputKeys.INDENT, "no");
>             exportSystemView(absPath, th, skipBinary, noRecurse);
>         } catch (TransformerException te) {
>             throw new RepositoryException(te);
>         } catch (SAXException se) {
>             throw new RepositoryException(se);
>         }
>     }
> (1) It should be "setOutputProperty()", not "setParameter()",
> (2) My tests show that setting the parameters only has an effect when done before calling setResult()
> That being said, the effect is minor, as the default settings for the TransformerHandler seem to be correct anway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.