My Forms template now opens website virtualisation URL when icon clicked.

New Template AVM API methods added to generate staging, user sandbox and path asset URLs for virtualisation server.
Some refactoring of constants used in AVMConstants into JNDIConstants to allow repository classes to also use them.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5624 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-05-04 11:27:46 +00:00
parent dd5a638c20
commit 741fb75305
3 changed files with 26 additions and 27 deletions

View File

@@ -49,8 +49,6 @@ import org.alfresco.util.VirtServerUtils;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.config.ClientConfigElement;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.jsf.FacesContextUtils;
/**
@@ -597,7 +595,7 @@ public final class AVMConstants
store = store.substring(0, store.indexOf(':'));
}
ClientConfigElement config = Application.getClientConfig(FacesContext.getCurrentInstance());
return MessageFormat.format(PREVIEW_SANDBOX_URL,
return MessageFormat.format(JNDIConstants.PREVIEW_SANDBOX_URL,
lookupStoreDNS(store),
config.getWCMDomain(),
config.getWCMPort());
@@ -677,7 +675,7 @@ public final class AVMConstants
assetPath = '/' + assetPath;
}
return MessageFormat.format(PREVIEW_ASSET_URL, dns, domain, port, assetPath);
return MessageFormat.format(JNDIConstants.PREVIEW_ASSET_URL, dns, domain, port, assetPath);
}
public static String lookupStoreDNS(String store)
@@ -952,9 +950,7 @@ public final class AVMConstants
private static VirtServerRegistry getVirtServerRegistry()
{
final FacesContext fc = FacesContext.getCurrentInstance();
final WebApplicationContext ac = FacesContextUtils.getRequiredWebApplicationContext(fc);
return (VirtServerRegistry)ac.getBean(BEAN_VIRT_SERVER_REGISTRY);
return Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getVirtServerRegistry();
}
private static ConfigElement getDeploymentConfig()
@@ -1004,13 +1000,6 @@ public final class AVMConstants
public final static String ROLE_CONTENT_MANAGER = "ContentManager";
public final static String ROLE_CONTENT_PUBLISHER = "ContentPublisher";
// virtualisation server MBean registry
private static final String BEAN_VIRT_SERVER_REGISTRY = "VirtServerRegistry";
// URLs for preview of sandboxes and assets
private final static String PREVIEW_SANDBOX_URL = "http://{0}.www--sandbox.{1}:{2}";
private final static String PREVIEW_ASSET_URL = "http://{0}.www--sandbox.{1}:{2}{3}";
// pattern for absolute AVM Path
private final static Pattern STORE_RELATIVE_PATH_PATTERN =
Pattern.compile("[^:]+:(.+)");