Kaleo workflow: Multiple notification onEntry - liferay

In my Kaleo workflow, one task have to two notification first is user-notification and second mail.
Both notification are set on Entry, in this scenario one first notification got and second is not send.
I want both notification on task entry.
My action block is like below.
<actions>
<notification>
<name>Name</name>
<description>Description</description>
<template>Mail Template</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<recipients receptionType="cc">
<roles>
<role>
<role-type>regular</role-type>
<name>Contract Management</name>
<auto-create>true</auto-create>
</role>
<role>
<role-type>regular</role-type>
<name>FSO</name>
<auto-create>true</auto-create>
</role>
<role>
<role-type>regular</role-type>
<name>Accounting</name>
<auto-create>true</auto-create>
</role>
</roles>
</recipients>
<execution-type>onEntry</execution-type>
</notification>
<notification>
<name>Name</name>
<template>You assigned new task, please check.</template>
<template-language>text</template-language>
<notification-type>user-notification</notification-type>
<execution-type>onEntry</execution-type>
</notification>
</actions>

<task>
<actions>
<notification>
<name>Name</name>
<description>Description</description>
<template>Mail Template</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<recipients receptionType="cc">
<roles>
<role>
<role-type>regular</role-type>
<name>Contract Management</name>
<auto-create>true</auto-create>
</role>
<role>
<role-type>regular</role-type>
<name>FSO</name>
<auto-create>true</auto-create>
</role>
<role>
<role-type>regular</role-type>
<name>Accounting</name>
<auto-create>true</auto-create>
</role>
</roles>
</recipients>
<execution-type>onEntry</execution-type>
</notification>
<!-- <notification>
<name>Name</name>
<template>You assigned new task, please check.</template>
<template-language>text</template-language>
<notification-type>user-notification</notification-type>
<execution-type>onEntry</execution-type>
</notification> -->
</actions>
<assignment />
<task-timers>
<task-timer>
<name>Other Notifications</name>
<delay>
<duration>1</duration>
<scale>second</scale>
</delay>
<blocking>false</blocking>
<timer-actions>
<timer-notification>
<name>Name</name>
<template>Your template</template>
<template-language>freemarker</template-language>
<notification-type>user-notification</notification-type>
</timer-notification>
</timer-actions>
</task-timer>
</task-timers>
<transitions />
</task>

Related

DocuSign API - Creating an envelope with a Document that has an Approve button

I am creating a draft envelope with a TXT document - which needs to display an Approve button to allow the signer to sign without placing a signature/initials on the document itself. Unfortunately I can't get the Approve button to show on the document, where have I gone wrong?
Here is the Request XML:
<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
<ns1:emailSubject>Test from iPaaS</ns1:emailSubject>
<ns1:documents>
<ns1:document>
<ns1:name>TestDocument</ns1:name>
<ns1:documentId>1</ns1:documentId>
<ns1:documentBase64><Base64BytesHere></ns1:documentBase64>
<ns1:fileExtension>txt</ns1:fileExtension>
</ns1:document>
</ns1:documents>
<ns1:recipients>
<ns1:signers>
<ns1:signer>
<ns1:routingOrder>1</ns1:routingOrder>
<ns1:recipientId>1</ns1:recipientId>
<ns1:name>John Smith</ns1:name>
<ns1:email>nobody#nobody.com</ns1:email>
</ns1:signer>
</ns1:signers>
</ns1:recipients>
<ns1:tabs>
<ns1:approveTabs>
<ns1:approve>
<anchorCaseSensitive />
<anchorHorizontalAlignment />
<anchorIgnoreIfNotPresent />
<anchorMatchWholeWord />
<anchorString />
<anchorUnits />
<anchorXOffset />
<anchorYOffset />
<conditionalParentLabel />
<conditionalParentValue />
<customTabId />
<documentId>1</documentId>
<mergeField />
<pageNumber>1</pageNumber>
<recipientId>1</recipientId>
<tabId />
<tabOrder />
<templateLocked />
<templateRequired />
<xPosition>100</xPosition>
<yPosition>100</yPosition>
<bold />
<font />
<fontColor />
<fontSize />
<italic />
<tabLabel />
<underline />
<buttonText />
<height>30</height>
<width>50</width>
</ns1:approve>
</ns1:approveTabs>
</ns1:tabs>
</ns1:envelopeDefinition>
Essentially I am looking for something that looks like the attached screenshot
The <tabs> node should be inside the <signer> node. The following example should work.
<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
<ns1:emailSubject>Test from iPaaS</ns1:emailSubject>
<ns1:documents>
<ns1:document>
<ns1:name>TestDocument</ns1:name>
<ns1:documentId>1</ns1:documentId>
<ns1:fileExtension>txt</ns1:fileExtension>
<ns1:documentBase64>RG9jIFRXTyBUV08gVFdP</ns1:documentBase64>
<ns1:fileExtension>txt</ns1:fileExtension>
</ns1:document>
</ns1:documents>
<ns1:recipients>
<ns1:signers>
<ns1:signer>
<ns1:routingOrder>1</ns1:routingOrder>
<ns1:recipientId>1</ns1:recipientId>
<ns1:name>John Smith</ns1:name>
<ns1:email>johnsmith#acme.com</ns1:email>
<ns1:tabs>
<ns1:approveTabs>
<ns1:approve>
<documentId>1</documentId>
<pageNumber>1</pageNumber>
<xPosition>100</xPosition>
<yPosition>100</yPosition>
<height>30</height>
<width>50</width>
</ns1:approve>
</ns1:approveTabs>
</ns1:tabs>
</ns1:signer>
</ns1:signers>
</ns1:recipients>
</ns1:envelopeDefinition>

