cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner problem with customization

miguel_martins
Champ in-the-making
Champ in-the-making
I am following a tutorial for Alfresco, called Alfresco_3_Enterprise_Content_Management_Implementation

At a certain point, testing the aspects, it tells me to change the file
custom-model-context.xml.sample
into custom-model-context.xml

Then it tells me to edit the file customModel.xml
with

<aspects>
   <!– Definition of new Content Aspect: Customer Details –>
   <aspect name="custom:CustomerDetails">
      <title>Customer Details</title>
      <properties>
          <property name="custom:CustomerName">
             <title>Customer Name</title>
                          <type>d:text</type>
                          <protected>false</protected>
                          <mandatory>false</mandatory>
                          <multiple>false</multiple>
                      </property>
                      <property name="custom:CustomerContactName">
                          <title>Customer Contact Name</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerContactPhone">
                          <title>Customer Contact Phone</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerProjectID">
                          <title>Customer Project ID</title>
                          <type>d:int</type>
                      </property>
                      <property name="custom:NewCustomer">
                          <title>New Customer</title>
                          <type>d:boolean</type>
                          <default>true</default>
                      </property>
                 </properties>
             </aspect>
        </aspects>

right before the line </model>
last, it indicates to edit the file
web-client-config-custom.xml
with

<!– Lists the custom aspect in business rules Action wizard –>
<config evaluator="string-compare" condition="Action Wizards">
   <aspects>
      <aspect name="custom:CustomerDetails"/>
   </aspects>
</config>
   <!– Displays the properties in view details page –>
   <config evaluator="aspect-name" condition="custom:CustomerDetails">
      <property-sheet>
         <separator name="sepCust1" display-label="Customer Details"
component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:CustomerName"/>
         <show-property name="custom:CustomerContactName"/>
         <show-property name="custom:CustomerContactPhone"/>
         <show-property name="custom:CustomerProjectID"/>
         <show-property name="custom:NewCustomer"/>
      </property-sheet>
   </config>



This is the error that the file alfresco.log indicates

rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 10300001 Could not import bootstrap model alfresco/extension/customModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10300001 Could not import bootstrap model alfresco/extension/customModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:151)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:69)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
   at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
   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(LifecycleSupport.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:516)
   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:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   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: 10300000 Failed to parse model
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:146)
   … 43 more
Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.alfresco.org/model/dictionary/1.0}model" end tag, found "{http://www.alfresco.org/model/dictionary/1.0}aspects" start tag (line 35, col 10)
   at org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:800)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Model_access.unmarshal()
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2773)
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2916)
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:94)
   … 44 more

If I pass on to edit the custom model context xml file, it allows alfresco to run (it crashes otherwise) and inside I can see the aspect named customerdetail. Any attempt to apply it to a file however, show a system error.
5 REPLIES 5

jarrett
Champ in-the-making
Champ in-the-making
Sounds like </model> can't be found, can you post all of customModel.xml please?

miguel_martins
Champ in-the-making
Champ in-the-making
<?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="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">



   <!– Optional meta-data about the model –>  

   <description>Custom 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="custom"/>
   

   </namespaces>


<aspects>

        </aspects>


<aspects>
   <!– Definition of new Content Aspect: Customer Details –>
   <aspect name="custom:CustomerDetails">
      <title>Customer Details</title>
      <properties>
          <property name="custom:CustomerName">
             <title>Customer Name</title>
                          <type>d:text</type>
                          <protected>false</protected>
                          <mandatory>false</mandatory>
                          <multiple>false</multiple>
                      </property>
                      <property name="custom:CustomerContactName">
                          <title>Customer Contact Name</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerContactPhone">
                          <title>Customer Contact Phone</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerProjectID">
                          <title>Customer Project ID</title>
                          <type>d:int</type>
                      </property>
                      <property name="custom:NewCustomer">
                          <title>New Customer</title>
                          <type>d:boolean</type>
                          <default>true</default>
                      </property>
                 </properties>
             </aspect>
        </aspects>


</model>

zaizi
Champ in-the-making
Champ in-the-making
Delete the empty aspect tags at line 35.

It should be

<?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="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">



   <!– Optional meta-data about the model –>  

   <description>Custom 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="custom"/>
  

   </namespaces>

<aspects>
   <!– Definition of new Content Aspect: Customer Details –>
   <aspect name="custom:CustomerDetails">
      <title>Customer Details</title>
      <properties>
          <property name="custom:CustomerName">
             <title>Customer Name</title>
                          <type>d:text</type>
                          <protected>false</protected>
                          <mandatory>false</mandatory>
                          <multiple>false</multiple>
                      </property>
                      <property name="custom:CustomerContactName">
                          <title>Customer Contact Name</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerContactPhone">
                          <title>Customer Contact Phone</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerProjectID">
                          <title>Customer Project ID</title>
                          <type>d:int</type>
                      </property>
                      <property name="custom:NewCustomer">
                          <title>New Customer</title>
                          <type>d:boolean</type>
                          <default>true</default>
                      </property>
                 </properties>
             </aspect>
        </aspects>


