How to configure my plug-in as print type?

59 views
Skip to first unread message

Toshihiko Makita

unread,
Nov 22, 2014, 11:16:36 AM11/22/14
to dita-o...@googlegroups.com
Hi All,

I have a my PDF plug-in that have following plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<plugin id="com.antennahouse.pdf5">
 
<feature extension="dita.conductor.transtype.check" value="pdf5" type="pdf"/>
 
<feature extension="dita.conductor.target.relative" value="integrator.xml" type="file"/>
 
<feature extension="dita.transtype.print" value="pdf5"/>
</plugin>



According to the DITA Open Toolkit Developer Reference I think it is enough.

But if I build the following map, topics/p_print_printonly.xml is rejected from "gen-list" processing. As a result several errors occured in the [mappull] process.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN" "bookmap.dtd">
<bookmap id="bookmap_26F29B320CC448C6BDEE032B001C3627" xml:lang="en-US">
   
<booktitle>
       
<mainbooktitle>Printonly test</mainbooktitle>
       
<booktitlealt>Unit test cases</booktitlealt>
   
</booktitle>
   
<chapter navtitle="Printonly test">
       
<topicref href="topics/p_print_yes.xml" type="topic" format="dita" id="topicref_001" print="yes"/>
       
<topicref href="topics/p_print_no.xml" type="topic" format="dita" id="topicref_002" print="no"/>
       
<topicref href="topics/p_print_printonly.xml" type="topic" format="dita" id="topicref_003" print="printonly"/>
   
</chapter>
</bookmap>  



gen-list:

 
[gen-list] GenMapAndTopicListModule.execute(): Starting...
 
[gen-list] Using Xerces grammar pool for DTD and schema caching.
 
[gen-list] Processing D:\My_Documents\pdf5\testdata\20141122_printonly\sample_printonly.ditamap
 
[gen-list] Processing D:\My_Documents\pdf5\testdata\20141122_printonly\topics\p_print_yes.xml
 
[gen-list] Processing D:\My_Documents\pdf5\testdata\20141122_printonly\topics\p_print_no.xml
 
[gen-list] Serializing job specification
 
[gen-list] 11 23, 2014 12:50:01 午前 java.util.prefs.WindowsPreferences <init>
 
[gen-list] WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
 
[gen-list] GenMapAndTopicListModule.execute(): Execution time: 0.923 seconds




mappull:
 
[mappull] Transforming into D:\My_Documents\pdf5\testdata\20141122_printonly\temp
 
[mappull] Processing D:\My_Documents\pdf5\testdata\20141122_printonly\temp\sample_printonly.ditamap to D:\My_Documents\pdf5\testdata\20141122_printonly\temp\sample_printonly.ditamap.pull
 
[mappull] Loading stylesheet D:\DITA-OT\DITA-OT1.8.5\xsl\preprocess\mappull.xsl
 
[mappull] D:\DITA-OT\DITA-OT1.8.5\xsl\preprocess\mappullImpl.xsl:446: Error! I/O error reported by XML parser processing file:/D:/My_Documents/pdf5/testdata/20141122_printonly/temp/topics/p_print_printonly.xml: D:\My_Documents\pdf5\testdata\20141122_printonly\temp\topics\p_print_printonly.xml (指定されたファイルが見つかりません。) Cause: java.io.FileNotFoundException: D:\My_Documents\pdf5\testdata\20141122_printonly\temp\topics\p_print_printonly.xml (指定されたファイルが見つかりません。)
 
[mappull] D:\DITA-OT\DITA-OT1.8.5\xsl\preprocess\mappullImpl.xsl:537: Error! Document has been marked not available: file:/D:/My_Documents



Are there any mistakes in my plug-in setting?

- My plug-in can be downloaded from GitHib.

- I attached test data and log file.
  20141122_printonly.zip

Please give me your advice.

Regards,

20141122_printonly.zip

Toshihiko Makita

unread,
Nov 26, 2014, 7:07:24 AM11/26/14
to dita-o...@googlegroups.com
Hi Radu,

Thank you for your investigation. Before your post I also received the mail from my user that the problem has solved when he manually maintain [DITA-OT]/lib/dost-configuration.jar by himself.
According to the upcoming DITA 1.3 spec @print attribute will be deprecated. So I advised to the user not to use @print attribute.
I think that implementing @print="printonly" is not so important. It should be resolved by select attribute or its specialization.
Anyway I appreciate your help.

Regards,

Hi Toshihiko,
I took a look at your plugin and it seems to be properly built.
Your plugin.xml advertises itself as a print plugin using:

<feature extension="dita.transtype.print" value="pdf5"/>
After the integrator is run, if you look in the "DITA-OT\lib\org.dita.dost.platform\plugin.properties", it will be changed to also list the "pdf5" plugin as a print transtype:
print_transtypes=pdf2;pdf;pdf5;legacypdf;d4pjournals;odt
But there's a problem, in the DITA OT folder there is a JAR library:
DITA-OT\lib\dost-configuration.jar
which contains an older copy of the plugin.properties.
For example if you rename that JAR to have some other extension, your plugin should be interpreted as a print-type plugin.
I'm not sure what the intention was with that "dost-configuration.jar" there, I will try to get some feedback from Jarno Elovirta, ideally the integrator would also re-build the JAR.
Regards,
Radu

Reply all
Reply to author
Forward
0 new messages