Oxygen button modification
Post here questions and problems related to oXygen frameworks/document types.
Oxygen button modification
- issue.png (36.93 KiB) Viewed 1070 times
I have created a button in Oxygen Tool.
On click it generates the tags like change-item, change-completed and change-summary tags. (in red box as shown in image)
On clicking the button again it generates the same. (in green box as shown in image)
But I want the latest change/last modified to be on top of the entry.
If you consider the image attached the text inside green block should be above the red box.
Can you please suggest me How to resolve this?
Thanks & regards
Aditya
Re: Oxygen button modification
Hi Aditya,
So this button is for the Oxygen desktop application, not for the WebAuthor in-browser editor, right?
Can you paste some code showing me how you implemented the button's functionality? How do you decide the offset in the document where to insert the XML fragment?
Regards,
Radu
So this button is for the Oxygen desktop application, not for the WebAuthor in-browser editor, right?
Can you paste some code showing me how you implemented the button's functionality? How do you decide the offset in the document where to insert the XML fragment?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Oxygen button modification
Hi Radu,
I have developed this button through framework "https://blog.oxygenxml.com/topics/custo ... etion.html".
Sure, here is snippet of the code:
This is the XML fragment -
<prolog><change-historylist><change-item><change-person>${system(user.name)}</change-person><change-completed>${date(yyyy-MM-dd h:mm)}</change-completed><change-summary ></change-summary></change-item></change-historylist></prolog>
The implementation of button's functionality -
ancestor-or-self::*[contains(@class, ' topic/prolog')] and not(ancestor-or-self::*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/prolog')])
And regarding the button you can see it enclosed in red box.
Thanks & regards
Aditya
I have developed this button through framework "https://blog.oxygenxml.com/topics/custo ... etion.html".
Sure, here is snippet of the code:
This is the XML fragment -
<prolog><change-historylist><change-item><change-person>${system(user.name)}</change-person><change-completed>${date(yyyy-MM-dd h:mm)}</change-completed><change-summary ></change-summary></change-item></change-historylist></prolog>
The implementation of button's functionality -
ancestor-or-self::*[contains(@class, ' topic/prolog')] and not(ancestor-or-self::*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/prolog')])
And regarding the button you can see it enclosed in red box.
- activation.png (228.08 KiB) Viewed 1024 times
- fragment.png (37.39 KiB) Viewed 1024 times
- button gen1.png (131.09 KiB) Viewed 1024 times
Aditya
Re: Oxygen button modification
Hi Aditya,
I do not understand this xpath expression you are using:
If I were to translate it to a human readable description it means "when the caret is inside a subelement of prolog but there is no prolog in the entire topic". In my opinion it always evaluates to "false".
I see in the screenshot you have a two operation tabs [1] and [2], how did you configure the [2] tab?
I would probably have the activation xpath expression for [1] like this:
as I want to enable the action no matter where the caret is, as long as there is a prolog already inserted in the topic with a changehistory element inside it.
, the fragment parameter I would pass directly as "<change-item>....." because the <changehistory> element is already there.
, the "insertLocation" I would pass as "ancestor-or-self::topic/prolog/changehistory"
, the "insertPosition" "Inside as first child" as it is now.
And you can create other activation modes as well using the "+" button, for example a context where there is a prolog but the changehistory list is missing from it so the operation also needs to insert a changehistory element.
Regards,
Radu
I do not understand this xpath expression you are using:
Code: Select all
ancestor-or-self::*[contains(@class, ' topic/prolog')] and not(ancestor-or-self::*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/prolog')])
I see in the screenshot you have a two operation tabs [1] and [2], how did you configure the [2] tab?
I would probably have the activation xpath expression for [1] like this:
Code: Select all
ancestor-or-self::topic[prolog[changehistory]]
, the fragment parameter I would pass directly as "<change-item>....." because the <changehistory> element is already there.
, the "insertLocation" I would pass as "ancestor-or-self::topic/prolog/changehistory"
, the "insertPosition" "Inside as first child" as it is now.
And you can create other activation modes as well using the "+" button, for example a context where there is a prolog but the changehistory list is missing from it so the operation also needs to insert a changehistory element.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Oxygen button modification
Hi radu,
I have developed this button through framework "https://blog.oxygenxml.com/topics/custo ... etion.html".
Here is the attachment:
(Here the tags enclosed in green box is the 1st generation and blue box is 2nd generation).
The Generate button is the button that i have generated.
The button that I have generated when clicked it generates the tags like change-item, change-completed and change-summary tags and when clicked again it displays the same, but my requirement is that it should keep the latest update generation on top. (Taking above image as reference it should have blue box with tags on top and green box with tags below it).
And coming onto the actions part, here is the attachment:
(In the activation part I have updated the activation path code specified by you ).
And regarding the operation 1 I have kept the fargment as : (Which is the standard XML Format specified by client).
Insertocation: (This basically checks for hierarchy of template and if found then inserts the tags in it).
Insert Position as: Insert as first child.
For operation 2, here is the attachment:
(this basically includes the tags from change-item).
Here is the code:.
Insert position as: After
Thanks & regards,
Aditya
I have developed this button through framework "https://blog.oxygenxml.com/topics/custo ... etion.html".
Here is the attachment:
- query1.png (196.26 KiB) Viewed 946 times
The Generate button is the button that i have generated.
The button that I have generated when clicked it generates the tags like change-item, change-completed and change-summary tags and when clicked again it displays the same, but my requirement is that it should keep the latest update generation on top. (Taking above image as reference it should have blue box with tags on top and green box with tags below it).
And coming onto the actions part, here is the attachment:
- Action.png (145.11 KiB) Viewed 946 times
Code: Select all
ancestor-or-self::topic[prolog[changehistory]]
And regarding the operation 1 I have kept the fargment as :
Code: Select all
<prolog><change-historylist><change-item><change-person>${system(user.name)}</change-person><change-completed>${date(yyyy-MM-dd h:mm)}</change-completed><change-summary ></change-summary></change-item></change-historylist></prolog>
Insertocation:
Code: Select all
ancestor-or-self::*[contains(@class, ' topic/prolog ')]
Insert Position as: Insert as first child.
For operation 2, here is the attachment:
- Action2.png (120.93 KiB) Viewed 946 times
Here is the code:
Code: Select all
<change-item><change-person>${system(user.name)}</change-person><change-completed>${date(yyyy-MM-dd h:mm)}</change-completed><change-summary ></change-summary></change-item>
Insert position as: After
Thanks & regards,
Aditya
Re: Oxygen button modification
Hi Aditya,
If you still have problems with this maybe you can export the entire action to an XML file and either zip and attach it to this forum thread or send it to us (support@oxygenxml.com).
Regards,
Radu
If you still have problems with this maybe you can export the entire action to an XML file and either zip and attach it to this forum thread or send it to us (support@oxygenxml.com).
- Screenshot 2024-02-26 at 08.06.52.png (173.02 KiB) Viewed 943 times
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 406
- Joined: Mon May 09, 2016 9:37 am
Re: Oxygen button modification
Post by sorin_carbunaru »
Hi,
So, I took your action, edited the activation XPath expression to change "changehistory" to "change-historylist", and when I used it, the newer entries where at the top:
Cheers,
Sorin Carbunaru
Oxygen XML Editor
So, I took your action, edited the activation XPath expression to change "changehistory" to "change-historylist", and when I used it, the newer entries where at the top:
- image.png (31.54 KiB) Viewed 918 times
Sorin Carbunaru
Oxygen XML Editor
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service