mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4975 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -295,7 +295,7 @@ public abstract class BaseTemplateContentServlet extends BaseServlet
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Template Image resolver helper */
|
/** Template Image resolver helper */
|
||||||
private TemplateImageResolver imageResolver = new TemplateImageResolver()
|
protected TemplateImageResolver imageResolver = new TemplateImageResolver()
|
||||||
{
|
{
|
||||||
public String resolveImagePathForName(String filename, boolean small)
|
public String resolveImagePathForName(String filename, boolean small)
|
||||||
{
|
{
|
||||||
|
@@ -111,7 +111,7 @@ public class GuestTemplateContentServlet extends BaseTemplateContentServlet
|
|||||||
guestUser.setHomeSpaceId(guestHomeRef.getId());
|
guestUser.setHomeSpaceId(guestHomeRef.getId());
|
||||||
|
|
||||||
// build the default model
|
// build the default model
|
||||||
return DefaultModelHelper.buildDefaultModel(services, guestUser, templateRef);
|
return DefaultModelHelper.buildDefaultModel(services, guestUser, templateRef, this.imageResolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -84,7 +84,7 @@ public class TemplateContentServlet extends BaseTemplateContentServlet
|
|||||||
NodeRef templateRef)
|
NodeRef templateRef)
|
||||||
{
|
{
|
||||||
return DefaultModelHelper.buildDefaultModel(services,
|
return DefaultModelHelper.buildDefaultModel(services,
|
||||||
Application.getCurrentUser(req.getSession()), templateRef);
|
Application.getCurrentUser(req.getSession()), templateRef, this.imageResolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -55,11 +55,31 @@ public class DefaultModelHelper
|
|||||||
* Other root level objects such as the current Space or Document are generally
|
* Other root level objects such as the current Space or Document are generally
|
||||||
* added by the appropriate bean responsible for provided access to those nodes.
|
* added by the appropriate bean responsible for provided access to those nodes.
|
||||||
* <p>
|
* <p>
|
||||||
|
* Uses the default TemplateImageResolver instance to resolve icons - assumes that the client
|
||||||
|
* has a valid FacesContext.
|
||||||
|
* <p>
|
||||||
* See {@link http://www.alfresco.org/mediawiki/index.php/Template_Guide}
|
* See {@link http://www.alfresco.org/mediawiki/index.php/Template_Guide}
|
||||||
*
|
*
|
||||||
* @return Map containing the default model.
|
* @return Map containing the default model.
|
||||||
*/
|
*/
|
||||||
public static Map<String, Object> buildDefaultModel(ServiceRegistry services, User user, NodeRef template)
|
public static Map<String, Object> buildDefaultModel(
|
||||||
|
ServiceRegistry services, User user, NodeRef template)
|
||||||
|
{
|
||||||
|
return buildDefaultModel(services, user, template, imageResolver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct the default FreeMarker template model.
|
||||||
|
* <p>
|
||||||
|
* Other root level objects such as the current Space or Document are generally
|
||||||
|
* added by the appropriate bean responsible for provided access to those nodes.
|
||||||
|
* <p>
|
||||||
|
* See {@link http://www.alfresco.org/mediawiki/index.php/Template_Guide}
|
||||||
|
*
|
||||||
|
* @return Map containing the default model.
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> buildDefaultModel(
|
||||||
|
ServiceRegistry services, User user, NodeRef template, TemplateImageResolver resolver)
|
||||||
{
|
{
|
||||||
if (services == null)
|
if (services == null)
|
||||||
{
|
{
|
||||||
@@ -74,7 +94,7 @@ public class DefaultModelHelper
|
|||||||
NodeRef userRootRef = new NodeRef(Repository.getStoreRef(), user.getHomeSpaceId());
|
NodeRef userRootRef = new NodeRef(Repository.getStoreRef(), user.getHomeSpaceId());
|
||||||
|
|
||||||
return FreeMarkerProcessor.buildDefaultModel(
|
return FreeMarkerProcessor.buildDefaultModel(
|
||||||
services, user.getPerson(), companyRootRef, userRootRef, template, imageResolver);
|
services, user.getPerson(), companyRootRef, userRootRef, template, resolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Template Image resolver helper */
|
/** Template Image resolver helper */
|
||||||
|
Reference in New Issue
Block a user