AnsweredAssumed Answered

problem in new content model

Question asked by mialfresco on Jul 29, 2009
Latest reply on Jul 30, 2009 by jayjayecl
Hi, As part of my requirement i need to create various content modesl like MOM (Minutes of meeting), Staff details etc.

For mom, i created a model named with "momModel.xml" and placed in shared\extension folder.

momModel.xml
<?xml version="1.0" encoding="UTF-8"?>

<!– Custom Model –>

<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!–       types and aspects added here will automatically be registered –>

<model name="mom:momModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>MOM Model</description>
   <author></author>
   <version>1.0</version>

   <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 –>
   <!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="custom.model" prefix="mom"/>
   </namespaces>

   <constraints>
   


   <constraint name="mom:projects_list" type="LIST">
         <parameter name="allowedValues">
              <list>
                   <value>Project 1</value>
               <value>Project 2</value>
                  <value>Project 3</value>
                  <value>Project 4</value>
                  <value>Project 5</value>
                  <value>Project 6</value>
                     <value>Project 7</value>
              </list>
         </parameter>
   </constraint>

</constraints>
  
<types>
  
<!– Definition of new Content Type: MOM –>

  <type name="custom:mom">

       <title>Minutes of Meeting</title>
         <parent>cm:content</parent>
         <properties>
            <property name="mom:ProjectName">
               <title>Project Name</title>
               <type>d:text</type>
             <constraints>
                 <constraint ref="mom:projects_list"/>
               </constraints>
           </property>
               
            <property name="mom:DateOfMeeting">
               <title>Meeting Date</title>
               <type>d:date</type>
            </property>

  </type>


</types>

   <aspects>
     
   </aspects>
        
</model>

and i created an mom-model-context.xml to load this model
mom-model-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>

    <!– Registration of new models –>   
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/momModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>

and the following is my web-client-config-custom.xml
<alfresco-config>

   <!– Example of overriding the from email address –>
   <!–
   <config>
      <client>
         <from-email-address>someone@your-domain.com</from-email-address>
         <search-max-results>100</search-max-results>
      </client>
   </config>
   –>

   <!– Example of adding languages to the list in the login page –>
   <!–
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="ca_ES">Catalan</language>
         <language locale="hr_HR">Croatian</language>
         <language locale="cs_CZ">Czech</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pl_PL">Polish</language>
         <language locale="pt_PT">Portuguese</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="sv_SV">Swedish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </config>
   –>
  
   <!– Example of configuring advanced search –>
   <!–
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         </content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </custom-properties>
      </advanced-search>
   </config>
   –>

   <!– Example of changing the sort direction for a view in the client –>
   <!–
   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction>ascending</sort-direction>
            </topic>
         </view-defaults>
      </views>
   </config>
   –>

   <!– Example of adding a custom icon to the Create Space dialog –>
   <!–
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </icons>
   </config>
   –>

   <!– The config below shows how to incorporate the example model–>
   <!– into the web client, for this to work you will need to –>
   <!– rename example-model-context.xml.sample to example-model-context.xml –>
   <!–
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="my:sop">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="my:publishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="my:processSteps" />
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </content-types>
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </custom-properties>
      </advanced-search>
   </config>
   –>





<!– English is the default language.  Add additional languages to the list in the login page –>
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
      </languages>
   </config>

<!– Example of adding a custom icon to the Create Space dialog –>
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom1" path="/images/icons/space-icon-custom1.gif" />
       <icon name="space-icon-custom2" path="/images/icons/_space-icon-custom2.gif" />
       <icon name="space-icon-custom3" path="/images/icons/space-icon-custom3.gif" />
               <icon name="space-icon-custom3" path="/images/icons/folder1.gif" />
      
      </icons>
   </config>

   <config>
      <client>
         <!– Override the from email address –>
          <from-email-address>alfresco@alfresco.com</from-email-address>

         <!– the minimum number of characters required for a valid search string –>
         <search-minimum>3</search-minimum>
        
         <!– set this value to true to enable AND text terms for simple/advanced search by default –>
         <search-and-terms>false</search-and-terms>
         
         <!– Limit search results. -1 for unlimited. –>
         <search-max-results>100</search-max-results>
      </client>    
   </config>


   <config evaluator="string-compare" condition="Content Wizards">
    
     <content-types>
         <type name="custom:mom" />
      </content-types>

   </config>

<config evaluator="node-type" condition="custom:mom">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="mom:ProjectName" />
         <show-property name="mom:DateOfMeeting" />
       

      </property-sheet>
   </config>



</alfresco-config>

but the server is throwing the following error. can anyone help me out my mistake
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'extension.dictionaryBootstrap' defined in file [C:\Alfresco\tomcat\share
d\classes\alfresco\extension\mom-model-context.xml]: Invocation of init method f
ailed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryExcepti
on: Could not import bootstrap model alfresco/extension/momModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not im
port bootstrap model alfresco/extension/momModel.xml
        at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(Dicti
onaryBootstrap.java:147)
        at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(Dictionary
Bootstrap.java:108)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:425)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:287)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
342)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
1)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)

        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:926)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:889)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492
)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443
)
        at org.apache.catalina.core.StandardService.start(StandardService.java:5
16)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710
)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to pa
rse model
        at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
        at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(Dicti
onaryBootstrap.java:142)
        … 42 more
Caused by: org.jibx.runtime.JiBXException: Error parsing document (line 72, col
10)
        at org.jibx.runtime.impl.UnmarshallingContext.isAt(UnmarshallingContext.
java:616)
        at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_jav
a_org_alfresco_repo_dictionary_m2bindingM2Property_access.isPresent()
        at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_rep
ository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_10()
        at org.alfresco.repo.dictionary.M2Class.JiBX_root_projects_repository_so
urce_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Class.java)
        at org.alfresco.repo.dictionary.M2Type.JiBX_root_projects_repository_sou
rce_java_org_alfresco_repo_dictionary_m2binding_unmarshal_2_0(M2Type.java)
        at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_jav
a_org_alfresco_repo_dictionary_m2bindingM2Type_access.unmarshal()
        at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_rep
ository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_4()
        at org.alfresco.repo.dictionary.M2Model.JiBX_root_projects_repository_so
urce_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Model.java)
        at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_jav
a_org_alfresco_repo_dictionary_m2bindingM2Model_access.unmarshal()
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshal
lingContext.java:2515)
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unmarsha
llingContext.java:2675)
        at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:94)
        … 43 more
Jul 29, 2009 11:58:07 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jul 29, 2009 11:58:08 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/alfresco] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class
reloading, using NOPLoggerRepository.
11:58:22,643  INFO  [web.site.FrameworkHelper] Successfully Initialized Web Fram
ework
11:58:30,490  INFO  [web.scripts.DeclarativeRegistry] Registered 67 Web Scripts
(+0 failed), 71 URLs
11:58:30,505  INFO  [web.scripts.AbstractRuntimeContainer] Initialised Presentat
ion Web Script Container (in 1477.7732ms)
11:59:32,874  INFO  [web.scripts.DeclarativeRegistry] Registered 101 Web Scripts
(+0 failed), 105 URLs
11:59:32,874  INFO  [web.scripts.AbstractRuntimeContainer] Initialised WebFramew
ork Web Script Container (in 62302.926ms)
11:59:33,061  INFO  [web.site.FrameworkHelper] Successfully Initialized Web Fram
ework
Jul 29, 2009 11:59:33 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 29, 2009 11:59:33 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 160792 ms


Outcomes