<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: script to execute on content rule - add metadata in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257284#M210414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Punted on the date - just set it to be the same as created value.&amp;nbsp; Now to figure out how to address/refer-to the custom metadata field (already setup within the RM Console).&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;//set variable to be the created value, then set values&lt;BR /&gt;var PubDate = document.properties["cm:created"];&lt;BR /&gt;document.properties["rma:originator"] = "John Q. Originator";&lt;BR /&gt;document.properties["rma:originatingOrganization"] = "SOMECO Company Ltd Inc";&lt;BR /&gt;document.properties["rma:publicationDate"] = PubDate;&lt;BR /&gt;document.save();&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 Feb 2011 04:26:26 GMT</pubDate>
    <dc:creator>gnyce</dc:creator>
    <dc:date>2011-02-06T04:26:26Z</dc:date>
    <item>
      <title>script to execute on content rule - add metadata</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257282#M210412</link>
      <description>I am attempting to write a (java)script that will execute on a content rule - specifically, to add some required metadata to a record within a Records Mgmt site.&amp;nbsp; I think I've managed to find the model definitions… in recordsModel.xml (and maybe recordsCustomModel.xml?)….rma&lt;IMG id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;riginatingOrganzationrm</description>
      <pubDate>Sat, 05 Feb 2011 17:46:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257282#M210412</guid>
      <dc:creator>gnyce</dc:creator>
      <dc:date>2011-02-05T17:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: script to execute on content rule - add metadata</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257283#M210413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, got originator and originatingOrganization working.&amp;nbsp; Currently stuck on setting the date - what format it wants, etc.&amp;nbsp; Once I get that figured out, will work on the custom metadata field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Caused by: org.alfresco.service.cmr.repository.datatype.TypeConversionException: The property value is not compatible &lt;BR /&gt;with the type defined for the property: &lt;BR /&gt;&amp;nbsp;&amp;nbsp; property: Name: {&lt;A href="http://www.alfresco.org/model/recordsmanagement/1.0}publicationDateTitle" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/recordsmanagement/1.0}publicationDateTitle&lt;/A&gt;: Publication Date&lt;BR /&gt;Description: null&lt;BR /&gt;Default Value: null&lt;BR /&gt;DataType Name: {&lt;A href="http://www.alfresco.org/model/dictionary/1.0}date" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}date&lt;/A&gt;&lt;BR /&gt;ContainerClass Name: {&lt;A href="http://www.alfresco.org/model/recordsmanagement/1.0}record" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/recordsmanagement/1.0}record&lt;/A&gt;&lt;BR /&gt;isMultiValued: false&lt;BR /&gt;isMandatory: true&lt;BR /&gt;isMandatoryEnforced: falseisProtected: false&lt;BR /&gt;isIndexed: true&lt;BR /&gt;isStoredInIndex: false&lt;BR /&gt;isIndexedAtomically: true&lt;BR /&gt;indexTokenisationMode: TRUE&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value: 2011020400:00:00&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value type: class java.lang.String&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Feb 2011 03:27:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257283#M210413</guid>
      <dc:creator>gnyce</dc:creator>
      <dc:date>2011-02-06T03:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: script to execute on content rule - add metadata</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257284#M210414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Punted on the date - just set it to be the same as created value.&amp;nbsp; Now to figure out how to address/refer-to the custom metadata field (already setup within the RM Console).&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;//set variable to be the created value, then set values&lt;BR /&gt;var PubDate = document.properties["cm:created"];&lt;BR /&gt;document.properties["rma:originator"] = "John Q. Originator";&lt;BR /&gt;document.properties["rma:originatingOrganization"] = "SOMECO Company Ltd Inc";&lt;BR /&gt;document.properties["rma:publicationDate"] = PubDate;&lt;BR /&gt;document.save();&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Feb 2011 04:26:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257284#M210414</guid>
      <dc:creator>gnyce</dc:creator>
      <dc:date>2011-02-06T04:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: script to execute on content rule - add metadata</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257285#M210415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Got it - looking at the RecordsCustomModel.xml, seemed like I could refer to the custom field by using "rmc:NameOfMyCustomField", and it worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;document.properties["rmc:MyCustomFieldNameHere"] = "Fill in field with this metadata";&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Feb 2011 05:10:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-to-execute-on-content-rule-add-metadata/m-p/257285#M210415</guid>
      <dc:creator>gnyce</dc:creator>
      <dc:date>2011-02-06T05:10:51Z</dc:date>
    </item>
  </channel>
</rss>

