mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Preview and Staging area Preview URLs generated for the website view now respect current webapp
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4596 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -336,19 +336,19 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Preview URL for the current Staging store
|
* @return Preview URL for the current Staging store and current webapp
|
||||||
*/
|
*/
|
||||||
public String getStagingPreviewUrl()
|
public String getStagingPreviewUrl()
|
||||||
{
|
{
|
||||||
return AVMConstants.buildAVMStoreUrl(getStagingStore());
|
return AVMConstants.buildAVMWebappUrl(getStagingStore(), getWebapp());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Preview URL for the current User Sandbox store
|
* @return Preview URL for the current User Sandbox store and current webapp
|
||||||
*/
|
*/
|
||||||
public String getSandboxPreviewUrl()
|
public String getSandboxPreviewUrl()
|
||||||
{
|
{
|
||||||
return AVMConstants.buildAVMStoreUrl(getSandbox());
|
return AVMConstants.buildAVMWebappUrl(getSandbox(), getWebapp());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -123,6 +123,22 @@ public final class AVMConstants
|
|||||||
return MessageFormat.format(PREVIEW_SANDBOX_URL, lookupStoreDNS(store), config.getWCMDomain(), config.getWCMPort());
|
return MessageFormat.format(PREVIEW_SANDBOX_URL, lookupStoreDNS(store), config.getWCMDomain(), config.getWCMPort());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String buildAVMWebappUrl(String store, String webapp)
|
||||||
|
{
|
||||||
|
if (webapp == null || webapp.length() == 0)
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException("Webapp name is mandatory.");
|
||||||
|
}
|
||||||
|
if (!webapp.equals(DIR_ROOT))
|
||||||
|
{
|
||||||
|
return buildAVMStoreUrl(store) + '/' + webapp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return buildAVMStoreUrl(store);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String buildAVMAssetUrl(final String avmPath)
|
public static String buildAVMAssetUrl(final String avmPath)
|
||||||
{
|
{
|
||||||
if (avmPath == null || avmPath.length() == 0)
|
if (avmPath == null || avmPath.length() == 0)
|
||||||
|
@@ -333,10 +333,10 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
|||||||
out.write(")</td><td><nobr>");
|
out.write(")</td><td><nobr>");
|
||||||
|
|
||||||
// direct actions for a sandbox
|
// direct actions for a sandbox
|
||||||
String sandboxUrl = AVMConstants.buildAVMStoreUrl(mainStore);
|
String websiteUrl = AVMConstants.buildAVMWebappUrl(mainStore, getWebapp());
|
||||||
Utils.encodeRecursive(context, aquireAction(
|
Utils.encodeRecursive(context, aquireAction(
|
||||||
context, mainStore, username, ACT_SANDBOX_PREVIEW, "/images/icons/preview_website.gif",
|
context, mainStore, username, ACT_SANDBOX_PREVIEW, "/images/icons/preview_website.gif",
|
||||||
null, null, sandboxUrl, null));
|
null, null, websiteUrl, null));
|
||||||
out.write(" ");
|
out.write(" ");
|
||||||
|
|
||||||
Utils.encodeRecursive(context, aquireAction(
|
Utils.encodeRecursive(context, aquireAction(
|
||||||
|
Reference in New Issue
Block a user