cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Side WebScripts

drozes
Champ in-the-making
Champ in-the-making
Hi guys.

So far these are my two methods for adding webscripts:

Share Tier Scripts I place in \tomcat\shared\classes\alfresco\web-extension\site-webscripts

And
Repo Tier Scripts I have been using the Share Interface Data Dictionary.
DataDictionary->webscripts->org->alfresco->custom


What I'd love to understand is how to add Share webscript through the DataDictionary interface
AND
How to add Repo Tier webscripts through my file system.

Thanks in advance!
8 REPLIES 8

jpotts
World-Class Innovator
World-Class Innovator
Share Tier web scripts cannot be run out of the content repository. Alfresco and Share are two completely separate web applications. Often they are run in two different containers or even two different physical nodes entirely.

You can, however, put repository tier web scripts in the file system. They go in $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/webscripts.

It looks like you have your Share tier web scripts in $TOMCAT_HOME/shared. That's fine, but definitely not my preference. I prefer to put them in $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/web-extension. I only use $TOMCAT_HOME/shared for things that are server- or environment-specific (like file system or LDAP configuration). That way, I can pick up my Alfresco and Share WAR files and move them across servers or go from Dev to QA to Prod and each WAR has everything it needs and does not have to be tweaked because of the environment it happens to be deployed to.

If I haven't convinced you to not use $TOMCAT_HOME/shared, your repository tier web scripts could also go in shared under $TOMCAT_HOME/shared/classes/alfresco/extension.

With all of that said, you might want to seriously consider packaging your web scripts and other extensions as AMPs (one for the repository tier and one for the Share tier). Then you have a nice, repeatable, less error-prone way to deploy your customizations and extensions. Learn more here.

Jeff

drozes
Champ in-the-making
Champ in-the-making
Thanks a ton Jeff -  this clears up some questions!

drozes
Champ in-the-making
Champ in-the-making
Share Tier web scripts cannot be run out of the content repository. Alfresco and Share are two completely separate web applications. Often they are run in two different containers or even two different physical nodes entirely.

You can, however, put repository tier web scripts in the file system. They go in $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/extension/templates/webscripts.

It looks like you have your Share tier web scripts in $TOMCAT_HOME/shared. That's fine, but definitely not my preference. I prefer to put them in $TOMCAT_HOME/webapps/share/WEB-INF/classes/alfresco/web-extension. I only use $TOMCAT_HOME/shared for things that are server- or environment-specific (like file system or LDAP configuration). That way, I can pick up my Alfresco and Share WAR files and move them across servers or go from Dev to QA to Prod and each WAR has everything it needs and does not have to be tweaked because of the environment it happens to be deployed to.

If I haven't convinced you to not use $TOMCAT_HOME/shared, your repository tier web scripts could also go in shared under $TOMCAT_HOME/shared/classes/alfresco/extension.

With all of that said, you might want to seriously consider packaging your web scripts and other extensions as AMPs (one for the repository tier and one for the Share tier). Then you have a nice, repeatable, less error-prone way to deploy your customizations and extensions. Learn more here.

Jeff


Would it be possible to edit some Aflresco Settings to allow Sahre Webscripts to be run out of the content repo?

jpotts
World-Class Innovator
World-Class Innovator
No. I can't think of a use case where it would even make sense to do that. What are you trying to do that makes you want to put your Share tier web scripts in the repository?

Jeff

drozes
Champ in-the-making
Champ in-the-making
Firstly thank you for the super-quick reply.

My company wants to be able to apply workflows to ALL aspects of a project.

So if we have a group of webscripts that are used for a certain webapp managed through Alfresco, we would like them to be able to be in the content repo - allowing workflows and all the special Alfrescian aspects to them.

Any advice? or not possible?

jpotts
World-Class Innovator
World-Class Innovator
What if you routed the web scripts as content, and then used the file system transfer to publish the web scripts to the Share tier file system once they are approved?

Jeff

drozes
Champ in-the-making
Champ in-the-making
Thanks definitely a possible solution.

I could also work into it different publishign target depending on it's approval status.

Thanks for the idea - I'm gonna let that brew.

Gonna use the http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Fws-curl.html documentation as a starting point.  Any guides are welcomed.

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
I could think of a valid use case for defining share webscripts in the repository:
If you have a multi-tenancy enabled system and you want to separate the default extensions available to all tenants (deployed on the classpath) and client-specific customizations for individual tenants (stored as content in the repository). These customizations would then be scoped to the tenant.
There would be a policy to keep client customizations to a minimum and move webscripts to the classpath when needed by more tenants (i.e. promote reuse).