how to print an error message when no application context is active?

Hi,

I cannot retrieve the application context when my file importer is launched through the drag and drop … and thus cannot print my message through FacesMessages.

What is the way to give some feedback to the user, then?

Tx

Patrick

0 votes

1 answers

1836 views

ANSWER



Hi Patco,

The importer itself is launched via an Automation chain, triggered during the drag'n'drop:

<extension point="chains" target="org.nuxeo.ecm.core.operation.OperationServiceComponent">
<chain id="FileManager.ImportWithMetaData">
  <operation id="FileManager.Import">
     <param name="overwite" type="boolean">true</param>
  </operation>
  <operation id="Document.Update">
    <param name="properties" type="properties">expr:Context.get("docMetaData")</param>
  </operation>
</chain>
</extension>

(contributed here)

I guess the best thing to do would be to override this chain, to append a call to a “Seam.AddInfoMessage” or “Seam.AddMessage” operation. If your message is complex (= template based) I think you'll have to create your own operation based on one of these, from which you can have full access to the Seam context.

0 votes