org.jasig.resource.aggr.util
Class ResourcesElementsProviderImpl

java.lang.Object
  extended by org.jasig.resource.aggr.util.ResourcesElementsProviderImpl
All Implemented Interfaces:
ResourcesElementsProvider, org.springframework.context.ResourceLoaderAware

public class ResourcesElementsProviderImpl
extends Object
implements org.springframework.context.ResourceLoaderAware, ResourcesElementsProvider

ResourcesDao implementation that resolves the String argument using the ServletContext. Depends on JAXBContext to unmarshal the Resources.

Author:
Nicholas Blair, npblair@wisc.edu
See Also:
ServletContextAware, JAXBContext

Field Summary
static String AGGREGATED_THEME_PARAMETER
           
static String DEFAULT_AGGREGATION_ENABLED
           
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
ResourcesElementsProviderImpl()
           
 
Method Summary
protected  void appendCssNode(Document document, DocumentFragment head, Css css, String relativeRoot)
          Convert the Css argument to an HTML link tag and append it to the DocumentFragment.
protected  void appendJsNode(Document document, DocumentFragment head, Js js, String relativeRoot)
          Convert the Js argument to an HTML script tag and append it to the DocumentFragment.
 Included getDefaultIncludedType()
          They type of resources to be returned by default
 Included getIncludedType(javax.servlet.http.HttpServletRequest request)
          They type of resources to be returned for this request
protected  org.springframework.core.io.Resource getResource(String skinXml)
           
protected  Resources getResources(javax.servlet.http.HttpServletRequest request, String skinXml)
           
 String getResourcesParameter(javax.servlet.http.HttpServletRequest request, String skinXml, String name)
          Get the specified skin parameter, null if there is no parameter with the specified name
 NodeList getResourcesXmlFragment(javax.servlet.http.HttpServletRequest request, String skinXml)
          Get an XML NodeList of link and script tags for the specified skin.
 void setDefaultIncludedType(Included included)
          Set the default include type for resources.
 void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
           
 void setResourcesDao(ResourcesDao resourcesDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGGREGATED_THEME_PARAMETER

public static final String AGGREGATED_THEME_PARAMETER

DEFAULT_AGGREGATION_ENABLED

public static final String DEFAULT_AGGREGATION_ENABLED

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

ResourcesElementsProviderImpl

public ResourcesElementsProviderImpl()
Method Detail

setResourceLoader

public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Specified by:
setResourceLoader in interface org.springframework.context.ResourceLoaderAware

setResourcesDao

public void setResourcesDao(ResourcesDao resourcesDao)

setDefaultIncludedType

public void setDefaultIncludedType(Included included)
Description copied from interface: ResourcesElementsProvider
Set the default include type for resources. Included.PLAIN results in un-aggregated resources being returned. Included.AGGREGATED results in aggregated resources being returned. Included.BOTH is not supported as an argument here.

Specified by:
setDefaultIncludedType in interface ResourcesElementsProvider

getDefaultIncludedType

public Included getDefaultIncludedType()
Description copied from interface: ResourcesElementsProvider
They type of resources to be returned by default

Specified by:
getDefaultIncludedType in interface ResourcesElementsProvider

getIncludedType

public Included getIncludedType(javax.servlet.http.HttpServletRequest request)
Description copied from interface: ResourcesElementsProvider
They type of resources to be returned for this request

Specified by:
getIncludedType in interface ResourcesElementsProvider

getResourcesParameter

public String getResourcesParameter(javax.servlet.http.HttpServletRequest request,
                                    String skinXml,
                                    String name)
Description copied from interface: ResourcesElementsProvider
Get the specified skin parameter, null if there is no parameter with the specified name

Specified by:
getResourcesParameter in interface ResourcesElementsProvider

getResourcesXmlFragment

public NodeList getResourcesXmlFragment(javax.servlet.http.HttpServletRequest request,
                                        String skinXml)
Description copied from interface: ResourcesElementsProvider
Get an XML NodeList of link and script tags for the specified skin. Uses ResourcesElementsProvider.getIncludedType(HttpServletRequest) to determine which resource URLs to use.

Specified by:
getResourcesXmlFragment in interface ResourcesElementsProvider

getResources

protected Resources getResources(javax.servlet.http.HttpServletRequest request,
                                 String skinXml)

getResource

protected org.springframework.core.io.Resource getResource(String skinXml)

appendJsNode

protected void appendJsNode(Document document,
                            DocumentFragment head,
                            Js js,
                            String relativeRoot)
Convert the Js argument to an HTML script tag and append it to the DocumentFragment.

Parameters:
document -
head -
js -
relativeRoot -

appendCssNode

protected void appendCssNode(Document document,
                             DocumentFragment head,
                             Css css,
                             String relativeRoot)
Convert the Css argument to an HTML link tag and append it to the DocumentFragment.

Parameters:
document -
head -
css -
relativeRoot -


Copyright © 2010 Jasig. All Rights Reserved.