AnsweredAssumed Answered

Alfresco Custom Aspects

Question asked by narithota on Jan 11, 2013
Latest reply on Sep 30, 2013 by tytanix
HI Team,

I need to upload the documents with custom metadata. I am using Open CMIS API to work with Alfresco. So I tried to upload a new custom model of aspects.

Following are three files :

MyModel.properties :

my_model.description=MyModel

MYMOdel-Context.xml :

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
    <bean id="example.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/MyModel.xml</value>
            </list>
        </property>
        <property name="labels">
            <list>
                <value>alfresco/extension/MyModel</value>
            </list>
        </property>
    </bean>
</beans>

MyModel.xml :

<?xml version="1.0" encoding="UTF-8"?>
<model name="my:example" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <description>Sample Model</description>
    <author>jordiv</author>
    <version>1.0</version>
    <imports>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
    </imports>
    <namespaces>
        <namespace uri="http://www.jordiv.com/model/content/1.0" prefix="my"/>
    </namespaces>
    <aspects>
        <aspect name="my:docProps">
            <title>GB Aspects</title>
            <properties>
                <property name="my:projectId">
                    <title>Project ID</title>
                    <type>d:text</type>
                </property>
                <property name="my:questionId">
                    <title>Question ID</title>
                    <type>d:text</type>
                </property>
            <property name="my:uploadedBy">
                    <title>Uploaded By</title>
                    <type>d:text</type>
                </property>
            </properties>
        </aspect>
    </aspects>
</model>


I place above three files in tomcat\shared\classes\alfresco\extension directory.

and I edited the web-client-config-custom.xml as:

<alfresco-config>
     <config evaluator="aspect-name" condition="my:docProps">
         <property-sheet>
             <show-property name="my:projectId"/>
             <show-property name="my:questionId"/>
          <show-property name="my:uploadedBy"/>
        </property-sheet>
    </config>
    <config evaluator="string-compare" condition="Action Wizards">
        <aspects>
            <aspect name="my:docProps" />
        </aspects>
    </config>
</alfresco-config>

After these steps I stopped and started the alfresco service but unfortunately service is not starting.

With out these files service is starting successfully.

I checked alfresco logs,but there is no relevant information.

Please tell me where I am doing wrong things.

Thanks
Naresh

Outcomes