}
@PayloadRoot(localPart = "listJournalRequest", namespace = "http://aktera.iritgo.de/webservices/journal")
public ListJournalResponse list(ListJournalRequest request) throws Exception
{
AkteraUser user = securityContext.getUser();
int firstResult = request.getFirstResult() != null ? request.getFirstResult().intValue() : 0;
int maxResults = request.getMaxResults() != null ? request.getMaxResults().intValue() : 100;
SortOrder orderDir = request.getOrderDir() != null ? SortOrder.byId(request.getOrderDir())
: SortOrder.ASCENDING;
String orderBy = StringTools.isNotTrimEmpty(request.getOrderBy()) ? request.getOrderBy() : "journal.occurredAt";
ListJournalResponse response = new ListJournalResponse();
DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
for (Map<String, Object> entry : journalManager.listJournalEntries(request.getQuery(), new Timestamp(0),
new Timestamp(new Date().getTime()), user.getId(), "", orderBy, orderDir, firstResult,
maxResults))
{
ListJournalResponse.Entry entryElement = new ListJournalResponse.Entry();
entryElement.setId((long) (Integer) entry.get("id"));