cancel
Showing results for 
Search instead for 
Did you mean: 

label definitions for share

hello_wrold
Champ in-the-making
Champ in-the-making
Hello all,

I've been tinkering with Alfresco (community ed., 4.2f) to get my custom labels for my custom content model, but somewhere I must've been missing the point – my aspects' labels won't appear in the share.

Generally, I followed Jeff Potts fine tutorial, made my custom fooModel.xml with an aspect "customer" that has two properties:


<aspects>
    <aspect name="foo:customer">
      <title>AHA Customer</title>
      <properties>
        <property name="foo:customerno">
          <type>d:text</type>
        </property>
        <property name="foo:customername">
          <type>d:text</type>
        </property>
      </properties>
    </aspect>
  </aspects>


My share-config-custom.xml:


<config evaluator="aspect" condition="foo:customer">
    <forms>
        <form>
            <!– Field visibility  –>
            <field-visibility>
                <show id="foo:customerno" />
                <show id="foo:customername" />
            </field-visibility>
           
            <!– appearance Element  –>
            <appearance>                   
                <field id="foo:customerno" labelId="prop.foo_customerno"  />
                <field id="foo:customername" labelId="prop.foo_customername"  />
            </appearance>
        </form>
    </forms>
</config>


I wanted the "foo:customerno" and "foo:customername" to appear  s "customer number" and "customer name". This works,  when I add a label to the appearance in share-config-custom.xml like this:

<field id="foo:customerno" labelId="prop.foo_customerno" label="customer number" />
<field id="foo:customername" labelId="prop.foo_customername" label="customer name" />


But for all I know this isn't the Alfresco Way to do it and I  efined them in my fooModel.properties as

foo_bar.aspect.foo_customerno=customer number
foo_bar.aspect.foo_customername=customer name

(with "foo" being my model's prefix bar, "bar is the model's name) However this doesn't work and the share client just show "foo:customerno:".


I tried a heap of variations on that scheme none of them lead  id what I wanted to. Other field definitions in fooModel.properties work just fine.

Could anyone give a hint or, even better, an example of how it's done the proper way? I feel like searching a needle in a haystack.

thanks,
  -daniel
1 REPLY 1

aaditvmajmudar
Confirmed Champ
Confirmed Champ
You can have your custom-slingshot.properties with key value pairs like,

e.g,
editform.indexing.field.cname=Customer Name

You can load this properties file from custom-slingshot-application-context.xml file.

After this in share config just provide attribute for label, label-id="editform.indexing.field.cname".

Hope this helps.