From bbaf4ed875548c854622b55a177c8d35ab9238dc Mon Sep 17 00:00:00 2001 From: Dennis Kao <ulysseskao@ximple.com.tw> Date: Thu, 08 Aug 2013 18:00:49 +0800 Subject: [PATCH] geoserver layer setting --- xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java | 50 +++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 43 insertions(+), 7 deletions(-) diff --git a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java index 0f6111c..45305a0 100644 --- a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java +++ b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/rest/GeoManagerEncoderTest.java @@ -1,11 +1,47 @@ package com.ximple.eofms.rest; -/** - * Created with IntelliJ IDEA. - * User: ulysseskao - * Date: 2013/8/8 - * Time: 下午 2:18 - * To change this template use File | Settings | File Templates. - */ +import it.geosolutions.geoserver.rest.encoder.GSLayerGroupEncoder; +import it.geosolutions.geoserver.rest.encoder.GSLayerGroupEncoder23; +import org.jdom.Element; +import org.testng.annotations.Test; + public class GeoManagerEncoderTest { + @Test + public void testLaterGroupEncoder() { + String a = "pgCLS:xtpc:fsc-203-c1-l37-w1,xtpc:fsc-203-c0-l38-w1,xtpc:fsc-203-c1-l38-w1,xtpc:fsc-203-c0-l37-w1,xtpc:fsc-311-c1-l45-w1,xtpc:fsc-311-c1-l45-w0,xtpc:fsc-311-c0-l45-w1,xtpc:fsc-501-c0-l1-w0,xtpc:fsc-501-c1-l2-w0,xtpc:fsc-502-c0-l1-w1,xtpc:fsc-502-c1-l2-w1,xtpc:fsc-503-c0-l1-w2,xtpc:fsc-999-c0-l62-w1"; + GSLayerGroupEncoder groupWriter = new GSLayerGroupEncoder23() { + + @Override + protected void addToRoot(Element... elements) { + for (Element e : elements) { + if (e != null) { + getRoot().addContent(e.cloneContent()); + } + } + } + }; + groupWriter.addLayer("xtpc:fsc-203-c1-l37-w1"); + groupWriter.addLayer("xtpc:fsc-203-c0-l38-w1"); + groupWriter.addLayer("xtpc:fsc-203-c1-l38-w1"); + groupWriter.addLayer("xtpc:fsc-203-c0-l37-w1"); + groupWriter.addLayer("xtpc:fsc-311-c1-l45-w1"); + groupWriter.addLayer("xtpc:fsc-311-c1-l45-w0"); + groupWriter.addLayer("xtpc:fsc-311-c0-l45-w1"); + groupWriter.addLayer("xtpc:fsc-501-c0-l1-w0"); + groupWriter.addLayer("xtpc:fsc-501-c1-l2-w0"); + groupWriter.addLayer("xtpc:fsc-502-c0-l1-w1"); + groupWriter.addLayer("xtpc:fsc-502-c1-l2-w"); + groupWriter.addLayer("xtpc:fsc-503-c0-l1-w2"); + groupWriter.addLayer("xtpc:fsc-999-c0-l62-w1"); + String s = groupWriter.toString(); + System.out.println(s); + } + + @Test + public void testLaterGroupEncoder23() { + String a = "pgCLS:xtpc:fsc-203-c1-l37-w1,xtpc:fsc-203-c0-l38-w1,xtpc:fsc-203-c1-l38-w1,xtpc:fsc-203-c0-l37-w1,xtpc:fsc-311-c1-l45-w1,xtpc:fsc-311-c1-l45-w0,xtpc:fsc-311-c0-l45-w1,xtpc:fsc-501-c0-l1-w0,xtpc:fsc-501-c1-l2-w0,xtpc:fsc-502-c0-l1-w1,xtpc:fsc-502-c1-l2-w1,xtpc:fsc-503-c0-l1-w2,xtpc:fsc-999-c0-l62-w1"; + GSLayerGroupEncoder23 groupWriter = new GSLayerGroupEncoder23(); + groupWriter.addLayer("topp:boundaries"); + String s = groupWriter.toString(); + } } -- Gitblit v0.0.0-SNAPSHOT