cancel
Showing results for 
Search instead for 
Did you mean: 

adding custom metadata attributes

meetmrharish
Champ on-the-rise
Champ on-the-rise
Hi

Is there any process to add a cstom attribute to the metadata of a document or webpage?
(just like title, description,etc., i need to add more attributes).

Regards,
Harish
6 REPLIES 6

meetmrharish
Champ on-the-rise
Champ on-the-rise
bringing to the top

jack_jin
Champ in-the-making
Champ in-the-making
Since AVM doesn't like you to have other object types other than wcm:avmplaincontent (I believe this is true in alfresco 3.0b and c), we added properties and aspects directly into the wcmModel.xml (it's in tomcat\webapps\alfresco\WEB-INF\classes\alfresco\model)

So our avmplaincontent looks something like


        <type name="wcm:avmplaincontent">
            <title>AVM Plain content</title>
            <parent>wcm:avmcontent</parent>

            <properties>
                <property name="wcm:dateAuthored">
                    <type>d:date</type>
                </property>
                <property name="wcm:filename">
                    <type>d:text</type>
                </property>
                <property name="wcm:type">
                    <type>d:text</type>
                </property>
                <property name="wcm:locale">
                    <type>d:text</type>
                    <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>false</tokenised>
                    </index>
                </property>
            </properties>


            <mandatory-aspects>
                <aspect>wcm:virtualURL</aspect>
            </mandatory-aspects>

        </type>

Hopefully this will help

meetmrharish
Champ on-the-rise
Champ on-the-rise
When you have added the custom attributes, does the change reflect to the whole alfresco in the system (or) can we limit the custom attributes scope only to a particular webproject

jack_jin
Champ in-the-making
Champ in-the-making
It's to the whole environment.  Although it might only apply to new objects, this I'm not sure about.

If you want to have certain attributes to certain situations, you can use aspects!


        <aspect name="wcm:displayable">
            <properties>
                <property name="wcm:showInLeftNav">
                    <type>d:boolean</type>
                </property>
                <property name="wcm:showOnSiteMap">
                    <type>d:boolean</type>
                </property>

            </properties>
        </aspect>

Attaching the aspect above to a particular object would enable the object to use the properties wcm:showInLeftNav and wcm:showOnSiteMap

Hopefully it helps

meetmrharish
Champ on-the-rise
Champ on-the-rise
Thanx for the reply Jack.

Here, when I am creating new custom attributes for a document, the new attributes are getting reflected everywhere except the webproject. In the webProject, when Iam creating a new content, it is not asking to fill any of the custom attributes. But, if the create a new content in any space otherthan webproject, the custom attributes are getting displayed. But whynot in webProject???

Regards
Harish

jack_jin
Champ in-the-making
Champ in-the-making
No problem!

I hope I'm understanding you correctly - you can't edit the properties after adding the aspect to a piece of content.

I have always added aspects in webscripts, and used the properties in aspect in webscripts.  I'm not sure how do you bring it up to Alfresco front end…  My guess would be one of the files in alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco.

Anyone else happen to know how to expose additional properties to the front end?