You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by Francesco Chicchiriccò <il...@apache.org> on 2013/02/05 11:38:20 UTC

"dbDump" in ReportService and ConfigurationService

Hi all,
I am currently completing some modifications started yesterday with 
ConfigurationServiceProxy.dbExport() that will involve some refactoring 
on console's HttpResourceStream and also to core's ReportTestITCase.

Basically, I would like to encapsulate the logic for handling streams 
(content.xml and reports in various formats) in the relevant service 
proxies.

While doing this, I've just noticed that ReportSevice has

     @GET
     @Path("executions/{executionId}/dbDump")
     Response exportExecutionResult(@PathParam("executionId") Long 
executionId,
             @QueryParam("format") ReportExecExportFormat fmt);

while ConfigurationService has

     @GET
     @Path("dbDump")
     Response dbExport();

Any special reason for this "dbDump"?
The only thing I can see is that both methods return an object stream 
(that can be in some cases XML) instead of serialized instances in JSON 
/ XML as the rest.

Regards.

-- 
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


RE: "dbDump" in ReportService and ConfigurationService

Posted by Jan Bernhardt <jb...@talend.com>.
+1

Best regards.
Jan

> -----Original Message-----
> From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
> Sent: Donnerstag, 7. Februar 2013 10:36
> To: dev@syncope.apache.org
> Subject: Re: "dbDump" in ReportService and ConfigurationService
> 
> On 06/02/2013 12:08, Jan Bernhardt wrote:
> > Hi Francesco,
> >> From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
> >>
> >> Hi all,
> >> I am currently completing some modifications started yesterday with
> >> ConfigurationServiceProxy.dbExport() that will involve some
> >> refactoring on console's HttpResourceStream and also to core's
> ReportTestITCase.
> >>
> >> Basically, I would like to encapsulate the logic for handling streams
> >> (content.xml and reports in various formats) in the relevant service
> proxies.
> >>
> >> While doing this, I've just noticed that ReportSevice has
> >>
> >>       @GET
> >>       @Path("executions/{executionId}/dbDump")
> >>       Response exportExecutionResult(@PathParam("executionId") Long
> >> executionId,
> >>               @QueryParam("format") ReportExecExportFormat fmt);
> >>
> >> while ConfigurationService has
> >>
> >>       @GET
> >>       @Path("dbDump")
> >>       Response dbExport();
> >>
> >> Any special reason for this "dbDump"?
> > No there is no special reason for "dbDump". (Code looks to me, as if this is
> what happens here.) I only tried to find a consistent manner, who to title a
> downloadable stream. I'm completely open for any
> suggestions/improvements for a different URL path.
> 
> 
> What about
> 
>      @GET
>      @Path("executions/{executionId}/stream")
>      Response exportExecutionResult(@PathParam("executionId") Long
> executionId,
>              @QueryParam("format") ReportExecExportFormat fmt);
> 
> and
> 
>      @GET
>      @Path("stream")
>      Response dbExport();
> 
> ?
> 
> Regards.
> 
> --
> Francesco Chicchiriccò
> 
> ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
> http://people.apache.org/~ilgrosso/


Re: "dbDump" in ReportService and ConfigurationService

Posted by Christian Schneider <ch...@die-schneider.net>.
In fact I recently changed dbDump to all/export I think. The problem was
that dbDump did never work.

Instead of the dbDump path it called the {key} path. So it returned an
empty configuration element. The test was still green though. So I added
a size check to the test.

As this ambiguity between {key} and a fixed path can happen any time I
wonder if we should change the paths for the lists like in this case the
configuration items to something like:
/configurations/items/{key} instead of /configurations/{key}.

Christian

