fatty- / daisy-pipeline

Automatically exported from code.google.com/p/daisy-pipeline
0 stars 0 forks source link

mime types on results in result XML #336

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is an example after running dtbook-validator in remote mode:

<?xml version="1.0" encoding="UTF-8"?>
<job xmlns="http://www.daisy.org/ns/pipeline/data" 
href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11" 
id="54a3840a-579e-4643-b58e-c59874c03b11" status="DONE">
    <script href="http://localhost:8182/ws/scripts/dtbook-validator" id="dtbook-validator">
        <nicename>DTBook Validator</nicename>
        <description> Validates DTBook documents. Supports inclusion of MathML. </description>
    </script>
    <log href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/log"/>
    <results href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result" mime-type="zip">
        <result from="port" href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/port/result" mime-type="zip" name="result">
            <result href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/port/result/result.xml" mime-type=""/>
        </result>
        <result from="port" href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/port/html-report" mime-type="zip" name="html-report">
            <result href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/port/html-report/html-report.xml" mime-type=""/>
        </result>
        <result from="port" href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/port/report" mime-type="zip" name="report">
            <result href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/port/report/report.xml" mime-type=""/>
        </result>
        <result from="option" href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/option/output-dir" mime-type="zip" name="output-dir">
            <result href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/option/''/dtbook-validation-report.xhtml" mime-type=""/>
            <result href="http://localhost:8182/ws/jobs/54a3840a-579e-4643-b58e-c59874c03b11/result/option/''/dtbook-validation-report.xml" mime-type=""/>
        </result>
    </results>
</job>

I think:
* The zip files should have the mime-type="application/zip"
* All result elements should have a non-empty mime-type (alternatively, no 
mime-type)

How would the mime-types be determined? Do we want to perform mime-type 
detection on the result fileset after the script has finished running? Would 
that be too resource-intensive? Should the "results" element be stored in the 
Derby DB so that mime-type detection doesn't have to be performed each time? Or 
maybe the scripts should be responsible of providing a d:fileset with 
media-type attributes on an output port?

Original issue reported on code.google.com by josteinaj@gmail.com on 27 Jun 2013 at 11:39

GoogleCodeExporter commented 9 years ago

Original comment by josteinaj@gmail.com on 27 Jun 2013 at 11:40

GoogleCodeExporter commented 9 years ago
It's mostly done, I've got to change a couple of things to make it work
properly

Original comment by capitan....@gmail.com on 27 Jun 2013 at 1:19

GoogleCodeExporter commented 9 years ago
ok, cool.

Original comment by josteinaj@gmail.com on 27 Jun 2013 at 1:20

GoogleCodeExporter commented 9 years ago
Done https://github.com/daisy-consortium/pipeline-framework/tree/issue_336

I think the idea was to include the option meta-data in the ports/options as 
px:meta-data. I proceeded following that ...

Original comment by capitan....@gmail.com on 27 Jun 2013 at 11:05

GoogleCodeExporter commented 9 years ago
Do you guys need me to do anything about this? 

Original comment by marisa.d...@gmail.com on 2 Jul 2013 at 12:26

GoogleCodeExporter commented 9 years ago
@marisa I think it's OK, done by Javier.

@Jostein can you please review Javi's solution ?

As far as I can see this is OK, the fwk get media type info from the XProc 
metadata (responsibility is in the author's hands). Let me know if you see a 
need for dynamic type detection.

Original comment by rdeltour@gmail.com on 2 Jul 2013 at 8:29

GoogleCodeExporter commented 9 years ago
Looks good.

I don't see how option outputs are given media types though. Should mediatype 
detection be performed on option output directories?

Original comment by josteinaj@gmail.com on 2 Jul 2013 at 9:07

GoogleCodeExporter commented 9 years ago
Yes, detecting the media type on output directories may be a good idea. Feel 
free to open a new issue if/when this is needed.

I'm closing the current one, since Javi's fix is OK.

Original comment by rdeltour@gmail.com on 2 Jul 2013 at 9:17

GoogleCodeExporter commented 9 years ago
created issue 344 for option output directories

Original comment by josteinaj@gmail.com on 2 Jul 2013 at 9:26