Email Notifications on Calendar Events in Alfresco

前端 未结 3 1992
心在旅途
心在旅途 2021-01-07 02:40

I\'m using Alfresco 4.0 I need to send email notification to selected members or all the members if a calendar event is created.

I\'m a newbie.

Kindly help m

相关标签:
3条回答
  • 2021-01-07 02:59

    You can set a simple rule on "Sites/yoursite/calendar" folder that executes a javascript script which sends the email.

    If you need something more complicated then you can use alfresco's "onCreateNode" policy and bind it to "ia:calendarEvent" type.

    From the top of my head something like this:

    ...
    
    this.onCreateNode = new JavaBehaviour(this, "onCreateNode", NotificationFrequency.TRANSACTION_COMMIT);
    
    this.policyComponent.bindClassBehaviour(QName.createQName(
        NamespaceService.ALFRESCO_URI, "onCreateNode"),
        "ia:calendarEvent", this.onCreateNode);
    
    ...
    ...
    ...
    
    public void onCreateNode(ChildAssociationRef childAssocRef)
    {
     //send email here
    }
    
    0 讨论(0)
  • 2021-01-07 03:04

    Thanks for all the valuable answers, I was able to complete my work on time. However after some search I got a complete script with all steps. You can follow this link, please read the 6th post for the answer:

    https://forums.alfresco.com/en/viewtopic.php?f=47&t=42366

    0 讨论(0)
  • 2021-01-07 03:13

    Should roughly go like this:

    Create a spring mananged bean, inject policyComponent

    <bean id="calendarType" class="your.CalendarType"
       init-method="init">
       <property name="policyComponent" ref="policyComponent" />
     </bean>
    

    with methods:

    public void init()
    {
        policyComponent.bindClassBehaviour(NodeServicePolicies.OnCreateNodePolicy.QNAME, CalendarModel.TYPE_EVENT ,
                new JavaBehaviour(this, "onCreateNode"));
    
    }
    
    public void onCreateNode(ChildAssociationRef childAssocRef)
    {
    // do stuff here
    }
    

    Have a look at http://wiki.alfresco.com/wiki/Policy_Component for more details.

    0 讨论(0)
提交回复
热议问题