Forec Author mode refresh

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Forec Author mode refresh

Post by sijomon » Mon Sep 07, 2009 5:15 pm

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?

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: Forec Author mode refresh

Post by sorin_ristache » Mon Sep 07, 2009 5:39 pm

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

sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Re: Forec Author mode refresh

Post by sijomon » Tue Sep 08, 2009 11:14 am

Yep, I use the AuthorDocumentController to update the nodes' attributes, but the displayed values don't change.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: Forec Author mode refresh

Post by sorin_ristache » Tue Sep 08, 2009 11:24 am

You can use authorAccess.getEditorAccess().refresh().


Regards,
Sorin

sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Re: Forec Author mode refresh

Post by sijomon » Tue Sep 08, 2009 12:28 pm

That did it - thanks again :)

sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Re: Forec Author mode refresh

Post by sijomon » Fri Sep 11, 2009 1:13 pm

Is there an Oxygen 10.2 API mechanism for doing this, we have to support 10.2 and 10.3?

Thanks.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: Forec Author mode refresh

Post by sorin_ristache » Fri Sep 11, 2009 2:06 pm

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

sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Re: Forec Author mode refresh

Post by sijomon » Fri Sep 11, 2009 3:04 pm

Ok, thnaks. It's good to have a definative answer.

Post Reply