Reusing topics that have keyrefs

ann.jensen
Posts: 240
Joined: Wed Jun 17, 2015 10:19 am

Reusing topics that have keyrefs

Post by ann.jensen » Mon Feb 27, 2017 3:54 pm

Hi,
I am using keyrefs throughout much of my DITA code. My main output is oxygen webhelp and all is fine.
I am starting to ruse some of my topics for Pdf output. I create a new project with a new root ditamap and then add in references to the topics from my main project whose content I want for the pdf output. However I run in to problems if those topics have keyrefs that cannot be resolved since the ditamap with the related key definitions cannot be found.
Is there a way that I can reference the ditamap with the related key definitions without including it in the project as I don't want all of its topics included in the output and I don't want to actually change the ditamap code...as it is used in my main project in its entirety.
Any advice appreciated.
Ann

Radu
Posts: 7103
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reusing topics that have keyrefs

Post by Radu » Mon Feb 27, 2017 3:59 pm

Hi Ann,

There is no specific publishing engine support for what you want. Maybe you can refer in the new DITA map you are working on to the other DITA Map using the "processing-role='resource-only'" attribute. This will allow the processor to use the keys from the map but the published output and TOC should not contain topics from it.
Probably in time you will need to refactor your DITA project and extract separate submaps which define keys and are used in both maps.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

ann.jensen
Posts: 240
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing topics that have keyrefs

Post by ann.jensen » Mon Feb 27, 2017 5:21 pm

Hi Radu,
I added a mapref to the rootmap of my new project with processing-role="resource-only". This is the keys are defined.
I then set this map as the rootmap.
I then added in references to the project rootmap pointing to the topics that have the keydefs.
However, the keydefs are not being resolved :(
Regards,
Ann

Radu
Posts: 7103
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reusing topics that have keyrefs

Post by Radu » Tue Feb 28, 2017 9:22 am

Hi Ann,

How exactly did you refer to the DITA Map?
Something like:

Code: Select all

<topicref format="ditamap" href='mapWithKeydefs.ditamap" processing-role="resource-only"'/>
right?

Does the "Validate and check for completeness" report any problem when validating the top level DITA Map?
I then set this map as the rootmap.
You should have let the top level map be the root map. Both Oxygen and the publishing process can work its way through the entire hierarchy of maps and gather keys.
I then added in references to the project rootmap pointing to the topics that have the keydefs.
However, the keydefs are not being resolved
Be keydefs you mean keyrefs, right? Are they not resolved on editing, on publishing or both?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

ann.jensen
Posts: 240
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing topics that have keyrefs

Post by ann.jensen » Tue Feb 28, 2017 1:06 pm

Hi Radu,
<topicref format="ditamap" href='mapWithKeydefs.ditamap" processing-role="resource-only"'/>
Yes, exactly like this.
Does the "Validate and check for completeness" report any problem when validating the top level DITA Map?
Yes, but I have ongoing validation results reporting keydef problems where the keyrefs resolve fine.
Be keydefs you mean keyrefs, right? Are they not resolved on editing, on publishing or both?
Yes, keyrefs not keydefs.

So my project has a dedicated root map i.e. rootmap.ditamap and this has a child for the map with keydefs i.e.'mapWithKeydefs.ditamap added with processing-role="resource-only".
It also has a child mapref that contains topicrefs that I actually want to be rendered in my published PDF.

Can processing resolve the keyrefs when the keydefs are in a sibling map...rather than a parent map.
rootmap
--- reference to mapwithkeydefs.ditamap
--- reference to mapwithkeyrefs.dita

Thanks,
Ann

ann.jensen
Posts: 240
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing topics that have keyrefs

Post by ann.jensen » Tue Feb 28, 2017 1:25 pm

Sorry, forgot to mention
Does the "Validate and check for completeness" report any problem when validating the top level DITA Map?
The following is returned in Transformation Problems where m_wf_iproperty.ditamap is mapWithKeydefs.ditamap.

Code: Select all

System ID: C:\DevBranches\DocService_devel\User_Guides\test_guide\test_guide.ditamap
Scenario: DITA Map PDF - Aspen
Input file: C:\DevBranches\DocService_devel\User_Guides\test_guide\test_guide.ditamap
Engine name: DITA-OT
Severity: warning
Description: [DOTJ036W] The file "file:/C:/DevBranches/DocService_devel/AGS_Documentation/system_documentation/dita_files/AGSSystems/WF_iProperty/m_wf_iproperty.ditamap" referenced by "%2" is outside the scope of the input dita/map directory.
URL: http://www.oxygenxml.com/DITA-messages.html#msgs__DOTJ036W
Regards,
Ann

Radu
Posts: 7103
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reusing topics that have keyrefs

Post by Radu » Wed Mar 01, 2017 10:45 am

Hi Ann,
So my project has a dedicated root map i.e. rootmap.ditamap and this has a child for the map with keydefs i.e.'mapWithKeydefs.ditamap added with processing-role="resource-only".
It also has a child mapref that contains topicrefs that I actually want to be rendered in my published PDF.
Ok
Can processing resolve the keyrefs when the keydefs are in a sibling map...rather than a parent map.
rootmap
--- reference to mapwithkeydefs.ditamap
--- reference to mapwithkeyrefs.dita
Yes, it should be able to do that.
The following is returned in Transformation Problems where m_wf_iproperty.ditamap is mapWithKeydefs.ditamap.

[DOTJ036W] The file "file:/C:/DevBranches/DocService_devel/AGS_Documentation/system_documentation/dita_files/AGSSystems/WF_iProperty/m_wf_iproperty.ditamap" referenced by "%2" is outside the scope of the input dita/map directory.
So this is a problem obtained when publishing. It seems that the map that you are publishing references to the m_wf_iproperty.ditamap which is in a folder path outside of the folder where the published map resides.
The DITA OT has always problems with this, we recommend two possible approaches:

https://www.oxygenxml.com/doc/versions/ ... -refs.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

ann.jensen
Posts: 240
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing topics that have keyrefs

Post by ann.jensen » Thu Mar 02, 2017 2:08 pm

Sorry again for confusion.
So mapWithKeydefs.ditamap is m_wf_iproperty.ditamap and it is a child of the root map i.e. the map that I am publishing.
It resides in a folder path outside of the folder where the published map resides...but that's the whole point of reuse I thought.
I have set fix.external.refs.com.oxygenxml to true for the transformation but that makes no difference.
I am stuck on why the root map cannot resolve keys that are defined in m_wf_iproperty.ditamap (to which it has a topic reference) when they are referenced in the other child map (mapwithkeyrefs.dita) :(

Radu
Posts: 7103
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reusing topics that have keyrefs

Post by Radu » Thu Mar 02, 2017 2:49 pm

Hi,
I have set fix.external.refs.com.oxygenxml to true for the transformation but that makes no difference.
I understand your use case and setting the parameter should have worked. There is probably something about your setup that I do not understand.
Could you try to create a sample DITA project from your current structure and send it to us? (support@oxygenxml.com).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

ann.jensen
Posts: 240
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing topics that have keyrefs

Post by ann.jensen » Thu Mar 02, 2017 7:13 pm

Hi Radu,
I guess the complexity is in that (in my main project) I am reusing topics across maps where the keyrefs in the topics are resolved based on the keyscopes of the parent map.
This is making it difficult to pull out small subsets of a map and reuse it in a different project to publish a PDF for example. There are so many
dependencies in topics within my keyscoped maps.
I will try to create a sample project to demonstrate this.
Thanks again,
Ann

Post Reply