<?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: javascript - copy content problem in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83653#M56209</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried using the "specializeType()" method you've suggested on my custom type (which inherits from "cm:content" type).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've done this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;changeFile = document.copy(currentFolder);&lt;BR /&gt;var typeChanged = changeFile.specializeType("cm:content");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;i've also tried this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var typeChanged = changeFile.specializeType("{&lt;A href="http://www.alfresco.org/model/content/1.0}content" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}content&lt;/A&gt;");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;* the document that i copy is, of course, a custom-type content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;after running this java script, there is no change in the type of the copied content (&lt;/SPAN&gt;&lt;STRONG&gt;typeChanged = false&lt;/STRONG&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; :? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;am i doing anything wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dror&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2007 11:18:25 GMT</pubDate>
    <dc:creator>friedman30</dc:creator>
    <dc:date>2007-08-22T11:18:25Z</dc:date>
    <item>
      <title>javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83651#M56207</link>
      <description>hi,I've added some custom types to alfresco. one of them is 'Image' which adds some properties to to the regular 'Content' props.I need to make a copy of that image (which is an 'Image' type) using javascript API.I am using the copy method :document.copy(currentFolder);‍which works great - with one</description>
      <pubDate>Sun, 12 Aug 2007 15:19:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83651#M56207</guid>
      <dc:creator>friedman30</dc:creator>
      <dc:date>2007-08-12T15:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83652#M56208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The JavaScript API supports modification of the object type and setting of various properties and aspects. You can either "specializeType()" the type using that API call and clear the properties you don't want or you can try creating a new object of the desired type (again all the APIs are there - see the examples) and then setting the content property of the destination object to a copy of the source object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2007 09:41:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83652#M56208</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-08-17T09:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83653#M56209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried using the "specializeType()" method you've suggested on my custom type (which inherits from "cm:content" type).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've done this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;changeFile = document.copy(currentFolder);&lt;BR /&gt;var typeChanged = changeFile.specializeType("cm:content");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;i've also tried this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var typeChanged = changeFile.specializeType("{&lt;A href="http://www.alfresco.org/model/content/1.0}content" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}content&lt;/A&gt;");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;* the document that i copy is, of course, a custom-type content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;after running this java script, there is no change in the type of the copied content (&lt;/SPAN&gt;&lt;STRONG&gt;typeChanged = false&lt;/STRONG&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; :? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;am i doing anything wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dror&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2007 11:18:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83653#M56209</guid>
      <dc:creator>friedman30</dc:creator>
      <dc:date>2007-08-22T11:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83654#M56210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I looked deeper into "specializeType" method and found that since it uses &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"isSubClass" i will always get false. (since i want to convert a type to its parent's class type).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;public boolean specializeType(String type) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ParameterCheck.mandatoryString("Type", type);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QName qnameType = createQName(type);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (getType().equals(qnameType) == false &amp;amp;&amp;amp; this.services.getDictionaryService().isSubClass(qnameType, getType()) == true) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.nodeService.setType(this.nodeRef, qnameType);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.type = qnameType;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to bypass this ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; :?: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dror&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2007 12:05:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83654#M56210</guid>
      <dc:creator>friedman30</dc:creator>
      <dc:date>2007-08-22T12:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83655#M56211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No at the moment i don't think there is. I'm not sure what the implication of converting a node from a type to a non-specialised type i.e. not a related type or one that has a sub-set of the properties - i'll try and find out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 08:36:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83655#M56211</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-08-23T08:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83656#M56212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks Kevin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to convert the copy of a specific content to another type since in my application i query by type and i don't want to get duplicated results just because i have a copy of a content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the copy is used to create a thumbnail for every image in the CMS, and if it'll be of the same type it will return in the query as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is why i must convert that copy to a basic type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hope i made it clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;:roll: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dror&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 11:13:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83656#M56212</guid>
      <dc:creator>friedman30</dc:creator>
      <dc:date>2007-08-23T11:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83657#M56213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The JavaScript API supports modification of the object type and setting of various properties and aspects. You can either "specializeType()" the type using that API call and clear the properties you don't want or you can try creating a new object of the desired type (again all the APIs are there - see the examples) and then setting the content property of the destination object to a copy of the source object.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I try to set the content property of the destination object to a copy of the source object using xxx.content = document.content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For images, Binary thats does not work. Any other way to do that?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 13:48:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83657#M56213</guid>
      <dc:creator>itayh</dc:creator>
      <dc:date>2007-09-04T13:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83658#M56214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One more Q,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I notice the write function in java script API. The wiki say:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;write(ScriptContent content)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Copy the content from the specified ScriptContent (sorry, available from 2.1 Enterprise onwards).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Does the 2.1 Enterprise version is different from 2.1 Community version?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Itay&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 05:51:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83658#M56214</guid>
      <dc:creator>itayh</dc:creator>
      <dc:date>2007-09-05T05:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: javascript - copy content problem</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83659#M56215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This function only made it in after 2.1 Community release - however it has already been merged into the community HEAD code stream so is available in public SVN or a nightly build download.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 11:06:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/javascript-copy-content-problem/m-p/83659#M56215</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-09-10T11:06:42Z</dc:date>
    </item>
  </channel>
</rss>

