* @return AGP item
*/
private AgpItem createAgpItem(ServiceInfo serviceInfo) {
if (serviceInfo!=null) {
AgpItem agpItem = new AgpItem();
AgpProperties props = agpItem.getProperties();
String type = serviceInfo.getType();
props.add(new AgpProperty("title", Val.chkStr(serviceInfo.getName())));
props.add(new AgpProperty("name", Val.chkStr(serviceInfo.getName())));
props.add(new AgpProperty("url", Val.chkStr(serviceInfo.getRestUrl())));
props.add(new AgpProperty("description", Val.chkStr(serviceInfo.getDescription())));
String thumbnailUrl = Val.chkStr(serviceInfo.getThumbnailUrl());
if (!thumbnailUrl.isEmpty()) {
props.add(new AgpProperty("thumbnailurl", thumbnailUrl));
}
String textInfo = Val.chkStr(serviceInfo.getText());
if (!textInfo.isEmpty()) {
props.add(new AgpProperty("text", textInfo));
}
String envelope = Val.chkStr(envelopeToString(serviceInfo.getEnvelope()));
if (!envelope.isEmpty()) {
props.add(new AgpProperty("extent", envelope));
}
String agpType = agsToAgpType.get(type);
if (agpType!=null) {
props.add(new AgpProperty("type", agpType));
return agpItem;
}
}
return null;
}