<?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: How to Reset the type of node using Javascript API? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211704#M164834</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please forgive me for butting in on this thread.&amp;nbsp;&amp;nbsp; However I would have thought that wanting to change the "type" of a node indicates something slightly wrong with your data modeling.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I can understand why you would want to specialise from cm:content to cm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ublish but not vice-versa.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you do need to frequently change type then I suspect that what you should be doing instead is adding and removing aspects rather than changing the "type".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Aug 2010 08:36:44 GMT</pubDate>
    <dc:creator>mrogers</dc:creator>
    <dc:date>2010-08-20T08:36:44Z</dc:date>
    <item>
      <title>How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211699#M164829</link>
      <description>Hi,Can any one knows how to reset a node in alfresco using javascript API.I want to change the node type to "cm:content" or any other type.Currently i am trying to delete the mandatory aspect associated with that node and getting integrity error.Please help…error2010-08-19 20:07:37,485 (IntegrityChe</description>
      <pubDate>Thu, 19 Aug 2010 14:51:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211699#M164829</guid>
      <dc:creator>anujs86</dc:creator>
      <dc:date>2010-08-19T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211700#M164830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Because it is _Mandatory_ it can not be removed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nor can you "change" the type, but you can specialize the type….meaning that you can move to a type that inherits from the content type that is currently being used by the content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jared&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 05:44:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211700#M164830</guid>
      <dc:creator>jottley</dc:creator>
      <dc:date>2010-08-20T05:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211701#M164831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Suppose if my node type is "cm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ublish" which inherits from "cm:content" and i want to specialize it to "cm:content", can i do it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, i saw, there is method available in NodeService Alfresco API &lt;/SPAN&gt;&lt;STRONG&gt;setType(NodeRef nodeRef, QName typeQName)&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;which&amp;nbsp; Re-sets the type of the node.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no method in Javascript API for it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anuj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 05:59:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211701#M164831</guid>
      <dc:creator>anujs86</dc:creator>
      <dc:date>2010-08-20T05:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211702#M164832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You've got to make sure you understand what happens if you call that Java code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;* Re-sets the type of the node.&amp;nbsp; Can be called in order specialise a node to a sub-type.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * This should be used with caution since calling it changes the type of the node and thus&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * implies a different set of aspects, properties and associations.&amp;nbsp; It is the calling codes&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * responsibility to ensure that the node is in a approriate state after changing the type.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;The javascript implementation of specializeType enforces this:&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;&amp;nbsp;&amp;nbsp; public boolean specializeType(String type)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QName qnameType = createQName(type);&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; // Ensure that we are performing a specialise&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (getQNameType().equals(qnameType) == false &amp;amp;&amp;amp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.services.getDictionaryService().isSubClass(qnameType, getQNameType()) == 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Specialise the type of the node&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; &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;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;/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;BR /&gt;&lt;SPAN&gt;Moving content up the inherited type chain is a dangerous thing…it _will_ most likely break content integrity.&amp;nbsp; That is why you will not find the ability to change the type in the UI or in the JavaScript API only to specialize the type.&amp;nbsp; If you use the Java API, you are responsible for ensuring the integrity is maintained.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jared&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 07:06:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211702#M164832</guid>
      <dc:creator>jottley</dc:creator>
      <dc:date>2010-08-20T07:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211703#M164833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jared !&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think i will need to find other way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anuj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 07:43:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211703#M164833</guid>
      <dc:creator>anujs86</dc:creator>
      <dc:date>2010-08-20T07:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211704#M164834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please forgive me for butting in on this thread.&amp;nbsp;&amp;nbsp; However I would have thought that wanting to change the "type" of a node indicates something slightly wrong with your data modeling.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I can understand why you would want to specialise from cm:content to cm&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ublish but not vice-versa.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you do need to frequently change type then I suspect that what you should be doing instead is adding and removing aspects rather than changing the "type".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 08:36:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211704#M164834</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2010-08-20T08:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211705#M164835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes i agree with you roger.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the thing is we cannot change our content model now and as per my requirement we need to remove the mandatory aspect applied to that content type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The option i figured out is to delete the existing content and create a new same type of content of type cm:content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any other better way of doing it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anuj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 09:46:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211705#M164835</guid>
      <dc:creator>anujs86</dc:creator>
      <dc:date>2010-08-20T09:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211706#M164836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you change your model to make the aspect optional rather than mandatory?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 10:01:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211706#M164836</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2010-08-20T10:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Reset the type of node using Javascript API?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211707#M164837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes we have tried changing the model, but still same problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2010 08:20:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-reset-the-type-of-node-using-javascript-api/m-p/211707#M164837</guid>
      <dc:creator>anujs86</dc:creator>
      <dc:date>2010-08-25T08:20:04Z</dc:date>
    </item>
  </channel>
</rss>

