Search in sources :

Example 1 with ListTypeJobQuery

use of net.geoprism.registry.etl.ListTypeJobQuery in project geoprism-registry by terraframe.

the class ListType method getJobs.

public List<ListTypeJob> getJobs() {
    ListTypeJobQuery query = new ListTypeJobQuery(new QueryFactory());
    query.WHERE(query.getListType().EQ(this));
    try (OIterator<? extends ListTypeJob> it = query.getIterator()) {
        return new LinkedList<ListTypeJob>(it.getAll());
    }
}
Also used : ListTypeJobQuery(net.geoprism.registry.etl.ListTypeJobQuery) QueryFactory(com.runwaysdk.query.QueryFactory) LinkedList(java.util.LinkedList)

Example 2 with ListTypeJobQuery

use of net.geoprism.registry.etl.ListTypeJobQuery in project geoprism-registry by terraframe.

the class ListTypeService method getPublishJobs.

@Request(RequestType.SESSION)
public JsonObject getPublishJobs(String sessionId, String oid, int pageSize, int pageNumber, String sortAttr, boolean isAscending) {
    QueryFactory qf = new QueryFactory();
    final ListTypeJobQuery query = new ListTypeJobQuery(qf);
    query.WHERE(query.getListType().EQ(oid));
    query.ORDER_BY_DESC(query.getCreateDate());
    // query.ORDER_BY(ihq.get(sortAttr), order);
    query.restrictRows(pageSize, pageNumber);
    try (OIterator<? extends ListTypeJob> it = query.getIterator()) {
        List<JsonSerializable> results = new LinkedList<>(it.getAll());
        return new Page<JsonSerializable>(query.getCount(), query.getPageNumber(), query.getPageSize(), results).toJSON();
    }
}
Also used : ListTypeJobQuery(net.geoprism.registry.etl.ListTypeJobQuery) QueryFactory(com.runwaysdk.query.QueryFactory) JsonSerializable(net.geoprism.registry.view.JsonSerializable) LinkedList(java.util.LinkedList) Request(com.runwaysdk.session.Request)

Aggregations

QueryFactory (com.runwaysdk.query.QueryFactory)2 LinkedList (java.util.LinkedList)2 ListTypeJobQuery (net.geoprism.registry.etl.ListTypeJobQuery)2 Request (com.runwaysdk.session.Request)1 JsonSerializable (net.geoprism.registry.view.JsonSerializable)1