*/
protected static void storeService(Object obj, WriterHelper cw)
throws ConfigurationException {
LOGGER.finer("In method storeService");
ServiceDTO s = null;
String u = null;
String t = "";
boolean fBounds = false;
boolean srsXmlStyle = false;
int serviceLevel = 0;
String svgRenderer = null;
boolean svgAntiAlias = false;
boolean citeConformanceHacks = false;
if (obj instanceof WFSDTO) {
WFSDTO w = (WFSDTO) obj;
s = w.getService();
t = "WFS";
fBounds = w.isFeatureBounding();
srsXmlStyle = w.isSrsXmlStyle();
serviceLevel = w.getServiceLevel();
citeConformanceHacks = w.getCiteConformanceHacks();
} else if (obj instanceof WMSDTO) {
WMSDTO w = (WMSDTO) obj;
s = w.getService();
t = "WMS";
svgRenderer = w.getSvgRenderer();
svgAntiAlias = w.getSvgAntiAlias();
} else {
throw new ConfigurationException("Invalid object: not WMS of WFS");
}
Map atrs = new HashMap();
atrs.put("type", t);
atrs.put("enabled", s.isEnabled() + "");
cw.openTag("service", atrs);
cw.comment(
"ServiceDTO elements, needed for the capabilities document\n"
+ "Title and OnlineResource are the two required");
if ((s.getName() != null) && (s.getName() != "")) {
cw.textTag("name", s.getName());
}
if ((s.getTitle() != null) && (s.getTitle() != "")) {
cw.textTag("title", s.getTitle());
}
if ((s.getAbstract() != null) && (s.getAbstract() != "")) {
cw.textTag("abstract", s.getAbstract());
}
if (s.getKeywords().length != 0) {
cw.openTag("keywords");
for (int i = 0; i < s.getKeywords().length; i++) {
cw.textTag("keyword", (s.getKeywords())[i].toString());
}
cw.closeTag("keywords");
}
if (s.getOnlineResource() != null) {
cw.textTag("onlineResource", s.getOnlineResource().toString());
}
if ((s.getFees() != null) && (s.getFees() != "")) {
cw.textTag("fees", s.getFees());
}
if ((s.getAccessConstraints() != null)
&& (s.getAccessConstraints() != "")) {
cw.textTag("accessConstraints", s.getAccessConstraints());
}
if (fBounds) {
cw.valueTag("featureBounding", fBounds + "");
}
//if (srsXmlStyle) {
cw.valueTag("srsXmlStyle", srsXmlStyle + "");
//}
if (serviceLevel != 0) {
cw.valueTag("serviceLevel", serviceLevel + "");
}
if (obj instanceof WFSDTO) //DJB: this method (storeService) doesnt separate WFS and WMS very well!
{
cw.textTag("citeConformanceHacks", citeConformanceHacks + "");
}
if ((s.getMaintainer() != null) && (s.getMaintainer() != "")) {
cw.textTag("maintainer", s.getMaintainer());
}
if (svgRenderer != null) {
cw.textTag("svgRenderer", svgRenderer);
}