How to display insertattribute value in xml by default

kpuchaka
Posts: 7
Joined: Wed Sep 29, 2021 7:02 pm

How to display insertattribute value in xml by default

Post by kpuchaka » Tue Oct 12, 2021 8:02 pm

Hello Experts,

I m inserting outputclass="partnumber" attribute in my xref element by using below entry in cc_config.xml:

<elementProposals path="xref" possibleElements="NONE">
<insertAttribute name="outputclass" value="partnumber"/>
</elementProposals>

The above one is working fine when i directly insert the <xref> element in my topic and i can see this outputclass="partnumber" in my xml view of the oxygen.

But i m using this <xref> element by using DITA reusbale key and when i insert the DITA key into my topic from DITA Resuable Component window,then it is inserting as <xref> element.In this case I can see outputclass="partnumber" value when i click on "Edit Attributes" of the element but that value is not showing in xml view.When i select that outputclass explicitly in attributes window,then it is selectable and displayed in my xml view.

We need this outputclass bydefault in xml view when <xref> element insert it.

Is there any way where we can achieve this ?how can we refresh this attribute value to make it display in xml by default?

When we insert thru DITA key,the structured would be like :
<xref keyref="SCREW_M2X4"/>

Please throw some pointers..

Regards
Kiran

alex_jitianu
Posts: 873
Joined: Wed Nov 16, 2005 11:11 am

Re: How to display insertattribute value in xml by default

Post by alex_jitianu » Wed Oct 13, 2021 11:42 am

Hello,

Thank you for reporting this issue. I will record an issue in our internal issue tracking system to find the cause and we will write on this thread when a fix will be released.

Meanwhile, as a workaround, you can use our Java-based API to intercept all fragments being inserted and check if there is a xref without a @outputclass attribute. If one is found, the filter adds the missing attribute. If you want to explore this path, write to us on support@oxygenxml.com and I will give you more details and some code to get you started.

Best regards,
Alex

kpuchaka
Posts: 7
Joined: Wed Sep 29, 2021 7:02 pm

Re: How to display insertattribute value in xml by default

Post by kpuchaka » Wed Oct 13, 2021 11:57 am

Hi Alex,

Thank you so much for your prompt reply..

I would like to try with your workaround of using Java Based API and can you please provide me the step by step approach how to insert this in my oxygen and deployment steps?

Also please provide me the sample code for the same.

P.S:I have also sent an email to support@oxygenxml.com for the same

Thank you.

Regards
Kiran

kpuchaka
Posts: 7
Joined: Wed Sep 29, 2021 7:02 pm

Re: How to display insertattribute value in xml by default

Post by kpuchaka » Thu Oct 14, 2021 12:02 pm

Hi Alex,

Your workaround is working and thank you so much for your help..!!

Regards
Kiran

kpuchaka
Posts: 7
Joined: Wed Sep 29, 2021 7:02 pm

Re: How to display insertattribute value in xml by default

Post by kpuchaka » Wed Nov 03, 2021 1:32 pm

Hi Alex,

Based on your provided framework SDL,I tried to implement the custom author framework and it is working as expected..

Thank you so much for that..!!

But i m not clear about the classpath tab and extensions tab.Do we have any documentation link where we can find the processor of customization of author frame work?

Is oxygen providing any such document to refer for development purpose? If so, can you please share me the link of that document where it can explain the process of customization ,so that it will be useful for further customizations if i need to do any.

Please do the needful..

Regards
Kiran

alex_jitianu
Posts: 873
Joined: Wed Nov 16, 2005 11:11 am

Re: How to display insertattribute value in xml by default

Post by alex_jitianu » Thu Nov 04, 2021 1:15 pm

Hi Kiran,

I'm glad I could help! Here are some useful links:

https://www.oxygenxml.com/doc/versions/ ... undle.html
https://www.oxygenxml.com/doc/versions/ ... s-tab.html
https://www.oxygenxml.com/doc/versions/ ... h-tab.html

Oxygen offers a number of extension points on which one must set implementation of specific interfaces from our Java-based API. You set these implementations from the Extensions tab. When you want to set a value for such an extension point, Oxygen searches inside the jars specified in the Classpath tab for implementations that match that specific extension point.

In our Maven based SDK sample project there is a module called sample-framework with examples on how you can use our Java-based API for different use cases.

Best regards,
Alex

kpuchaka
Posts: 7
Joined: Wed Sep 29, 2021 7:02 pm

Re: How to display insertattribute value in xml by default

Post by kpuchaka » Wed Nov 10, 2021 4:49 pm

Hi Alex,

Thank you so much for your prompt reply and help so far..!!

I just setup the project in my local and able to update the AuthorDocumentFilter class to insert outputclass based on our requirement. Now I want to check the possibility of using this same framework for another purpose.

We have one reference key map which contains all the reusable keys like below:
<topicgroup keyscope="Parts-In">
<keydef href="GUID-7566B055-F44F-4DFD-B501-AA95E5906C57" keys="12NC14" navtitle="UCM TOP STD FILTER /800B"/>
</topicgroup>

When we open this map in oxygen, then all the above keys were displayed in right side "DITA Reusable Components" window(see the attached document).
Then our technical authors will create userdefined keys in another map with the help of above created keys which are displaying in "DITA Reusable Components" window.
Sample of user defined keys map is below:
<topicref keydef="Parts-In.12NC14" keys="STS_TOP_FILTER" />

After complete the "User defined keys map" authoring,authors will check-in the map and during the checkin or before the checkin of the map, they wanted to validate all the keys mentioned in "DITA Reusable Components" window were addressed in their "User Defined Keys" map or not.

So is there any API method available to read the no.of keydef elements count in right side "DITA Reusable Components" window and also authoring "User Defined Keys" map xml file?If so,then we can match the actual count of keydef elements with "User Defined Key" map keydef values and if it is not same, then we can inform authors that "all the keys were not replaced.." some thing like this message.

Is the above scenario is possible? If so, can you please help me about that API?And also can we trigger that message during checking the "User defined keys" map?

If you think any other solution for this requirement, please advise me.
sample userdefined keys.PNG
sample userdefined keys.PNG (175.28 KiB) Viewed 114 times
Please do the needful..!!

P.S:If you want me to move this to different thread, then I can create new thread next time.

Regards
Kiran

alex_jitianu
Posts: 873
Joined: Wed Nov 16, 2005 11:11 am

Re: How to display insertattribute value in xml by default

Post by alex_jitianu » Thu Nov 11, 2021 10:29 am

Hi Kiran,

The DITAAccess.getKeys(URL) API will give you all the keys presented in the DITA Reusable Components view. Unfortunately, you'll need to parse "User Defined Keys" map yourself and build a data structure with the defined keys and their binding. You can implement such an action in your framework customization through an Author Action added on the toolbar, for example. This action must invoke a custom author operation . Inside the Java code of this custom operation is where you get the keys and compare them.

Best regards,
Alex

Post Reply