<?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: Accessing Aspects with JavaScript in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107363#M75194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The aspects property just returns the names of the aspects applied to the node.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can retrieve properties (defined by an aspect) using the standard doc.properties collection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. reviewer = document.properties["custom:Reviewers"];&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2007 14:52:02 GMT</pubDate>
    <dc:creator>davidc</dc:creator>
    <dc:date>2007-08-07T14:52:02Z</dc:date>
    <item>
      <title>Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107360#M75191</link>
      <description>I have a custom aspect defined as follows:&amp;nbsp;&amp;nbsp; &amp;lt;aspects&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;aspect name="custom:Reviewers"&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Reviewers&amp;lt;/title&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;properties&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="custom:Reviewer1"&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Reviewer1&amp;lt;/title&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ty</description>
      <pubDate>Tue, 07 Aug 2007 00:16:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107360#M75191</guid>
      <dc:creator>slothrop</dc:creator>
      <dc:date>2007-08-07T00:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107361#M75192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you using Alfresco 2.1?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2007 10:15:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107361#M75192</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-08-07T10:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107362#M75193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Are you using Alfresco 2.1?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like document.aspects returns a Java HashSet but the objects returned by an iterator do not have the properties defined in the aspect, Reviewers.&amp;nbsp; There is no such thing as casting in JavaScript, right?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2007 13:43:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107362#M75193</guid>
      <dc:creator>slothrop</dc:creator>
      <dc:date>2007-08-07T13:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107363#M75194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The aspects property just returns the names of the aspects applied to the node.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can retrieve properties (defined by an aspect) using the standard doc.properties collection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. reviewer = document.properties["custom:Reviewers"];&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2007 14:52:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107363#M75194</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-08-07T14:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107364#M75195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;document.properties["custom:Reviewers"] returns null even though "if(document.hasAspect("custom:Reviewers"))" returns true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;document.properties returns an array of length 17.&amp;nbsp; When I step through the array:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var propertyAccumulator;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for(i=0; i&amp;lt;l; i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = new String(document.properties&lt;/SPAN&gt;&lt;EM&gt;);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(s != null &amp;amp;&amp;amp; s.indexOf("Reviewer") &amp;gt;= 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name = s;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;propertyAccumulator = propertyAccumulator + " " + s;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;where l = document.properties.length, s is always null.&amp;nbsp; If instead of s = new String(document.properties&lt;EM&gt;) I do s = document.properties&lt;EM&gt;.toString() I get an error that says "can't call method toString() on null," of course (just trying to cover all bases here).&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2007 16:48:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107364#M75195</guid>
      <dc:creator>slothrop</dc:creator>
      <dc:date>2007-08-07T16:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107365#M75196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After trying everything I can think of, I am forced to conclude that document aspects cannot be accessed by JavaScript.&amp;nbsp; This includes not just custom aspects but also the Alfresco-defined aspects like inlineeditable, copiedfrom, etc.&amp;nbsp; I have tried every variation of document.properties["custom:Reviewers"] that I can imagine.&amp;nbsp; I can access Alfresco-defined properties like name, creator, title, etc but no others.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 00:08:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107365#M75196</guid>
      <dc:creator>slothrop</dc:creator>
      <dc:date>2007-08-09T00:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107366#M75197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Let me try here.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 10:23:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107366#M75197</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-08-10T10:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107367#M75198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Document aspect properties can be get &amp;amp; set with Javascript - I've just tested - it's working fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although the aspect may be applied, it's possible the property has not been set.&amp;nbsp; You can inspect any node in the repository using the node browser (&lt;/SPAN&gt;&lt;A href="http://localhost:8080/alfresco/faces/jsp/admin/store-browser.jsp" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/faces/jsp/admin/store-browser.jsp&lt;/A&gt;&lt;SPAN&gt;) - take a look at your node in question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the content model you can assign a default value to any property - if you do, the property is set on the node at creation time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 13:27:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107367#M75198</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-08-10T13:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107368#M75199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know if the property (which property?) has been set.&amp;nbsp; What I know is that "Company Home &amp;gt; Pending Publication &amp;gt; Submissions" space has a content rule that adds the custom aspect "Reviewers" added to incoming documents.&amp;nbsp; I can open up the Details page on the documents and add values for the 3 properties of the Reviewers aspect, Reviewer1, Reviewer2 and Reviewer3.&amp;nbsp; This aspect and its property values persist when the document is copied or moved into other spaces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have defined a content rule for the "Company Home &amp;gt; Pending Publication &amp;gt; Submissions &amp;gt; In Progress &amp;gt; Under Review" space that is applied to incoming documents that have the Reviewers aspect.&amp;nbsp; This rule executes a JavaScript file.&amp;nbsp; However, when I copy a document which has the "Reviewers" aspect and has had values entered for the Reviewer1, Reviewer2 and Reviewer3 properties into the "Under Review" space, in this JavaScript code even though document.hasAspect("custom.Reviewers") returns true, document.properties["custom:Reviewers"] returns null and document.aspects["custom:Reviewers"] is undefined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I need to set the property, how do I do it?&amp;nbsp; The Node Browser has been of no help.&amp;nbsp; Its results are pretty much meaningless to me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 23:59:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107368#M75199</guid>
      <dc:creator>slothrop</dc:creator>
      <dc:date>2007-08-10T23:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107369#M75200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I don't know if the property (which property?) has been set.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;The property you're trying to access!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What are the names of your properties?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;custom:Reviewer1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;custom:Reviewer2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;custom:Reviewer3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;document.properties["custom:Reviewer1"] &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;document.properties["custom:Reviewer2"] &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;document.properties["custom:Reviewer3"]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 10:52:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107369#M75200</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-08-13T10:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Aspects with JavaScript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107370#M75201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This worked!&amp;nbsp; It's hard to believe that I haven't tried that before.&amp;nbsp; But it worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your assistance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 16:38:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-aspects-with-javascript/m-p/107370#M75201</guid>
      <dc:creator>slothrop</dc:creator>
      <dc:date>2007-08-13T16:38:16Z</dc:date>
    </item>
  </channel>
</rss>

