cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory/Required fields: Title and Description

lock999
Champ in-the-making
Champ in-the-making
Hi,

While creating a custom type, when we include <parent>cm:content</parent> as shown below, properties Title and Description displayed on the web client form are not mandatory.

How can we make Title and Description mandatory only for our custom model? Is there any way to override cm:title and cm:description? Changing contentModel.xml will result in a global change and will affect all other models where Title and Description may not be mandatory.

    <type name="my:myModel">
         <title>My Model</title>
         <parent>cm:content</parent>
         <properties>
          ………..
          ………..
          ………..
         </properties>

Thanks
7 REPLIES 7

davidc
Star Contributor
Star Contributor
You can't override the definition of an aspect just for your sub-type.

You can raise a JIRA issue to record an enhancement request, or implement yourselves and contribute back.

lock999
Champ in-the-making
Champ in-the-making
Thanks David for the prompt reply.

sharifu
Confirmed Champ
Confirmed Champ
Is there an update on this?

lmartin
Champ in-the-making
Champ in-the-making
Has there been any progress on this request?

I too need to make the cm:title field mandatory and I found an old blog (http://www.ixxus.com/blog/2009/01/aspects/) that talks about overriding the cm:titled aspect. It looked promising so I have included this in my custom content model:

      <aspect name="bsf:titledAspect">
         <title>Titled</title>
         <parent>cm:titled</parent>
            <overrides>
               <property name="cm:title">
                  <mandatory>true</mandatory>
               </property>
            </overrides>
      </aspect>

And made the bsf:titledAspect a mandatory aspect on my custom content type.

It does not appear to have any effect though, the title field is still not showing as mandatory in the Share edit properties page. Thoughts? I will keep searching…

sbixsbix
Champ in-the-making
Champ in-the-making
Furthermore I tried to change the "Description" title with something else (i.e. <title>Location</title> and the only results were compilation errors….
This is the relevant portion of my custom model
        <!– Documenti CM mio –>
        <type name="sals:realtyFolders">
           <title>realties</title>
           <parent>cm:folder</parent>
           <mandatory-aspects>
                <aspect>sals:realtyLoc</aspect>
           </mandatory-aspects>
        </type>
….
   <aspects>
        <aspect name="sals:realtyLoc">
           <title>Titled</title>
           <parent>cm:titled</parent>
           <overrides>
                <property name="cm:description"> <title>Realty Location</title> <mandatory>true</mandatory> </property>
           </overrides>
        </aspect>
   </aspects>

And this is the error I get on catalina.out:
Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.alfresco.org/model/dictionary/1.0}property" end tag, found "{http://www.alfresco.org/model/dictionary/1.0}title" start tag (line 2201, col 43)

oofdachile
Champ in-the-making
Champ in-the-making
Hi, folks –

Just to make sure I'm in sync, this thread is reporting that in Community 4.2c, if I create an aspect named "my:alpha" with one non-mandatory d:text property named "my:zed" (and a few other properties as well), and another aspect named "my:beta" like this:


<aspect name="my:beta">
        <title>Beta - Like Alpha but Zed is mandatory</title>
        <parent>my:alpha</parent>
   <overrides>
      <property name="my:zed">
         <mandatory>true</mandatory>
      </property>
   </overrides>
</aspect>

… then types with this "my:beta" aspect should not yet be expected to have the field "my:zed" set as mandatory?  (That is the behavior I'm seeing now in Comm 4.2c's Alfresco Explorer (yeah, I know, I'm just debugging) "Update" form, though its checkin form is operating as I hoped.)  Our business model calls for a few metadata fields that are mandatory in some types and optional in others, but which can be easily searched across all spaces & types.  This requirement seems to cry out for an alpha/beta-like pair of aspects for use by our metadata types to make these fields mandatory as needed.

If this "my:beta's my:zed isn't mandatory" description is the current behavior, then has anyone tried reversing the override (ie, in alpha, zed IS mandatory, but in beta, zed IS NOT mandatory) to see what happens?  (I'm about to try it, but it seemed wise to ask.)

Thanks in advance for any updates/eta's/clarifications/betterIdeas/smartRemarks you can share.

Don

Hi, folks –

  I tried making "my:zed" mandatory in aspect "my:alpha", and setting it to be non-mandatory in aspect "my:beta", as mentioned in my last post, but Alfresco complains:

07140000 Cannot relax mandatory attribute of property 'my:zed

(… without the closing tick mark?)

Don