Class MediaSearchByCodeNamedQueryDataPopulator
- java.lang.Object
-
- de.hybris.platform.cmsfacades.common.populator.impl.AbstractNamedQueryDataPopulator
-
- de.hybris.platform.cmsfacades.media.populator.MediaSearchByCodeNamedQueryDataPopulator
-
- All Implemented Interfaces:
Populator<NamedQueryData,NamedQuery>
public class MediaSearchByCodeNamedQueryDataPopulator extends AbstractNamedQueryDataPopulator
This populator will convert parameters for the Media Search by code Named Query. This converter uses the catalogId and catalogVersionId parameters to fetch theCatalogVersionModel
and add it to the NamedQuery parameter's Map.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PARAM_CATALOG_ID
static java.lang.String
PARAM_CATALOG_VERSION
static java.lang.String
PARAM_CODE
-
Fields inherited from class de.hybris.platform.cmsfacades.common.populator.impl.AbstractNamedQueryDataPopulator
COLON, COMMA, PERCENT
-
-
Constructor Summary
Constructors Constructor Description MediaSearchByCodeNamedQueryDataPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
buildParameterStringMap(java.lang.String params)
Using the parameter String, convert it to a Mapfor future processing. java.util.Map<java.lang.String,? extends java.lang.Object>
convertParameters(java.lang.String params)
Converts the parameters from the request String into a Map.protected CatalogVersionService
getCatalogVersionService()
void
setCatalogVersionService(CatalogVersionService catalogVersionService)
protected void
validateInputParameters(java.lang.String catalogId, java.lang.String catalogVersionId, java.lang.String code)
Validate if the input parameters are empty, and if they are, throws a ConversionException-
Methods inherited from class de.hybris.platform.cmsfacades.common.populator.impl.AbstractNamedQueryDataPopulator
getActiveCatalogVersion, getCmsAdminSiteService, populate, setCmsAdminSiteService
-
-
-
-
Field Detail
-
PARAM_CODE
public static final java.lang.String PARAM_CODE
- See Also:
- Constant Field Values
-
PARAM_CATALOG_ID
public static final java.lang.String PARAM_CATALOG_ID
- See Also:
- Constant Field Values
-
PARAM_CATALOG_VERSION
public static final java.lang.String PARAM_CATALOG_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
convertParameters
public java.util.Map<java.lang.String,? extends java.lang.Object> convertParameters(java.lang.String params)
Description copied from class:AbstractNamedQueryDataPopulator
Converts the parameters from the request String into a Map. The input, if not empty, should be already validated with the following format: {param}:{value} Multiple parameters are also allowed separated by comma- Specified by:
convertParameters
in classAbstractNamedQueryDataPopulator
- Parameters:
params
- - the parameters received from the request- Returns:
- a Map of parameters
-
validateInputParameters
protected void validateInputParameters(java.lang.String catalogId, java.lang.String catalogVersionId, java.lang.String code)
Validate if the input parameters are empty, and if they are, throws a ConversionException- Parameters:
catalogId
- - the catalog id extracted from the requestcatalogVersionId
- - the catalog version id extracted from the request- Throws:
ConversionException
-
buildParameterStringMap
public java.util.Map<java.lang.String,java.lang.String> buildParameterStringMap(java.lang.String params)
Using the parameter String, convert it to a Mapfor future processing. Suppress sonar warning (squid:S2095 | Java's garbage collection cannot be relied on to clean up everything. Specifically, connections, streams, files and other classes that implement the Closeable interface or it's super-interface) : in this case Stream is not opening any connection or IO stream. - Overrides:
buildParameterStringMap
in classAbstractNamedQueryDataPopulator
- Parameters:
params
- - the String parameter received from the request- Returns:
- a Map
representing the requested parameter String
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
-