Search in sources :

Example 16 with Service

use of gov.usgs.cida.coastalhazards.model.Service in project coastal-hazards by USGS-CIDA.

the class TemplateResource method templateItem.

private Item templateItem(Item template, String attr, Layer layer, Summary summary) {
    String newId = IdGenerator.generate();
    Item newItem = new Item();
    newItem.setAttr(attr);
    boolean isRibbonable = Attributes.getRibbonableAttrs().contains(attr);
    List<Service> services = layer.getServices();
    Bbox bbox = layer.getBbox();
    List<Service> serviceCopies = new LinkedList<>();
    for (Service service : services) {
        serviceCopies.add(Service.copyValues(service, null));
    }
    newItem.setServices(serviceCopies);
    newItem.setItemType(Item.ItemType.data);
    newItem.setSummary(summary);
    newItem.setId(newId);
    newItem.setBbox(Bbox.copyValues(bbox, new Bbox()));
    newItem.setActiveStorm(template.isActiveStorm());
    newItem.setRibbonable(isRibbonable);
    newItem.setType(template.getType());
    newItem.setName(template.getName());
    return newItem;
}
Also used : Item(gov.usgs.cida.coastalhazards.model.Item) Bbox(gov.usgs.cida.coastalhazards.model.Bbox) WFSService(gov.usgs.cida.coastalhazards.util.ogc.WFSService) OGCService(gov.usgs.cida.coastalhazards.util.ogc.OGCService) Service(gov.usgs.cida.coastalhazards.model.Service) LinkedList(java.util.LinkedList)

Example 17 with Service

use of gov.usgs.cida.coastalhazards.model.Service in project coastal-hazards by USGS-CIDA.

the class StormUtil method getCswServiceFromLayer.

private static Service getCswServiceFromLayer(Layer layer) {
    Service cswService = null;
    List<Service> services = layer.getServices();
    if (services.size() > 0) {
        for (Service service : services) {
            if (service.getType() == ServiceType.csw) {
                cswService = service;
                break;
            }
        }
    }
    return cswService;
}
Also used : Service(gov.usgs.cida.coastalhazards.model.Service)

Aggregations

Service (gov.usgs.cida.coastalhazards.model.Service)17 Item (gov.usgs.cida.coastalhazards.model.Item)8 LinkedList (java.util.LinkedList)8 Response (javax.ws.rs.core.Response)8 Summary (gov.usgs.cida.coastalhazards.model.summary.Summary)7 Tiny (gov.usgs.cida.coastalhazards.model.summary.Tiny)6 Test (org.junit.Test)6 WFSService (gov.usgs.cida.coastalhazards.util.ogc.WFSService)5 Gson (com.google.gson.Gson)4 IOException (java.io.IOException)4 HashMap (java.util.HashMap)4 LayerManager (gov.usgs.cida.coastalhazards.jpa.LayerManager)3 Bbox (gov.usgs.cida.coastalhazards.model.Bbox)3 Layer (gov.usgs.cida.coastalhazards.model.Layer)3 List (java.util.List)3 Map (java.util.Map)3 RolesAllowed (javax.annotation.security.RolesAllowed)3 Path (javax.ws.rs.Path)3 Produces (javax.ws.rs.Produces)3 Viewable (org.glassfish.jersey.server.mvc.Viewable)3