cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Custom Aspects

narithota
Champ in-the-making
Champ in-the-making
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
6 REPLIES 6

jpotts
World-Class Innovator
World-Class Innovator
It is hard to troubleshoot this without error messages. Your files look right at a quick glance. It is unlikely that your server is simply refusing to startup without telling you why. Can you check your catalina.out and provide the stack trace if it exists?

Jeff

narithota
Champ in-the-making
Champ in-the-making
I solved the problem.

Actual problem lies in web-client-config-custom.xml. Tags not closed prperly.

Thanks for the response.


Naresh

mahesh2
Champ in-the-making
Champ in-the-making
hiiiiiiii narithota,how to create custom aspects in alfresco,iam new to alfresco.

vassilisx
Champ in-the-making
Champ in-the-making
You can follow this excellent guide from Jeff Potts: http://ecmarchitect.com/images/articles/alfresco-content/content-article-2ed.pdf

If you are using Alfresco 4.2.x please bare in mind that you shouldn't use folders under /WEB-INF, as suggested in the guide. For more information see also Custom types and aspects in Alfresco 4.2.c

tytanix
Champ in-the-making
Champ in-the-making
Hello, I'm having problem with custom metadata too. I've followed the guides you've linked step by step but I can't resolve my issue.
I've modified and created my file into tomcat/shared and not in WEB-INF.
When I launch alfresco Explorer, the browser return error 404 and, if I launch alfresco Share, it says that there are problem with IMAP.
I've tryed to delete my file from EXTENTION and everything works ok.
Does anyone have any idea about how to solve this problem?
Thanks!

where did you find "web-client-config-custom.xml" file?