package com.ximple.eofms.rest;
|
|
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();
|
}
|
}
|