org.broadleafcommerce.common.file.service
Class StaticAssetPathServiceImpl

java.lang.Object
  extended by org.broadleafcommerce.common.file.service.StaticAssetPathServiceImpl
All Implemented Interfaces:
StaticAssetPathService

@Service(value="blStaticAssetPathService")
public class StaticAssetPathServiceImpl
extends Object
implements StaticAssetPathService


Field Summary
protected  String staticAssetEnvironmentSecureUrlPrefix
           
protected  String staticAssetEnvironmentUrlPrefix
           
protected  String staticAssetUrlPrefix
           
 
Constructor Summary
StaticAssetPathServiceImpl()
           
 
Method Summary
 String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
          This method will take in an assetPath (think image url) and prepend the staticAssetUrlPrefix if one exists.
 String getStaticAssetEnvironmentSecureUrlPrefix()
          Returns the secure value of the environment url prefix (e.g.
 String getStaticAssetEnvironmentUrlPrefix()
          Returns the value configured for the current environment for the static asset url prefix.
 String getStaticAssetUrlPrefix()
          Returns the value configured to mark an item as a static URL.
 void setStaticAssetEnvironmentSecureUrlPrefix(String staticAssetEnvironmentSecureUrlPrefix)
           
 void setStaticAssetEnvironmentUrlPrefix(String staticAssetEnvironmentUrlPrefix)
          Sets the environment url prefix.
 void setStaticAssetUrlPrefix(String staticAssetUrlPrefix)
          Sets the static asset url prefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

staticAssetUrlPrefix

@Value(value="${asset.server.url.prefix.internal}")
protected String staticAssetUrlPrefix

staticAssetEnvironmentUrlPrefix

@Value(value="${asset.server.url.prefix}")
protected String staticAssetEnvironmentUrlPrefix

staticAssetEnvironmentSecureUrlPrefix

@Value(value="${asset.server.url.prefix.secure}")
protected String staticAssetEnvironmentSecureUrlPrefix
Constructor Detail

StaticAssetPathServiceImpl

public StaticAssetPathServiceImpl()
Method Detail

convertAssetPath

public String convertAssetPath(String assetPath,
                               String contextPath,
                               boolean secureRequest)
This method will take in an assetPath (think image url) and prepend the staticAssetUrlPrefix if one exists. Will append any contextPath onto the request. If the incoming assetPath contains the internalStaticAssetPrefix and the image is being prepended, the prepend will be removed.

Specified by:
convertAssetPath in interface StaticAssetPathService
Parameters:
assetPath - - The path to rewrite if it is a cms managed asset
contextPath - - The context path of the web application (if applicable)
secureRequest - - True if the request is being served over https
Returns:
See Also:
org.broadleafcommerce.common.file.service.StaticAssetService#getStaticAssetUrlPrefix(), org.broadleafcommerce.common.file.service.StaticAssetService#getStaticAssetEnvironmentUrlPrefix()

getStaticAssetUrlPrefix

public String getStaticAssetUrlPrefix()
Description copied from interface: StaticAssetPathService
Returns the value configured to mark an item as a static URL. OOB BLC maintains this value in common.properties.

Specified by:
getStaticAssetUrlPrefix in interface StaticAssetPathService

setStaticAssetUrlPrefix

public void setStaticAssetUrlPrefix(String staticAssetUrlPrefix)
Description copied from interface: StaticAssetPathService
Sets the static asset url prefix

Specified by:
setStaticAssetUrlPrefix in interface StaticAssetPathService

getStaticAssetEnvironmentUrlPrefix

public String getStaticAssetEnvironmentUrlPrefix()
Description copied from interface: StaticAssetPathService
Returns the value configured for the current environment for the static asset url prefix. If this is different than the common value, then the URLs will get rewritten by the FieldMapWrapper when called from the DisplayContentTag or ProcessURLFilter.

Specified by:
getStaticAssetEnvironmentUrlPrefix in interface StaticAssetPathService

setStaticAssetEnvironmentUrlPrefix

public void setStaticAssetEnvironmentUrlPrefix(String staticAssetEnvironmentUrlPrefix)
Description copied from interface: StaticAssetPathService
Sets the environment url prefix.

Specified by:
setStaticAssetEnvironmentUrlPrefix in interface StaticAssetPathService

getStaticAssetEnvironmentSecureUrlPrefix

public String getStaticAssetEnvironmentSecureUrlPrefix()
Description copied from interface: StaticAssetPathService
Returns the secure value of the environment url prefix (e.g. prefixed with https if needed).

Specified by:
getStaticAssetEnvironmentSecureUrlPrefix in interface StaticAssetPathService

setStaticAssetEnvironmentSecureUrlPrefix

public void setStaticAssetEnvironmentSecureUrlPrefix(String staticAssetEnvironmentSecureUrlPrefix)


Copyright © 2013. All Rights Reserved.