You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2006/01/18 10:04:48 UTC
Re: Disable editing menu when document in
Renaud Richardet schrieb:
> Hello,
>
> Thanks for fixing the "Edit with BXE" menu state [1]. I would like to
> use another editor, e.g.
>
> <item wf:event="edit" uc:usecase="edit.bxe" href="?"><i18n:text>With
> BXE</i18n:text></item>
> <item wf:event="edit" uc:usecase="edit.myeditor"
> href="?"><i18n:text>With My Editor</i18n:text></item>
>
> How do I correctly register the usecase "edit.myeditor", so that the
> menu "With My Editor" is disabled when a document is in review state?
If the menu item for a usecase is enabled depends on the return value
of the method
Usecase.checkPreconditions()
If your usecase extends, e.g., DocumentUsecase, you have to override
doCheckPreconditions()
and add an error message if the workflow event cannot be invoked:
protected void doCheckPreconditions() throws Exception {
super.doCheckPreconditions();
if (!WorkflowUtil.canInvoke(this.manager,
getSession(),
getLogger(),
getSourceDocument(),
getEvent())) {
addErrorMessage("error-workflow-document",
new String[] { getEvent(),
getSourceDocument().getId() });
}
}
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org