String loc = Val.chkStr(request.getParameter("loc"));
if (key.length() > 0) {
Schemas schemas = context.getCatalogConfiguration().getConfiguredSchemas();
Schema schema = schemas.get(key);
if (schema == null) {
throw new SchemaException("Unsupported schema key.");
} else {
definition = schema.getGxeEditorDefinition();
}
} else if (loc.length() > 0) {
definition = new GxeDefinition();
definition.setFileLocation(loc);
}
String sCfg = "";
if (definition != null) {
msgBroker = this.getMessageBroker(request,response,context,msgBroker);
sCfg = this.generateDefinition(request,response,context,msgBroker,definition);
}
// set the response
if ((sCfg != null) && (sCfg.length() > 0)) {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("\r\n\"cfgDefinition\":").append(sCfg);
sb.append("\r\n}");
sResponse = sb.toString();
} else {
throw new SchemaException("Unsupported schema type.");
}
} catch (Throwable t) {
if (!(t instanceof SchemaException)) {
LOGGER.log(Level.WARNING,"Error processing request.",t);