read-only attributes
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: read-only attributes
Post by cristi_talau »
Hello,
In Web Author an attribute can be edited either inline using a form-control or by using the "Attributes" side-view.
If you want an attribute to be read-only, you can remove from CSS any form-control that edits that attribute. Regarding the "Attributes" view, we have Java API [1] that allows one to completely hide the attribute from the UI. To use this Java API, you should create a plugin [2].
Best,
Cristian
[1] https://www.oxygenxml.com/InstData/Edit ... playFilter
[2] https://www.oxygenxml.com/doc/versions/ ... ugins.html
In Web Author an attribute can be edited either inline using a form-control or by using the "Attributes" side-view.
If you want an attribute to be read-only, you can remove from CSS any form-control that edits that attribute. Regarding the "Attributes" view, we have Java API [1] that allows one to completely hide the attribute from the UI. To use this Java API, you should create a plugin [2].
Best,
Cristian
[1] https://www.oxygenxml.com/InstData/Edit ... playFilter
[2] https://www.oxygenxml.com/doc/versions/ ... ugins.html
-
- Posts: 12
- Joined: Tue Oct 04, 2016 12:18 pm
Re: read-only attributes
Hi,
I have implemented a CustomProtocolPlugin (this is working fine) and also an AuthorAttributesDisplayFilter, however how do I activate the filter?
Looking at other threads in the forum, it seems that I need to do this via WSAuthorEditorPageBase. Where/how do I get an instance of WSAuthorEditorPageBase so that I can add the filter to it?
Thanks,
Oscar
I have implemented a CustomProtocolPlugin (this is working fine) and also an AuthorAttributesDisplayFilter, however how do I activate the filter?
Looking at other threads in the forum, it seems that I need to do this via WSAuthorEditorPageBase. Where/how do I get an instance of WSAuthorEditorPageBase so that I can add the filter to it?
Thanks,
Oscar
-
- Site Admin
- Posts: 95
- Joined: Thu Jun 09, 2016 2:01 pm
Re: read-only attributes
Post by Gabriel Titerlea »
Hello,
To add your filter you can implement a ro.sync.exml.plugin.workspace.WorkspaceAccessPluginExtension and override the applicationStarted method:
To register the WorkspaceAccessPluginExtension you need to add it in the plugin.xml file of your plugin as follows:
Best,
Gabriel
To add your filter you can implement a ro.sync.exml.plugin.workspace.WorkspaceAccessPluginExtension and override the applicationStarted method:
Code: Select all
@Override
public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess) {
WebappPluginWorkspace workspaceAccess = (WebappPluginWorkspace) pluginWorkspaceAccess;
workspaceAccess.addEditingSessionLifecycleListener(new WebappEditingSessionLifecycleListener() {
@Override
public void editingSessionStarted(String sessionId, AuthorDocumentModel documentModel) {
documentModel.getAuthorAccess().getEditorAccess().addAuthorAttributesDisplayFilter(YOUR_FILTER_HERE);
}
});
}
Code: Select all
<extension type="WorkspaceAccess" class="com.example.YourWorkspaceAccessPluginExtension"/>
Gabriel
-
- Posts: 16
- Joined: Wed Jan 12, 2022 6:17 pm
Re: read-only attributes
Hi
I seem to have the same/ similar Use-Case.
I want to make some Attributes of XML-Tags to be not editable via the Attributes-Side View and the In-place Attributes Editor in Author Mode.
Instead of Web Author, i am using OxygenXMLAuthor Eclipse Plugin v24.0
Greetings,
Steffen

I seem to have the same/ similar Use-Case.
I want to make some Attributes of XML-Tags to be not editable via the Attributes-Side View and the In-place Attributes Editor in Author Mode.
Instead of Web Author, i am using OxygenXMLAuthor Eclipse Plugin v24.0
Greetings,
Steffen
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: read-only attributes
Hi Steffen,
Here are some possibilities:
1) Remove the attribute completely from being displayed in the Attributes view, using the API Gabriel mentioned above which works also in the Eclipse plugin:
https://www.oxygenxml.com/InstData/Edit ... layFilter-
2) Use the API to set a document filter:
ro.sync.ecss.extensions.api.AuthorDocumentController.setDocumentFilter(AuthorDocumentFilter)
and avoid changing the value for that specific attribute, but the end user might still get confused as the value will remain editable in the Attributes view but when it gets committed it will not be inserted in the document.
3) If you edit your DITA framework customization in the Oxygen Preferences->"Document Type Associations" page, in the "Extensions" tab there is an extension named "Author Custom Attribute Value Editor" which can be set by you to your own Java class:
https://www.oxygenxml.com/doc/versions/ ... ditor.html
Regards,
Radu
Here are some possibilities:
1) Remove the attribute completely from being displayed in the Attributes view, using the API Gabriel mentioned above which works also in the Eclipse plugin:
https://www.oxygenxml.com/InstData/Edit ... layFilter-
2) Use the API to set a document filter:
ro.sync.ecss.extensions.api.AuthorDocumentController.setDocumentFilter(AuthorDocumentFilter)
and avoid changing the value for that specific attribute, but the end user might still get confused as the value will remain editable in the Attributes view but when it gets committed it will not be inserted in the document.
3) If you edit your DITA framework customization in the Oxygen Preferences->"Document Type Associations" page, in the "Extensions" tab there is an extension named "Author Custom Attribute Value Editor" which can be set by you to your own Java class:
https://www.oxygenxml.com/doc/versions/ ... ditor.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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