Adding support to resourceEncoder for Description, Abstract and layerEncoder queriable

This commit is contained in:
ccancellieri 2012-09-26 14:17:00 +02:00
parent ed9d1414ad
commit 3a05e405bd
2 changed files with 62 additions and 28 deletions

View File

@ -60,35 +60,37 @@ public class GSLayerEncoder extends PropertyXMLEncoder {
else else
set("enabled","false"); set("enabled","false");
} }
private final static String DESCRIPTION = "description";
/**
* Add the 'description' node with a text value from 'description'
*
*/
protected void addDescription(final String description) {
add(DESCRIPTION, description);
}
/**
* Set or modify the 'description' node with a text value from 'description'
*/
public void setDescription(final String description) {
set(DESCRIPTION, description);
}
// /** // queryable
// * @param name the name of the layer private final static String QUERYABLE = "queryable";
// */ /**
// protected void addName(final String name){ * Add the 'queryable' node with a text value from 'queryable' (true as default)
// add("name",name); */
// } protected void addQueryable(final String queryable) {
// add(QUERYABLE, queryable!=null?queryable.toString():"true");
// /** }
// * @return name the name of the layer or null /**
// */ * Set or modify the 'queryable' node with a text value from 'queryable' (true as default)
// public String getName() { */
// final Element nameNode = get("name"); public void setQueryable(final Boolean queryable) {
// if (nameNode != null) set(QUERYABLE, queryable!=null?queryable.toString():"true");
// return nameNode.getText(); }
// else
// return null;
// }
//
// /**
// * @param name the name of the layer
// * @throws IllegalArgumentException
// */
// public void setName(final String name) throws IllegalArgumentException {
// if (name==null || name.isEmpty())
// throw new IllegalArgumentException("Unable to set an empty or null parameter");
// set("name",name);
// }
/** /**
* @see {@link GSLayerEncoder#setWmsPath(String)} * @see {@link GSLayerEncoder#setWmsPath(String)}
* *

View File

@ -194,6 +194,38 @@ public abstract class GSResourceEncoder
else else
return null; return null;
} }
private final static String DESCRIPTION = "description";
/**
* Add the 'description' node with a text value from 'description'
*
*/
protected void addDescription(final String description) {
add(DESCRIPTION, description);
}
/**
* Set or modify the 'description' node with a text value from 'description'
*/
public void setDescription(final String description) {
set(DESCRIPTION, description);
}
private final static String ABSTRACT = "abstract";
/**
* Add the 'abstract' node with a text value from 'abstract'
*
*/
protected void addAbstract(final String _abstract) {
add(ABSTRACT, _abstract);
}
/**
* Set or modify the 'abstract' node with a text value from 'abstract'
*/
public void setAbstract(final String _abstract) {
set(ABSTRACT, _abstract);
}
private final static String TITLE = "title"; private final static String TITLE = "title";