System.out.println("rest based on schemaBase: " + type.getSchemaBase());
// Generate ReadOnly list of Attributes
//
DataStoreConfig dataStoreConfig = config.getDataStore(dataStoreId);
FeatureType featureType = null;
try {
DataStore dataStore = dataStoreConfig.findDataStore(getServlet()
.getServletContext());
featureType = dataStore.getSchema(typeName);
} catch (IOException e) {
// DataStore unavailable!
}
if (((type.getSchemaBase() == null)
|| "--".equals(type.getSchemaBase()))
|| (type.getSchemaAttributes() == null)) {
//We are using the generated attributes
this.schemaBase = "--";
this.schemaName = typeName + "_Type";
this.attributes = new LinkedList();
// Generate ReadOnly list of Attributes
//
List generated = DataTransferObjectFactory.generateAttributes(featureType);
this.attributes = attributesDisplayList(generated);
addList = Collections.EMPTY_LIST;
} else {
this.schemaBase = type.getSchemaBase();
this.schemaName = type.getSchemaName();
this.attributes = new LinkedList();
//
// Need to add read only AttributeDisplay for each required attribute
// defined by schemaBase
//
List schemaAttributes = DataTransferObjectFactory
.generateRequiredAttributes(schemaBase);
attributes.addAll(attributesDisplayList(schemaAttributes));
attributes.addAll(attributesFormList(type.getSchemaAttributes(),
featureType));
addList = new ArrayList(featureType.getAttributeCount());
for (int i = 0; i < featureType.getAttributeCount(); i++) {
String attributeName = featureType.getAttributeType(i).getName();
if (lookUpAttribute(attributeName) == null) {
addList.add(attributeName);
}
}