cancel
Showing results for 
Search instead for 
Did you mean: 

apply aspect to property

sachinr_bhat
Champ in-the-making
Champ in-the-making
Hi All,

Is it possible to apply an aspect to a particular property of a content-type and not entire content-type?

Eg:BaseModel.xml

<type name="foo:baseDocument">
     <title>Base Document</title>
     <parent>cm:content</parent>
     <properties>
         <property name="foo:documentType">
                <title>document type</title>
               <type>d:text</type>
          <mandatory>false</mandatory>
          <index enabled="true">
             <atomic>false</atomic>
             <stored>false</stored>
             <tokenised>true</tokenised>
          </index>
              </property>
         <property name="foo:extraRef">
                <title>Extra Reference</title>
                <type>d:text</type>
               <mandatory>false</mandatory>
               <index enabled="true">
               <atomic>false</atomic>
               <stored>false</stored>
               <tokenised>true</tokenised>
                </index>
              </property>
I want to apply new aspect only to <foo:documentType> property and not entire content-type  <foo:baseDocument>. How to do this?

Thanks and Regards,
Sachin Bhat.
12 REPLIES 12

sachinr_bhat
Champ in-the-making
Champ in-the-making
Hi Invictus,

Thank you for your reply invictus.

You are right and I understood your 1st thing and i will control the aspects based on the circumstances.

In case of 2nd thing, why i am removing the old aspects: When i am changing from fooSmiley Tongueinv to foo:sinv i am removing pinv related aspects because those aspects metadata anyhow i am not using and may contain null values and may give problem while exporting metadata of a document.

In case of 3rd thing, while processing the document if the user wrongly selected type like foo:sinv instead of fooSmiley Tongueinv and later if he realized that one he/she can go back and change that one.

In case of 4th thing, you are right it is giving error for noderef for the document i am trying to change. For the first time it will work fine. Second time onwards when i change the value in combobox to some other type it is giving that error.  I think it is creating everytime new nodeRef(Id) and hence it is not able to find old Id. Regarding java debugger i am not using that one.

I will go through the code and fix that one sir. Thank you for your support!!

You said you have written some webscripts. I wanted to learn webscripts sir. If any good resource to learn that if you advice i will be really happy and thankful to you invictus!!!!!

Thanks and Regards,
Sachin Bhat.

invictus9
Champ in-the-making
Champ in-the-making
You said you have written some webscripts. I wanted to learn webscripts sir. If any good resource to learn that if you advice i will be really happy and thankful to you invictus!!!!!

1) Your first resource for web scripts is the wiki. Search for "web scripts". Actually, on the front page of the wiki, there is a listing under Cookbooks for "Web Scripts".

2) Web scripts provide a complete user interface on top of the Alfresco repository, for some definition of "complete". Alfresco Share use web scripts to implement much of its functionality. As such, they can be embedded in a larger framework. I have some, admittedly clunky, use with iFrames and web scripts.

3) Web scripts are used to implement web applications based on Alfresco. They use Alfresco security policies, and provide different faces depending on how you access them.

4) Study the web scripts in the repository – there are more than 300 of them.

5) Practice, practice, practice. I wrote 6 web scripts over the course of a week to do mildly different things.

sachinr_bhat
Champ in-the-making
Champ in-the-making
Thanks a lot invictus for your valuable suggestions. I will definitely read the webscript resources and practice them.

Thanks and Regards,
Sachin Bhat.