Oxy collapsible property for bookevent elements

Post here questions and problems related to oXygen frameworks/document types.
ashukuma
Posts: 20
Joined: Fri Nov 14, 2014 10:04 am

Oxy collapsible property for bookevent elements

Post by ashukuma »

We have done some customization in CSS for bookmap elements. For one of the requirement, we have do add custom CSS to

Code: Select all

<bookchangehistory>
element. We have the following structure for <bookchangehistory> element in our bookmap DTD.

Code: Select all

  <bookchangehistory>
            <reviewed>
                <person value=""/>
            </reviewed>
            <edited>
                <person value=""/>
                <organization/>
            </edited>
            <approved value="no">
                <person value=""/>
                <organization/>
            </approved>
            <bookevent>
                <bookeventtype name="workflow_status" value="work"/>
            </bookevent>
            <bookevent>
                <bookeventtype name="changerecord"/>
                <person/>
                <revisionid/>
                <completed>
                    <year/>
                    <month/>
                    <day/>
                </completed>
                <summary/>
            </bookevent>
            <bookevent>
                <bookeventtype name="changerecord"/>
                <person/>
                <revisionid/>
                <completed>
                    <year/>
                    <month/>
                    <day/>
                </completed>
                <summary/>
            </bookevent>
        </bookchangehistory>
We would like to add collapsible property to <bookevent> with <bookeventtype="changerecord">. Since this type of element can be inserted multiple times, we would like to have some kind of collapsible property defined only for these elements which can collapse all these elements in one go. It would be easier for end users to collapse all bookevent at once.

The element which should only remain visible are reviewed, edited, approved and first bookevent element. Rest all following bookevent elements must be collapsible.

We did try to add collapsible property to bookevent element, but it is adding to all the following bookevent elements. We also tried to add collapsible property to bookchangehistory with exceptions of approved. edited. reviewed and first bookevent element, but it always collapses all but the last element available in the CSS definition.

Code: Select all

*[class~="bookmap/bookchangehistory"]{
-oxy-foldable:true !important;
-oxy-folded:false !important;
content:oxy_label(text, "Revision Information", width, 163px, text-align, left,color,gray,styles,"font-weight:bold")!important;
color:gray;
font-weight:normal;
-oxy-not-foldable-child: bookevent;
-oxy-not-foldable-child: reviewed;
-oxy-not-foldable-child: approved;
-oxy-not-foldable-child: edited;
} 
The above piece of code is hiding all but edited element.

Another observation with above mentioned code is that, even though I have ser oxy_lable as Revision Information, it is showing Bookchangehistory Revision Information as display text in author view.

Is there a way to achieve collapsibility to only bookevent elements at one go and not on individual ones?
adrian_sorop
Posts: 73
Joined: Wed Jun 22, 2016 2:48 pm

Re: Oxy collapsible property for bookevent elements

Post by adrian_sorop »

Hi!

Thank you for writing.
I've investigated your use-case. The -oxy-not-foldable-child property does not take into account all values, if multiple childs are set. It uses the last one.
I've logged and internal issue (ID is EXM-48482). We'll update this post when this will be fixed.

Regards,
Adrian S
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
ashukuma
Posts: 20
Joined: Fri Nov 14, 2014 10:04 am

Re: Oxy collapsible property for bookevent elements

Post by ashukuma »

Hey Adrian,

What about the other query?
  • Another observation with above mentioned code is that, even though I have set oxy_label as Revision Information, it is showing Bookchangehistory Revision Information as display text in author view.
  • Is there any other way we can achieve collapsibility for multiple bookevents?
adrian_sorop
Posts: 73
Joined: Wed Jun 22, 2016 2:48 pm

Re: Oxy collapsible property for bookevent elements

Post by adrian_sorop »

By bad, I forgot about those.
even though I have set oxy_label as Revision Information, it is showing Bookchangehistory Revision Information as display text in author
Oxygen's default CSS sets the name of the element as label on a before(3)
You can overwrite that style for

Code: Select all

bookchangehistory
element and set it to empty:

Code: Select all

*[class~='bookmap/bookchangehistory']:before(3) {
    content: "" !important;
}
Is there any other way we can achieve collapsibility for multiple bookevents?
A JS Operation that will expand all bookevents element can be used for this scope.
JS Operation documentation: https://www.oxygenxml.com/doc/versions/ ... soperation

Go to Oxygen Preferences, Document Type Association, select and edit your framework (I assume is DITA Map).
Go to Author tab, then to Actions. Set an ID and a Name (and shortcut if you want) for your action.
For Operation, click to the Choose button and select JSOperation from list and click OK.
Operation's argument scrip should be:

Code: Select all

function doOperation() {
    results = authorAccess.getDocumentController().findNodesByXPath("//bookevent", true, true, true);
	authorFoldManager = authorAccess.getEditorAccess().getAuthorFoldManager();
    for(i = 0; i < results.length; i++){
        authorFoldManager.expandFold(results[i]);
    }
}
After this, you can add this action to Contextual Menu for example: In the Author tab, Contextual menu, find your action in the list and add it to the menu.

Let me know if this works for you,
Adrian S
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Oxy collapsible property for bookevent elements

Post by Radu »

Hi,

One question for the original poster, are you using the customization for the Oxygen desktop installation or in the WebAuthor in-browser editor?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
adrian_sorop
Posts: 73
Joined: Wed Jun 22, 2016 2:48 pm

Re: Oxy collapsible property for bookevent elements

Post by adrian_sorop »

Hi,

I'm excited to announce that version 24.0 of the Oxygen XML Editor is now available to be downloaded.
In this new release, setting multiple not-foldable-child elements is now possible.

The not-foldable-child elements can be defined as a comma separated list, like:

Code: Select all

p {
    -oxy-foldable:true;
    -oxy-not-foldable-child: b, i;
}
Regards,
Adrian S
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply