Initial tidy up of existing data dictionary REST API implementation.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18512 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2010-02-09 05:13:18 +00:00
parent 4add52a7c1
commit 9177ad3927
27 changed files with 22 additions and 79 deletions

View File

@@ -1,8 +0,0 @@
<webscript>
<shortname>Get Child Association Definitions</shortname>
<description>Get the collection of child association definitions</description>
<url>/api/classes/{classname}/childassociation/{assocname}</url>
<format default="json">argument</format>
<authentication>user</authentication>
<transaction allow="readonly">required</transaction>
</webscript>

View File

@@ -1,3 +0,0 @@
<#import "assocdefinition.lib.ftl" as assocDefLib/>
<@assocDefLib.assocDefJSON assocdefs=assocdefs/>

View File

@@ -1,8 +0,0 @@
<webscript>
<shortname>Get Child Assocation Definitions</shortname>
<description>Get the collection of child association definitions for a given classname</description>
<url>/api/classes/{classname}/childassociations</url>
<format default="json">argument</format>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -1,9 +0,0 @@
<#import "assocdefinition.lib.ftl" as assocDefLib/>
[
<#list assocdefs as assocdefs>
<#if assocdefs.isChild() == true>
<@assocDefLib.assocDefJSON assocdefs=assocdefs/>
<#if assocdefs_has_next>,</#if>
</#if>
</#list>
]

View File

@@ -544,47 +544,18 @@
<!-- DICTIONARY Service REST API --> <!-- DICTIONARY Service REST API -->
<!-- --> <!-- -->
<!-- GET CLASS DETAILS --> <bean id="webscript.dictionary" abstract="true" parent="webscript">
<bean id="webscript.org.alfresco.repository.dictionary.getclassdetails.get" class="org.alfresco.repo.web.scripts.dictionary.GetClassDetails" parent="webscript">
<property name="dictionaryService" ref="DictionaryService"/> <property name="dictionaryService" ref="DictionaryService"/>
<property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/> <property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/>
</bean> </bean>
<!-- GET CLASS DETAIL --> <bean id="webscript.org.alfresco.repository.dictionary.classes.get" class="org.alfresco.repo.web.scripts.dictionary.ClassesGet" parent="webscript.dictionary"/>
<bean id="webscript.org.alfresco.repository.dictionary.getclassdetail.get" class="org.alfresco.repo.web.scripts.dictionary.GetClassDetail" parent="webscript"> <bean id="webscript.org.alfresco.repository.dictionary.class.get" class="org.alfresco.repo.web.scripts.dictionary.ClassGet" parent="webscript.dictionary"/>
<property name="dictionaryService" ref="DictionaryService"/> <bean id="webscript.org.alfresco.repository.dictionary.subclasses.get" class="org.alfresco.repo.web.scripts.dictionary.SubClassesGet" parent="webscript.dictionary"/>
<property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/> <bean id="webscript.org.alfresco.repository.dictionary.property.get" class="org.alfresco.repo.web.scripts.dictionary.PropertyGet" parent="webscript.dictionary"/>
</bean> <bean id="webscript.org.alfresco.repository.dictionary.properties.get" class="org.alfresco.repo.web.scripts.dictionary.PropertiesGet" parent="webscript.dictionary"/>
<bean id="webscript.org.alfresco.repository.dictionary.association.get" class="org.alfresco.repo.web.scripts.dictionary.AssociationGet" parent="webscript.dictionary"/>
<!-- GET SUBCLASSES DEFINITION's --> <bean id="webscript.org.alfresco.repository.dictionary.associations.get" class="org.alfresco.repo.web.scripts.dictionary.AssociationsGet" parent="webscript.dictionary"/>
<bean id="webscript.org.alfresco.repository.dictionary.getsubclassesdef.get" class="org.alfresco.repo.web.scripts.dictionary.GetSubClassesDef" parent="webscript">
<property name="dictionaryService" ref="DictionaryService"/>
<property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/>
</bean>
<!-- GET PROPERTY DEFINITION -->
<bean id="webscript.org.alfresco.repository.dictionary.getproperty.get" class="org.alfresco.repo.web.scripts.dictionary.GetPropertyDef" parent="webscript">
<property name="dictionaryService" ref="DictionaryService"/>
<property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/>
</bean>
<!-- GET PROPERTY DEFINITION's -->
<bean id="webscript.org.alfresco.repository.dictionary.getproperties.get" class="org.alfresco.repo.web.scripts.dictionary.GetPropertyDefs" parent="webscript">
<property name="dictionaryService" ref="DictionaryService"/>
<property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/>
</bean>
<!-- GET ASSOCIATION DEFINITION -->
<bean id="webscript.org.alfresco.repository.dictionary.getassociationdef.get" class="org.alfresco.repo.web.scripts.dictionary.GetAssociationDef" parent="webscript">
<property name="dictionaryService" ref="DictionaryService"/>
<property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/>
</bean>
<!-- GET ASSOCIATION DEFINITION's -->
<bean id="webscript.org.alfresco.repository.dictionary.getassociationdefs.get" class="org.alfresco.repo.web.scripts.dictionary.GetAssociationDefs" parent="webscript">
<property name="dictionaryService" ref="DictionaryService"/>
<property name="dictionaryHelper" ref="dictionaryWebScriptHelper"/>
</bean>
<!-- Dictionary Service Web Script Helper Class --> <!-- Dictionary Service Web Script Helper Class -->
<bean id="dictionaryWebScriptHelper" class="org.alfresco.repo.web.scripts.dictionary.DictionaryHelper" init-method="init"> <bean id="dictionaryWebScriptHelper" class="org.alfresco.repo.web.scripts.dictionary.DictionaryHelper" init-method="init">