</model>

miguel_martins
Champ in-the-making
Champ in-the-making
Worked like a charm, thank you.

Im having a problem up ahead, when trying to create a custom content type


the web client config custom is as follows
<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>

   –>


<config evaluator="node-type" condition="custom:pressrelease">
   <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="custom:PRName" />
      <show-property name="custom:PREmail" />
      <show-property name="custom:PRPhone" />
      <show-property name="custom:PRDate" />
   </property-sheet>
</config>





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





<!– Lists the custom aspect in business rules Action wizard –>
<config evaluator="string-compare" condition="Action Wizards">
   <aspects>
      <aspect name="custom:CustomerDetails"/>
   </aspects>
<subtypes>
   <type name="custom:pressrelease"/>
</subtypes>

</config>

   <!– Displays the properties in view details page –>
   <config evaluator="aspect-name" condition="custom:CustomerDetails">
      <property-sheet>
         <separator name="sepCust1" display-label="Customer Details"
component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:CustomerName"/>
         <show-property name="custom:CustomerContactName"/>
         <show-property name="custom:CustomerContactPhone"/>
         <show-property name="custom:CustomerProjectID"/>
         <show-property name="custom:NewCustomer"/>
<show-property name="custom:ProjectLocation"/>

      </property-sheet>
   </config>






</alfresco-config>


the custom model xml is as follows
<?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="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">



   <!– Optional meta-data about the model –>  

   <description>Custom 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="custom"/>
   

   </namespaces>


  <constraints>
    <constraint name="custom:office_list" type="LIST">
          <parameter name="allowedValues">
               <list>
                   <value>California USA</value>
                   <value>New Jersey USA</value>
                   <value>London UK</value>
                   <value>Ahmedabad India</value>
                   <value>Singapore</value>
               </list>
          </parameter>
    </constraint>
    <constraint name="custom:name_length" type="LENGTH">
          <parameter name="minLength">
              <value>3</value>
          </parameter>
          <parameter name="maxLength">
              <value>20</value>
          </parameter>
    </constraint>
  </constraints>

<types>
   <!– Definition of new Content Type: Press Release –>
   <type name="custom:pressrelease">
      <title>Press Release</title>
      <parent>cm:content</parent>
      <properties>
         <property name=»custom:PRName»>
            <title>PR Person Name</title>
            <type>d:text</type>
         </property>
         <property name=»custom:PREmail»>
            <title>PR Person Email</title>
            <type>d:text</type>
         </property>
         <property name=»custom:PRPhone»>
            <title>PR Person Phone</title>
            <type>d:text</type>
         </property>
         <property name=»custom:PRDate»>
            <title>PR Released Date</title>
            <type>d:date</type>
         </property>
      </properties>
   </type>
</types>


<aspects>
<!– Definition of new Content Aspect: Customer Details –>
<aspect name="custom:CustomerDetails">
   <title>Customer Details</title>
   <properties>
      <property name="custom:CustomerName">
         <title>Customer Name</title>
         <type>d:text</type>
         <protected>false</protected>
         <mandatory>false</mandatory>
         <multiple>false</multiple>
         <constraints>
           <constraint ref="custom:name_length"/>
         </constraints>
      </property>
      <property name="custom:ProjectLocation">
         <title>Project Location</title>
         <type>d:text</type>
         <constraints>
           <constraint ref="custom:office_list"/>
         </constraints>
      </property>
      <property name="custom:CustomerContactName">
         <title>Customer Contact Name</title>
         <type>d:text</type>
      </property>
      <property name="custom:CustomerContactPhone">
         <title>Customer Contact Phone</title>
         <type>d:text</type>
      </property>
      <property name="custom:CustomerProjectID">
         <title>Customer Project ID</title>
                          <type>d:int</type>
                      </property>
                      <property name="custom:NewCustomer">
                          <title>New Customer</title>
                          <type>d:boolean</type>
                          <default>true</default>
                      </property>
                 </properties>
             </aspect>
        </aspects>
</model>

the log shows


14:32:17,693 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 11030001 Could not import bootstrap model alfresco/extension/customModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 11030001 Could not import bootstrap model alfresco/extension/customModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:151)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
How and where can you locate the errors in this? I keep going back to the log for hints but I dont think I can locate them yet. I can see that it claims to not be able to import customModel.xml but is it on line what? 151?

Thank you in advance.

miguel_martins
Champ in-the-making
Champ in-the-making
Fixed, turns out the custom model file was wrong using
»customSmiley TongueRName»
instead of
"customSmiley TongueRName"