You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "Jim Ancona (JIRA)" <ji...@apache.org> on 2008/03/06 19:00:58 UTC

[jira] Created: (ABDERA-131) Unable to override the default writer using abdera.properties

Unable to override the default writer using abdera.properties
-------------------------------------------------------------

                 Key: ABDERA-131
                 URL: https://issues.apache.org/jira/browse/ABDERA-131
             Project: Abdera
          Issue Type: Bug
    Affects Versions: 0.4.0
            Reporter: Jim Ancona
         Attachments: AbderaPropertiesBug.patch

I want to use PrettyWriter as the defalt writer for my app, so I created an abdera.properties file for my app consisting of the following line:
org.apache.abdera.writer.Writer=org.apache.abdera.parser.stax.util.PrettyWriter

The problem seems to reside in ServiceUril, but the code is quite convoluted, and I couldn't discern how it is supposed to work. I have created a unit test which demonstrates the problem, which I believe affects any attempt to override default classes using abdera.properties.


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


[jira] Updated: (ABDERA-131) Unable to override the default writer using abdera.properties

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

Jim Ancona updated ABDERA-131:
------------------------------

    Attachment: AbderaPropertiesBug.patch

Unit test which demonstrates the problem.

> Unable to override the default writer using abdera.properties
> -------------------------------------------------------------
>
>                 Key: ABDERA-131
>                 URL: https://issues.apache.org/jira/browse/ABDERA-131
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Jim Ancona
>         Attachments: AbderaPropertiesBug.patch
>
>
> I want to use PrettyWriter as the defalt writer for my app, so I created an abdera.properties file for my app consisting of the following line:
> org.apache.abdera.writer.Writer=org.apache.abdera.parser.stax.util.PrettyWriter
> The problem seems to reside in ServiceUril, but the code is quite convoluted, and I couldn't discern how it is supposed to work. I have created a unit test which demonstrates the problem, which I believe affects any attempt to override default classes using abdera.properties.

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


Re: [jira] Resolved: (ABDERA-131) Unable to override the default writer using abdera.properties

Posted by James M Snell <ja...@gmail.com>.
In short, yes. With StreamWriter, we basically have two different writer 
mechanisms now.  By default, AbstractProvider uses StreamWriter to 
output the service document, while the FOM objects use the Writer and 
NamedWriter mechanism.  Also, be aware that the prettyxml writer 
definitely is not perfect; I'd caution against using it extensively in a 
production environment because it can tend to insert more whitespace 
than is actually necessary and can interfere with things like digital 
signatures and encryption.

- James

Jim Ancona wrote:
> James M Snell (JIRA) wrote:
>> Resolution: Fixed Fix Version/s: 0.4.0
>>
>> Fix checked in. Give it a try.  In my tests, I was able to
>> successfully set both the prettyxml and json writers as the default
> 
> I'm replying here rather than in JIRA, because I'm not sure whether the
> behavior I'm seeing now is a bug.
> 
> With James' fix, documents being served from my Adapters are now
> formatted using PrettyXML, but I noticed that my service document was
> still unformatted. I notice that AbstractProvider.getServiceDocument()
> uses StreamWriterResponseContext to generate the service document. I
> overrode that method to call setAutoIndent(true) on the ResponseContext
> and got the desired behavior. Is that the best way to get a formatted
> service document? Any suggestion on how to get a JSON service
> version :-)?
> 
> Jim
> 
> 

Re: [jira] Resolved: (ABDERA-131) Unable to override the default writer using abdera.properties

Posted by Jim Ancona <ji...@anconafamily.com>.
James M Snell (JIRA) wrote:
> Resolution: Fixed Fix Version/s: 0.4.0
> 
> Fix checked in. Give it a try.  In my tests, I was able to
> successfully set both the prettyxml and json writers as the default

I'm replying here rather than in JIRA, because I'm not sure whether the
behavior I'm seeing now is a bug.

With James' fix, documents being served from my Adapters are now
formatted using PrettyXML, but I noticed that my service document was
still unformatted. I notice that AbstractProvider.getServiceDocument()
uses StreamWriterResponseContext to generate the service document. I
overrode that method to call setAutoIndent(true) on the ResponseContext
and got the desired behavior. Is that the best way to get a formatted
service document? Any suggestion on how to get a JSON service
version :-)?

Jim


[jira] Resolved: (ABDERA-131) Unable to override the default writer using abdera.properties

Posted by "James M Snell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James M Snell resolved ABDERA-131.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.4.0

Fix checked in. Give it a try.  In my tests, I was able to successfully set both the prettyxml and json writers as the default

> Unable to override the default writer using abdera.properties
> -------------------------------------------------------------
>
>                 Key: ABDERA-131
>                 URL: https://issues.apache.org/jira/browse/ABDERA-131
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Jim Ancona
>             Fix For: 0.4.0
>
>         Attachments: AbderaPropertiesBug.patch
>
>
> I want to use PrettyWriter as the defalt writer for my app, so I created an abdera.properties file for my app consisting of the following line:
> org.apache.abdera.writer.Writer=org.apache.abdera.parser.stax.util.PrettyWriter
> The problem seems to reside in ServiceUril, but the code is quite convoluted, and I couldn't discern how it is supposed to work. I have created a unit test which demonstrates the problem, which I believe affects any attempt to override default classes using abdera.properties.

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