Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-8988

Creation related event handlers doesn't work for types created by a content template

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 5.5
    • Fix Version/s: None
    • Component/s: None

      Description

      It seems that content templates uses a SimplePrincipal and not NuxeoPrincipal

      If the "EL" field is the only activation field filled

      19:58:40,641 ERROR [OperationEventListener] Failed to handle event aboutToCreate using chain: InitPropertiesListener
      java.lang.ClassCastException: org.nuxeo.ecm.core.api.SimplePrincipal cannot be cast to org.nuxeo.ecm.core.api.NuxeoPrincipal
      	at org.nuxeo.ecm.automation.core.scripting.Scripting.initBindings(Scripting.java:87)
      	at org.nuxeo.ecm.automation.core.scripting.MvelExpression.eval(MvelExpression.java:38)
      	at org.nuxeo.ecm.automation.core.events.EventHandler.isEnabled(EventHandler.java:254)
      	at org.nuxeo.ecm.automation.core.events.EventHandlerRegistry.handleEvent(EventHandlerRegistry.java:195)
      	at org.nuxeo.ecm.automation.core.events.OperationEventListener.handleEvent(OperationEventListener.java:33)
      	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:195)
      	at org.nuxeo.ecm.core.api.AbstractSession.fireEvent(AbstractSession.java:400)
      	at org.nuxeo.ecm.core.api.AbstractSession.notifyEvent(AbstractSession.java:452)
      	at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:863)
      	at org.nuxeo.ecm.platform.content.template.factories.SimpleTemplateBasedFactory.createContentStructure(SimpleTemplateBasedFactory.java:67)
      	at org.nuxeo.ecm.platform.content.template.service.ContentTemplateServiceImpl.executeFactoryForType(ContentTemplateServiceImpl.java:179)
      	at org.nuxeo.ecm.platform.content.template.listener.ContentCreationListener.handleEvent(ContentCreationListener.java:60)
      	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:195)
      	at org.nuxeo.ecm.core.api.AbstractSession.fireEvent(AbstractSession.java:400)
      	at org.nuxeo.ecm.core.api.AbstractSession.notifyEvent(AbstractSession.java:452)
      	at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:896)
      	at org.nuxeo.ecm.platform.content.template.factories.SimpleTemplateBasedFactory.createContentStructure(SimpleTemplateBasedFactory.java:67)
      	at org.nuxeo.ecm.platform.content.template.service.ContentTemplateServiceImpl.executeFactoryForType(ContentTemplateServiceImpl.java:179)
      	at org.nuxeo.ecm.platform.content.template.listener.ContentCreationListener.handleEvent(ContentCreationListener.java:60)
      	at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:195)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: