Permalink
Browse files

closes #81

  • Loading branch information...
groldan committed Nov 28, 2011
1 parent b9b8630 commit 7371f513e194deab23c63e6d350c7973f306e975
Showing with 22 additions and 18 deletions.
  1. +22 −18 geowebcache/wms/src/main/java/org/geowebcache/service/wms/WMSGetCapabilities.java
@@ -152,30 +152,33 @@ private void service(StringBuilder str) {
private void serviceContact(StringBuilder str) {
ServiceInformation servInfo = tld.getServiceInformation();
- ServiceProvider servProv = null;
- ServiceContact servCont = null;
+ if (servInfo == null) {
+ return;
+ }
- if (servInfo != null) {
- servProv = servInfo.getServiceProvider();
+ ServiceProvider servProv = servInfo.getServiceProvider();
+ if (servProv == null) {
+ return;
+ }
- if (servProv != null) {
- servCont = servProv.getServiceContact();
- }
+ ServiceContact servCont = servProv.getServiceContact();
- str.append(" <ContactInformation>\n");
+ str.append(" <ContactInformation>\n");
- if (servProv.getProviderName() != null || servCont != null) {
- str.append(" <ContactPersonPrimary>\n");
- if (servCont != null) {
- str.append(" <ContactPerson>" + servCont.getIndividualName()
- + "</ContactPerson>\n");
- }
- str.append(" <ContactOrganisation>" + servProv.getProviderName()
- + "</ContactOrganisation>\n");
- str.append(" </ContactPersonPrimary>\n");
+ if (servProv.getProviderName() != null || servCont != null) {
+ str.append(" <ContactPersonPrimary>\n");
+ if (servCont != null) {
+ str.append(" <ContactPerson>" + servCont.getIndividualName()
+ + "</ContactPerson>\n");
+ }
+ str.append(" <ContactOrganisation>" + servProv.getProviderName()
+ + "</ContactOrganisation>\n");
+ str.append(" </ContactPersonPrimary>\n");
+ if (servCont != null) {
str.append(" <ContactPosition>" + servCont.getPositionName()
+ "</ContactPosition>\n");
+
str.append(" <ContactAddress>\n");
str.append(" <AddressType>" + servCont.getAddressType() + "</AddressType>\n");
str.append(" <Address>" + servCont.getAddressStreet() + "</Address>\n");
@@ -191,9 +194,10 @@ private void serviceContact(StringBuilder str) {
+ "<ContactFacsimileTelephone/>\n");
str.append(" <ContactElectronicMailAddress>" + servCont.getAddressEmail()
+ "</ContactElectronicMailAddress>\n");
- str.append(" </ContactInformation>\n");
}
}
+
+ str.append(" </ContactInformation>\n");
}
private void capability(StringBuilder str) {

0 comments on commit 7371f51

Please sign in to comment.