cancel
Showing results for 
Search instead for 
Did you mean: 

web scripts placed in class path folder not recognized

targa2000
Champ in-the-making
Champ in-the-making
I placed a simple webscript in class path folder: {Alfresco_installation}\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\templates\webscripts\com\dev\simpletwo

went to
http://localhost:8080/alfresco/service/index and refreshed web scripts, but my web script is not being recognized. 

What is wrong?

simpletwo.get.desc.xml
<webscript>
<shortname>Simple Two</shortname>
<description>Simple Two web script</description>
<url>/simpletwo?name={nameArgument}</url>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

simpletwo.get.html.ftl
<html>
<body>
<p>Simple 2, ${args.name}!</p>
</body>
</html>

According to the alfresco wiki on web scripts, we can place web scripts in the following:

These files need to be stored in a folder somewhere. They can live in either the Alfresco Repository or the Java ClassPath. The following folders are listed in the sequence in which Alfresco searches for Web Script implementation files:

   1. repository folder: /Company Home/Data Dictionary/Web Scripts Extensions
   2. repository folder: /Company Home/Data Dictionary/Web Scripts
   3. class path folder: /alfresco/extension/templates/webscripts
   4. class path folder: /alfresco/templates/webscripts

Within any of these folders, you can use subfolders to organize web scripts.

New web scripts will not be visible until the "Refresh Web Scripts" link is clicked on the /alfresco/service/ page.

http://wiki.alfresco.com/wiki/Web_Scripts

using Alfresco EE 3.2 on Vista

to get the web script identified by alfresco, need to load to

   1. repository folder: /Company Home/Data Dictionary/Web Scripts Extensions

and refresh.

but other paths should work?
5 REPLIES 5

ssaravanan
Champ in-the-making
Champ in-the-making
Which version of Alfresco you are using.
In 3.2 tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/ folder has the bootstrap scripts and
if you drop your webscripts into
tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts, then it should pick the webscripts
after a refresh of the webscripts

targa2000
Champ in-the-making
Champ in-the-making
it only picked it up on restart of tomcat.

ssaravanan
Champ in-the-making
Champ in-the-making
Anything you put on the extensions folder will definitely get picked only after restart.
If you drop your webscripts into
tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts
Then a refresh will serve the purpose.
As I told earlier,  tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/ folder has the bootstrap scripts
so anything you drop in that folder will get picked up only at restart.

mikeh
Star Contributor
Star Contributor
It's never a good idea to modify files inside the deployed webapp folder; as soon as the .war file gets redeployed all your changes will be lost!

Instead, replace webapps\alfresco\WEB-INF\ with shared\ and deploy your webscript there.

Thanks,
Mike

dc_noze
Champ in-the-making
Champ in-the-making
Hi guys,
i'm using alfresco 3.0 labs and i have a similar problem with loading webscripts.
I placed some webscripts in class path folder: {Alfresco_installation}\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\templates\webscripts. My webscripts are organized like folderx/foldery/webscript-file.
I am not able to load this webscripts even restarting alfresco. I have moved the webscripts outside the folder structure without results. Moving the webscripts to  {Alfresco_installation}\tomcat\shared\classes\alfresco\templates\webscripts works.
I have other things under {Alfresco_installation}\tomcat\shared\classes\alfresco including configuration file and webscripts.
Any idea?
It is possible that the two directory:
- {Alfresco_installation}\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\templates\webscripts
- {Alfresco_installation}\tomcat\shared\classes\alfresco\templates\webscripts
clash in some way? I mean the classpath relative path is the same.

Any help would appreciated.