Friday, February 27, 2015

How to deploy a custom model into Alfresco Enterprise 5.0.0.3?

How to deploy a custom model into Alfresco Enterprise 5.0.0.3?

The below method is very useful during the alfresco development and not suggested for the production.
If you want to use it for the production, use an AMP to deploy package into alfresco war and use the 
dictionaryModelBootstrap bean to load the custom model.

* Upload the student.xml model file into Data Dictionary\Models folder in the Repository folder.

* If you look at the Is Active status, it is false.




* To make the model active, follow the below steps.

* Launch the Alfresco Enterprise Admin Console (http://IP:Port/alfresco/service/enterprise/admin/admin-systemsummary)

* Click Model and Message Console under Consoles option.




* Type the following command and execute it.
activate model student.xml

* Once it is successfully loaded, you can get the following message.
Model activated: student.xml [null]

* To verify the installed model,  type the below command and execute it.
show models

Result should be:

IsLoaded: Y , RepoVersion: 1.0 , RepoName: student.xml , ModelQName: {codingFreaks.student}studentModel , Description: Student Custom Model , Author: Muralidharan Deenathayalan , Published: null , Version: 1.0


/* Strudent model */

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

<!-- Simple Student Customer Model -->


<model name="student:studentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Student Custom Model</description>
   <author>Muralidharan Deenathayalan</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/system/1.0" prefix="sys" />
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
      <import uri="http://www.alfresco.org/model/site/1.0" prefix="st" />      
      <import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" />
   </imports>

   <namespaces>
      <namespace uri="codingFreaks.student" prefix="student" />
   </namespaces>
   
   <types>   
      <type name="student:studentFolder">
         <title>Student Folder Container</title>
         <parent>cm:folder</parent>
         <properties>
            <property name="student:StudentID">
               <title>Student Id</title>
               <type>d:text</type>
               <mandatory>true</mandatory>               
            </property>
            <property name="student:firstName">
               <title>First Name</title>
               <type>d:text</type>
               <mandatory>true</mandatory>              
            </property>
            <property name="student:lastName">
               <title>Last Name</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="student:email">
               <title>Email </title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>            
         </properties>
         
 </type>
   </types>
</model>




No comments:

Post a Comment