cancel
Showing results for 
Search instead for 
Did you mean: 

AMP Structure for Java Backed Web Script Project - Urgent!!!

chatwithavik
Champ in-the-making
Champ in-the-making
Hi,

I'mtrying to create a AMP file which will add some custom Java Backed Web scripts onto the Alfresco war. However even on deploying the the amp I'm not seeing the new services.

The following is the exploded amp structure

/|_config|  |_alfresco|      |_module|          |_moduleid|             |_module-context.xml|             |_simple.get.desc.xml|             |_simple.get.html.ftl |_lib|   |_moduleid.jar|      |_META-INF|      |_org|          |_alfresco|              |_module|                  |_moduleid|                      |_SimpleWebScript.class   |_module.properties‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The following are the contents of module.properties
module.id=moduleidmodule.aliases=moduleidaliasmodule.version=1.0module.title=module idmodule.description=module description‍‍‍‍‍

And the following is my module-context.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xsi:schemaLocation="http://www.springframework.org/schema/beans                          http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">   <bean    id="webscript.com.csaa.services.simple.get"         class="org.alfresco.module.moduleid.SimpleWebScript"         parent="webscript">   </bean>   </beans>‍‍‍‍‍‍‍‍‍‍‍‍‍

Is there anything I've missed in this packaging? Please advise
5 REPLIES 5

jpotts
World-Class Innovator
World-Class Innovator
Try this:

1. Package your web scripts under /webscripts
2. Put your web script files in a "package" folder structure so they don't clash with others. (So under /webscripts you might have /com/someco and then your web script files go in there).
3. Create a file-mapping.properties file in your module directory with the following contents:

# Custom AMP to WAR location mappings## The following property can be used to include the standard set of mappings.# The contents of this file will override any defaults.  The default is# 'true', i.e. the default mappings will be augmented or modified by values in# this file.#include.default=true## Custom mappings.  If 'include.default' is false, then this is the complete set.#/webscripts=/WEB-INF/classes/alfresco/extension/templates/webscripts‍‍‍‍‍‍‍‍‍‍‍‍‍‍

That will move your web scripts into the standard location for web scripts within the Alfresco WAR.

Jeff

chatwithavik
Champ in-the-making
Champ in-the-making
Jeff,

Thanks for the reply.

My AMP structure now has a new webscripts folder at the root level alomng with config and lib folders. The webscript folder has the .ftl and the .desc.xml files. I also have the file-mapping.properties file with the contents you suggested in the same location as the module.properties which is in the config/alfresco/module/moduleid folder of the amp. However when I deploy the amp through the mmt I do not see the new module created in the /WEB-INF/classes/alfresco/module folder in the exploded alfresco war. Earlier I was seeing a new module get created in this location. I still seem to be missing something. Can you point me to the right direction.

Thanks for the help.

Avik

vikramvishal
Champ in-the-making
Champ in-the-making
Avik,

I also had the same problem and was struggling for quite a long time. Finally looked into the code…… and had taken an approach which worked for me, described below. I guess this is the only way and no other way around.
config- alfresco.module– your package name folder (i.e. com.something.something…..)—context ( here you can have your web-scripts-application-context.xml)– module-context.xml (include your xml described above)–module.properties-alfresco.extension.templates.webscripts.com.smething.something–.desc–.ftl–any other file related to webscripts‍‍‍‍‍‍‍‍‍‍‍‍

Hope this helps….

Regards
Vikram Vishal  Smiley Very Happy

openpj
Elite Collaborator
Elite Collaborator
Have you tried to build your AMPs using Maven archetype dedicated to Alfresco AMPs developed by Sourcesense?

http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven

Hope this helps.

jpotts
World-Class Innovator
World-Class Innovator
The file mapping properties file should let you have any folder structure you want. Avik, can you reprint your latest-and-greatest folder structure and the entire contents of your file mapping and module properties files?

Jeff