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;
}
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;
}
Aggregations