docusign - webhook returns invalid XML?

This is what I wanted to do:
Using rest API send a document to be signed
Person signs it and webhook triggers XML containing signed document in this case PDF
What happens is in Connect log I see that API triggered webhook that is then picked up by requestb.in. In here what I see is XML is incomplete same as on my real Web service catcher procedure?
<?xml version="1.0" encoding="utf-8"?>
<DocuSignEnvelopeInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.net/API/3.0">
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>Signer</Type>
<Email>lino#xx.xxx</Email>
<UserName>Lino</UserName>
<RoutingOrder>1</RoutingOrder>
<Sent>2017-01-10T04:42:34.857</Sent>
<DeclineReason xsi:nil="true" />
<Status>Sent</Status>
<RecipientIPAddress />
<CustomFields />
<TabStatuses>
<TabStatus>
<TabType>SignHere</TabType>
<Status>Active</Status>
<XPosition>52</XPosition>
<YPosition>104</YPosition>
<TabLabel>Sign Here</TabLabel>
<TabName>SignHere</TabName>
<TabValue />
<DocumentID>1</DocumentID>
<PageNumber>1</PageNumber>
</TabStatus>
</TabStatuses>
<AccountStatus>Active</AccountStatus>
<RecipientId>d6567258-6407-4bd8-a544-c12528e32XXX</RecipientId>
</RecipientStatus>
</RecipientStatuses>
<TimeGenerated>2017-01-10T04:42:55.0381883</TimeGenerated>
<EnvelopeID>e08dcbc1-a09a-459b-9b84-5b5Xb3f335XX</EnvelopeID>
<Subject>Request a signature via email example</Subject>
<UserName>Lino</UserName>
<Email>lino#xx.xxx</Email>
<Status>Sent</Status>
<Created>2017-01-10T04:42:34.343</Created>
<Sent>2017-01-10T04:42:34.903</Sent>
<ACStatus>Original</ACStatus>
<ACStatusDate>2017-01-10T04:42:34.343</ACStatusDate>
<ACHolder>Lino</ACHolder>
<ACHolderEmail>lino#xx.xxx</ACHolderEmail>
<ACHolderLocation>DocuSign</ACHolderLocation>
<SigningLocation>Online</SigningLocation>
<SenderIPAddress>XX.XXX.XXX.XX </SenderIPAddress>
<EnvelopePDFHash />
<CustomFields />
<AutoNavigation>true</AutoNavigation>
<EnvelopeIdStamping>true</EnvelopeIdStamping>
<AuthoritativeCopy>false</AuthoritativeCopy>
<DocumentStatuses>
<DocumentStatus>
<ID>1</ID>
<Name>contract.pdf</Name>
<TemplateName />
<Sequence>1</Sequence>
</DocumentStatus>
</DocumentStatuses>
</EnvelopeStatus>
<DocumentPDFs>
<DocumentPDF>
<Name>contract.pdf</Name>
<PDFBytes>.........
But there are no closing tags or anything. This is all I get.
When I try downloading it as BLOB using base64 file it says pdf invalid or corrupted.

Check security header in Mule http:listener

