<?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 Removing property from aspect and adding it in to direct type in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/removing-property-from-aspect-and-adding-it-in-to-direct-type/m-p/82628#M25379</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have created one custom content model. In that model I am passing one property to one aspect like this:&lt;BR /&gt;model.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;aspect name="ab:xyzAspect"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;xyz Aspect&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;property name="ab:abc"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;abc&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/property&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/aspect&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;share.properties file:&lt;BR /&gt;&lt;FONT color="#008000"&gt;aspect.model_xyzAspect=xyz Aspect&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;form.field.label.model.abc=abc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Also added below in proper tags in share-config.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;aspect name="ab:xyzAspect"/&amp;gt; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;show id="ab:abc" /&amp;gt; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;field id="ab:abc" label-id="form.field.label.ab.abc"&amp;gt;&amp;lt;/field&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;now after this I have made one document and given this aspect to it.&lt;BR /&gt;From share ui it is completely showing value with property and working fine.&lt;BR /&gt;&lt;BR /&gt;But now requirment is changed and this property is directly on type and so I have changed the model according to it.&lt;BR /&gt;like:&lt;BR /&gt;model.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type name="ab:mno"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;mno&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;parent&amp;gt;ab:abFunctions&amp;lt;/parent&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;property name="ab:abc"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;abc&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/property&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/type&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;share.properties file:&lt;BR /&gt;&lt;FONT color="#008000"&gt;type.model_mno=mno&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;form.field.label.model.abc=abc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Also added below in proper tags in share-config.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type name="ab:mno"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;show id="ab:abc" /&amp;gt; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;field id="ab:abc" label-id="form.field.label.ab.abc"&amp;gt;&amp;lt;/field&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;removed aspect from it.&lt;/P&gt;&lt;P&gt;After changing it in model I restarted my server and working fine for new documents but for the older documents its not opening edit properties field and shwoing this can not be viewed.&lt;BR /&gt;What should I do to avoid this and is it any possible solution that I can show properties for older documents?&lt;/P&gt;&lt;P&gt;Please help me in this.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Dhrumil&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 12:23:58 GMT</pubDate>
    <dc:creator>dhrumilgosaliya</dc:creator>
    <dc:date>2020-09-24T12:23:58Z</dc:date>
    <item>
      <title>Removing property from aspect and adding it in to direct type</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/removing-property-from-aspect-and-adding-it-in-to-direct-type/m-p/82628#M25379</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have created one custom content model. In that model I am passing one property to one aspect like this:&lt;BR /&gt;model.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;aspect name="ab:xyzAspect"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;xyz Aspect&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;property name="ab:abc"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;abc&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/property&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/aspect&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;share.properties file:&lt;BR /&gt;&lt;FONT color="#008000"&gt;aspect.model_xyzAspect=xyz Aspect&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;form.field.label.model.abc=abc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Also added below in proper tags in share-config.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;aspect name="ab:xyzAspect"/&amp;gt; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;show id="ab:abc" /&amp;gt; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;field id="ab:abc" label-id="form.field.label.ab.abc"&amp;gt;&amp;lt;/field&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;now after this I have made one document and given this aspect to it.&lt;BR /&gt;From share ui it is completely showing value with property and working fine.&lt;BR /&gt;&lt;BR /&gt;But now requirment is changed and this property is directly on type and so I have changed the model according to it.&lt;BR /&gt;like:&lt;BR /&gt;model.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type name="ab:mno"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;mno&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;parent&amp;gt;ab:abFunctions&amp;lt;/parent&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;property name="ab:abc"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;title&amp;gt;abc&amp;lt;/title&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/property&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/properties&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;/type&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;share.properties file:&lt;BR /&gt;&lt;FONT color="#008000"&gt;type.model_mno=mno&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;form.field.label.model.abc=abc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Also added below in proper tags in share-config.xml&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;type name="ab:mno"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;show id="ab:abc" /&amp;gt; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;&amp;lt;field id="ab:abc" label-id="form.field.label.ab.abc"&amp;gt;&amp;lt;/field&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;removed aspect from it.&lt;/P&gt;&lt;P&gt;After changing it in model I restarted my server and working fine for new documents but for the older documents its not opening edit properties field and shwoing this can not be viewed.&lt;BR /&gt;What should I do to avoid this and is it any possible solution that I can show properties for older documents?&lt;/P&gt;&lt;P&gt;Please help me in this.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Dhrumil&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 12:23:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/removing-property-from-aspect-and-adding-it-in-to-direct-type/m-p/82628#M25379</guid>
      <dc:creator>dhrumilgosaliya</dc:creator>
      <dc:date>2020-09-24T12:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing property from aspect and adding it in to direct type</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/removing-property-from-aspect-and-adding-it-in-to-direct-type/m-p/82629#M25380</link>
      <description>&lt;P&gt;As far as i know, if you move a property from aspect to type based property and remove aspect definition all together from content model, the properties on share ui won't show and fail to load the proprties due to Dictionary exception for existing nodes (if aspect was applied and property was already set). The error you are seeing is expected. For new nodes its not a problem anyway because they are created with new model change you made.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From user's point of view it doesn't matter where you keep a property. To keep the things simple i would suggest to keep the aspect as is and instead mark that aspect as a mandatory aspect on type.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;type &lt;SPAN&gt;name="ab:mno"&lt;/SPAN&gt;&amp;gt;
......
 &amp;lt;mandatory-aspects&amp;gt;
   &amp;lt;aspect&amp;gt;ab:xyzAspect&amp;lt;/aspect&amp;gt;
 &amp;lt;/mandatory-aspects&amp;gt;
&amp;lt;/type&amp;gt;	
&lt;/PRE&gt;
&lt;P&gt;If you were to remove the aspect definition for your specific use case, and if you have several nodes that holds the property and value from earlier defined aspect i.e. &lt;SPAN&gt;ab:xyzAspect and s&lt;/SPAN&gt;ince property name is same that you are moving, you have to follow this type of approach consodering you want to preserve the already set property value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1- Create a temp aspect with a temp property&lt;/P&gt;
&lt;P&gt;2- Copy property value (value from &lt;SPAN&gt;ab:abc&lt;/SPAN&gt;) from existing aspect (&lt;SPAN&gt;ab:xyzAspect&lt;/SPAN&gt;) to temp aspect's property and apply the aspect on all the existing nodes.&lt;/P&gt;
&lt;P&gt;3- Remove aspect e.g.&amp;nbsp;&lt;SPAN&gt;ab:xyzAspect from all the existing nodes&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now your previous aspect's&amp;nbsp;(ab:xyzAspect) property (ab:abc) value is preserved on a temp aspect.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;4- Update the type definition with&amp;nbsp;ab:abc as property, and remove&amp;nbsp;ab:xyzAspect definition from content model.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5- Copy the earlier saved values from temp aspect's property to newly added property (type based) on all existing nodes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;6- Remove the temp aspect from all existing nodes.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;7- Remove the temp aspect definition from content model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now&amp;nbsp;&lt;SPAN&gt;ab:abc property on type will have the values that was originally saved.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Note, you would have to write a cleanup script or use javascript-console to cleanup nodes.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 18:10:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/removing-property-from-aspect-and-adding-it-in-to-direct-type/m-p/82629#M25380</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-09-24T18:10:04Z</dc:date>
    </item>
  </channel>
</rss>

