public void execute(UIRequest request, UIResponse response) throws UIControllerException
{
try
{
ModelRequestWrapper wrappedRequest = new ModelRequestWrapper(request);
ModelResponseWrapper wrappedResponse = new ModelResponseWrapper(response);
readConfig();
ListingDescriptor listing = createListingDescriptor(wrappedRequest);
if (! StringTools.isEmpty(request.getParameterAsString("listId")))
{
listing.setId(request.getParameterAsString("listId"));
}
if (request.getParameter(listing.getId() + "Page") != null)
{
listing.setPage(NumberTools.toInt(request.getParameter(listing.getId() + "Page"), listing.getPage()));
}
listing.updateSort(wrappedRequest);
if (! StringTools.isTrimEmpty(request.getParameterAsString(listId
+ ListingDescriptor.SEARCH_CATEGORY_PARAMETER_SUFFIX)))
{
listing.setCategory(request.getParameterAsString(listId
+ ListingDescriptor.SEARCH_CATEGORY_PARAMETER_SUFFIX));
}
Map<String, String> searchCategories = handler.createSearchCategories(wrappedRequest, listing);
if (searchCategories != null)
{
listing.setCategories(searchCategories);
}
String currentSearchCategory = handler.getCurrentSearchCategory(wrappedRequest, listing);
if (currentSearchCategory != null)
{
listing.setCategory(currentSearchCategory);
}
ListContext context = createListContext(wrappedRequest, listing);
handler.adjustListing(wrappedRequest, listing, context);
ListFiller filler = handler.createListing(wrappedRequest, listing, handler, context);
ListTools.createListing(wrappedRequest, wrappedResponse, listing, handler, context, filler);
wrappedResponse.get(listing.getId()).setAttribute("formAction", "bean");
if (forward != null)
{
response.setForward(forward);
}