I have a need to check some security HTTP header (called for example X-MyApp-Security) value before processing it after Mule http:listener. Header should be checked like basic auth header but more simply.
I found some Mule documentation about this but don't understand how to use it my simple flow:
<http:listener-config name="HTTP_Listener_Configuration" host="${httpServer.host}" port="${httpServer.port}" doc:name="HTTP Listener Configuration" />
<flow name="planadoWebhookFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP" allowedMethods="POST"/>
<set-payload value="Hello from security area!" doc:name="Set Payload"/>
</flow>
Please help me with header authentication in Mule 3.7.
You can use the "http:basic-security-filter" element, here you have an example:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp"
xmlns:db="http://www.mulesoft.org/schema/mule/db"
xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml"
xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
xmlns:json="http://www.mulesoft.org/schema/mule/json"
xmlns:ws="http://www.mulesoft.org/schema/mule/ws"
xmlns:smtps="http://www.mulesoft.org/schema/mule/smtps"
xmlns:email="http://www.mulesoft.org/schema/mule/email"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/current/mule-ftp.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/smtps http://www.mulesoft.org/schema/mule/smtps/current/mule-smtps.xsd
http://www.mulesoft.org/schema/mule/email http://www.mulesoft.org/schema/mule/email/current/mule-email.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.1/mule-spring-security.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
">
<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="user" password="password" authorities="ROLE_ADMIN" />
<ss:user name="anon" password="anon" authorities="ROLE_ANON" />
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
</spring:beans>
<mule-ss:security-manager>
<mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" />
</mule-ss:security-manager>
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9091" doc:name="HTTP Listener Configuration"/>
<flow name="testingFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/>
<logger message="Before Authentication" level="INFO" doc:name="Log Failure"/>
<http:basic-security-filter realm="mule-realm"/>
<logger message="After Authentication" level="INFO" doc:name="Log Failure"/>
</flow>
</mule>
You can find more information in the next link:
https://docs.mulesoft.com/mule-user-guide/v/3.7/http-listener-connector#authentication

How do I select which view when adding document library web part to a page in my site definition?

In my custom SharePoint 2010 site definition:
I have a custom list instance in my site definition with multiple views...
I have a page that I want to display one of the views on...
In the page's Elements.xml definition, where can I select to show either the "Correspondence" or "Accounting" views shown in the list instance's Schema.xml below?
XML has been cleaned up for simplicity of reading.
List Instance's Schema.xml
<List Title="Client Documents" Direction="none" Url="Client Documents" BaseType="1" Type="101" BrowserFileHandling="Permissive" EnableContentTypes="TRUE" DisableAttachments="TRUE" Catalog="FALSE" VersioningEnabled="TRUE" SendToLocation="|" ImageUrl="/_layouts/images/itdl.png" xmlns:ows="Microsoft SharePoint" xmlns:spctf="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>...</ContentTypes>
<Fields>...</Fields>
<Forms />
<Views>
...
<View DisplayName="CORE Client - Accounting" BaseViewID="1" Type="HTML" MobileView="TRUE" ImageUrl="/_layouts/images/dlicon.png" XslLink="main.xsl" WebPartZoneID="Main" WebPartOrder="1" Url="Forms/CORE Client Accounting.aspx" SetupPath="pages\viewpage.aspx">
<XslLink>main.xsl</XslLink>
<Query>
<Where>
<Eq>
<FieldRef Name="ContentType" />
<Value Type="Computed">Client - Accounting</Value>
</Eq>
</Where>
</Query>
<ViewFields>...</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<Aggregations Value="Off" />
</View>
<View DisplayName="CORE Client - Correspondence" BaseViewID="1" Type="HTML" MobileView="TRUE" ImageUrl="/_layouts/images/dlicon.png" XslLink="main.xsl" WebPartZoneID="Main" WebPartOrder="1" Url="Forms/CORE Client Correspondence.aspx" SetupPath="pages\viewpage.aspx">
<XslLink>main.xsl</XslLink>
<Query>
<GroupBy Collapse="TRUE" GroupLimit="30">
<FieldRef Name="Client_x0020_Correspondence_x0020_Type" />
</GroupBy>
<Where>
<Eq>
<FieldRef Name="ContentType" />
<Value Type="Computed">Client - Correspondence</Value>
</Eq>
</Where>
</Query>
<ViewFields>...</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<Aggregations Value="Off" />
</View>
...
</Views>
</MetaData>
</List>
Module's Elements.xml
<File Url="ClientDocumentsCorrespondence.aspx" Path="default.aspx" Type="GhostableInLibrary" >
<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/PLClientDocuments.aspx" />
<Property Name="Title" Value="GASOP Client Documents - Correspondence" />
<Property Name="ContentType" Value="Welcome Page" />
<AllUsersWebPart WebPartOrder="0" WebPartZoneID="zone1">...</AllUsersWebPart>
<AllUsersWebPart WebPartOrder="1" WebPartZoneID="zone1">...</AllUsersWebPart>
<View List="Client Documents"
DisplayName=""
Url=""
DefaultView="FALSE"
BaseViewID="1"
Type="HTML"
WebPartOrder="0"
WebPartZoneID="zone2"
ContentTypeID="0x"
ID="g_4d8c86ec_b324_4f6a_a2e9_ba1a36466c68"
Hidden="TRUE">
<![CDATA[<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>...</properties>
</data>
</webPart>
</webParts>]]>
</View>
</File>
its seem to on schema.xml you have creating two views but both have same BaseViewID. you must be unique BaseViewID for each view. 1 is the ID of the AllItems view(Default View).
Refer to this post: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/52e45ddd-73a8-400f-890c-323a0eaaeccb
copy-paste default view and giv unique Id of BaseViewID.
than on your Module's Elements.xml
<View List="Lists/Client Documents" BaseViewID="<<Your View Unique ID>>" DisplayName="Client Documents" Name="Client Documents" RecurrenceRowset="TRUE" WebPartZoneID="Main" WebPartOrder="0">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title">Invoice Approved</property>
<property name="AllowConnect" type="bool">True</property>
<property name="AllowClose" type="bool">False</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</View>
Please read for more details : http://blog.qumsieh.ca/2010/09/01/sharepoint-2010-schema-xml-onet-xml-and-toolbar-type/

