[Yanel-dev] Storing reviewer comments with workflow transitions

Rob Adamson bobacus at gmail.com
Wed Nov 3 17:06:10 CET 2010


Thanks Michael, that was very helpful. Further questions below...

On 3 November 2010 09:16, Michael Wechner <michael.wechner at wyona.com> wrote:
>
>> Q2. What are my options for storing the reason text provided by the
>> reviewer?  I need to persist this with the ability to retrieve it for
>> displaying to the author on another screen.
>
> Since each revision of a node can have a workflow instance I would suggest
> to attach
> it to the revision as a property, e.g.
>
> Revision revision =
> getRealm().getRepository("/events/2010/example.html").getRevision(REVISION_NUMBER);
> revision.setProperty("reject-message", REJECT_MESSAGE);

I assume you meant

getRealm().getRepository().getNode("/events/2010/example.html").getRevision(REVISION_NUMBER);

Is there a convenient way to get at the node path from a resource?

I am using the path to resolve the resource, like this:

        Resource resource =
getYanel().getResourceManager().getResource(getEnvironment(),
getRealm(), params.resourcePath);

where params.resourcePath is the URL relative to the realm.

Then to get the revision, I am doing this:

		Node node = getRealm().getRepository().getNode(params.resourcePath);
		Revision revision = node.getRevision(params.revision);

However this doesn't work because the node path is not the same as the
realm-relative URL.

Is there a general solution?

Rob


More information about the Yanel-development mailing list