View File

@@ -40,7 +40,7 @@ import java.util.Map;
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class GetAssociationDef extends DeclarativeWebScript public class AssociationGet extends DeclarativeWebScript
{ {
private DictionaryService dictionaryservice; private DictionaryService dictionaryservice;
private DictionaryHelper dictionaryhelper; private DictionaryHelper dictionaryhelper;

View File

@@ -41,7 +41,7 @@ import java.util.Map;
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class GetAssociationDefs extends DeclarativeWebScript public class AssociationsGet extends DeclarativeWebScript
{ {
private DictionaryService dictionaryservice; private DictionaryService dictionaryservice;
private DictionaryHelper dictionaryhelper; private DictionaryHelper dictionaryhelper;

View File

@@ -43,7 +43,7 @@ import java.util.Map;
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class GetClassDetails extends DeclarativeWebScript public class ClassGet extends DeclarativeWebScript
{ {
private DictionaryService dictionaryservice; private DictionaryService dictionaryservice;

View File

@@ -45,7 +45,7 @@ import java.util.List;
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class GetClassDetail extends DeclarativeWebScript public class ClassesGet extends DeclarativeWebScript
{ {
private DictionaryService dictionaryservice; private DictionaryService dictionaryservice;
private DictionaryHelper dictionaryhelper; private DictionaryHelper dictionaryhelper;

View File

@@ -34,11 +34,11 @@ import org.json.JSONObject;
import org.json.JSONArray; import org.json.JSONArray;
/** /**
* Unit Test for Dictionaryervice REST API * Unit test for Dictionary REST API
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class DictionaryServiceTest extends BaseWebScriptTest public class DictionaryRestApiTest extends BaseWebScriptTest
{ {
private static final String URL_SITES = "/api/classes"; private static final String URL_SITES = "/api/classes";

View File

@@ -42,7 +42,7 @@ import java.util.Map;
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class GetPropertyDefs extends DeclarativeWebScript public class PropertiesGet extends DeclarativeWebScript
{ {
private DictionaryService dictionaryservice; private DictionaryService dictionaryservice;
private DictionaryHelper dictionaryhelper; private DictionaryHelper dictionaryhelper;

View File

@@ -41,7 +41,7 @@ import java.util.Map;
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class GetPropertyDef extends DeclarativeWebScript public class PropertyGet extends DeclarativeWebScript
{ {
private DictionaryService dictionaryservice; private DictionaryService dictionaryservice;
private DictionaryHelper dictionaryhelper; private DictionaryHelper dictionaryhelper;

View File

@@ -39,12 +39,12 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
*
* Webscript to get the Sub-Classdefinitions using classfilter , namespacePrefix and name * Webscript to get the Sub-Classdefinitions using classfilter , namespacePrefix and name
*
* @author Saravanan Sellathurai * @author Saravanan Sellathurai
*/ */
public class GetSubClassesDef extends DeclarativeWebScript public class SubClassesGet extends DeclarativeWebScript
{ {
private DictionaryService dictionaryservice; private DictionaryService dictionaryservice;
private DictionaryHelper dictionaryhelper; private DictionaryHelper dictionaryhelper;