cancel
Showing results for 
Search instead for 
Did you mean: 

Add custom attributes at Folder level(Space Level)

prateekgoyal
Champ in-the-making
Champ in-the-making
Hello All,
I want to add some custom attributes(metadata) to the space. Is it possible?
Means can i add them by modifying any xml within Alfresco, as in the case of a document for which we need to modify examplemodel.xml.
Please rply soon, its urgent.
14 REPLIES 14

alexey
Champ in-the-making
Champ in-the-making
Of course it's possible.
It's a part of my customModel.xml
<model name="sgnhp:sgnhpModels" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Some description</description>
   <author>About</author>
   <version>1.0</version>
   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>
   <namespaces>
      <!– Define a Namespace for my new definitions –>
      <namespace uri="ru.snos.sgnhp" prefix="sgnhp"/>
   </namespaces>
   <!– Type and Aspect definitions go here –>
   <types>
      <type name="sgnhp:engineeringContract">
         <title>Engineering Contract</title>
         <parent>cm:folder</parent>
         <properties>
            <property name="sgnhp:contractNumber">
               <type>d:text</type>
            </property>
            <property name="sgnhp:plant">
               <type>d:text</type>
            </property>
            <property name="sgnhp:workshop">
               <type>d:text</type>
            </property>
         </properties>
      </type>
   </types>
</model>
web-client-config-custom.xml

   <config evaluator="string-compare" condition="Space Wizards">
      <folder-types>
         <type name="sgnhp:engineeringContract"/>
      </folder-types>
   </config>
   <config evaluator="node-type" condition="sgnhp:engineeringContract">
      <property-sheet>
         <show-property name="sgnhp:contractNumber" display-label-id="contractNumber"/>
         <show-property name="sgnhp:plant" display-label-id="plant"/>
         <show-property name="sgnhp:workshop" display-label-id="workshop"/>
      </property-sheet>
   </config>

prateekgoyal
Champ in-the-making
Champ in-the-making
Hey Alexey,
Thanks for the rply…but can you tell me how will it appear on Alfresco web client, when i start the create space wizard

alexey
Champ in-the-making
Champ in-the-making
It will appear when you choose  "From scratch" in the "Create space wizard"

prateekgoyal
Champ in-the-making
Champ in-the-making
Hey i have tried it, but it is not appearing their…
I have done the following changes:
1. made the changes in customModel.xml
2. made an extry for this in web-client-config-custom.xml
3. restarted the tomcat server
4. started the advance space wizard 'From Scratch'

but not able to find anything….

alexey
Champ in-the-making
Champ in-the-making
You should look in the alfresco.log.

prateekgoyal
Champ in-the-making
Champ in-the-making
hey i am geting the following warning in the log
"[org.alfresco.web.bean.spaces.CreateSpaceWizard] Failed to add 'sgnhp:engineeringContract' to the list of folder types as the prefix can not be resolved"

alexey
Champ in-the-making
Champ in-the-making
You must create a new file sgnhp-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>
   <!– Registration of new models –>   
   <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
      <property name="models">
         <list>
            <value>alfresco/extension/customModel.xml</value>
         </list>
      </property>
   </bean>
</beans>
Restart the Tomcat server.

prateekgoyal
Champ in-the-making
Champ in-the-making
hey now i'm able to get that 'engineeringContract' folder on my web client , but not getting any option to enter the values for it. How can i do this….

prateekgoyal
Champ in-the-making
Champ in-the-making
Actually i'm getting following message on the log:

[org.alfresco.web.app.ResourceBundleWrapper] Failed to find I18N message string key: contractNumber
17:01:41,345 WARN  [org.alfresco.web.app.ResourceBundleWrapper] Failed to find I18N message string key: plant
17:01:41,345 WARN  [org.alfresco.web.app.ResourceBundleWrapper] Failed to find I18N message string key: workshop

and not giving any option to supply any values for it.