XmlDocuments Element ignored in Content Type?

I have a content type defined in Elements.xml and I want to add an Event Receiver. My Elements.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Announcement (0x0104) -->
<ContentType ID="0x0104008a424de98660457481eb7d8ddb5161ee"
Name="News Posting"
Group="News"
Description="$Resources:NewsCTypeDescription"
Inherits="TRUE"
Version="1"
Sealed="TRUE"
>
<FieldRefs>
<FieldRef ID="{7EBC5918-CB79-440A-8DF3-480C6951C4EB}" Name="NewsExcerpt"/>
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
<spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
<Receiver>
<Name>ItemAdded</Name>
<Type>ItemAdded</Type>
<Class>MyAssembly.NewsItemEventReceiver</Class>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<SequenceNumber>10000</SequenceNumber>
<Synchronization>Synchronous</Synchronization>
<Data />
<Filter />
</Receiver>
</spe:Receivers>
</XmlDocument>
</XmlDocuments>
</ContentType>
</Elements>
The weird thing is that the Event Receiver never executes. I've checked the Schema with SharePoint Manager 2010, and it seems that the XmlDocuments element is ignored completely?
Here's the content type SchemaXml according to SharePoint Manager:
<?xml version="1.0" encoding="utf-16"?>
<ContentType ID="0x0104008A424DE98660457481EB7D8DDB5161EE" Name="News Posting" Group="News" Description="A News Posting" Sealed="TRUE" Version="1">
<Folder TargetName="_cts/News Posting" />
<Fields>
<Field ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" Name="ContentType" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="ContentType" Group="_Hidden" Type="Computed" DisplayName="Content Type" Sealed="TRUE" Sortable="FALSE" RenderXMLUsingPattern="TRUE" PITarget="MicrosoftWindowsSharePointServices" PIAttribute="ContentTypeID" Customization="">
<FieldRefs>
<FieldRef ID="{03e45e84-1992-4d42-9116-26f756012634}" Name="ContentTypeId" />
</FieldRefs>
<DisplayPattern>
<MapToContentType>
<Column Name="ContentTypeId" />
</MapToContentType>
</DisplayPattern>
</Field>
<Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" Group="_Hidden" Type="Text" DisplayName="Title" Required="TRUE" FromBaseType="TRUE" Customization="" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
<Field ID="{7662cd2c-f069-4dba-9e35-082cf976e170}" Name="Body" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Body" Group="_Hidden" Type="Note" RichText="TRUE" RichTextMode="FullHtml" IsolateStyles="TRUE" DisplayName="Body" Sortable="FALSE" NumLines="15" Customization="" />
<Field ID="{6a09e75b-8d17-4698-94a8-371eda1af1ac}" Name="Expires" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Expires" Group="_Hidden" Type="DateTime" DisplayName="Expires" Format="DateOnly" Customization="" />
<Field ID="{7EBC5918-CB79-440A-8DF3-480C6951C4EB}" Group="News" Name="NewsExcerpt" DisplayName="Excerpt of the Article" Description="165 Characters maximum" MaxLength="165" Type="Text" Customization="" />
</Field>
</Fields>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<Display>ListForm</Display>
<Edit>ListForm</Edit>
<New>ListForm</New>
</FormTemplates>
</XmlDocument>
</XmlDocuments>
</ContentType>
I have tried adding a FormTemplates XmlDocument as well, just to see if that works, but even this is ignored (I've changed the ListForm to ListForm2, but the SchemaXml is unchanged.
I've deleted the entire Web Application and Content Database to make sure there was nothing stale/stuck, but the result is still the same.
Is XmlDocuments depreciated in SharePoint 2010? What are the alternatives?
You should add your event receiver as a feature, maybe even as a part of the same feature that installs the content type. We always do it this way and it works perfectly

Resources