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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]