Disable opening of conrefs when page is not editable

Oxygen general issues.
dvezina
Posts: 23
Joined: Sat Mar 08, 2014 12:10 am

Disable opening of conrefs when page is not editable

Post by dvezina »

Hello,

I have a page that is not editable.
authorPage.setEditable(false);

If the DITA document contains conrefs, the user is able to open them. I want to disable the link - preferably without changing the style sheet and preferably through the plugin (not ExtensionBundle).

Ideas?

Thanks,
D

Oxygen 17.0
Plugin
Radu
Posts: 9498
Joined: Fri Jul 09, 2004 5:18 pm

Re: Disable opening of conrefs when page is not editable

Post by Radu »

Hi Deanna,

There is also a contextual menu action for editing the referenced content which you can remove by setting a popup menu customizer

Code: Select all

WSAuthorEditorPageBase.addPopUpMenuCustomizer(AuthorPopupMenuCustomizer)
.

Going back to your problem, after you load the XML and call authorPage.setEditable(false); you could also set a pseudo class on the root element like:

Code: Select all

authorPage.getDocumentController().setPseudoClass("read-only", authorPage.getDocumentController().getAuthorDocumentNode().getRootElement());
Then we need to somehow change the rendering of the reference based on this pseudo style.

You would need a custom CSS content like:

Code: Select all


@namespace oxy "http://www.oxygenxml.com/extensions/author";

:root:read-only oxy|reference:before {
content: "" !important;
}
If you want to provide it via a plugin you could add a custom URI resolver:

Code: Select all

ro.sync.exml.workspace.api.util.XMLUtilAccess.addPriorityURIResolver(URIResolver)
and when you receive a callback for an input source which has the URI "http://www.oxygenxml.com/extensions/aut ... Custom.css"

try to resolve it to a source which has an URL pointing to a CSS resource with the content I suggested above from the plugin folder.

In Oxygen 17.1 you will be able to contribute directly a custom CSS via a special plugin extension type.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dvezina
Posts: 23
Joined: Sat Mar 08, 2014 12:10 am

Re: Disable opening of conrefs when page is not editable

Post by dvezina »

THANKS!
Post Reply