cancel
Showing results for 
Search instead for 
Did you mean: 

Expand site content model

janaka1984
Star Contributor
Star Contributor
hi

i need to add extra property when create new site. when open edit form that extra property should be able to show

how can i do it?

Regards
janaka
10 REPLIES 10

angelborroy
Community Manager Community Manager
Community Manager
You can start here: https://github.com/keensoft/alfresco-summit-2014/tree/master/10-enhancements/02-custom-site-props

You also need to override siteContent.xml to include your new property in the model.
Hyland Developer Evangelist

Hi angel

can't I use only custom content model to do this without changing the source code.

My expectation is that I can create a new site by using existing create site form. also I have my own dashlet and load all site data with an empty field which relate to custom property. after the edit, all custom site property should be stored with existing site data.

thanks
Janaka

angelborroy
Community Manager Community Manager
Community Manager
You can do that, but siteContent.xml should be override to include that new property.

Otherwise you should create a new aspect (which is a different model) and apply this aspect to your Site node on dashlet property updating.
Hyland Developer Evangelist

Hi angel,

I created different content model with new ASPECT and registered it on context. but i am not clear "apply this aspect to your Site node on dashlet property". can give sample?



<!– Sites Namespace –>
   <namespaces>
      <namespace uri="http://www.alfresco.org/model/site/1.0" prefix="st"/>
      <!– if you want to extend the properties of a site then use this namespace to mark the custom properties –>
      <namespace uri="http://www.alfresco.org/model/sitecustomproperty/1.0" prefix="stcp"/>
   </namespaces>


   <aspects>
        <!– Example Custom Site Properties Aspect –>
      <aspect name="st:extraSiteProperties">
   
        <title>Custom Site Properties</title>         
         <properties>
            <property name="stcp:extraInformation">
               <title>Extra Site Information</title>
               <type>d:text</type>       
            </property>
         </properties>
        </aspect>
  
   </aspects>

Regards
janaka

angelborroy
Community Manager Community Manager
Community Manager
I understood that you wanted to create a dashlet (http://share-extras.github.io) to include the new property, is right? You can develop your now dashlet and add the aspect by using Java API or JavaScript API.
Hyland Developer Evangelist

hi angel,

when I create a new site, custom property which is defined by myself, should be stored with existing site property (1:1).
I have dashlet. when I open my dashlet, I need to see newly created site property and it's related custom property which can edit.

e.g

site name | shortName | description | customID | customName

Regards
janaka

angelborroy
Community Manager Community Manager
Community Manager
Maybe I don't understand your point.

If you create a site and you want that new property to be informed, you need to go that way https://github.com/keensoft/alfresco-summit-2014/tree/master/10-enhancements/02-custom-site-props There is no other alternative. Obviously you can use and aspect to store that new property.
Hyland Developer Evangelist

janaka1984
Star Contributor
Star Contributor
Hi angel,

thanks for waste your time.

Actually, I need to generate metadata automatically, when creating new site.

can't we use "Metadata Extractors" to achieve this requirement?

Regards
janaka