cancel
Showing results for 
Search instead for 
Did you mean: 

tried to create library content model

hdalang
Champ in-the-making
Champ in-the-making
I tried to create library content model but it's showing in create content list, I want to know where is my problem. could you please fix the problem by sharing the code and explain where is my mistake?

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



libraryModel.xml


<?xml version="1.0" encoding="UTF-8"?>
<model name="lib:library" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>IUA Library</description>
<author>Hisham Khartoum</author>
<version>1.0</version>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>
   <namespaces>
      <namespace uri="http://www.iua-library.com/model/content/1.0" prefix="lib"/>
   </namespaces>
   <constraints>
      <constraint name="lib:BookLanguage" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Arabic</value>
               <value>English</value>
               <value>Frensh</value>
            </list>
         </parameter>
         <parameter name="caseSensitive">
            <value>false</value>
         </parameter>
      </constraint>
      <constraint name="lib:LibraryBuilding" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Main Library</value>
               <value>Engineering College</value>
               <value>Medicine College</value>
               <value>Computer College</value>
            </list>
         </parameter>
         <parameter name="caseSensitive">
            <value>false</value>
         </parameter>
      </constraint>
      <constraint name="lib:BookPlace" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>First Board</value>
               <value>Second Board</value>
               <value>Third Board</value>
               <value>Forth Board</value>
            </list>
         </parameter>
         <parameter name="caseSensitive">
            <value>false</value>
         </parameter>
      </constraint>
   </constraints>
   <types>
      <type name="lib:library-book">
      <parent>cm:content</parent>
         <properties>
            <property name="lib:publisher">
               <title>Publisher</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="lib:pages">
               <title>Pages</title>
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>
            <property name="lib:Language">
               <title>Language</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="lib:BookLanguage" />
               </constraints>
            </property>
            <property name="lib:place">
               <title>Place</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="lib:BookPlace" />
               </constraints>
            </property>
            <property name="lib:building">
               <title>Building</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="lib:LibraryBuilding" />
               </constraints>
            </property>
<!–
            <property name="lib:price">
               <title>Price</title>
               <type>d:double</type>
               <mandatory>true</mandatory>
            </property>
–>
         </properties>
      </type>
   </types>
</model>



web-client-config-custom.xml

<code>
<alfresco-config>

   <!– Custom Content Type Settings –>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="iabookSmiley Tongueroduct"/>
      </content-types>
   </config>
   <config evaluator="node-type" condition="iabookSmiley Tongueroduct">
      <property-sheet>
         <show-property name="name" />
         <show-property name="mimetype" display-label-id="content_type" component-generator="MimeTypeSelectorGenerator" />
         <show-property name="encoding" display-label-id="encoding" ignore-if-missing="false" component-generator="CharsetSelectorGenerator" />
         <show-property name="size" display-label-id="size" converter="org.alfresco.faces.ByteSizeConverter" show-in-edit-mode="false" />
         <show-property name="title" display-label-id="title" ignore-if-missing="false" />
         <show-property name="description" display-label-id="description" ignore-if-missing="false" component-generator="MultilingualTextAreaGenerator" />
         <show-property name="iabook:sku" />
         <show-property name="iabook:manufacturer" />
         <show-property name="iabook:color" />
         <show-property name="iabook:brand" />
         <show-property name="iabook:unitPrice" />
         <show-property name="iabook:displayUntil" />
         <show-property name="iabook:competitorProducts" />
         <show-property name="iabook:competitorDetails" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="lib:library-book"/>
      </content-types>
   </config>
   <config evaluator="node-type" condition="lib:library-book">
      <property-sheet>
         <show-property name="name" />
         <show-property name="mimetype" display-label-id="content_type" component-generator="MimeTypeSelectorGenerator" />
         <show-property name="title" display-label-id="title" ignore-if-missing="false" />
         <show-property name="description" display-label-id="description" ignore-if-missing="false" component-generator="MultilingualTextAreaGenerator" />
         <show-property name="libSmiley Tongueublisher" />
         <show-property name="libSmiley Tongueages" />
         <show-property name="lib:Language" />
         <show-property name="libSmiley Tonguelace" />
         <show-property name="lib:building" />
      </property-sheet>
   </config>
</alfresco-config>

</code
3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator
Where did you place those files? you should place all of them (library-context.xml,libraryModel.xml,web-client-config-custom.xml)under classpath:alfresco/extension.
And the configuration will only work on web client,not share.

hdalang
Champ in-the-making
Champ in-the-making
I did fix the problem and it's being fixed, cause I was using the same bean id which cause the problem:
   <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">

I was using extension.dictionaryBootstap then I add library.extension.dictionaryBootstap

kaynezhang
World-Class Innovator
World-Class Innovator
Ok good luck.