mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.9 to HEAD
9848: Merged V2.2 to V2.9 9610: Fixed ETWOTWO-548 10232: Merged V2.2 to V2.9 10231: Merged V2.1 to V2.2 10229: Merged V2.1-A to V2.1 10227: https://issues.alfresco.com/jira/browse/ADB-106 10530: Merged V2.2 to V2.9 9847: Applied patch for ETWOTWO-542 (supplied by Peter Monks) 9897: Fix for ETWOTWO-302: Alphabetise advanced workflow names 9901: Fixed ETWOTWO-426: V2.2 upgrade problems with MySQL 5.0.51 9902: Fix for ETWOTWO-438: Versionable aspect and add-content permissions 9905: Fix ETWOTWO-560 9912: Increased test wait iterations from 10 (10s) to 100 (100s). 9919: Part fix for ACT-3574: Added close for schema bootstrap connection git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10612 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -36,7 +36,6 @@ import org.alfresco.config.ConfigElement;
|
||||
import org.alfresco.config.ConfigService;
|
||||
import org.alfresco.config.JNDIConstants;
|
||||
import org.alfresco.mbeans.VirtServerRegistry;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
@@ -52,7 +51,12 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.VirtServerUtils;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.wcm.preview.PreviewURIService;
|
||||
import org.alfresco.web.bean.wcm.preview.VirtualisationServerPreviewURIService;
|
||||
import org.alfresco.web.config.ClientConfigElement;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
|
||||
/**
|
||||
@@ -603,6 +607,30 @@ public final class AVMUtil
|
||||
return MessageFormat.format(JNDIConstants.PREVIEW_ASSET_URL, dns, domain, port, assetPath);
|
||||
}
|
||||
|
||||
public static String getPreviewURI(final String storeId, final String assetPath)
|
||||
{
|
||||
if (previewURIGenerator == null)
|
||||
{
|
||||
WebApplicationContext wac = FacesContextUtils.getRequiredWebApplicationContext(
|
||||
FacesContext.getCurrentInstance());
|
||||
|
||||
if (wac.containsBean(SPRING_BEAN_NAME_PREVIEW_URI_SERVICE))
|
||||
{
|
||||
// if the bean is present retrieve it
|
||||
previewURIGenerator = (PreviewURIService)wac.getBean(SPRING_BEAN_NAME_PREVIEW_URI_SERVICE,
|
||||
PreviewURIService.class);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Backwards compatibility - if the new Spring bean doesn't exist, default to the
|
||||
// existing behaviour (create a URL to the virtualisation server).
|
||||
previewURIGenerator = new VirtualisationServerPreviewURIService();
|
||||
}
|
||||
}
|
||||
|
||||
return previewURIGenerator.getPreviewURI(storeId, assetPath);
|
||||
}
|
||||
|
||||
public static String lookupStoreDNS(String store)
|
||||
{
|
||||
if (store == null || store.length() == 0)
|
||||
@@ -987,4 +1015,7 @@ public final class AVMUtil
|
||||
|
||||
private static ConfigElement deploymentConfig = null;
|
||||
private static ConfigElement linksManagementConfig = null;
|
||||
|
||||
private final static String SPRING_BEAN_NAME_PREVIEW_URI_SERVICE = "PreviewURIService";
|
||||
private static PreviewURIService previewURIGenerator = null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user