cancel
Showing results for 
Search instead for 
Did you mean: 

strange behavior - properties not always displayed

friedman30
Champ in-the-making
Champ in-the-making
i have a custom type with it's custom properties and Alfresco content type inherited properties.
i experience a strange problem with the inherited properties when in edit mode.
:?

This is the code:

<config evaluator="node-type" condition="custom:VerizonContent">
      <property-sheet>
       <show-property name="mimetype" show-in-view-mode="false" show-in-edit-mode="false" />         
       <show-property name="size" show-in-view-mode="false" show-in-edit-mode="false" />   
       <show-property name="title" />
       <show-property name="description" />   
       <show-property name="modifier" show-in-view-mode="false" show-in-edit-mode="false" />
       <show-property name="modified" show-in-view-mode="false" show-in-edit-mode="false" />      
       <show-property name="author" show-in-view-mode="false" show-in-edit-mode="false" />
       <show-property name="creator" show-in-view-mode="false" show-in-edit-mode="false" />
      <show-property name="custom:VerizonContentStatus" show-in-view-mode="true" show-in-edit-mode="false" />
       <show-property name="custom:VerizonContentRatingValue" show-in-view-mode="true" show-in-edit-mode="true" />
       <show-property name="custom:VerizonAvailableDate" show-in-view-mode="true" show-in-edit-mode="true" />
       <show-property name="custom:VerizonUnapproveDate" show-in-view-mode="true" show-in-edit-mode="true" />
       <show-property name="custom:VerizonLong" show-in-view-mode="true" show-in-edit-mode="true" />
       <show-property name="custom:VerizonKeywords" show-in-view-mode="true" show-in-edit-mode="true" />
     </property-sheet> 
   </config>

everything works fine, except for one thing - the 2 properties - "title" and "description" are not displayed in the first time i enter the edit page.
after this first time, the two properties are displayed and all works great .

what should i do to fix this??  :?:

thanks,

Dror
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
These 2 properties are added as a result of the titled aspect being applied. This is done during the edit processing if the aspect is not already present. That explains why they are not there before and are after.

To make them always appear in the property sheet add the "ignore-if-missing" attribute i.e.

<show-property name="title" ignore-if-missing="false" />

friedman30
Champ in-the-making
Champ in-the-making
thanks  Smiley Very Happy

itayh
Champ in-the-making
Champ in-the-making
Hi,

I have a problem when adding content using ftp.
Those 2 properties do not exist as multilingual.
I mean that nodeService.getPropery for the title and description after MLPropertyInterceptor.setMLAware(true) is null.

Any one has any idea?

Thx

itayh
Champ in-the-making
Champ in-the-making
Hi,

I found a solution

I add at CifsHelper class the next lines:

Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(3, 1.0f);
            titledProps.put(ContentModel.PROP_TITLE, name);
            titledProps.put(ContentModel.PROP_DESCRIPTION, "");
            this.nodeService.addAspect(parentFolderNodeRef, ContentModel.ASPECT_TITLED, titledProps);

both for content and folder and it seem to work.

Is it enough? Am I missing something?

Itay