mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
ALF-8990: RSOLR 032: Model track and build from SOLR
- SOLR tracking now reflects all models loaded and changed on the repo to which it points - model tracking and related fixes - model XML now round trips for Boolean properties :-) - upgraded to latest version of jibx - 1.2.3 - added API to load models and not class load constraint extensions (does not affect the generated model XML only constraint enforcement) - removed solr specific m2 model binding - fixed SOLR tracking test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28714 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<webscript>
|
<webscript>
|
||||||
<shortname>Get Model</shortname>
|
<shortname>Get Model</shortname>
|
||||||
<description>Get the model for given model name.</description>
|
<description>Get the model for given model name.</description>
|
||||||
<url>/api/solr/model/{modelShortQName}</url>
|
<url>/api/solr/model</url>
|
||||||
<format default="json">argument</format>
|
<format default="json">argument</format>
|
||||||
<authentication>admin</authentication>
|
<authentication>admin</authentication>
|
||||||
<transaction allow="readonly">required</transaction>
|
<transaction allow="readonly">required</transaction>
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
[
|
[
|
||||||
<#list diffs as diff>
|
<#list diffs as diff>
|
||||||
{
|
{
|
||||||
"name": <@solrLib.qNameJSON qName=diff.modelName/>,
|
"name": "${diff.modelName}",
|
||||||
"type" : "${diff.type}",
|
"type" : "${diff.type}",
|
||||||
"oldChecksum": <#if diff.oldChecksum??>${diff.oldChecksum?c}<#else>null</#if>,
|
"oldChecksum": <#if diff.oldChecksum??>${diff.oldChecksum?c}<#else>null</#if>,
|
||||||
"newChecksum": <#if diff.newChecksum??>${diff.newChecksum?c}<#else>null</#if>
|
"newChecksum": <#if diff.newChecksum??>${diff.newChecksum?c}<#else>null</#if>
|
||||||
|
@@ -58,17 +58,16 @@ public class AlfrescoModelGet extends AbstractWebScript
|
|||||||
private void handle(WebScriptRequest req, WebScriptResponse res) throws JSONException, IOException
|
private void handle(WebScriptRequest req, WebScriptResponse res) throws JSONException, IOException
|
||||||
{
|
{
|
||||||
// create map of template vars
|
// create map of template vars
|
||||||
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
|
String modelQName = req.getParameter("modelQName");
|
||||||
String modelName = templateVars.get("modelShortQName");
|
if(modelQName == null)
|
||||||
if(modelName == null)
|
|
||||||
{
|
{
|
||||||
throw new WebScriptException(
|
throw new WebScriptException(
|
||||||
Status.STATUS_BAD_REQUEST,
|
Status.STATUS_BAD_REQUEST,
|
||||||
"URL parameter 'modelShortQName' not provided.");
|
"URL parameter 'modelQName' not provided.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelDefinition.XMLBindingType bindingType = ModelDefinition.XMLBindingType.SOLR;
|
ModelDefinition.XMLBindingType bindingType = ModelDefinition.XMLBindingType.DEFAULT;
|
||||||
AlfrescoModel model = solrTrackingComponent.getModel(QName.createQName(modelName, namespaceService));
|
AlfrescoModel model = solrTrackingComponent.getModel(QName.createQName(modelQName));
|
||||||
res.setHeader("XAlfresco-modelChecksum", String.valueOf(model.getModelDef().getChecksum(bindingType)));
|
res.setHeader("XAlfresco-modelChecksum", String.valueOf(model.getModelDef().getChecksum(bindingType)));
|
||||||
model.getModelDef().toXML(bindingType, res.getOutputStream());
|
model.getModelDef().toXML(bindingType, res.getOutputStream());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user