* Return a list personal notes
* */
@Override
public void doView(GadgletRequestWrapper request, GadgletResponse response)
throws RequestException {
HasMoreItems hasMore = new HasMoreItems();
int returnedItems;
HashMap<String, Object> params = null;
if (request.getParameter(Params.PRIORITY.getParamName()) != null
&& !request.getParameter(Params.PRIORITY.getParamName())
.isEmpty()) {
params = new HashMap<String, Object>();
try {
params.put(Params.PRIORITY.getParamName(), Integer
.parseInt(request.getParameter(Params.PRIORITY
.getParamName())));
} catch (NumberFormatException e) {
log.warning(e.getMessage());
throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
}
}
List<PersonalNotesData> items = (List<PersonalNotesData>) helper
.getSharedItems(request, PersonalNotesData.class,
request.getFilterBy(),
request.getFilterByDeclaration(), params,
request.getOrderBy(), request.getStartFrom(),
request.getItemNum(), hasMore);
// if the request is for 3 items the method getOwnerItems will try to
// find 4 and then remove the last...
returnedItems = items.size();
if (hasMore.isTrue()) {
response.setHasMore(true);
returnedItems = returnedItems - 1;
} else
response.setHasMore(false);