read-only attributes

Post here questions and problems related to oXygen frameworks/document types.
odovao
Posts: 12

read-only attributes

Fri Oct 14, 2016 12:02 pm

Hi

Is is possible to mark a element's attributes read-only in CSS, but still be able to modify the element itself?

Version: Web author 18.0.0

Thanks
cristi_talau
Posts: 123

Re: read-only attributes

Fri Oct 14, 2016 2:17 pm

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
odovao
Posts: 12

Re: read-only attributes

Wed Nov 09, 2016 3:30 am

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
Gabriel Titerlea
Posts: 33

Re: read-only attributes

Wed Nov 09, 2016 11:37 am

Hello,

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);
      }
     });
  }


To register the WorkspaceAccessPluginExtension you need to add it in the plugin.xml file of your plugin as follows:

Code: Select all

<extension type="WorkspaceAccess" class="com.example.YourWorkspaceAccessPluginExtension"/>


Best,
Gabriel

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest