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 caseModifier and Type | Field and Description |
---|---|
static String |
KEY_NAME
The Salat parameter name
|
idFieldName, idParamName, productFetch, productService
secureURLUsingSalt
paramsAdded, usePathAsParams
filter, 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, setProductService
getBaseUrlStr, getProtocolStrict, getUrlFormat, getWwwStrict, initWithRequestCycle, isAbsolute, isSecureURLUsingSalt, setAbsolute, setBaseUrlStr, setProtocolStrict, setSecureURLUsingSalt, setUrlFormat, setWwwStrict
isParamsAdded, isUsePathAsParams, joinDelimet, setParamsAdded, setProcessors, setUsePathAsParams
cleanDangligngDelimets, getDanglingDelimRegEx, getDelimiter, join, setDanglingDelimRegEx, setDelimiter
getFilter, getProcessors, setFilter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply
public static final String KEY_NAME
public CollectionURLGeneratorTransformer()
public CollectionURLGeneratorTransformer(Class<org.apache.wicket.Page> base)
public CollectionURLGeneratorTransformer(CollectionURLGeneratorTransformer t, ProductService<C> productService) throws Exception
Exception
protected void encryptParameter(Map.Entry<String,String> keyVaue, Key key) throws Exception
protected String addAnalyticsParams(Object input, String url) throws Exception
URLGeneratorTransformer
URLGeneratorTransformer.secureURL(Object, String)
)addAnalyticsParams
in class URLGeneratorTransformer
input
- as Objecturl
- as StringException
protected 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 WicketURLGeneratorTransformer
public Object transform(Object colRef)
URLGeneratorTransformer
URLGeneratorTransformer.secureURL(Object, String)
then URLGeneratorTransformer.decorateURL(Object, String)
and then URLGeneratorTransformer.addAnalyticsParams(Object, String)
transform
in interface org.apache.commons.collections.Transformer
transform
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.