Plug in not working correctly (ant build file)

Post here questions and problems related to editing and publishing DITA content.
montims
Posts: 5
Joined: Tue Sep 13, 2016 9:13 pm

Plug in not working correctly (ant build file)

Post by montims »

I created a plugin and it is integrated into oXygen. I got a Build Successful after running the integrator, and my PDF appears in the new output directory that I specified in the ant build file. However, when I try to edit elements, ,my changes do not appear in my PDF. If it helps, I'm following the dita for Print (http://xmlpress.net/publications/dita/dita-for-print/) instructions. I have gone through these instructions multiple times to ensure my files are all set up correctly.

I tried this test and my PDF output was unchanged:

Copied commons-attr.xsl from DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs to DITA-OT/plugins/com.company.custpdf/cfg/fo/attrs.

In the copied file in my plugin directory, I changed:

Code: Select all

<xsl:attribute-set name=topic.title" use-attribute-sets="common.title">
<xsl:attribute name="border-bottom">3pt solid black<xsl:attribute>
to:

Code: Select all

<xsl:attribute-set name=topic.title" use-attribute-sets="common.title">
<xsl:attribute name="border-bottom">3pt solid red<xsl:attribute>
In my custom.xsl, I added:

Code: Select all

<xsl:import href="commons-attrs.xsl"/>
Sorry for the novel - I'm an xsl-fo newbie just trying to add an image to my cover page and adjust my global margins :(
radu_pisoi
Posts: 404
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Plug in not working correctly (ant build file)

Post by radu_pisoi »

Hi,

Sorry, I'm afraid I don't have too many details about the 'DITA for Print' book. This book is written by Leigh W. White. Did you try to contact her about this problem?

However, a procedure about how to create a custom PDF plugin can be found in the DITA-OT documentation:
http://www.dita-ot.org/2.3/dev_ref/pdf- ... ample.html

It seems that you forgot to link to the 'custom.xsl' from the customization catalog file, see the step 4 from the above procedure.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
montims
Posts: 5
Joined: Tue Sep 13, 2016 9:13 pm

Re: Plug in not working correctly (ant build file)

Post by montims »

Thanks, Radu. I believe my catalog.xml file is set up correctly (in DITA-OT/plugins/com.company.custpdf/cfg):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<catalog prefer="system" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/>
<uri name="cfg:fo/xsl/custom.xsl" uri="fo/xsl/custom.xsl"/>
<uri name="cfg:fo/font-mappings.xml" uri="fo/font-mappings.xml"/>
</catalog>
-monti
montims
Posts: 5
Joined: Tue Sep 13, 2016 9:13 pm

Re: Plug in not working correctly (ant build file)

Post by montims »

I moved the plugin I initially created out of the plugin directory and created a new plugin based on the instructions you pointed to above. When I run the Integrator in oXygen, it fails with the following error:

Code: Select all

BUILD FAILED
C:\Program Files (x86)\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\integrator.xml:66: The following error occurred while executing this line:
C:\Program Files (x86)\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\integrator.xml:44: Integration failed: java.io.FileNotFoundException: C:\Program Files (x86)\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\resources\plugins.xml (Access is denied)
radu_pisoi
Posts: 404
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Plug in not working correctly (ant build file)

Post by radu_pisoi »

Hi,

The DITA-OT Integrator tool generates some files(ANT, XSLT and others) in the DITA-OT folder. So, the folder where the DITA OT is located needs to have full write access permissions set to it. For example if you are integrating plugins in the DITA OT folder bundled with Oxygen XML Editor and if you are running on Windows and your application is installed in the Program Files folder, you can start the Oxygen XML Editor main executable with administrative rights for the integrator process to be able to modify resources in the DITA OT folder. See more details in our user manual:
http://oxygenxml.com/doc/versions/18.0/ ... lugin.html

Another option is to copy the DITA-OT folder from the '{oXygenInstallDir}/frameworks' directory in a folder where you have write access and configure oXygen to use it. See detailed instructions here:
http://oxygenxml.com/doc/versions/18.0/ ... ta-ot.html
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
montims
Posts: 5
Joined: Tue Sep 13, 2016 9:13 pm

Re: Plug in not working correctly (ant build file)

Post by montims »

Thanks, Radu. I was able to successfully integrate my plugin. I'm still having the same issue (make changes that don't appear in my PDF output). Is the plugin integrated into the primary DITA Map PDF extract? That is what I'm running.

Following are my steps/code:

1. Copy commons-attr.xsl from:
DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/
to my plugin:
DITA-OT/plugins/com.example.print-pdf/cfg/fo/attrs/

2. In the commons-attr.xsl file in my plugin directory, change:

Code: Select all

<xsl:attribute-set name="topic.title" use-attribute-sets="common.title">
<xsl:attribute name="border-bottom">3pt solid black</xsl:attribute>
to:

Code: Select all

<xsl:attribute-set name="topic.title" use-attribute-sets="common.title">
<xsl:attribute name="border-bottom">3pt solid red</xsl:attribute>
This should change the border under all top-level headings to red (instead of the default black).

3. Copy commons.xsl from:
DITA-OT/plugins/org.dita.pdf2/xsl/fo/
to my plugin:
DITA-OT/plugins/com.example.print-pdf/cfg/fo/attrs/

4. In the custom.xsl file in my plugin directory, add xsl:import statements:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:import href="commons-attr.xsl">
<xsl:import href="commons.xsl">
</xsl:stylesheet>
5. Generate PDF (DITA Map PDF).
I still have black borders.

Am I missing something? Thank you! -monti
Post Reply