cancel
Showing results for 
Search instead for 
Did you mean: 

Custom property's label \ Multiline textbox

nie
Champ in-the-making
Champ in-the-making
Hi,

i got a few simple questions about displaying custom properties in the web cilent.

1. How can i change the label displayed next to my custom property fields?

I would like to change it in modify properties dialog, property sheet page and advanced search dialog.

2. How can i make multiline editboxes for my own properties? How can i set the size of it etc?

I'm thinking about an editbox like the one used for the description property by default.

3. Is it possible to make some properties 'belong togather' ?

I would like to add pairs(or maybe 3-4) of properties into a list.
I want to do something like the example below, but the <multiple>  tag should effect more than 1 property. I hope it's clear Smiley Happy

<property name="mycv:lang">
  <type>d:text</type>
  <multiple>true</multiple>
</property>

Thanks,

Nie
3 REPLIES 3

gavinc
Champ in-the-making
Champ in-the-making
Hi,

You can set the label of your property in several ways. The first way is to specify the <title> element in the model i.e.

<property name="custom:property">
   <title>My Custom Property</title>
   <type>d:text</type>
</property>

In the example above and below the outcome would be the label showing "My Custom Property". You can also internationalise the title by specifying the title in a properties file see http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Model_Localization for details.

You can also specify the label in your property sheet configuration, you can either supply an explicit string or a message-id to lookup the string in webclient.properties.

<show-property name="custom:property" title="My Custom Property" />

or

<show-property name="custom:property" title-id="custom_prop_title" />

See http://wiki.alfresco.com/wiki/Adding_Custom_I18N_Strings for details on adding custom strings.

As for using a textarea instead of a textfield you can add this to your property config:

<show-property name="custom:property" component-generator="TextAreaGenerator" />

To set the size of it see http://wiki.alfresco.com/wiki/Simple_Customisations#Using_A_TextArea

For general information on configuring the display of custom metadata see http://wiki.alfresco.com/wiki/Displaying_Custom_Metadata

Finally, no, it's not currently possible to define properties that "belong together". The 'multiple' element you mention is whether the property itself can contain multiple values.

nie
Champ in-the-making
Champ in-the-making
Hi,

thanks for the answers Gavin.

I think the description of my third question wasn't too understandable, so i guess i'll just try to explain it again.

I meant that i would like to store a list of arrays in a property. I want to store CVs and add the current projects the given people is working on, but one project got multiple datafields, and of course the number of projects can be more than 1 aswell.Something like this:

Projects
–Project1
—-Project1 Name
—-Project1 Starting Date
—-Project1 Finishing Date
–Project2
—-Project2 Name
—-Project2 Starting Date
—-Project2 Finishing Date

So the number of data fields for a project is always the same, but the number of projects can be anything.

Is it possible to store metadata like this in Alfresco?

Thanks,

Nie

gavinc
Champ in-the-making
Champ in-the-making
Yes, but it sounds like creating a separate type and association would be better.

For example create a type to represent the project with the fields you mention i.e. project name, start date and finish date.

Then define an association from the type representing the CV to the project type. You can define the association with a multiplicty of 0..* to allow any number of projects.

You could alternatively store a list of arrays in a property if you wish. I believe you can set the property type to be d:any. You can call nodeService.setProperty and pass the Java object representing the data. A call to getProperty would give you back the Java object.

Doing this though will mean your data is stored in binary format and will not be searchable. It's therefore better to go the modelling route if you can.
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.