Automatic conversion of conkeyrefs to text

Post here questions and problems related to editing and publishing DITA content.
pault
Posts: 70
Joined: Thu Mar 21, 2013 12:55 am

Automatic conversion of conkeyrefs to text

Post by pault »

Is there a way that oXygen can automatically convert all topics that contain conkeyrefs to text?

This would be useful for our LSP. Manually doing this in Author mode is a painful process.

Thanks,

Paul
sorin_carbunaru
Posts: 398
Joined: Mon May 09, 2016 9:37 am

Re: Automatic conversion of conkeyrefs to text

Post by sorin_carbunaru »

Hello,

Unfortunately this feature is not yet available in oXygen, but he already had a request logged on our side and I added you vote to it, to increase its priority. We will update this thread when the feature will be available in a future version of oXygen.

Best wishes,
Sorin Carbunaru
oXygen XML
sorin_carbunaru
Posts: 398
Joined: Mon May 09, 2016 9:37 am

Re: Automatic conversion of conkeyrefs to text

Post by sorin_carbunaru »

One possible idea could be to contact the DITA-OT community (https://groups.google.com/forum/#!forum/dita-ot-users, https://groups.yahoo.com/neo/groups/dita-users/info or even https://stackoverflow.com/questions/tagged/dita-ot). When DITA-OT publishes the DITA content, it has to resolve the content references, and it might generate some temporary files where all the conkeyrefs are replaced with the referred text.

Perhaps you can try to publish you content with oXygen using DITA-OT, and then replace your files with the previously mentioned temporary files. But this also may be a bit tedious... But you should first contact the DITA-OT community and ask for advice.

Sorin C.
sorin_carbunaru
Posts: 398
Joined: Mon May 09, 2016 9:37 am

Re: Automatic conversion of conkeyrefs to text

Post by sorin_carbunaru »

Hello again Paul,

A colleague of mine suggested an approach that could make replacing conrefs with text less painful: you could create an Author action based on our JSOperation, and use the JavaScript code from https://github.com/oxygenxml/javascript ... keyrefs.js as the operation's script. Then you can add this action in the framework's toolbar (see https://www.oxygenxml.com/doc/versions/ ... olbar.html), and use the toolbar action to replace all conrefs/keyrefs from a topic with the corresponding text.

You might find the following image helpful for creating your new Author action: http://www.oxygenxml.com/forum/files/re ... fsJSOp.png (it's rather big; that's why I preferred to share the link insted of post the image).

Sorin C.
jacqueline_anderson
Posts: 1
Joined: Fri Jun 08, 2018 6:14 pm

Re: Automatic conversion of conkeyrefs to text

Post by jacqueline_anderson »

Hi Sorin,

I followed your instructions and everything works as advertised. The only problem is that Oxygen now throws the following error:
Cannot save the file: Exception checking in document: 403 - Forbidden: The object is not currently checked out.
SD_ERR: 234
Report: [detachAllChildren]
d_verobj.cpp[line: 252] XDD_Err_NotCheckedOut)

I am using Oxygen 18.1 for Mac.

Any suggestions?

Jay
sorin_carbunaru
Posts: 398
Joined: Mon May 09, 2016 9:37 am

Re: Automatic conversion of conkeyrefs to text

Post by sorin_carbunaru »

Hello Jay,

It seems to me that you use a CMS... And if I understand correctly, you first call the action you created and everything works as expected (i.e. the references are replaced by the corresponding text content), and then you try to manually save the document (or maybe an automatic save is triggered), and that is when the error is shown. Am I right?

My guess is that the error would be shown even if you just manually write some text to some document and then try to save.

The problem seems to be that you didn't check out the document you are working with. The CMS should provide such an action. After locally checking out the file and editing it, you will need to also check it in, to send your changes to the CMS.

Kind regards,
Sorin C.
Post Reply