cancel
Showing results for 
Search instead for 
Did you mean: 

amp file

marco_altieri
Star Contributor
Star Contributor
Hi,

what is the best option to customize web quick start ?
All the tutorials / Wiki / code comments seem to suggest that it's necessary to change directly the core codes: templates, pages, css, etc…

With share and alfresco it's always better to use amp files. Do you suggest to do the same also for Web Quick Start?

Thanks,
Marco
6 REPLIES 6

sam1980
Champ in-the-making
Champ in-the-making
My understanding is that you customize Web Quick Start by putting your overrides (if you are using tomcat) in  tomcat\shared\classes\alfresco\web-extension. A mechanism in Share will use the configuration made here in instead of the shipped configurations. All *-context.xml files will be loaded during the start up phase. For customizing templates, components etc you also have to do this in \tomcat\shared\classes\alfresco\web-extension.

I.E you want to customize tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\documentlibrary\repo-toolbar.get.html.ftl you have to create a copy of the file in tomcat\shared\classes\alfresco\site-webscripts\org\alfresco\components\documentlibrary\repo-toolbar.get.html.ftl and modify it there. Share will thus pick up this file instead of the one Share ships with.

Disclaimer: I'm new to Alfresco - so i might misinform you on this.

marco_altieri
Star Contributor
Star Contributor
Hi Sam,

I think that you are right for all the customizations in alfresco and share. I have worked on other projects with share and I knew how to do it.
The problem is that I need to customize Web Quick Start. For example the templates five-block.ftl or the webscript  common/page.ftl

Are you saying that I can use the same folders in shared to overwrite the WQS templates and webscripts?

Thanks,
Marco

sam1980
Champ in-the-making
Champ in-the-making
My understanding is that the wcmqs-webapp is only provided as an example and *could* be a starting point for build a web site utilizing Web Quick Start. In the project I'm currently involved we stripped down the wcmqs webapp to the bare minimum and built our own templates for our own needs.

marco_altieri
Star Contributor
Star Contributor
Hi Sam,

this is also my understanding. I just wanted to know if someone has found a better practice.

Thank you

bremmington
Champ on-the-rise
Champ on-the-rise
Although it's true that the example webapp was actually intended to be purely an example, it is built on Surf which is pretty extensible.

It's a little hard to explain why (but come back to me if you'd like to know, and I'll have a go at it), but if you want to define a new template (or override an existing one) then place its XML descriptor (such as "five-block.xml") into this folder on the classpath (below <tomcat>/shared/classes/, for instance):

surf/site/templates/
  
Similarly, if you want to add or change a page definition, place its XML descriptor (such as "homepage.xml") into this folder on the classpath:

surf/site/pages/
  

If you want to add a new webscript then you can add them in this location on the classpath:

surf/webscripts/
  
And, finally, to add new templates (the actual FreeMarker template such as "five-block.ftl" - not the descriptor files) then put them on the classpath here:

surf/templates/

sam1980
Champ in-the-making
Champ in-the-making
Found out that I had to package functionality in an amp file if i wanted to include custom class files, such as attaching behaviors to the custom content types, ref this post https://forums.alfresco.com/en/viewtopic.php?f=10&t=39109. Here is description of how to set up a maven build for the amp-file using the maven-amp-plugin: http://www.open-source-ecm.com/2010/04/maven-alfresco-creating-amp.html.