comparison gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java @ 561:3f39756e0c8a

Fixed a NPE. Now it is possible to put an Mapservice without an Layer into the Request-Document of am Mapviewer-Interface-Call. gnv/trunk@667 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 09 Feb 2010 13:05:49 +0000
parents 8032da9e8b70
children 8355d7cacd09
comparison
equal deleted inserted replaced
560:1fb55ff633db 561:3f39756e0c8a
860 Element mapServiceNode = this.createArtifactElement(document, 860 Element mapServiceNode = this.createArtifactElement(document,
861 "mapservice"); 861 "mapservice");
862 mapServiceNode.setAttribute("id", mapService.getID()); 862 mapServiceNode.setAttribute("id", mapService.getID());
863 mapServiceNode.setAttribute("type", mapService.getType()); 863 mapServiceNode.setAttribute("type", mapService.getType());
864 mapServiceNode.setAttribute("url", mapService.getURL()); 864 mapServiceNode.setAttribute("url", mapService.getURL());
865 Iterator<Layer> layer = mapService.getLayer().iterator(); 865 if (mapService.getLayer() != null){
866 while (layer.hasNext()){ 866 Iterator<Layer> layer = mapService.getLayer().iterator();
867 Layer tmpLayer = layer.next(); 867 while (layer.hasNext()){
868 Element layerNode = this.createArtifactElement(document, 868 Layer tmpLayer = layer.next();
869 "layer"); 869 Element layerNode = this.createArtifactElement(document,
870 layerNode.setAttribute("id", tmpLayer.getID()); 870 "layer");
871 layerNode.setAttribute("name", tmpLayer.getName()); 871 layerNode.setAttribute("id", tmpLayer.getID());
872 layerNode.setAttribute("isgrouplayer", 872 layerNode.setAttribute("name", tmpLayer.getName());
873 ""+tmpLayer.isGroupLayer()); 873 layerNode.setAttribute("isgrouplayer",
874 layerNode.setAttribute("parentid", tmpLayer.parentID()); 874 ""+tmpLayer.isGroupLayer());
875 mapServiceNode.appendChild(layerNode); 875 layerNode.setAttribute("parentid", tmpLayer.parentID());
876 mapServiceNode.appendChild(layerNode);
877 }
876 } 878 }
877 mapServicesNode.appendChild(mapServiceNode); 879 mapServicesNode.appendChild(mapServiceNode);
878 } 880 }
879 rootNode.appendChild(mapServicesNode); 881 rootNode.appendChild(mapServicesNode);
880 return document; 882 return document;

http://dive4elements.wald.intevation.org