[Yanel-dev] Storing reviewer comments with workflow transitions

Michael Wechner michael.wechner at wyona.com
Wed Nov 3 17:39:47 CET 2010


On 11/3/10 4:06 PM, Rob Adamson wrote:
> 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);

yes, sorry for the typo above :-)

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

you mean like the "source node" of a resource?

If so, then no, because a resource could be purely dynamic.

The trick is to do this through the resource interfaces, e.g.

http://www.yanel.org/javadoc/org/wyona/yanel/core/api/attributes/VersionableV2.html#getRevisions()

and

http://www.yanel.org/javadoc/org/wyona/yanel/core/api/attributes/WorkflowableV1.html#getWorkflowState(REVISION_NUMBER)

but maybe I misunderstand you?

Can you explain a bit more in which context you try to use this?

Unfortunately I need to run now, but will be online again by tomorrow 
morning.

Cheers

Michael
> 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