[ 
https://jira.nuxeo.org/browse/NXP-4798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=70298#action_70298
 ] 

Sean Radford commented on NXP-4798:
-----------------------------------

Not sure. Does not seem quite right to have 2 sets of events being fired off.

In the second use case above it states 'event listener before document model 
creation is not enough because it does not have access to the seam context'. Is 
this correct? You can just use the static org.jboss.seam.contexts.Contexts
#getXXXContext() methods in a synchronous event listerner?

For the 1st use case of allowing the event to alter the name of the document, 
this can easily be achieved by amending 
org.nuxeo.core.api.AbstractSession#createDocumentModel(DocumentModel) by moving 
the 1st line of code:

String name = docModel.getName()

to immediately after:

notifyEvent(DocumentEventTypes.ABOUT_TO_CREATE, docModel, options, null, null, 
false, true); // no lifecycle yet


> Improve customization of document actions methods
> -------------------------------------------------
>
>                 Key: NXP-4798
>                 URL: https://jira.nuxeo.org/browse/NXP-4798
>             Project: Nuxeo Enterprise Platform
>          Issue Type: Improvement
>    Affects Versions: 5.3 GA
>            Reporter: Anahide Tchertchian
>             Fix For: 5.3.x
>
>
> Override "documentActions" seam component (using seam install precedence 
> mechanism) is the only solution to make it possible to, for instance:
> - generate the document name according to custom rules
> - fill the document model properties using seam context variables (event 
> listener before document model creation is not enough because it does not 
> have access to the seam context), before creation form is presented, or after 
> document model is saved to the session (when creaton the document or editing 
> it)
> Plus it seems seam remoting methods do not behave correctly when overriding 
> the seam component, as posted on the ecm mailing list (see 
> http://lists.nuxeo.com/pipermail/ecm/2010-February/008657.html). These 
> methods are useful to select document from tables.
> => An easy solution may be to raise seam events in DocumentActionsBean 
> component to provide hooks in appropriate methods that usually need to be 
> customized.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.nuxeo.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to