Properties file are not recognized when dealing with custom model in share

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

Properties file are not recognized when dealing with custom model in share

Jump to solution

Hello,

                    I implemented a custom model as below

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

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

<!-- Optional meta-data about the model -->
<description>DC Custom Model</description>
<author>Techsophy</author>
<version>1.0</version>

<!-- 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" />
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>

<namespaces>
<namespace uri="http://www.DCcustommodel.com/model/content/1.0" prefix="dc" />
</namespaces>

<constraints>
<constraint name="dc:alphanumeric" type="REGEX">
<parameter name="expression">
<value>[a-zA-Z0-9]</value>
</parameter>
<parameter name='requiresMatch'><value>true</value></parameter>
</constraint>
<constraint name="dc:length" type="LENGTH">
<parameter name='minLength'><value>1</value></parameter>
<parameter name='maxLength'><value>10</value></parameter>
</constraint>
</constraints>

<types>
<!-- Enterprise-wide generic document type -->
<type name="dc:membershipDocument">
<title>Transaction Document</title>
<parent>cm:content</parent>
<properties>
<property name="dc:membershipId" >
<type>d:text</type>
<mandatory>true</mandatory>
<constraints>
<constraint ref="dc:alphanumeric" />
<constraint ref="dc:length" />
</constraints>
</property>
</properties>
</type>

<type name="dc:transactionDocument">
<title>Transaction Document</title>
<parent>cm:content</parent>
<properties>
<property name="dc:transactionId" >
<type>d:text</type>
<mandatory>true</mandatory>
<constraints>
<constraint ref="dc:alphanumeric" />
<constraint ref="dc:length" />
</constraints>
</property>
</properties>
</type>
</types>
</model>

and properties files for that model is dcModel.xml contains properties as below

#dc:membership_document
dc_DCcustommodel.type.dc_membershipDocument.title=Membership Document
dc_DCcustommodel.property.dc_membershipId.title=Membership Id

#dc:transaction_document
dc_DCcustommodel.type.dc_transactionDocument.title=Transaction Document
dc_DCcustommodel.property.dc_transactionId.title=Transaction Id

I registered that with bean in service-context.xml

<bean id="dccCustomModel_dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/module/${project.artifactId}/model/dccModel.xml</value>
</list>
</property>
</bean>

amp generation and further steps are completed successfully.

All the above are done in content-tutorial-platform-jar.

But the problem is still it is showing dc:transactionId in properties section when I changed type of file from share UI .I'm expecting Transaction Id should be shown.

When i configured model and properties  in content-tutorial-share-jar,everything is fine and i'm able to see values from properties file.

Any help will be appreciated.

Thanks 

Ajay

1 Solution

Accepted Solutions
Highlighted
Master

Re: Properties file are not recognized when dealing with custom model in share

Jump to solution

In your dictionary bootstrap you are actually not bootstrapping your model messages file. There should be another property for the messages in the Spring bean.

View solution in original post

2 Replies
Highlighted
Master

Re: Properties file are not recognized when dealing with custom model in share

Jump to solution

In your dictionary bootstrap you are actually not bootstrapping your model messages file. There should be another property for the messages in the Spring bean.

View solution in original post

Highlighted
Active Member

Re: Properties file are not recognized when dealing with custom model in share

Jump to solution

Its working now. Thank you Axel Faust