<?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 filing records via Web Scripts / JavaScript API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/filing-records-via-web-scripts-javascript-api/m-p/219073#M172203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having problems writing a web script that can put some content into a RM folder.&amp;nbsp; I am basing my script on the &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Web_Scripts_Examples#Upload_Script" rel="nofollow noopener noreferrer"&gt;example upload script&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; Here's a snippet from my script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; // find the appropriate record folder&lt;BR /&gt;&amp;nbsp; var filePlan = companyhome.childByNamePath("Sites/rm/documentlibrary");&lt;BR /&gt;&amp;nbsp; var recordFolder = filePlan.childByNamePath("Civilian Files/Case Files and Papers/Gilbert Competency Hearing");&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; // create document in the record folder for uploaded file&lt;BR /&gt;&amp;nbsp; record = recordFolder.createFile(filename);&lt;BR /&gt;&amp;nbsp; record.properties.content.write(content);&lt;BR /&gt;&amp;nbsp; record.properties.encoding = "UTF-8";&lt;BR /&gt;&amp;nbsp; record.properties.title = title;&lt;BR /&gt;&amp;nbsp; record.properties.description = description;&lt;BR /&gt;&amp;nbsp; record.save();&lt;BR /&gt;&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;/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;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Now, when I create a file in the record folder, RecordsManagementServiceImpl.onFileContent(..) is called by policy and the record aspects are added.&amp;nbsp; This is good.&amp;nbsp; However, when I go to view the created record in the node browser, the title and description are null.&amp;nbsp; I can't figure out how to set those in my script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I go to share and try to view the document, it bombs on the metadata form.&amp;nbsp; I guessed that some expected metadata was missing, and I found that the Share filed records have the "author" and "versionable" aspects in addition to what mine had.&amp;nbsp; So, I went to add the versionable aspect to my document by saying&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;record.addAspect("cm:versionable")&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;The effect of this is putting Alfresco into an infinite loop somewhere deep in its bowels.&amp;nbsp; If I'm "lucky" enough to use a database that does table locking, it just bombs after a timeout period.&amp;nbsp; (H2 bombs, H2 with MVCC enabled loops, PostgreSQL loops.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured that I need to add the metadata in as similar a way to Share as possible, but I'm having a lot of trouble wrapping my head around the complexities of the implementation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If Alfresco engineering reads this, please expose RM actions via the ScriptRecordsManagmentService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help would be appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Dec 2009 00:04:00 GMT</pubDate>
    <dc:creator>kgeis</dc:creator>
    <dc:date>2009-12-19T00:04:00Z</dc:date>
    <item>
      <title>filing records via Web Scripts / JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/filing-records-via-web-scripts-javascript-api/m-p/219073#M172203</link>
      <description>I'm having problems writing a web script that can put some content into a RM folder.&amp;nbsp; I am basing my script on the example upload script.&amp;nbsp; Here's a snippet from my script:&amp;nbsp; // find the appropriate record folder&amp;nbsp; var filePlan = companyhome.childByNamePath("Sites/rm/documentlibrary");&amp;nbsp; var recordFolde</description>
      <pubDate>Sat, 19 Dec 2009 00:04:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/filing-records-via-web-scripts-javascript-api/m-p/219073#M172203</guid>
      <dc:creator>kgeis</dc:creator>
      <dc:date>2009-12-19T00:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: filing records via Web Scripts / JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/filing-records-via-web-scripts-javascript-api/m-p/219074#M172204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm wondering about whether Alfresco should call the "file" action upon TRANSACTION_COMMIT after adding record folder content.&amp;nbsp; It seems like this should be done for EVERY_EVENT.&amp;nbsp; How could I possibly set the record properties if the record aspect is not added until TRANSACTION_COMMIT (which I assume is outside the context of the web script, after the web script is done executing.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Dec 2009 00:19:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/filing-records-via-web-scripts-javascript-api/m-p/219074#M172204</guid>
      <dc:creator>kgeis</dc:creator>
      <dc:date>2009-12-19T00:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: filing records via Web Scripts / JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/filing-records-via-web-scripts-javascript-api/m-p/219075#M172205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is a build in rule "Declare as record" you might be interested to have a look at. It can be applied to the folder where you upload the file to and might already do the job (and then check which other aspects are added).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Access is via the explorer client - create rule wizard.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Generally records can not have versions - you need to un-declare - re-declare them - same e.g. when filing emails with attachments - you need to spit them before declaring the file a record - otherwise you would change the file/record&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Updated) BUT- I just checked a photo record's aspects in the node browser - these show as following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Aspects&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/system/1.0}referenceable" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/system/1.0}referenceable&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/content/1.0}thumbnailed" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}thumbnailed&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/content/1.0}titled" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}titled&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/imap/1.0}flaggable" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/imap/1.0}flaggable&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/recordsmanagement/1.0}filePlanComponent" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/recordsmanagement/1.0}filePlanComponent&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/rmcustom/1.0}customSupplementalMarkingList" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/rmcustom/1.0}customSupplementalMarkingList&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/recordsmanagement/1.0}recordSearch" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/recordsmanagement/1.0}recordSearch&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/content/1.0}auditable" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}auditable&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/content/1.0}ownable" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}ownable&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/recordsmanagement/1.0}declaredRecord" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/recordsmanagement/1.0}declaredRecord&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&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;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/dod5015/1.0}digitalPhotographRecord" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/dod5015/1.0}digitalPhotographRecord&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/recordsmanagement/1.0}commonRecordDetails" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/recordsmanagement/1.0}commonRecordDetails&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/recordsmanagement/1.0}recordComponentIdentifier" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/recordsmanagement/1.0}recordComponentIdentifier&lt;/A&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;A href="http://www.alfresco.org/model/content/1.0}versionable" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}versionable&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fpp&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Dec 2009 07:19:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/filing-records-via-web-scripts-javascript-api/m-p/219075#M172205</guid>
      <dc:creator>fpp</dc:creator>
      <dc:date>2009-12-24T07:19:41Z</dc:date>
    </item>
  </channel>
</rss>

