From acc3acd1924536d07dd1fbd9a56d74b463553c5c Mon Sep 17 00:00:00 2001 From: Sathish Kumar Date: Tue, 11 Jun 2024 13:30:26 +0530 Subject: [PATCH] [APPS-2836] POST Endpoint for creating Retention Schedule --- .../rm-public-rest-context.xml | 2 +- .../rest/api/impl/ApiNodesModelFactory.java | 4 +- .../RetentionScheduleRelation.java | 3 +- .../api/rententionschedule/package-info.java | 37 +++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) rename amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/{recordcategories => rententionschedule}/RetentionScheduleRelation.java (97%) create mode 100644 amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/rententionschedule/package-info.java diff --git a/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-public-rest-context.xml b/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-public-rest-context.xml index 1b6f1dd354..b3a0a47105 100644 --- a/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-public-rest-context.xml +++ b/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-public-rest-context.xml @@ -139,7 +139,7 @@ - + diff --git a/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java b/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java index 9903f3bc81..0ba7970bd4 100644 --- a/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java +++ b/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/ApiNodesModelFactory.java @@ -939,11 +939,11 @@ public class ApiNodesModelFactory retentionScheduleActionDefinition.setDescription(dispositionActionDefinition.getDescription()); String period = dispositionActionDefinition.getPeriod().toString(); String[] periodArray = period.split("\\|"); - if(periodArray[0] != null && !periodArray[0].isEmpty()) + if(periodArray.length == 1) { retentionScheduleActionDefinition.setPeriod(periodArray[0]); } - if(periodArray[0] != null && !periodArray[1].isEmpty()) + if(periodArray.length == 2) { retentionScheduleActionDefinition.setPeriodAmount(Integer.parseInt(periodArray[1])); } diff --git a/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RetentionScheduleRelation.java b/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/rententionschedule/RetentionScheduleRelation.java similarity index 97% rename from amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RetentionScheduleRelation.java rename to amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/rententionschedule/RetentionScheduleRelation.java index 43bc475017..d0b9f278c6 100644 --- a/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/recordcategories/RetentionScheduleRelation.java +++ b/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/rententionschedule/RetentionScheduleRelation.java @@ -24,7 +24,7 @@ * along with Alfresco. If not, see . * #L% */ -package org.alfresco.rm.rest.api.recordcategories; +package org.alfresco.rm.rest.api.rententionschedule; import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule; import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService; @@ -36,6 +36,7 @@ import org.alfresco.rest.framework.resource.parameters.Parameters; import org.alfresco.rm.rest.api.impl.ApiNodesModelFactory; import org.alfresco.rm.rest.api.impl.FilePlanComponentsApiUtils; import org.alfresco.rm.rest.api.model.RetentionSchedule; +import org.alfresco.rm.rest.api.recordcategories.RecordCategoriesEntityResource; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; diff --git a/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/rententionschedule/package-info.java b/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/rententionschedule/package-info.java new file mode 100644 index 0000000000..678c81f73d --- /dev/null +++ b/amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/rententionschedule/package-info.java @@ -0,0 +1,37 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco 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 Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ + +/** + * Package info that defines the Information Governance Record Categories REST API + * + * @author Ana Bozianu + * @since 2.6 + */ +@WebApi(name="gs", scope=Api.SCOPE.PUBLIC, version=1) +package org.alfresco.rm.rest.api.rententionschedule; +import org.alfresco.rest.framework.Api; +import org.alfresco.rest.framework.WebApi; \ No newline at end of file