use of org.alfresco.repo.solr.AlfrescoModel in project alfresco-remote-api by Alfresco.
the class AlfrescoModelGet method handle.
private void handle(WebScriptRequest req, WebScriptResponse res) throws JSONException, IOException {
// create map of template vars
String modelQName = req.getParameter("modelQName");
if (modelQName == null) {
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "URL parameter 'modelQName' not provided.");
}
ModelDefinition.XMLBindingType bindingType = ModelDefinition.XMLBindingType.DEFAULT;
AlfrescoModel model = solrTrackingComponent.getModel(QName.createQName(modelQName));
res.setHeader("XAlfresco-modelChecksum", String.valueOf(model.getModelDef().getChecksum(bindingType)));
model.getModelDef().toXML(bindingType, res.getOutputStream());
}
Aggregations