mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- moving generic xml parsing utilities out of FormsService and into their own class
- refactoring to generate and regenerate methods to make it easier to use project level overridden properties, and to at some point (soon) make it possible to make error handling for rendering engines more robust - added a web project object to encapsulate web project properties and provide a central location for getting forms and rendering engines with web project level overridden properties - made select default workflow screen match wireframes - using the same workflowdefault type in the wcm model for web projects and forms. - using outputpathpattern aspect consistently - using commons.io to parse paths - using form name rather than noderef as parameter for selected form from content forms dashlet - fixed bug where rendition properties noderef wasn't being properly associated with renditions causing problems with regenerate - using multivalued properties to track renditions - remove weird registerRendition/registerFormInstanceData calls. no longer necessary since generateRendition and regenerate are done within forminstancedata and rendition - adding default workflow parameters as property of Form - adding a unique name property to rendering engine templates to allow for looking one up by name git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4702 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,6 +18,7 @@ package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -25,7 +26,9 @@ import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.config.JNDIConstants;
|
||||
import org.alfresco.mbeans.VirtServerRegistry;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.service.cmr.avm.AVMNotFoundException;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
@@ -37,6 +40,7 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
/**
|
||||
* @author Ariel Backenroth
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public final class AVMConstants
|
||||
@@ -368,9 +372,9 @@ public final class AVMConstants
|
||||
{
|
||||
throw new IllegalArgumentException("Asset path is mandatory.");
|
||||
}
|
||||
if (assetPath.startsWith( '/' + JNDIConstants.DIR_DEFAULT_WWW + '/' + JNDIConstants.DIR_DEFAULT_APPBASE ))
|
||||
if (assetPath.startsWith('/' + JNDIConstants.DIR_DEFAULT_WWW + '/' + JNDIConstants.DIR_DEFAULT_APPBASE))
|
||||
{
|
||||
assetPath = assetPath.substring(('/' + JNDIConstants.DIR_DEFAULT_WWW + '/' + JNDIConstants.DIR_DEFAULT_APPBASE ).length());
|
||||
assetPath = assetPath.substring(('/' + JNDIConstants.DIR_DEFAULT_WWW + '/' + JNDIConstants.DIR_DEFAULT_APPBASE).length());
|
||||
}
|
||||
if (assetPath.startsWith('/' + DIR_ROOT))
|
||||
{
|
||||
@@ -516,6 +520,44 @@ public final class AVMConstants
|
||||
return m.matches() && m.group(1).length() != 0 ? m.group(1) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates all directories for a path if they do not already exist.
|
||||
*/
|
||||
public static void makeAllDirectories(final String avmDirectoryPath)
|
||||
{
|
||||
final ServiceRegistry serviceRegistry =
|
||||
Repository.getServiceRegistry(FacesContext.getCurrentInstance());
|
||||
final AVMService avmService = serviceRegistry.getAVMService();
|
||||
// LOGGER.debug("mkdir -p " + avmDirectoryPath);
|
||||
String s = avmDirectoryPath;
|
||||
final Stack<String[]> dirNames = new Stack<String[]>();
|
||||
while (s != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (avmService.lookup(-1, s) != null)
|
||||
{
|
||||
// LOGGER.debug("path " + s + " exists");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (AVMNotFoundException avmfe)
|
||||
{
|
||||
}
|
||||
final String[] sb = AVMNodeConverter.SplitBase(s);
|
||||
s = sb[0];
|
||||
// LOGGER.debug("pushing " + sb[1]);
|
||||
dirNames.push(sb);
|
||||
}
|
||||
|
||||
while (!dirNames.isEmpty())
|
||||
{
|
||||
final String[] sb = dirNames.pop();
|
||||
// LOGGER.debug("creating " + sb[1] + " in " + sb[0]);
|
||||
avmService.createDirectory(sb[0], sb[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param path Path to match against
|
||||
*
|
||||
@@ -628,18 +670,16 @@ public final class AVMConstants
|
||||
private final static Pattern STORE_RELATIVE_PATH_PATTERN =
|
||||
Pattern.compile("[^:]+:(.+)");
|
||||
private final static Pattern WEBAPP_RELATIVE_PATH_PATTERN =
|
||||
Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW +
|
||||
"/" + JNDIConstants.DIR_DEFAULT_APPBASE + "/([^/]+))(.*)");
|
||||
Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW +
|
||||
"/" + JNDIConstants.DIR_DEFAULT_APPBASE + "/([^/]+))(.*)");
|
||||
private final static Pattern SANDBOX_RELATIVE_PATH_PATTERN =
|
||||
Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW +
|
||||
"/" + JNDIConstants.DIR_DEFAULT_APPBASE + ")(.*)");
|
||||
Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW +
|
||||
"/" + JNDIConstants.DIR_DEFAULT_APPBASE + ")(.*)");
|
||||
|
||||
// patterns for WEB-INF files that require virtualisation server reload
|
||||
private final static Pattern WEB_INF_PATH_PATTERN =
|
||||
Pattern.compile( ".*:/" +
|
||||
JNDIConstants.DIR_DEFAULT_WWW + "/" +
|
||||
JNDIConstants.DIR_DEFAULT_APPBASE + "/" +
|
||||
".*/WEB-INF/((classes/.*)|(lib/.*)|(web.xml))",
|
||||
Pattern.CASE_INSENSITIVE
|
||||
);
|
||||
Pattern.compile(".*:/" + JNDIConstants.DIR_DEFAULT_WWW +
|
||||
"/" + JNDIConstants.DIR_DEFAULT_APPBASE + "/" +
|
||||
".*/WEB-INF/((classes/.*)|(lib/.*)|(web.xml))",
|
||||
Pattern.CASE_INSENSITIVE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user