Page 1 of 1

Forec Author mode refresh

Posted: Mon Sep 07, 2009 5:15 pm
by sijomon
Hi,

Still at it with these Oxygen plugins/operations, and generally being quite successful, however I have come acros the following issue.

I have a CSS that renders the content of a particular attribute when present in an element, the CSS rule is:

Code: Select all

[para-number]:before{
display: block;
content: attr(para-number);
font-weight: bold;
font-size: larger;
}
This renders the paragraph number, as defined in the para-number attribute, for any element that posses that attribute.

I also have an operation which rewrites the value of this attribute for some or all elements which posses it.

The problems is; the user is viewing the file in author mode with the current apara-number values displayed, the operation is invoked and it rewrites the attribute values, the attribute values displayed in author do not update. Is there a way to force the author mode to re-render the document using the new attribute values?

Re: Forec Author mode refresh

Posted: Mon Sep 07, 2009 5:39 pm
by sorin_ristache
Hello,

The refresh should be done automatically. How do you change the attribute value in your Author action? Do you set it directly on the node? You have to call the document controller for that: authorAccess.getDocumentController().setAttribute().


Regards,
Sorin

Re: Forec Author mode refresh

Posted: Tue Sep 08, 2009 11:14 am
by sijomon
Yep, I use the AuthorDocumentController to update the nodes' attributes, but the displayed values don't change.

Re: Forec Author mode refresh

Posted: Tue Sep 08, 2009 11:24 am
by sorin_ristache
You can use authorAccess.getEditorAccess().refresh().


Regards,
Sorin

Re: Forec Author mode refresh

Posted: Tue Sep 08, 2009 12:28 pm
by sijomon
That did it - thanks again :)

Re: Forec Author mode refresh

Posted: Fri Sep 11, 2009 1:13 pm
by sijomon
Is there an Oxygen 10.2 API mechanism for doing this, we have to support 10.2 and 10.3?

Thanks.

Re: Forec Author mode refresh

Posted: Fri Sep 11, 2009 2:06 pm
by sorin_ristache
I am not sure when AuthorEditorAccess.refresh() was added (10.3 or a previous version). Did you try your Author extension class in version 10.2 and you get an error in an output view at the bottom of the Oxygen window? If you get a NoSuchMethodError when you run your Author extension in version 10.2 then it was added in version 10.3 and there is no way to do the refresh programatically.


Regards,
Sorin

Re: Forec Author mode refresh

Posted: Fri Sep 11, 2009 3:04 pm
by sijomon
Ok, thnaks. It's good to have a definative answer.