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:
David Caruana
2007-06-06 11:57:42 +00:00
parent c89bce7bda
commit 3d86571cda
9 changed files with 127 additions and 62 deletions

View File

@@ -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)