- changing terminology from root tag name to root element name

- fixing form data functions calls with absolute paths - making them webapp relative - and adding test cases

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4218 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-10-24 23:40:05 +00:00
parent 3d6221f39e
commit 5b6772ac2c
10 changed files with 99 additions and 40 deletions

View File

@@ -16,6 +16,8 @@
*/
package org.alfresco.web.forms;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.faces.context.FacesContext;
import org.alfresco.model.WCMModel;
import org.alfresco.repo.avm.AVMRemote;
@@ -91,17 +93,23 @@ public abstract class AbstractRenderingEngine
return parentAVMPath;
}
if (path.charAt(0) == '/')
{
//XXXarielb this doesn't work with context paths for the website
parent = parentAVMPath.substring(0,
parentAVMPath.indexOf(':') +
('/' + AVMConstants.DIR_APPBASE +
'/' + AVMConstants.DIR_WEBAPPS).length());
final Pattern p = Pattern.compile("([^:]+:/" + AVMConstants.DIR_APPBASE +
"/[^/]+/[^/]+).*");
final Matcher m = p.matcher(parentAVMPath);
if (m.matches())
{
parent = m.group(1);
}
}
else if (parentAVMPath.charAt(parentAVMPath.length() - 1) != '/')
{
parent = parent + '/';
}
final String result =
parent + (parent.endsWith("/") || path.startsWith("/") ? path : '/' + path);
final String result = parent + path;
LOGGER.debug("built full avmPath " + result +
" for parent " + parentAVMPath +
" and request path " + path);