AnsweredAssumed Answered

Additional Date type attribute for person

Question asked by raweck on Nov 6, 2007
Latest reply on Nov 7, 2007 by raweck
I wanted to extend user attributes by new Date type attribute.
I added:

<property name="cm:replacementPersonStartDate">
  <type>d:date</type>
</property>
to contentModel.xml file.


<tr>
<td><h:outputText value="#{msg.replacement_person_start_date}"/>:</td>
<td>
<h:inputText id="replacement_person_start_date" value="#{UsersBean.person.properties.replacementPersonStartDate}" size="35" maxlength="1024" onkeyup="updateButtonState();" onchange="updateButtonState();" /> *
</td>
</tr>
to edit-user-details.jsp file.


<td class="propertiesLabel">
<h:outputText value="#{msg.replacement_person_start_date}" />:
</td>
<td>
<h:outputText value="#{UsersBean.person.properties.replacementPersonStartDate}" />
</td>
</tr>
to user-console.jsp file.

I added props.put(…(Date)…) line in changeUserDetails() :

public String changeUserDetails()
{

props.put(ContentModel.PROP_EMAIL, (String)getPerson().getProperties().get(ContentModel.PROP_EMAIL));

props.put(ContentModel.PROP_REPLACEMENT_PERSON_START_DATE,
(Date)getPerson().getProperties().get(ContentModel.PROP_REPLACEMENT_PERSON_START_DATE));

this.nodeService.setProperties(getPerson().getNodeRef(), props);

}
in UsersBean.java file.

If I do it for String or Integer type attribute it works, for Date type attribute it does not. What is wrong?

Outcomes