public class AddSortLinkProcessor
extends org.thymeleaf.processor.attr.AbstractAttributeModifierAttrProcessor
A Thymeleaf processor that generates a search query href that will reflect the current search criteria in addition to the requested sort string
This is intended to be used in an anchor tag:
<a blc:addsortlink="price">Sort By Price</a>
Produces:
<a class="asc" href="http://mysite.com/category?sort=price+asc">Sort By Price</a>
This sort link can then be picked up by the BroadleafCategoryController to actually translate search queries based
on that query parameter. If there is no sort active on the request then this will print out a link to sort ascending.
Otherwise the link will output the non-active sort (so that you can switch between them).
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowMultipleSorts |
| Constructor and Description |
|---|
AddSortLinkProcessor()
Sets the name of this processor to be used in Thymeleaf template
|
| Modifier and Type | Method and Description |
|---|---|
protected org.thymeleaf.processor.attr.AbstractAttributeModifierAttrProcessor.ModificationType |
getModificationType(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element,
String attributeName,
String newAttributeName) |
protected Map<String,String> |
getModifiedAttributeValues(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element,
String attributeName) |
int |
getPrecedence() |
protected boolean |
recomputeProcessorsAfterExecution(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element,
String attributeName) |
protected boolean |
removeAttributeIfEmpty(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element,
String attributeName,
String newAttributeName) |
doAdditionalProcess, processAttribute, shouldRemoveAttributedoProcess, getMatcherpublic AddSortLinkProcessor()
public int getPrecedence()
getPrecedence in class org.thymeleaf.processor.AbstractProcessorprotected Map<String,String> getModifiedAttributeValues(org.thymeleaf.Arguments arguments, org.thymeleaf.dom.Element element, String attributeName)
getModifiedAttributeValues in class org.thymeleaf.processor.attr.AbstractAttributeModifierAttrProcessorprotected org.thymeleaf.processor.attr.AbstractAttributeModifierAttrProcessor.ModificationType getModificationType(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element,
String attributeName,
String newAttributeName)
getModificationType in class org.thymeleaf.processor.attr.AbstractAttributeModifierAttrProcessorprotected boolean removeAttributeIfEmpty(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element,
String attributeName,
String newAttributeName)
removeAttributeIfEmpty in class org.thymeleaf.processor.attr.AbstractAttributeModifierAttrProcessorprotected boolean recomputeProcessorsAfterExecution(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element,
String attributeName)
recomputeProcessorsAfterExecution in class org.thymeleaf.processor.attr.AbstractAttributeModifierAttrProcessorCopyright © 2015. All Rights Reserved.