mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Web Scripts:
- addition of extension paths for web script customisations - updated "delete ticket" web script to return appropriate response on success git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5867 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -53,10 +53,24 @@ import freemarker.cache.TemplateLoader;
|
||||
public class ClassPathStore implements WebScriptStore, InitializingBean
|
||||
{
|
||||
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
protected boolean mustExist = false;
|
||||
protected String classPath;
|
||||
protected File fileDir;
|
||||
|
||||
|
||||
/**
|
||||
* Sets whether the class path must exist
|
||||
*
|
||||
* If it must exist, but it doesn't exist, an exception is thrown
|
||||
* on initialisation of the store
|
||||
*
|
||||
* @param mustExist
|
||||
*/
|
||||
public void setMustExist(boolean mustExist)
|
||||
{
|
||||
this.mustExist = mustExist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the class path
|
||||
*
|
||||
@@ -74,7 +88,22 @@ public class ClassPathStore implements WebScriptStore, InitializingBean
|
||||
throws Exception
|
||||
{
|
||||
ClassPathResource resource = new ClassPathResource(classPath);
|
||||
fileDir = resource.getFile();
|
||||
if (resource.exists())
|
||||
{
|
||||
fileDir = resource.getFile();
|
||||
}
|
||||
else if (mustExist)
|
||||
{
|
||||
throw new WebScriptException("Web Script Store classpath:" + classPath + " must exist; it was not found");
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.WebScriptStore#exists()
|
||||
*/
|
||||
public boolean exists()
|
||||
{
|
||||
return (fileDir != null);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
Reference in New Issue
Block a user