cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing custom properties with ftl

jbcordina
Champ in-the-making
Champ in-the-making
Hi,
I juste finished to create a new custome content wizard based on a custom content type.
Now i must access to the custom properties with a freemarker file like ${content.properties.description}

My custom content type is defined with in the BaseRequestWizard.java :

public abstract class BaseRequestWizard extends BaseWizardBean
{
   protected String fileName;
   protected String author;
   protected String title;
   protected String description;
   protected String mimeType;
   protected String encoding;
   protected String objectType;
   protected boolean inlineEdit;
   protected boolean otherPropertiesChoiceVisible = true;
   protected boolean showOtherProperties = true;
   //Custom properties :
   protected String thematic;
   protected String module;
   protected String processing;
   protected String community;


First question : am i wrong with this technique ?
And How can i access to my custom properties ?

Thanks in advance.
4 REPLIES 4

jbcordina
Champ in-the-making
Champ in-the-making
For information, i tried :
    - ${content.properties.processing}
    - ${content.properties.["processing"]}
    - ${content.properties.["cmSmiley Tonguerocessing"]}

But no results Smiley Sad

sbuckle
Champ in-the-making
Champ in-the-making
What prefix did you specify for your namespace in your model? Let's say you set it to be "custom" then you would access it from Freemarker like this:


${content.properties["custom:processing"]}
You don't need to be put the "." as you have in the examples that you gave.

jbcordina
Champ in-the-making
Champ in-the-making
I tried with my namespace but it doesn't work.
Do I need to add some definitions in a xml file to access to my values ?

sbuckle
Champ in-the-making
Champ in-the-making
If it's not too big, can you post your model definition (the XML)?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.