AnsweredAssumed Answered

Custom Aspect types not showing in share console!

Question asked by bilalsaeed on Jul 1, 2016
Latest reply on Jul 4, 2016 by bilalsaeed
I am writing a webscript for Document Management, there I needed additional metadata of files so I used aspects to achieve such functionality. In Alfresco console custom metadata is appearing but in share console it isn't. Here what I followed the instructions so far.

Placed content-model-context.xml file in "tomcat\shared\classes\alfresco\extension". Content of the file is:


<?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="com.compname.alfresco.addon.documentManagement.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/model/contentModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>


Placed contentModel.xml file in "tomcat\shared\classes\alfresco\extension\model". Content of the file is:


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

<!– Definition of new Model –>

<!– The important part here is the name - Note: the use of the my: namespace
   which is defined further on in the document –>
<model name="ud:documentManagementCustomModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Document Management Custom Model</description>
   <author>compname</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 Alfresco System Model Definitions –>
        <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
    </imports>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect
      your own namespace –>
   <namespaces>
      <namespace uri="http://www.compname.com/model/content/1.0"
         prefix="ud" />
   </namespaces>

   <aspects>
      <aspect name="ud:documentManagementCustomFields">
         <title>UploadDoc Custom Fields</title>
         <properties>
            <property name="ud:entityName">
               <type>d:text</type>
            </property>
            <property name="ud:entityID">
               <type>d:text</type>
            </property>
            <property name="ud:caseID">
               <type>d:text</type>
            </property>
                                <property name="ud:sAuthor">
               <type>d:text</type>
            </property>
                                <property name="ud:aBranch">
               <type>d:text</type>
            </property>
                                <property name="ud:cCategory">
               <type>d:text</type>
            </property>
                                <property name="ud:cSubcategory">
               <type>d:text</type>
            </property>
            <property name="ud:documentType">
               <type>d:text</type>
            </property>
            <property name="ud:diaryNumber">
               <type>d:text</type>
            </property>
            <property name="ud:bundleID">
               <type>d:text</type>
            </property>
            <property name="ud:cmNumber">
               <type>d:text</type>
            </property>
            <property name="ud:serviceRequestID">
               <type>d:text</type>
            </property>
            <property name="ud:documentManagementCustomFieldOne">
               <type>d:text</type>
            </property>
            <property name="ud:documentManagementCustomFieldTwo">
               <type>d:text</type>
            </property>
            <property name="ud:documentManagementCustomFieldThree">
               <type>d:text</type>
            </property>
            <property name="ud:documentManagementCustomFieldFour">
               <type>d:text</type>
            </property>
            <property name="ud:documentManagementCustomFieldFive">
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
   </aspects>
   
</model>                       


Then in share-config-custom.xml I placed content:

<aspects>
         <!– Aspects that a user can see –>
         <visible>
            <aspect name="cm:generalclassifiable" />
            …..
       <aspect name="ud:documentManagementCustomFields" />
         </visible>


<types>
         <type name="cm:content">
            <subtype name="smf:smartFolderTemplate" />
         </type>

          <type name="cm:folder">
         </type>

         <type name="trx:transferTarget">
            <subtype name="trx:fileTransferTarget" />
         </type>
      </types>
    
     <config evaluator="aspect" condition="ud:documentManagementCustomFields">
          <forms>
             <form>
                <field-visibility>
                  <show id="ud:entityName" />
                  <show id="ud:entityID" />
                  <show id="ud:caseID" />
                  <show id="ud:sAuthor" />
                  <show id="ud:aBranch" />
                  <show id="ud:cCategory" />
                  <show id="ud:cSubcategory" />
                  <show id="ud:documentType" />
                  <show id="ud:diaryNumber" />
                  <show id="ud:bundleID" />
                  <show id="ud:cmNumber" />
                </field-visibility>
               
                <appearance>
                  
                  <field id="ud:entityName" label-id="prop.ud_entityName">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>

                  <field id="ud:entityID" label-id="prop.ud_entityID">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>              
   
                  <field id="ud:caseID" label-id="prop.ud_caseID">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>              
                  
                  <field id="ud:sAuthor" label-id="prop.ud_sAuthor">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>
                  
                  <field id="ud:aBranch" label-id="prop.ud_aBranch">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>

                  <field id="ud:cCategory" label-id="prop.ud_cCategory">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>
                  <field id="ud:cSubcategory" label-id="prop.ud_cSubcategory">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>
                  <field id="ud:documentType" label-id="prop.ud_documentType">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>
                  <field id="ud:diaryNumber" label-id="prop.ud_diaryNumber">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>
                  <field id="ud:bundleID" label-id="prop.ud_bundleID">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>
                  <field id="ud:cmNumber" label-id="prop.ud_cmNumber">

                     <control template="/org/alfresco/components/form/controls/textfield.ftl" />

                  </field>              
                  
                  
                  
                </appearance>
            </form>
          </forms>
      </config>


Though my custom model is appearing in the list of manage aspects but yet none of the types of my custom aspect appears.

Outcomes