use of org.opencastproject.index.service.exception.ListProviderException in project opencast by opencast.
the class WorkflowsListProvider method getList.
@Override
public Map<String, String> getList(String listName, ResourceListQuery query, Organization organization) throws ListProviderException {
Map<String, String> workflowsList = new HashMap<String, String>();
WorkflowQuery q = new WorkflowQuery();
if (query != null) {
if (query.getLimit().isSome())
q.withCount(query.getLimit().get());
if (query.getOffset().isSome())
q.withStartPage(query.getOffset().get());
}
WorkflowInstance[] workflowInstances;
try {
workflowInstances = workflowService.getWorkflowInstances(q).getItems();
} catch (WorkflowDatabaseException e) {
logger.error("Error by querying the workflow instances from the DB: ", e);
throw new ListProviderException(e.getMessage(), e.getCause());
}
for (WorkflowInstance w : workflowInstances) {
workflowsList.put(Long.toString(w.getId()), w.getTitle() + " - " + w.getMediaPackage().getTitle());
}
return workflowsList;
}
Aggregations