Motivating users to move to a new Oxygen release
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Motivating users to move to a new Oxygen release
Post by chrispitude »
We have a Git-hosted Oxygen project used by about 40 participating writers.
The upcoming release of Oxygen v23.1 has me thinking... what's the best way for me to centrally encourage users to upgrade to the new Oxygen version, but only after I qualify it for use?
If I could find some way to query the Oxygen version from CSS, I could maybe do something like
Code: Select all
:root[-oxy-variable('oxygenVersion') < 23.1)]:before {
display: block;
border: 3pt green solid;
background-color: lightgreen;
padding: 10pt;
content: 'Click here to download the latest version of Oxygen XML Author';
font-size: 16pt;
-oxy-link: 'https://www.oxygenxml.com/xml_author/download_oxygenxml_author.html';
text-decoration: underline;
color: navy;
}
Is there a way to query the Oxygen version from CSS? (I made up the oxygenVersion variable; I didn't see it listed in the variables list at https://www.oxygenxml.com/doc/versions/ ... ables.html.)
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Motivating users to move to a new Oxygen release
Post by alex_jitianu »
Unfortunately, such an editor variable doesn't exist. Moreover, we don't expand editor variables in selectors. An Oxygen plugin could use our Java API to detect the Oxygen version and present a notification to the user. The approved version could be in a configuration file or it could sit somewhere on a server and the plugin could read it from there.
I will also add an issue to add a new property, versionGreaterThan, in the @oxygen media type :
Code: Select all
@media oxygen AND (versionGreaterThan:"23.1") {
:root {
content: 'Click here to download the latest version of Oxygen XML Author';
font-size: 16pt;
-oxy-link: 'https://www.oxygenxml.com/xml_author/download_oxygenxml_author.html';
}
}
Alex
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Motivating users to move to a new Oxygen release
Post by chrispitude »
Since we're discussing CSS-driven writer reminders, is there a way to query the filename of the current file being edited and display something accordingly? For example, a .dita topic filename has "/_warehouse/" in the directory ancestory, I would want to display a reminder banner to check all references before modifying and committing content.
This is admittedly well beyond what CSS was intended for.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Motivating users to move to a new Oxygen release
Post by alex_jitianu »
It can be done with the help of oxy_xpath :
Code: Select all
:root:before {
display: block;
color: red;
content:
oxy_xpath("if (contains(base-uri(), '/_warehouse/')) then ('REUSABLE TOPIC') else ('')", evaluate, static);
}
Anyway, perhaps an Oxygen plugin that intercepts the save event and warns the user would be more robust,
Best regards,
Alex
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Motivating users to move to a new Oxygen release
Post by chrispitude »

I thought maybe I could use oxy_label() to apply conditional formatting from the XPath expression, but I get the literally 'oxy_label(...)' text as content:
Code: Select all
content: oxy_xpath("if (contains(base-uri(), '/_warehouse/')) then ('oxy_label(text, \"WAREHOUSE TOPIC\")') else ('')", evaluate, static);
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Motivating users to move to a new Oxygen release
Post by alex_jitianu »
You can use a unique pseudo-element, intended for this label only:
Code: Select all
:root:before(100) {
.....
}
You can use oxy_label too, but put it on the outside:
Code: Select all
:root:before(100) {
display: block;
content:
oxy_label(
text, oxy_xpath("if (contains(base-uri(), '/_warehouse/')) then ('REUSABLE TOPIC') else ('')", evaluate, static),
width, 10em,
color, red) ;
}
Alex
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Motivating users to move to a new Oxygen release
Post by chrispitude »
I'm just exploring this to see where it goes. There's no urgency or need to continue if this proves to be nontrivial.
I created a standalone Oxygen project with only
/* show that CSS is active */
:root { background-color: yellow; }
Code: Select all
:root:before(100) {
display: block;
content:
oxy_label(
text, oxy_xpath("if (contains(base-uri(), '/_warehouse/')) then ('REUSABLE TOPIC') else ('')", evaluate, static),
width, 10em, color, red, background-color, pink, text-align, center);
}
but when the selector doesn't match (I change "_warehouse_" to "_Xwarehouse_"), then the banner block element does not disappear; it just becomes empty:
I'm attaching the testcase. Just apply the "+ Warehouse CSS" style in the Styles drop-down. What do you think?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Motivating users to move to a new Oxygen release
Post by alex_jitianu »
Now I understand. It is a series of unfortunate events that leads to that empty block. Both a display: block and the usage of oxy_label() have this effect. I will add an issue to investigate. Meanwhile, it works if you write the rule like this:
Code: Select all
:root:before(100) {
display: inline;
width: 10em;
content: oxy_xpath("if (contains(base-uri(), '/_warehouse/')) then ('REUSABLE TOPIC') else ('')", evaluate, static);
background-color: pink;
color: red;
text-align: center;
}
Alex
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Motivating users to move to a new Oxygen release
Post by chrispitude »
Hi Alex,alex_jitianu wrote: ↑Thu Mar 04, 2021 5:04 pmI will also add an issue to add a new property, versionGreaterThan, in the @oxygen media type :
Code: Select all
@media oxygen AND (versionGreaterThan:"23.1") { :root { content: 'Click here to download the latest version of Oxygen XML Author'; font-size: 16pt; -oxy-link: 'https://www.oxygenxml.com/xml_author/download_oxygenxml_author.html'; } }
Is there an issue ID for the versionGreaterThan CSS property idea you mentioned?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Motivating users to move to a new Oxygen release
Post by alex_jitianu »
The issue ID is EXM-47521 . Looking over the thread again, I think the versionLessThan variant is the one you need.
Best regards,
Alex
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Motivating users to move to a new Oxygen release
Post by chrispitude »
Feel free to close EXM-47521. I have filed an enhancement request to have a minimum Oxygen release parameter stored directly in the .xpr file, rather than using CSS to check it indirectly.
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Motivating users to move to a new Oxygen release
Post by alex_jitianu »
I've added your note on the issue, but I will leave it open for awhile. Perhaps we will discover other scenarios in which that feature would be of help.
Best regards,
Alex
- 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