Revision fdbff5bc
Added by Andreas Müller over 3 years ago
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/BaseListController.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 |
|
|
11 | 9 |
package eu.etaxonomy.cdm.remote.controller; |
12 | 10 |
|
13 | 11 |
import java.io.IOException; |
... | ... | |
37 | 35 |
import eu.etaxonomy.cdm.remote.editor.CdmTypePropertyEditor; |
38 | 36 |
import eu.etaxonomy.cdm.remote.editor.UUIDPropertyEditor; |
39 | 37 |
|
40 |
|
|
41 | 38 |
/** |
42 | 39 |
* @author a.kohlbecker |
43 | 40 |
* @since 22.07.2009 |
44 |
* |
|
45 |
* @param <T> |
|
46 |
* @param <SERVICE> |
|
47 | 41 |
*/ |
48 | 42 |
public abstract class BaseListController <T extends CdmBase, SERVICE extends IService<T>> extends AbstractListController<T, SERVICE> { |
49 | 43 |
|
... | ... | |
55 | 49 |
binder.registerCustomEditor(Class.class, new CdmTypePropertyEditor()); |
56 | 50 |
} |
57 | 51 |
|
58 |
|
|
59 | 52 |
/** |
60 | 53 |
* NOTE: The indices for pages are 0-based see {@link Pager} |
61 | 54 |
* |
... | ... | |
119 | 112 |
return pageByRestrictions(type, initStrategy, orderBy, pagerParameters, new ArrayList<>(restrictions)); |
120 | 113 |
} |
121 | 114 |
|
122 |
|
|
123 | 115 |
/** |
124 | 116 |
* This method can be overwritten by subclasses, for example to apply additional filtering like for the publish flag. |
125 | 117 |
* |
... | ... | |
135 | 127 |
return service.page(type, restrictions, pagerParameters.getPageSize(), pagerParameters.getPageIndex(), orderBy.orderHints(), initStrategy); |
136 | 128 |
} |
137 | 129 |
|
138 |
|
|
139 | 130 |
// /** |
140 | 131 |
// * Parameter less method to be used as default when request without parameter are made. Otherwise |
141 | 132 |
// * the nameless methods {@link #doPage(Integer, Integer, Class)} and {@link #doList(Integer, Integer, Class)} |
... | ... | |
168 | 159 |
HttpServletRequest request, |
169 | 160 |
@SuppressWarnings("unused") HttpServletResponse response) { |
170 | 161 |
|
171 |
if (request != null) |
|
172 |
{ |
|
162 |
if (request != null){ |
|
173 | 163 |
logger.info("doList() " + requestPathAndQuery(request)); |
174 | 164 |
} |
175 | 165 |
|
176 | 166 |
//if(start == null){ start = 0;} |
177 |
if(limit == null){ limit = PagerParameters.DEFAULT_PAGESIZE;} |
|
178 |
if(limit < 1){ limit = null;} |
|
167 |
if(limit == null){ |
|
168 |
limit = PagerParameters.DEFAULT_PAGESIZE; |
|
169 |
}else if(limit < 1){ |
|
170 |
limit = null; |
|
171 |
} |
|
179 | 172 |
return service.list(type, limit, start, null, getInitializationStrategy()); |
180 | 173 |
} |
181 | 174 |
|
Also available in: Unified diff
Cleanup