On 07.02.2013 10:35, Francesco Chicchiriccò wrote:
> On 06/02/2013 12:08, Jan Bernhardt wrote:
>> Hi Francesco,
>>> From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
>>>
>>> Hi all,
>>> I am currently completing some modifications started yesterday with
>>> ConfigurationServiceProxy.dbExport() that will involve some
>>> refactoring on
>>> console's HttpResourceStream and also to core's ReportTestITCase.
>>>
>>> Basically, I would like to encapsulate the logic for handling streams
>>> (content.xml and reports in various formats) in the relevant service
>>> proxies.
>>>
>>> While doing this, I've just noticed that ReportSevice has
>>>
>>>       @GET
>>>       @Path("executions/{executionId}/dbDump")
>>>       Response exportExecutionResult(@PathParam("executionId") Long
>>> executionId,
>>>               @QueryParam("format") ReportExecExportFormat fmt);
>>>
>>> while ConfigurationService has
>>>
>>>       @GET
>>>       @Path("dbDump")
>>>       Response dbExport();
>>>
>>> Any special reason for this "dbDump"?
>> No there is no special reason for "dbDump". (Code looks to me, as if
>> this is what happens here.) I only tried to find a consistent manner,
>> who to title a downloadable stream. I'm completely open for any
>> suggestions/improvements for a different URL path.
>
> What about
>
>     @GET
>     @Path("executions/{executionId}/stream")
>     Response exportExecutionResult(@PathParam("executionId") Long
> executionId,
>             @QueryParam("format") ReportExecExportFormat fmt);
>
> and
>
>     @GET
>     @Path("stream")
>     Response dbExport();
>
> ?
>
> Regards.
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: "dbDump" in ReportService and ConfigurationService

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 06/02/2013 12:08, Jan Bernhardt wrote:
> Hi Francesco,
>> From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
>>
>> Hi all,
>> I am currently completing some modifications started yesterday with
>> ConfigurationServiceProxy.dbExport() that will involve some refactoring on
>> console's HttpResourceStream and also to core's ReportTestITCase.
>>
>> Basically, I would like to encapsulate the logic for handling streams
>> (content.xml and reports in various formats) in the relevant service proxies.
>>
>> While doing this, I've just noticed that ReportSevice has
>>
>>       @GET
>>       @Path("executions/{executionId}/dbDump")
>>       Response exportExecutionResult(@PathParam("executionId") Long
>> executionId,
>>               @QueryParam("format") ReportExecExportFormat fmt);
>>
>> while ConfigurationService has
>>
>>       @GET
>>       @Path("dbDump")
>>       Response dbExport();
>>
>> Any special reason for this "dbDump"?
> No there is no special reason for "dbDump". (Code looks to me, as if this is what happens here.) I only tried to find a consistent manner, who to title a downloadable stream. I'm completely open for any suggestions/improvements for a different URL path.

What about

     @GET
     @Path("executions/{executionId}/stream")
     Response exportExecutionResult(@PathParam("executionId") Long 
executionId,
             @QueryParam("format") ReportExecExportFormat fmt);

and

     @GET
     @Path("stream")
     Response dbExport();

?

Regards.

-- 
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


RE: "dbDump" in ReportService and ConfigurationService

Posted by Jan Bernhardt <jb...@talend.com>.
Hi Francesco,


> -----Original Message-----
> From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
> Sent: Dienstag, 5. Februar 2013 11:38
> To: dev@syncope.apache.org
> Subject: "dbDump" in ReportService and ConfigurationService
> 
> Hi all,
> I am currently completing some modifications started yesterday with
> ConfigurationServiceProxy.dbExport() that will involve some refactoring on
> console's HttpResourceStream and also to core's ReportTestITCase.
> 
> Basically, I would like to encapsulate the logic for handling streams
> (content.xml and reports in various formats) in the relevant service proxies.
> 
> While doing this, I've just noticed that ReportSevice has
> 
>      @GET
>      @Path("executions/{executionId}/dbDump")
>      Response exportExecutionResult(@PathParam("executionId") Long
> executionId,
>              @QueryParam("format") ReportExecExportFormat fmt);
> 
> while ConfigurationService has
> 
>      @GET
>      @Path("dbDump")
>      Response dbExport();
> 
> Any special reason for this "dbDump"?

No there is no special reason for "dbDump". (Code looks to me, as if this is what happens here.) I only tried to find a consistent manner, who to title a downloadable stream. I'm completely open for any suggestions/improvements for a different URL path.

Best regards.
Jan

> The only thing I can see is that both methods return an object stream (that
> can be in some cases XML) instead of serialized instances in JSON / XML as
> the rest.
> 
> Regards.
> 
> --
> Francesco Chicchiriccò
> 
> ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
> http://people.apache.org/~ilgrosso/