From 1d12f8689f30664be3274ab2610906b01aec88a7 Mon Sep 17 00:00:00 2001 From: Saravanan Sellathurai Date: Fri, 21 Nov 2008 15:37:09 +0000 Subject: [PATCH] Removed Childassociation webscript which is no more used git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12078 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../dictionary/GetChildAssociationDef.java | 103 ------------------ .../dictionary/GetChildAssociationDefs.java | 90 --------------- 2 files changed, 193 deletions(-) delete mode 100644 source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDef.java delete mode 100644 source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDefs.java diff --git a/source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDef.java b/source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDef.java deleted file mode 100644 index 42cdbebe68..0000000000 --- a/source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDef.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2005-2007 Alfresco Software Limited. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - * As a special exception to the terms and conditions of version 2.0 of - * the GPL, you may redistribute this Program in connection with Free/Libre - * and Open Source Software ("FLOSS") applications as described in Alfresco's - * FLOSS exception. You should have recieved a copy of the text describing - * the FLOSS exception, and it is also available here: - * http://www.alfresco.com/legal/licensing" - */ -package org.alfresco.repo.web.scripts.dictionary; - -import org.alfresco.web.scripts.DeclarativeWebScript; -import org.alfresco.web.scripts.Status; -import org.alfresco.web.scripts.WebScriptException; -import org.alfresco.web.scripts.WebScriptRequest; -import org.alfresco.service.namespace.QName; -import org.alfresco.service.cmr.dictionary.DictionaryService; -import org.alfresco.service.cmr.dictionary.ClassDefinition; -import java.util.HashMap; -import java.util.Map; - -/* - * Webscript to get the ChildAssociationdefinitions for a given classname and child-association-name - * @author Saravanan Sellathurai - */ - -public class GetChildAssociationDef extends DeclarativeWebScript -{ - private DictionaryService dictionaryservice; - private ClassDefinition classdefinition; - private DictionaryHelper dictionaryhelper; - - private static final String MODEL_PROP_KEY_ASSOCIATION_DETAILS = "assocdefs"; - private static final String DICTIONARY_ASSOCIATION_NAME = "assocname"; - private static final String DICTIONARY_CLASS_NAME = "classname"; - - /** - * Set the dictionaryService property. - * - * @param dictionaryService The dictionary service instance to set - */ - public void setDictionaryService(DictionaryService dictionaryService) - { - this.dictionaryservice = dictionaryService; - } - - /** - * Set the dictionaryhelper class - * - * @param dictionaryService The dictionary service instance to set - */ - public void setDictionaryHelper(DictionaryHelper dictionaryhelper) - { - this.dictionaryhelper = dictionaryhelper; - } - - /** - * @Override method from DeclarativeWebScript - */ - protected Map executeImpl(WebScriptRequest req, Status status) - { - String classname = req.getServiceMatch().getTemplateVars().get(DICTIONARY_CLASS_NAME); - String assocname = req.getServiceMatch().getTemplateVars().get(DICTIONARY_ASSOCIATION_NAME); - Map model = new HashMap(); - QName classqname = null; - QName assocqname = null; - boolean classnameGiven = (classname != null) && (classname.length() > 0); - boolean assocnameGiven = (assocname != null) && (assocname.length() > 0); - - if(classnameGiven && assocnameGiven) - { - classqname = QName.createQName(this.dictionaryhelper.getFullNamespaceURI(classname)); - assocqname = QName.createQName(this.dictionaryhelper.getFullNamespaceURI(assocname)); - } - classdefinition = this.dictionaryservice.getClass(classqname); - - if(this.classdefinition != null) - { - model.put(MODEL_PROP_KEY_ASSOCIATION_DETAILS, this.classdefinition.getChildAssociations().get(assocqname)); - return model; - } - else - { - throw new WebScriptException(Status.STATUS_NOT_FOUND, "The exact parameter has not been provided in the URL"); - } - } - -} \ No newline at end of file diff --git a/source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDefs.java b/source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDefs.java deleted file mode 100644 index 0a6c95dfed..0000000000 --- a/source/java/org/alfresco/repo/web/scripts/dictionary/GetChildAssociationDefs.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2005-2007 Alfresco Software Limited. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - * As a special exception to the terms and conditions of version 2.0 of - * the GPL, you may redistribute this Program in connection with Free/Libre - * and Open Source Software ("FLOSS") applications as described in Alfresco's - * FLOSS exception. You should have recieved a copy of the text describing - * the FLOSS exception, and it is also available here: - * http://www.alfresco.com/legal/licensing" - */ -package org.alfresco.repo.web.scripts.dictionary; - -import org.alfresco.web.scripts.DeclarativeWebScript; -import org.alfresco.web.scripts.Status; -import org.alfresco.web.scripts.WebScriptException; -import org.alfresco.web.scripts.WebScriptRequest; -import org.alfresco.service.namespace.QName; -import org.alfresco.service.cmr.dictionary.DictionaryService; -import org.alfresco.service.cmr.dictionary.ClassDefinition; -import java.util.HashMap; -import java.util.Map; - -public class GetChildAssociationDefs extends DeclarativeWebScript{ - - private DictionaryService dictionaryservice; - private ClassDefinition classdefinition; - private DictionaryHelper dictionaryhelper; - - private static final String MODEL_PROP_KEY_ASSOCIATION_DETAILS = "assocdefs"; - private static final String DICTIONARY_CLASS_NAME = "classname"; - - /** - * Set the dictionaryService property. - * - * @param dictionaryService The dictionary service instance to set - */ - public void setDictionaryService(DictionaryService dictionaryService) - { - this.dictionaryservice = dictionaryService; - } - - /** - * Set the dictionaryhelper class - * - * @param dictionaryService The dictionary service instance to set - */ - public void setDictionaryHelper(DictionaryHelper dictionaryhelper) - { - this.dictionaryhelper = dictionaryhelper; - } - - /** - * @Override method from DeclarativeWebScript - */ - protected Map executeImpl(WebScriptRequest req, Status status) - { - String classname = req.getServiceMatch().getTemplateVars().get(DICTIONARY_CLASS_NAME); - Map model = new HashMap(); - QName classqname = null; - boolean classnameGiven = (classname != null) && (classname.length() > 0); - - if(classnameGiven){ - classqname = QName.createQName(this.dictionaryhelper.getFullNamespaceURI(classname)); - } - classdefinition = this.dictionaryservice.getClass(classqname); - if(this.classdefinition != null){ - model.put(MODEL_PROP_KEY_ASSOCIATION_DETAILS, this.classdefinition.getChildAssociations().values()); - return model; - } - else - { - throw new WebScriptException(Status.STATUS_NOT_FOUND, "The exact parameter has not been provided in the URL"); - } - } - -} \ No newline at end of file