daisy / pipeline

Super-project that aggregates all Pipeline related code, provides a common tracker for Pipeline related issues and holds the Pipeline website
http://daisy.github.io/pipeline
21 stars 21 forks source link

Use Pipeline 2 as XProc engine in oXygen #410

Open josteinaj opened 10 years ago

josteinaj commented 10 years ago

This would make developing scripts which depends on steps implemented in Java easier.

Instructions for implementing support for external XProc engines in oXygen here: http://www.oxygenxml.com/doc/ug-editor/tasks/xproc-API-external-engine.html

Ideally it should connect to a running instance of Pipeline 2 to avoid the ~10s startup time, but if it's simpler to simply start and stop DP2 for each execution, that's acceptable too.

@capitancambio: how much work would it be to implement a web api for invoking arbitrary XProc scripts do you think? The grammar would probably be a jobRequest but with a href to a XProc script instead of a script ID.

(I thought we had an issue for oXygen-support already, but I can't find it.)

capitancambio commented 10 years ago

I got rid of the previous issue as it was my understanding that we were already using a catalog based approach. Anyway this issue is kind of different from the previous requirements.

It's feasible, although I'd refrain ourselves of including this api in the pipeline distribution. I'd suggest to open another service in another port just dedicated to offer an rest api for xproc. the api itself should be quite simple (only one entry), that calls the osgified version of calabash using a given set of inputs,options and outputs. what you think?

I was planing to refactor the webservice for the next release using jersey, this could be a nice warmup.

bertfrees commented 10 years ago

I have made an XProc API before, but not a web API. It uses the AMQP protocol. See https://github.com/daisy/pipeline-build-utils/commits/xprocspec.

josteinaj commented 10 years ago

@capitancambio: sounds good. no need for remote mode, authentication, inline documents or any of those things. The only thing which might complicate things (which is not essential) is live logging messages(?), but for a MVP a logfile is enough.

@bertfrees: ah, of course, you invoke DP2 from xproc-maven-plugin... didn't think of that. Do you think it can be easily reused for this purpose?

rdeltour commented 10 years ago

another option might be to use the REST API built in Calabash (or available somewhere, I don't remember exactly). It's called Piperack, not sure how it could fit in our OSGi env.

bertfrees commented 10 years ago

@josteinaj: I used it with the xproc-maven-plugin before I had learned about Pax-Exam. It was rather rudimentary. Whether it could be reused depends on the exact requirements but the use case sounded very similar so... Not sure how you would implement live logging, you need to look into the AMQP a bit.

capitancambio commented 10 years ago

@josteinj I guess we could do sth with long polling there.

@rdeltour look at that, the first time I hear about it, interesting

cheers,

Javi

capitancambio commented 10 years ago

@bertfrees nice stuff

cheers,

Javi