use of org.collectionspace.chain.csp.webui.main.Request in project application by collectionspace.
the class StructuredDateParser method run.
@Override
public void run(Object in, String[] tail) throws UIException {
UIRequest request = ((Request) in).getUIRequest();
String displayDate = request.getRequestArgument("displayDate");
JSONObject output = new JSONObject();
StructuredDateInternal structuredDate = null;
StructuredDateFormatException formatException = null;
try {
structuredDate = StructuredDateInternal.parse(displayDate);
} catch (StructuredDateFormatException e) {
formatException = e;
}
try {
if (formatException != null) {
// The convention in app layer error responses appears to be to
// send a boolean isError, and an array of error messages.
output.put("isError", true);
output.put("messages", new String[] { "Unrecognized date format", formatException.getMessage() });
}
if (structuredDate != null) {
String tenantDomain = request.getTenant();
output.put("structuredDate", structuredDateToJSON(tenantDomain, structuredDate));
}
} catch (JSONException e) {
throw new UIException("Error building JSON", e);
}
request.sendJSONResponse(output);
}
use of org.collectionspace.chain.csp.webui.main.Request in project application by collectionspace.
the class VocabRedirector method run.
public void run(Object in, String[] tail) throws UIException {
Request q = (Request) in;
redirect(q.getCache(), q.getStorage(), q.getUIRequest(), tail);
}
use of org.collectionspace.chain.csp.webui.main.Request in project application by collectionspace.
the class WebAutoComplete method run.
public void run(Object in, String[] tail) throws UIException {
Request q = (Request) in;
autocomplete(q.getCache(), q.getStorage(), q.getUIRequest());
}
use of org.collectionspace.chain.csp.webui.main.Request in project application by collectionspace.
the class UserDetailsCreateUpdate method run.
public void run(Object in, String[] tail) throws UIException {
Request q = (Request) in;
store_set(q.getStorage(), q.getUIRequest(), StringUtils.join(tail, "/"));
}
use of org.collectionspace.chain.csp.webui.main.Request in project application by collectionspace.
the class UserDetailsDelete method run.
public void run(Object in, String[] tail) throws UIException {
Request q = (Request) in;
store_delete(q.getStorage(), q.getUIRequest(), StringUtils.join(tail, "/"));
}
Aggregations