AnsweredAssumed Answered

Cannot Access Custom Fields in Profile

Question asked by risenhoover on Aug 19, 2008
Latest reply on Aug 21, 2008 by risenhoover
Hi all,

Here's another problem that has vexed me for the last few weeks.  The background is that I'd like to store some extra information about users in the profile, beyond what Alfresco offers.  This is with Alfresco Enterprise 2.2.0

I created a custom type that descends from the standard cm:person, as such:

    <type name="d3:person">
         <title>D3 Person</title>
            <property name="d3:telephone">
            <property name="d3:mobile">

            <!–  This is a "T" or "M" to identify preferred communication mechanism –>
            <property name="d3:preferred_comm">
               <title>Preferred Comm.</title>

I created a web script called "profile" that gets the "person" object (which is the currently-authenticated user), and specializes it to my type, as such:

var my_person = person;

if ( my_person.specializeType("d3:person")) {
  logger.log("Specialized my_person to d3:person");

model.my_person = my_person;

And then I created a template that accesses the extra properties I created:

<?xml version="1.0" encoding="UTF-8"?>
    <title>NOT IMPLEMENTED</title>
    <cell>NOT IMPLEMENTED</cell>

You'd think this would work, but it throws an exception, stating that it cannot find the "telephone" property in the my_person object.

org.alfresco.service.cmr.repository.TemplateException - Error during processing of the template 'Expression is undefined on line 7, column 15 in test/profile/profile.get.xml.ftl.'. Please contact your system administrator.

Now I've tried changing the "${}" expression to all of it's various forms, including: …properties["telephone"], …properties["cm:telephone"], …properties["Telephone"] but nothing works.

I get this same exception over and over again.

Any thoughts?