public class CollectionURLGeneratorTransformer<C extends Product> extends ProductURLGeneratorTransformer<C>
Transformer that accepts collection Id/sku or any identifier that #collectionFetch accepts or Collection as Product and produces a Link for it.
In addition to basic URL construction it also allows secureURL(Object, String) to add a SALT.secureURL(Object, String) in the submit process, it can validate the URL SALT.
CollectionAttributes.ATTRIB_COLLECTION_META_JSON
TODO: Add Unit test case| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_NAME
The Salat parameter name
|
idFieldName, idParamName, productFetch, productServicesecureURLUsingSaltparamsAdded, usePathAsParamsfilter, processors| Constructor and Description |
|---|
CollectionURLGeneratorTransformer() |
CollectionURLGeneratorTransformer(Class<org.apache.wicket.Page> base) |
CollectionURLGeneratorTransformer(CollectionURLGeneratorTransformer t,
ProductService<C> productService)
Allow to create a submit transformer from a ReadOnly version or visa versa
based on if productService is null.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
addAnalyticsParams(Object input,
String url)
Add analytic params (not affected by
URLGeneratorTransformer.secureURL(Object, String)) |
protected String |
cleanAndValidate(String url) |
protected void |
encryptParameter(Map.Entry<String,String> keyVaue,
Key key)
Encrypts a parameter key value pair.
|
String |
getCampaignPropertyName() |
String |
getMedium()
If the medium of sending the link is email, newsletter etc.
|
int |
getSaltLength() |
boolean |
isUpdateMode()
If true will not modify and persist the collection, will rather read from the collection.
|
protected String |
secureURL(Object input,
String url)
Adds the
CollectionAttributes#ATTRIB_COLLECTION_ACCESS_SALT as salt param and collectionId param. |
void |
setCampaignPropertyName(String campaignPropertyName) |
void |
setMedium(String medium)
If the medium of sending the link is email, newsletter etc.
|
void |
setSaltLength(int saltLength) |
void |
setUpdateMode(boolean updateMode)
If true will not modify and persist the collection, will rather read from the collection.
|
Object |
transform(Object colRef)
|
decorateURL, getCollectionFetch, getIdFieldName, getIdParamName, getProductService, setCollectionFetch, setIdFieldName, setIdParamName, setProductServicegetBaseUrlStr, getProtocolStrict, getUrlFormat, getWwwStrict, initWithRequestCycle, isAbsolute, isSecureURLUsingSalt, setAbsolute, setBaseUrlStr, setProtocolStrict, setSecureURLUsingSalt, setUrlFormat, setWwwStrictisParamsAdded, isUsePathAsParams, joinDelimet, setParamsAdded, setProcessors, setUsePathAsParamscleanDangligngDelimets, getDanglingDelimRegEx, getDelimiter, join, setDanglingDelimRegEx, setDelimitergetFilter, getProcessors, setFilterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplypublic static final String KEY_NAME
public CollectionURLGeneratorTransformer()
public CollectionURLGeneratorTransformer(Class<org.apache.wicket.Page> base)
public CollectionURLGeneratorTransformer(CollectionURLGeneratorTransformer t, ProductService<C> productService) throws Exception
Exceptionprotected void encryptParameter(Map.Entry<String,String> keyVaue, Key key) throws Exception
protected String addAnalyticsParams(Object input, String url) throws Exception
URLGeneratorTransformerURLGeneratorTransformer.secureURL(Object, String))addAnalyticsParams in class URLGeneratorTransformerinput - as Objecturl - as StringExceptionprotected String cleanAndValidate(String url)
cleanAndValidate in class ProductURLGeneratorTransformer<C extends Product>protected String secureURL(Object input, String url)
CollectionAttributes#ATTRIB_COLLECTION_ACCESS_SALT as salt param and collectionId param.secureURL in class WicketURLGeneratorTransformerpublic Object transform(Object colRef)
URLGeneratorTransformerURLGeneratorTransformer.secureURL(Object, String) then URLGeneratorTransformer.decorateURL(Object, String) and then URLGeneratorTransformer.addAnalyticsParams(Object, String)transform in interface org.apache.commons.collections.Transformertransform in class ProductURLGeneratorTransformer<C extends Product>public boolean isUpdateMode()
public void setUpdateMode(boolean updateMode)
public String getMedium()
public void setMedium(String medium)
public int getSaltLength()
public void setSaltLength(int saltLength)
public String getCampaignPropertyName()
public void setCampaignPropertyName(String campaignPropertyName)
Copyright © 2018. All rights reserved.