Push a DITA archive to a webserver
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Push a DITA archive to a webserver
Hello,
I discovered that Radu developed a plugin to zip a ditamap and all its contents/dependencies. That is pretty helpful and works perfectly. Nonetheless, knowing that I need to send DITA projects zipped to a server to be published in a Content Delivery Portal, I usually use a curl command and rely on the API of the CDP.
For instance, here's a frequent command:
Thus, I am curious to know how I could set a curl command or an equivalent using a web service, should I use an ant's exec task or is there another way to proceed?
What would be your suggestions
I discovered that Radu developed a plugin to zip a ditamap and all its contents/dependencies. That is pretty helpful and works perfectly. Nonetheless, knowing that I need to send DITA projects zipped to a server to be published in a Content Delivery Portal, I usually use a curl command and rely on the API of the CDP.
For instance, here's a frequent command:
Code: Select all
curl –X POST -H "Authorization: Basic XXXXXXXXXXXXXXX" --form file="@C:\fantastic-DITA-project.zip" https://my.CDP.net/xxx/api/sources/dita/upload?
What would be your suggestions

------
Gaspard
Gaspard
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Push a DITA archive to a webserver
Hi,
Maybe you can create your own "publish.bat" script which first calls the DITA Open Toolkit's "dita -i ....." command line to create the zip in an output folder, then from the same "publish.bat" you can call any other command line tool that you want to handle the zip further.
Or indeed Ant build files can run an arbitrary command line:
https://ant.apache.org/manual/Tasks/exec.html
so you could for example modify the Ant build file of my DITA to Zip plugin to also run an <exec> task after the zip is created in the output folder.
Regards,
Radu
Maybe you can create your own "publish.bat" script which first calls the DITA Open Toolkit's "dita -i ....." command line to create the zip in an output folder, then from the same "publish.bat" you can call any other command line tool that you want to handle the zip further.
Or indeed Ant build files can run an arbitrary command line:
https://ant.apache.org/manual/Tasks/exec.html
so you could for example modify the Ant build file of my DITA to Zip plugin to also run an <exec> task after the zip is created in the output folder.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Re: Push a DITA archive to a webserver
Hello, Radu!
Good news, I have a plugin that correctly zip the map, topics and resources. I included a target that pushes the archive to an external portal via a web service call.
However, when I test it, I have to select the new DITA-OT transformation in my scenarios, and I would like to automate this task. Do you know if there's any way to force or isolate a specific scenario when publishing with a DITA-OT hosted on a server?
Good news, I have a plugin that correctly zip the map, topics and resources. I included a target that pushes the archive to an external portal via a web service call.
However, when I test it, I have to select the new DITA-OT transformation in my scenarios, and I would like to automate this task. Do you know if there's any way to force or isolate a specific scenario when publishing with a DITA-OT hosted on a server?
------
Gaspard
Gaspard
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Push a DITA archive to a webserver
Hi Gaspar,
For automation why don't you run the DITA OT process directly from the command line?
https://www.dita-ot.org/dev/topics/buil ... mmand.html
Regards,
Radu
For automation why don't you run the DITA OT process directly from the command line?
https://www.dita-ot.org/dev/topics/buil ... mmand.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Re: Push a DITA archive to a webserver
Hello Radu and Xephon!
Using the command line would be much easier in my case, but I must upload the DITA-OT to an external server for a client who uses a SaaS CCMS. Therefore, I can't ensure the transformation will be correctly selected that's why I wanted to force a specific transformation scenario in the DITA-OT itself.
However, I'm not sure it is feasible, so I will ask the CCMS vendor to orient me on the correct solution
Using the command line would be much easier in my case, but I must upload the DITA-OT to an external server for a client who uses a SaaS CCMS. Therefore, I can't ensure the transformation will be correctly selected that's why I wanted to force a specific transformation scenario in the DITA-OT itself.
However, I'm not sure it is feasible, so I will ask the CCMS vendor to orient me on the correct solution

------
Gaspard
Gaspard
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Push a DITA archive to a webserver
Hi Gaspar,
The DITA OT has the concept of output format which is passed using the "-f" or "-format" flag in the command line:
https://www.dita-ot.org/dev/topics/outp ... aid-title1
https://www.dita-ot.org/dev/topics/buil ... mmand.html
Regards,
Radu
The DITA OT does not have the concept of "transformation scenario". Oxygen has this concept. An Oxygen transformation scenario calls the DITA OT with certain parameters/flags.that's why I wanted to force a specific transformation scenario in the DITA-OT itself.
The DITA OT has the concept of output format which is passed using the "-f" or "-format" flag in the command line:
https://www.dita-ot.org/dev/topics/outp ... aid-title1
https://www.dita-ot.org/dev/topics/buil ... mmand.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service