/** Delegate to parent. */ public Decorator getDecorator(HttpServletRequest request, Page page) { return parent.getDecorator(request, page); }
/** Delegate to parent. */ public Decorator getNamedDecorator(HttpServletRequest request, String name) { return parent.getNamedDecorator(request, name); } }
@Override public void init(Config config, Properties properties, DecoratorMapper decoratorMapper) throws InstantiationException { target.init(config, properties, decoratorMapper); }
@Override public Decorator getDecorator(HttpServletRequest httpServletRequest, Page page) { return wrapDecorator(target.getDecorator(httpServletRequest, page)); }
@Override public Decorator getNamedDecorator(HttpServletRequest httpServletRequest, String name) { return wrapDecorator(target.getNamedDecorator(httpServletRequest, name)); }
/** * Get the decorator mapper for this module. This method will return an initialised decorator mapper. In order to * initialise it though, it needs a parent decorator mapper and configuration, that's why getModule() isn't used. * * @param config The Sitemesh configuration * @param parent The parent decorator mapper * @return An initialised decorator mapper */ @ClusterSafe("Local. We are just manipulating the sitemesh configuration in the local web app.") public synchronized DecoratorMapper getDecoratorMapper(Config config, DecoratorMapper parent) { if (decoratorMapper == null) { decoratorMapper = createDecoratorMapper(); try { decoratorMapper.init(config, new Properties(), parent); } catch (InstantiationException ie) { log.error("Error initialising decorator mapper in plugin " + getKey(), ie); decoratorMapper = null; } } return decoratorMapper; }
if (osHeader == null) return parent.getDecorator(request, page); String decoratorName = parent.getDecorator(request, page).getName(); if (decoratorName != null) { decoratorName += '-' + properties.getProperty(os); return parent.getDecorator(request, page);
/** * Returns a Sitemesh Decorator object with the <code>decoratorName</code> specified. * * @param request * @param decoratorName * @return */ protected Decorator getDecorator(HttpServletRequest request, String decoratorName) { return getSitemeshFactory().getDecoratorMapper().getNamedDecorator(request, decoratorName); }
/** Push new DecoratorMapper onto end of chain. */ protected void pushDecoratorMapper(String className, Properties properties) { try { Class decoratorMapperClass = ClassLoaderUtil.loadClass(className, getClass()); DecoratorMapper newMapper = getDecoratorMapper(decoratorMapperClass); newMapper.init(config, properties, decoratorMapper); decoratorMapper = newMapper; } catch (ClassNotFoundException e) { throw new FactoryException("Could not load DecoratorMapper class : " + className, e); } catch (Exception e) { throw new FactoryException("Could not initialize DecoratorMapper : " + className, e); } }
pageObj.setRequest((HttpServletRequest) pageContext.getRequest()); pageContext.getRequest().setAttribute(DECORATOR, decorator); Decorator d = decoratorMapper.getDecorator(((HttpServletRequest) pageContext.getRequest()), pageObj); pageContext.getRequest().removeAttribute(DECORATOR);
if (decoratorMapper != null) Decorator decorator = decoratorMapper.getNamedDecorator(httpServletRequest, name); if (decorator != null)
if (decoratorMapper != null) Decorator decorator = decoratorMapper.getDecorator(httpServletRequest, page); if (decorator != null)
public com.opensymphony.sitemesh.Decorator selectDecorator(Content content, SiteMeshContext context) { SiteMeshWebAppContext webAppContext = (SiteMeshWebAppContext) context; HttpServletRequest request = webAppContext.getRequest(); com.opensymphony.module.sitemesh.Decorator decorator = decoratorMapper.getDecorator(request, new Content2HTMLPage(content, request)); if (decorator == null || decorator.getPage() == null) { return new NoDecorator(); } else { return new OldDecorator2NewStrutsFreemarkerDecorator(decorator); } } }
public com.opensymphony.sitemesh.Decorator selectDecorator(Content content, SiteMeshContext context) { SiteMeshWebAppContext webAppContext = (SiteMeshWebAppContext) context; HttpServletRequest request = webAppContext.getRequest(); Decorator decorator = decoratorMapper.getDecorator(request, new Content2HTMLPage(content, request)); if (decorator == null || decorator.getPage() == null) { return new NoDecorator(); } else { return new OldDecorator2NewStrutsVelocityDecorator(decorator); } } }
public Decorator selectDecorator(Content content, SiteMeshContext context) { SiteMeshWebAppContext webAppContext = (SiteMeshWebAppContext) context; HttpServletRequest request = webAppContext.getRequest(); com.opensymphony.module.sitemesh.Decorator decorator = decoratorMapper.getDecorator(request, new Content2HTMLPage(content, request)); if (decorator == null || decorator.getPage() == null) { return new NoDecorator(); } else { return new OldDecorator2NewDecorator(decorator); } } }
Decorator decorator = decoratorMapper.getDecorator(request, htmlPage); template = decorator.getPage();
Decorator decorator = decoratorMapper.getDecorator(request, htmlPage); template = decorator.getPage();