cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED]Custom Model error

monitloth
Champ on-the-rise
Champ on-the-rise
I followed the tutorial from the handbook to create a custom model (Customer Details). I get no errors, but the aspect is not shown, when at wizard.

web-client-config-custom.xml:

<alfresco-config>

<config evaluator="string-compare" condition="Action Wizards">
<aspects>
<aspect name="custom:CustomerDetails"/>
</aspects>
</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 –>
   <!– 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>
</alfresco-config>

custom-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/customModel.xml</value>
            </list>
        </property>
    </bean>
</beans>

customModel.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="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>
</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>
</property>
</properties>
</aspect>
</aspects>
</model>

I checked the forum.

Why don't I get the aspect?
5 REPLIES 5

lyamamot
Champ in-the-making
Champ in-the-making
Did you remember to reload the web client configuration? Log in to your Alfresco instance as admin and go to http://[your host]/alfresco/faces/jsp/admin/webclientconfig-console.jsp. Type in 'reload' and click the button.

Are you sure your content for which you are viewing the details has your aspect applied?

monitloth
Champ on-the-rise
Champ on-the-rise
I  didn't do it earlier. I get this, and it looks good:

<Built-in evaluators> —> OK
classpath:alfresco/web-client-config.xml —> OK
classpath:alfresco/web-client-config-dialogs.xml —> OK
classpath:alfresco/web-client-config-wizards.xml —> OK
classpath:alfresco/web-client-config-properties.xml —> OK
classpath:alfresco/web-client-config-navigation.xml —> OK
classpath:alfresco/web-client-config-wcm.xml —> OK
classpath:alfresco/web-client-config-actions.xml —> OK
classpath:alfresco/web-client-config-forum-actions.xml —> OK
classpath:alfresco/web-client-config-blog-actions.xml —> OK
classpath:alfresco/web-client-config-wcm-actions.xml —> OK
classpath:alfresco/web-client-config-workflow-actions.xml —> OK
classpath:alfresco/extension/web-client-config-custom.xml —> OK
workspace://SpacesStore/app:company_home/app:dictionary/app:webclient_extension/cm:web-client-config-custom.xml —> Skipped - not available
classpath:alfresco/module/org.alfresco.module.RecordsManagement/ui/web-client-custom.xml —> OK
custom-model-context.xml is not listed.

Location of files:
WEB-INF/classes/alfresco/model:
customModel.xml
custom-model-context.xml
WEB-INF/classes/alfresco/
web-client-config-custom.xml

No difference.

lyamamot
Champ in-the-making
Champ in-the-making
Sorry, I think the reloading thing only applies if you are trying to update the web client dynamically, as described in the wiki under Dynamic Models.

One oddity is that you've written alfresco/extension/customModel.xml in your custom-model-context.xml but your model file is under alfresco/model/customModel.xml, right?

monitloth
Champ on-the-rise
Champ on-the-rise
You are right!
So I changed that part to:
alfresco/model/custom-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/model/customModel.xml</value>
            </list>
        </property>
    </bean>
</beans>
Location of the other file:
alfresco/model/customModel.xml

No change. Still not getting any aspect when adding aspect to space.

Thanks.

monitloth
Champ on-the-rise
Champ on-the-rise
I used the files from the "ecmarchitect.com" website, "Working With Custom Content Types". It works now.