AnsweredAssumed Answered

Custom space template (lab 3)

Question asked by mridoni on Sep 22, 2008
First of all: I'm a real Alfresco newbie, so please forgive (and correct) me if I use the wrong terminology somewhere. I'm trying to create a custom space type and I'm having some difficulties in doing so. What I want to accomplish is to have a template/space type which should allow me to input, in addition to a tile and description, several custom properties; each space of this new type is supposed to be a folder where documentation related to a project is stored, while the folder itself should have metadata like budget approval date, etc.

I used the info I found in several forum posts and came up with two files:

mymodel-custom.xml


<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <!– Imports are required to allow references to definitions in other models –>
   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>
   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="extension.custom" prefix="custom" />
   </namespaces>
   <types>
      <!– Definition of new Content Type: Standard Operating Procedure –>
      <type name="custom:projectSpace">
         <title>ProjectSpace</title>
         <parent>cm:folder</parent>
         <properties>
            <property name="custom:Solution">
               <type>d:text</type>
               <constraints>
                  <constraint type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>Alfresco</value>
                           <value>Documentum</value>
                        </list>
                     </parameter>
                     <parameter name="caseSensitive">
                        <value>true</value>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
         </properties>
         <associations>
            <association name="custom:PM">
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
         </associations>
      </type>
   </types>
</model>

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="custom.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
      <property name="models">
         <list>
            <value>alfresco/extension/mymodel-custom.xml</value>
         </list>
      </property>
   </bean>
</beans>

which I put into the classes/alfresco/extension folder together with a third file, web-client-config-custom.xml


<config evaluator="node-type" condition="custom:projectSpace">
        <property-sheet>
                <show-property name="custom:Solution" />
                <show-association name="custom:PM" show-in-edit-mode="true" show-in-view-mode="true" />
        </property-sheet>
</config>

The files are apparently read and parsed successfully (I put in some malformed XML to test this, then I reverted it) but I can't find my custom space anywhere in the Data Dictionary in the web client. I also followed the suggestion at http://wiki.alfresco.com/wiki/Displaying_Custom_Metadata#Creating_Custom_Space_Types_in_the_Web_Client but to no extent.

I'm sure I'm doing something wrong, but I don't know if the fact that I'm using Labs 3b could be an issue.

Thanks for your help

Marco Ridoni

Outcomes