AnsweredAssumed Answered

Got the result without doing steps in Page23-24 for Custom T

Question asked by bisana on Jun 7, 2012
Hi
I am trying to create Custom Type, define few properties, then apply it to the documents, In short I am following "Alfresco Developer Series  Working with Custom Content Types", 2'nd edition By Jeff Potts
My Model.xml files is given below

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="sc:somecomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Someco Model</description>
<author>Jeff Potts</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" />
</imports>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="http://www.someco.com/model/content/1.0" prefix="sc" />
</namespaces>

<constraints>
 
  <constraint name="sc:lddoctypeList" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>Acquisitions</value>
                    <value>Amendments</value>
                    <value>Article of Associations</value>
                    <value>Board Resolutions</value>
                 </list>
            </parameter>
            <parameter name="caseSensitive">
                <value>true</value>
            </parameter>
        </constraint>
</constraints>





<types>
<!– Enterprise-wide generic document type –>

<type name="sc:doc">
<title>Someco Document</title>
<parent>cm:content</parent>

<mandatory-aspects>
<aspect>cm:generalclassifiable</aspect>
</mandatory-aspects>
</type>

<type name="sc:legaldept">
<title>Legal Department Documents</title>
<parent>sc:doc</parent>



<properties>
<property name="sc:lddoctype">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                    <index enabled="true">
                        <atomic>false</atomic>
                        <stored>false</stored>
                        <tokenised>TRUE</tokenised>
                    </index>
                    <constraints>
                        <constraint ref="sc:lddoctypeList"/>
                    </constraints>
                </property>

<property name="sc:nameofparty"> 
<type>d:text</type>
<mandatory>false</mandatory>
  <constraints>
<constraint ref="sc:partyList" />
</constraints>
</property>



<property name="sc:nameofotherparty">
 
<type>d:text</type>
<mandatory>false</mandatory>
</property>

<property name="sc:project">
<type>d:text</type>
<mandatory>false</mandatory>
</property>


<property name="sc:lsrno">
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>

</type>
</types>
</model>

Till Page 22, I was able to follow exactly as the document, On page 23 , When I add "node-type"  evaluator and change cm:content to sc:legaldept and restarting the service will make my custom document type defined on the docs disappear. When I remove the "node-type" evaluator I get  the Custom Type properties back,. I tried out in different instance, behavior was similar each time.
Now without doing instruction in
    Configuring the form service for a Custom Type
       Configuring the form service for Custom Properties
I was able to see my  properties defined in the Custom Types applied on documents
Now I did for Advanced search and restarted the service
I am able to see the Custom Type and its properties, and I am able to search and get result
My "share-config-custom.xml" has the below contents

<alfresco-config>
 
 
  <config replace="true" evaluator="string-compare" condition="AdvancedSearch">
<advanced-search>
<!– Forms for the advanced search type list –>
<forms>
<form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content</form>
<form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form>
<form labelId="type.sc_legaldept" descriptionId="search.form.desc.sc_legaldept">sc:legaldept</form>
</forms>
</advanced-search>
</config>


<!– Document Library config section –>
<config evaluator="string-compare" condition="DocumentLibrary">




<types>
<type name="cm:content">
  <!–<subtype name="sc:doc" />  –>
<subtype name="sc:legaldept" />
</type>

<type name="sc:doc">
<subtype name="sc:legaldept" />
</type>
</types>
</config>
</alfresco-config>



Is there any thing wrong it what I am doing.
I am puzzled why my Custom document type properties is not showing ,when I copy "node-type" and doing the changes as per the document.
Is it fine if I don't add node-type and model-type evaluators or if I am not able to do the steps mentioned in 23 and 24

Guidance requested, I am a guy who is not much exposed to propragmming
Thanks
Joseph John

Outcomes