AnsweredAssumed Answered

Adding Mandatory Child association to Custom Content Type

Question asked by asmita.hardikar on Feb 18, 2008
Latest reply on Sep 23, 2011 by ragnaroek-hh
I have defined a custom content model as shown below.

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model  –>
<model name="ps:ps" xmlns="">
<!– Optional meta-data about the model –>
<!– Imports are required to allow references to definitions in other models –>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="" prefix="cm"/>
<!– Introduction of new namespaces defined by this model –>
            <namespace uri="" prefix="ps"/>
       <type name="ps:xs">
       <type name="ps:bxs">
       <type name="ps:prof">
                         <property name="ps:Id">
       <type name="ps:bprof">
             <!– I want this to have a default value. "default" tag is not supported. It gives an exception. –>
                         <property name="ps:product">
             <!– I want this as a mandatory association. –>
                           <child-association name="ps:bxs_link">

I am unable to achieve the following in this model:
1. Define a mandatory child association: I tried all combinations of "true-false" for source & target. When I specify "target" as mandatory, it given following error during execution

  Please correct the errors below then click OK. 
A system error happened during the operation: Unknown Exception in Transaction.
stack: ERROR [org.alfresco.repo.node.integrity.IntegrityChecker] Found 1 integrity violations:
The association target multiplicity has been violated:
   Source Node: workspace://SpacesStore/2571013d-ddee-11dc-a9c3-475304f6f2e8
   Association: Association[ class=ClassDef[name={}bprof], name={}bxs_link, target class={}bxs, source role=null, target role=null]
   Required target Multiplicity: 1..1
   Actual target Multiplicity: 0
12:23:02,290 ERROR [org.alfresco.web.ui.common.Utils] A system error happened during the operation: Unknown Exception in Transaction.

2. specify default value for property: when I add default tag.
Failed to parse model

Request your help at the earliest please !