// metadataLink
GSMetadataLinkInfoEncoder metadatalink = new GSMetadataLinkInfoEncoder("text/xml",
"ISO19115:2003", "http://www.organization.org/metadata1");
fte.addMetadataLinkInfo(metadatalink);
GSLayerEncoder layerEncoder = null;
if (VERSION.getVersion(GS_VERSION).compareTo(VERSION.UNRECOGNIZED) > 0) {
layerEncoder = new GSLayerEncoder();
} else if (VERSION.getVersion(GS_VERSION).compareTo(VERSION.UNRECOGNIZED) == 0) {
layerEncoder = new GSLayerEncoder21();
}
layerEncoder.setEnabled(true);
layerEncoder.setQueryable(true);
layerEncoder.setAdvertised(true);
layerEncoder.setDefaultStyle("point");
layerEncoder.addStyle("point2");
layerEncoder.addStyle("point3");
// authorityURL
GSAuthorityURLInfoEncoder authorityURL = new GSAuthorityURLInfoEncoder("authority1",
"http://www.authority1.org");
layerEncoder.addAuthorityURL(authorityURL);
// identifier
GSIdentifierInfoEncoder identifier1 = new GSIdentifierInfoEncoder("authority1",
"identifier1");
GSIdentifierInfoEncoder identifier2 = new GSIdentifierInfoEncoder("authority1",
"another_identifier");
layerEncoder.addIdentifier(identifier1);
layerEncoder.addIdentifier(identifier2);
// optionally select the attributes to publish
RESTLayer layer = reader.getLayer(DEFAULT_WS, layerName);
RESTFeatureType resource = reader.getFeatureType(layer);