Page 1 of 1

The ro.sync.ecss.extensions.api.AuthorDocumentFilter

Posted: Wed Apr 02, 2014 7:28 pm
by SSC
Hello,

we do use the Oxygen Author Eclipse version 15.2.

I got two questions concerning the AuthorDocumentFilter:

Is it somehow possible to attach a default AuthorDocumentFilter to the ro.sync.ecss.extensions.api.AuthorDocumentControllers of a certain framework?

Currently I am using an IPartListener in order to get access to the AuthorDocumentControllers and then set a certain AuthorDocumentFilter to those AuthorDocumentControllers.

But now we have the case that we want to add a framework specific AuthorDocumentFilter and I wonder, if it is possible to set the AuthorDocumentFilter via framework Extension.

Otherwise I would have to create an extra plugin just for attaching a certain AuthorDocumentFilter and only build this plugin, when I use that certain kind of framework.

Second Question: Could you consider to hold a Collection of AuthorDocumentFilter in the AuthorDocumentControllers instead of only setting just one AuthorDocumentFilter?

For now I also would have a workaround by using the Decorator Pattern and then combine the functionality of more than one AuthorDocumentFilter.
But the Decorator Pattern approach has one drawback, because a third party plugin which we may use in the future could also set their own custom AuthorDocumentFilter and override our AuthorDocumentFilter.
Therefore an addDocumentFilter() method would be better than the current setDocumentFilter() method.

Looking forward to your answers :)

Best regards,

Simon

Re: The ro.sync.ecss.extensions.api.AuthorDocumentFilter

Posted: Thu Apr 03, 2014 2:13 pm
by Radu
Hi Simon,

Please see some answers below:
Is it somehow possible to attach a default AuthorDocumentFilter to the ro.sync.ecss.extensions.api.AuthorDocumentControllers of a certain framework?
This is not available as a separate extension.
Is the specific framework constructed by you or one of the frameworks which come with Oxygen and to which you want to make only minor changes?
If you set your own "ro.sync.ecss.extensions.api.ExtensionsBundle" implementation for that specific framework, it has a method "ro.sync.ecss.extensions.api.ExtensionsBundle.createAuthorExtensionStateListener()" which creates an extension state listener. That listener is notified when the current editor page is activated/deactivated and you can use those callbacks to set or reset the styles filter.
Could you consider to hold a Collection of AuthorDocumentFilter in the AuthorDocumentControllers instead of only setting just one AuthorDocumentFilter?
Indeed right now with Oxygen 15.2 API your only alternative is to get the current filter "ro.sync.ecss.extensions.api.AuthorDocumentController.getDocumentFilter()", wrap it inside your own filter and then set this composed filter back.
We do have plans to allow adding multiple filters, I will update this forum thread when we implement this.

Regards,
Radu