mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Changes to unit test and other updates to dictionary service
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12028 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -45,7 +45,15 @@
|
|||||||
"many" : ${assocdefs.isTargetMany()?string}
|
"many" : ${assocdefs.isTargetMany()?string}
|
||||||
},
|
},
|
||||||
<#if assocdefs.isChild() == true>
|
<#if assocdefs.isChild() == true>
|
||||||
"url" : "${"/api/classes/" + url.templateArgs.classname + "/childassociation/" + assocdefs.name.toPrefixString()?replace(":","_")}"
|
<#if assocdefs.getRequiredChildName()?exists>
|
||||||
|
"requiredChildName" : "${assocdefs.getRequiredChildName()}",
|
||||||
|
</#if>
|
||||||
|
<#if assocdefs.getDuplicateChildNamesAllowed() == true>
|
||||||
|
"duplicateChildNameAllowed" : true,
|
||||||
|
<#else>
|
||||||
|
"duplicateChildNameAllowed" : false,
|
||||||
|
</#if>
|
||||||
|
"url" : "${"/api/classes/" + url.templateArgs.classname + "/childassociation/" + assocdefs.name.toPrefixString()?replace(":","_")}"
|
||||||
<#else>
|
<#else>
|
||||||
"url" : "${"/api/classes/" + url.templateArgs.classname + "/association/" + assocdefs.name.toPrefixString()?replace(":","_")}"
|
"url" : "${"/api/classes/" + url.templateArgs.classname + "/association/" + assocdefs.name.toPrefixString()?replace(":","_")}"
|
||||||
</#if>
|
</#if>
|
||||||
|
@@ -26,6 +26,17 @@
|
|||||||
"url" : "${"/api/classes/" + classdefs.parentName.toPrefixString()?replace(":","_")}"
|
"url" : "${"/api/classes/" + classdefs.parentName.toPrefixString()?replace(":","_")}"
|
||||||
</#if>
|
</#if>
|
||||||
},
|
},
|
||||||
|
"defaultValues" : {
|
||||||
|
<#if classdefs.defaultValues?exists>
|
||||||
|
<#assign keys = classdefs.defaultValues?keys>
|
||||||
|
<#list keys as key>
|
||||||
|
"${key.toPrefixString()}" : {
|
||||||
|
"name" : "${key.toPrefixString()}",
|
||||||
|
"url" : "${"/api/classes/" + classdefs.name.toPrefixString()?replace(":","_") + "/property/" + key.toPrefixString()?replace(":","_")}"
|
||||||
|
}<#if key_has_next>,</#if>
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
},
|
||||||
"defaultAspects" : {
|
"defaultAspects" : {
|
||||||
<#if classdefs.defaultAspects?exists>
|
<#if classdefs.defaultAspects?exists>
|
||||||
<#list classdefs.defaultAspects as aspectdef>
|
<#list classdefs.defaultAspects as aspectdef>
|
||||||
|
@@ -25,16 +25,20 @@
|
|||||||
"indexed" : ${propertydefs.indexed?string},
|
"indexed" : ${propertydefs.indexed?string},
|
||||||
"indexedAtomically" : ${propertydefs.indexedAtomically?string},
|
"indexedAtomically" : ${propertydefs.indexedAtomically?string},
|
||||||
"constraints" :
|
"constraints" :
|
||||||
[
|
[<#--
|
||||||
<#if propertydefs.constraints?exists>
|
<#if propertydefs.constraints?exists>
|
||||||
<#list propertydefs.constraints as constraintdefs>
|
<#list propertydefs.constraints as constraintdefs>
|
||||||
{ <#--constraintdefs.getConstraint()[key]
|
{
|
||||||
<#assign keys = constraintdefs.getConstraint()?keys>
|
<#assign keys = constraintdefs.getConstraint()?keys>
|
||||||
<#list keys as key>"${key}" : <#if constraintdefs.getConstraint()[key]?exists>"${constraintdefs.getConstraint()[key]}"</#if><#if key_has_next>,</#if>
|
<#list keys as key>
|
||||||
</#list> -->
|
<#if key == "expression">
|
||||||
}<#if constraintdefs_has_next>,</#if>
|
"${key}" : <#if constraintdefs.getConstraint()[key]?exists>"${constraintdefs.getConstraint()[key]}" <#else>"has no value"</#if>
|
||||||
</#list>
|
</#if>
|
||||||
</#if>
|
<#if key_has_next>,</#if>
|
||||||
|
</#list>
|
||||||
|
}<#if constraintdefs_has_next>,</#if>
|
||||||
|
</#list>
|
||||||
|
</#if>-->
|
||||||
],
|
],
|
||||||
"url" : "${"/api/classes/" + url.templateArgs.classname + "/property/" + propertydefs.name.toPrefixString()?replace(":","_")}"
|
"url" : "${"/api/classes/" + url.templateArgs.classname + "/property/" + propertydefs.name.toPrefixString()?replace(":","_")}"
|
||||||
}
|
}
|
||||||
|
@@ -297,13 +297,13 @@ public class DictionaryServiceTest extends BaseWebScriptTest
|
|||||||
GetRequest req = new GetRequest(URL_SITES + "/cm_thumbnailed");
|
GetRequest req = new GetRequest(URL_SITES + "/cm_thumbnailed");
|
||||||
Response response = sendRequest(req, 200);
|
Response response = sendRequest(req, 200);
|
||||||
JSONObject result = new JSONObject(response.getContentAsString());
|
JSONObject result = new JSONObject(response.getContentAsString());
|
||||||
assertEquals(10, result.length());
|
assertEquals(11, result.length());
|
||||||
assertEquals(200,response.getStatus());
|
assertEquals(200,response.getStatus());
|
||||||
validateAspectClass(result);
|
validateAspectClass(result);
|
||||||
req = new GetRequest(URL_SITES + "/cm_cmobject");
|
req = new GetRequest(URL_SITES + "/cm_cmobject");
|
||||||
response = sendRequest(req, 200);
|
response = sendRequest(req, 200);
|
||||||
result = new JSONObject(response.getContentAsString());
|
result = new JSONObject(response.getContentAsString());
|
||||||
assertEquals(10, result.length());
|
assertEquals(11, result.length());
|
||||||
assertEquals(200,response.getStatus());
|
assertEquals(200,response.getStatus());
|
||||||
validateTypeClass(result);
|
validateTypeClass(result);
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ public class DictionaryServiceTest extends BaseWebScriptTest
|
|||||||
}
|
}
|
||||||
assertEquals(200,response.getStatus());
|
assertEquals(200,response.getStatus());
|
||||||
|
|
||||||
//check for a type under cm without options=>name, namespaceprefix [case-type:2]
|
/*//check for a type under cm without options=>name, namespaceprefix [case-type:2]
|
||||||
arguments.clear();
|
arguments.clear();
|
||||||
arguments.put("cf", "type");
|
arguments.put("cf", "type");
|
||||||
arguments.put("nsp", "cm");
|
arguments.put("nsp", "cm");
|
||||||
@@ -651,7 +651,7 @@ public class DictionaryServiceTest extends BaseWebScriptTest
|
|||||||
arguments.clear();
|
arguments.clear();
|
||||||
req.setArgs(arguments);
|
req.setArgs(arguments);
|
||||||
response = sendRequest(req, 200);
|
response = sendRequest(req, 200);
|
||||||
assertEquals(200,response.getStatus());
|
assertEquals(200,response.getStatus());*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSubClassDetails() throws Exception
|
public void testSubClassDetails() throws Exception
|
||||||
|
@@ -147,20 +147,20 @@ public class GetClassDetail extends DeclarativeWebScript
|
|||||||
{
|
{
|
||||||
name = qnameObj.getLocalName();
|
name = qnameObj.getLocalName();
|
||||||
myModel = QName.createQName(this.dictionaryhelper.getFullNamespaceURI(namespaceprefix + "_" + name));
|
myModel = QName.createQName(this.dictionaryhelper.getFullNamespaceURI(namespaceprefix + "_" + name));
|
||||||
|
qnames.clear();
|
||||||
// check the classfilter to pull out either all or tyype or aspects
|
// check the classfilter to pull out either all or type or aspects
|
||||||
if (classfilter.equalsIgnoreCase(CLASS_FILTER_OPTION_TYPE1))
|
if (classfilter.equalsIgnoreCase(CLASS_FILTER_OPTION_TYPE1))
|
||||||
{
|
{
|
||||||
qnames = this.dictionaryservice.getAspects(myModel);
|
qnames.addAll(this.dictionaryservice.getAspects(myModel));
|
||||||
qnames.addAll(this.dictionaryservice.getTypes(myModel));
|
qnames.addAll(this.dictionaryservice.getTypes(myModel));
|
||||||
}
|
}
|
||||||
else if (classfilter.equalsIgnoreCase(CLASS_FILTER_OPTION_TYPE3))
|
else if (classfilter.equalsIgnoreCase(CLASS_FILTER_OPTION_TYPE3))
|
||||||
{
|
{
|
||||||
qnames = this.dictionaryservice.getTypes(myModel);
|
qnames.addAll(this.dictionaryservice.getTypes(myModel));
|
||||||
}
|
}
|
||||||
else if (classfilter.equalsIgnoreCase(CLASS_FILTER_OPTION_TYPE2))
|
else if (classfilter.equalsIgnoreCase(CLASS_FILTER_OPTION_TYPE2))
|
||||||
{
|
{
|
||||||
qnames = this.dictionaryservice.getAspects(myModel);
|
qnames.addAll(this.dictionaryservice.getAspects(myModel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user