Automatic conversion of conkeyrefs to text

pault
Posts: 64

Automatic conversion of conkeyrefs to text

Thu Feb 08, 2018 6:29 pm

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
Site Admin
Posts: 154

Re: Automatic conversion of conkeyrefs to text

Fri Feb 09, 2018 11:18 am

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
Site Admin
Posts: 154

Re: Automatic conversion of conkeyrefs to text

Fri Feb 09, 2018 11:46 am

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
Site Admin
Posts: 154

Re: Automatic conversion of conkeyrefs to text

Mon Feb 12, 2018 11:22 am

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-sample-operations/blob/master/replace-conrefs-keyrefs/replace-conrefs-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/19.1/ug-editor/topics/dg-configure-toolbar.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/replaceRefsJSOp.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

Re: Automatic conversion of conkeyrefs to text

Fri Jun 08, 2018 6:20 pm

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
Site Admin
Posts: 154

Re: Automatic conversion of conkeyrefs to text

Mon Jun 11, 2018 10:49 am

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.

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest