cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change the display name for an aspect?

grauenwolf
Champ in-the-making
Champ in-the-making
This is my aspect:

<?xml version="1.0" encoding="utf-8"?><model name="ac:androidContent" xmlns="http://www.alfresco.org/model/dictionary/1.0">   <description>Android Content Model</description>   <author>Cynergy</author>   <version>1.0</version>   <imports>      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>   </imports>   <namespaces>      <namespace uri="http://www.cynergy.com/androidContent/content/1.0" prefix="ac"/>   </namespaces>   <constraints>      <constraint name="ac:NotificationSummary_Length" type="LENGTH">         <parameter name="minLength">            <value>1</value>         </parameter>         <parameter name="maxLength">            <value>50</value>         </parameter>      </constraint>      <constraint name="ac:Priority_Options" type="LIST">         <parameter name="allowedValues">            <list>               <value>High</value>               <value>Medium</value>               <value>Low</value>            </list>         </parameter>      </constraint>   </constraints>   <aspects>      <aspect name="ac:androidContentProps">         <title>Android Content</title>         <properties>            <property name="ac:propNotify">               <title>Notify</title>               <type>d:boolean</type>            </property>            <property name="ac:propNotificationSummary">               <title>Notification Summary</title>               <type>d:text</type>               <constraints>                  <constraint ref="ac:NotificationSummary_Length" />               </constraints>            </property>            <property name="ac:propArchiveDate">               <title>Archive Date</title>               <type>d:datetime</type>            </property>            <property name="ac:propPublishDate">               <title>Publish Date</title>               <type>d:datetime</type>            </property>            <property name="ac:propPriority">               <title>Priority</title>               <type>d:text</type>               <multiple>false</multiple>               <constraints>                  <constraint ref="ac:Priority_Options" />               </constraints>            </property>         </properties>      </aspect>   </aspects></model>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

In Alfresco Share then name is "aspect.ac_androidContentProps". How do I change that to something that is friendly?
5 REPLIES 5

afaust
Legendary Innovator
Legendary Innovator
Hello,

you need to provide a message bundle (*.properties with human readable labels) to Share. Will Abson describes this (among other things) in his Guide to add custom aspects to Share.

Regards
Axel

grauenwolf
Champ in-the-making
Champ in-the-making
That didn't work for me.


acandroidContent.properties

ac_androidContent.aspect.ac_androidContentProps=Android Contentaspect.ac_androidContentProps=Android Content‍‍‍‍

myexample-model-context.xml

<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><beans>  <bean id="example.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">    <property name="models">      <list>        <value>alfresco/extension/myModel.xml</value>        <value>alfresco/extension/acandroidContent.xml</value>      </list>    </property>    <property name="labels">      <list>        <value>alfresco/extension/mymodel</value>        <value>alfresco/extension/acandroidContent</value>      </list>    </property>  </bean></beans>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

grauenwolf
Champ in-the-making
Champ in-the-making
P.S. I see that my friendly name for the aspect is showing up when I create a new folder rule. It is when I am directly applying the aspect to an item that it uses the ugly name.

mitpatoliya
Star Collaborator
Star Collaborator
have you registered your property file.
I think in your context file you need to have entry for that as well.

afaust
Legendary Innovator
Legendary Innovator
Your configuration only applies to labels on the Repository tier - you need to provide custom aspect label properties in Share as well.

Taken from the link to Will Absons post I provided earlier:

1) Define an additional message bundle (in Share Tomcat /shared/classes/alfresco/web-extension/custom-slingshot-application-context.xml)
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><beans>   <!– Add XY messages –>   <bean id="webscripts.xy.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">      <property name="resourceBundles">         <list>            <value>alfresco.messages.XY</value>         </list>      </property>   </bean></beans>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

2) Create a XY.properties file in your Share Tomcat (assuming you follow best practice of separating Share and Repository) /shared/classes/alfresco/messages folder that contains your aspect label
aspect.kb_referencable=Knowledge Base Referencable‍‍‍

Regards
Axel