diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/module-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/module-context.xml index 805736da39..4ef9447a72 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/module-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/module-context.xml @@ -7,7 +7,7 @@ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd "> - + @@ -258,4 +258,7 @@ + + + diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-public-rest-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-public-rest-context.xml new file mode 100644 index 0000000000..4f3404a3ae --- /dev/null +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-public-rest-context.xml @@ -0,0 +1,58 @@ + + + + + + + + + + org.alfresco.rest.api.QuickShareLinks + + + + + + + + + + + + + + + + + + org.alfresco.rest.api.Nodes + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 1c736ba78a..c721e273d1 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -26,7 +26,6 @@ true ${project.build.directory}/solr/home 1.0-SNAPSHOT - 1.0-SNAPSHOT @@ -341,11 +340,6 @@ reflections test - - org.alfresco - alfresco-rm-community-rest-api - ${alfresco.rm.community.rest.api.version} - diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/CategoryChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/CategoryChildrenRelation.java new file mode 100644 index 0000000000..aa48716a8d --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/CategoryChildrenRelation.java @@ -0,0 +1,66 @@ +/* + * #%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 org.alfresco.module.org_alfresco_module_rm.rest.api; + +import java.util.ArrayList; +import java.util.List; + +import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; +import org.alfresco.rest.api.Nodes; +import org.alfresco.rest.api.model.Node; +import org.alfresco.rest.framework.resource.EntityResource; +import org.alfresco.rest.framework.resource.RelationshipResource; +import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction; +import org.alfresco.rest.framework.resource.parameters.Parameters; + +@RelationshipResource(name="category-children", entityResource = CategoryEntityResource.class, title = "Children of Category type") +public class CategoryChildrenRelation implements + RelationshipResourceAction.Create +{ + private Nodes nodes; + + public void setNodes(Nodes nodes) + { + this.nodes = nodes; + } + + @Override + public List create(String parentFolderNodeId, List nodeInfos, Parameters parameters) + { + List result = new ArrayList<>(nodeInfos.size()); + + for (Node nodeInfo : nodeInfos) + { + nodeInfo.setNodeType(RecordsManagementModel.RM_PREFIX + ":" + RecordsManagementModel.TYPE_RECORD_CATEGORY.getPrefixString()); + result.add(nodes.createNode(parentFolderNodeId, nodeInfo, parameters)); + } + + return result; + } + +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/CategoryEntityResource.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/CategoryEntityResource.java new file mode 100644 index 0000000000..f5eef95d34 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/CategoryEntityResource.java @@ -0,0 +1,36 @@ +/* + * #%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 org.alfresco.module.org_alfresco_module_rm.rest.api; + +import org.alfresco.rest.framework.resource.EntityResource; + +@EntityResource(name="categories", title = "Categories") +public class CategoryEntityResource +{ + +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/FileplanChildrenRelation.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/FileplanChildrenRelation.java new file mode 100644 index 0000000000..b8d07d8137 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/FileplanChildrenRelation.java @@ -0,0 +1,53 @@ +/* + * #%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 org.alfresco.module.org_alfresco_module_rm.rest.api; + +import org.alfresco.rest.api.Nodes; +import org.alfresco.rest.api.model.Node; +import org.alfresco.rest.framework.resource.RelationshipResource; +import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction; +import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo; +import org.alfresco.rest.framework.resource.parameters.Parameters; + +@RelationshipResource(name="children", entityResource = RMFileplanComponentsEntityResource.class, title = "Children of fileplan component") +public class FileplanChildrenRelation implements RelationshipResourceAction.Read +{ + private Nodes nodes; + + public void setNodes(Nodes nodes) + { + this.nodes = nodes; + } + + @Override + public CollectionWithPagingInfo readAll(String parentFolderNodeId, Parameters parameters) + { + return nodes.listChildren(parentFolderNodeId, parameters); + } + +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/RMFileplanComponentsEntityResource.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/RMFileplanComponentsEntityResource.java new file mode 100644 index 0000000000..c8860d17b1 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/RMFileplanComponentsEntityResource.java @@ -0,0 +1,57 @@ +/* + * #%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 org.alfresco.module.org_alfresco_module_rm.rest.api; + +import org.alfresco.rest.api.Nodes; +import org.alfresco.rest.api.model.Node; +import org.alfresco.rest.framework.WebApiDescription; +import org.alfresco.rest.framework.WebApiParam; +import org.alfresco.rest.framework.resource.EntityResource; +import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction; +import org.alfresco.rest.framework.resource.parameters.Parameters; + +@EntityResource(name="fileplan-components", title = "Fileplan Components") +public class RMFileplanComponentsEntityResource implements + EntityResourceAction.ReadById +{ + + private Nodes nodes; + + public void setNodes(Nodes nodes) + { + this.nodes = nodes; + } + + @WebApiDescription(title = "Get Node Information", description = "Get information for the fileplan component with id 'nodeId'") + @WebApiParam(name = "nodeId", title = "The node id") + public Node readById(String nodeId, Parameters parameters) + { + return nodes.getFolderOrDocument(nodeId, parameters); + } + +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/impl/RMNodesImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/impl/RMNodesImpl.java new file mode 100644 index 0000000000..bd6badcf37 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/impl/RMNodesImpl.java @@ -0,0 +1,50 @@ +/* + * #%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 org.alfresco.module.org_alfresco_module_rm.rest.api.impl; + +import java.util.List; +import java.util.Map; + +import org.alfresco.module.org_alfresco_module_rm.rest.api.model.RMNode; +import org.alfresco.rest.api.impl.NodesImpl; +import org.alfresco.rest.api.model.Node; +import org.alfresco.rest.api.model.UserInfo; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.namespace.QName; + +public class RMNodesImpl extends NodesImpl +{ + @Override + public Node getFolderOrDocument(final NodeRef nodeRef, NodeRef parentNodeRef, QName nodeTypeQName, List includeParam, Map mapUserInfo) + { + Node node = super.getFolderOrDocument(nodeRef, parentNodeRef, nodeTypeQName, includeParam, mapUserInfo); + Node node2 = new RMNode(node); + + return node2; + } +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/model/RMNode.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/model/RMNode.java new file mode 100644 index 0000000000..335333f1e5 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/model/RMNode.java @@ -0,0 +1,79 @@ +/* + * #%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 org.alfresco.module.org_alfresco_module_rm.rest.api.model; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.alfresco.rest.api.model.AssocChild; +import org.alfresco.rest.api.model.AssocTarget; +import org.alfresco.rest.api.model.Node; +import org.alfresco.rest.api.model.PathInfo; +import org.alfresco.rest.api.model.UserInfo; +import org.alfresco.service.cmr.repository.NodeRef; + +public class RMNode extends Node +{ + protected boolean hasRetentionSchedule; + + public boolean isHasRetentionSchedule() + { + return hasRetentionSchedule; + } + + public void setHasRetentionSchedule(boolean hasRetentionSchedule) + { + this.hasRetentionSchedule = hasRetentionSchedule; + } + + public RMNode(Node node) + { + this.nodeRef = node.getNodeRef(); + this.name = node.getName(); + this.createdAt = node.getCreatedAt(); + this.modifiedAt = node.getModifiedAt(); + this.createdByUser = node.getCreatedByUser(); + this.modifiedByUser = node.getModifiedByUser(); + this.archivedAt = node.getArchivedAt(); + this.archivedByUser = node.getArchivedByUser(); + this.isFolder = node.getIsFolder(); + this.isFile = node.getIsFile(); + this.isLink = node.getIsLink(); + this.parentNodeRef = node.getParentId(); + this.pathInfo = node.getPath(); + this.relativePath = node.getRelativePath(); + this.secondaryChildren = node.getSecondaryChildren(); + this.targets = node.getTargets(); + this.aspectNames = node.getAspectNames(); + this.properties = node.getProperties(); + this.allowableOperations = node.getAllowableOperations(); + + this.hasRetentionSchedule = true; + } +} diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/package-info.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/package-info.java new file mode 100644 index 0000000000..46a42e731b --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/rest/api/package-info.java @@ -0,0 +1,31 @@ +/* + * #%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% + */ + +@WebApi(name="ig", scope=Api.SCOPE.PUBLIC, version=1) +package org.alfresco.module.org_alfresco_module_rm.rest.api; +import org.alfresco.rest.framework.Api; +import org.alfresco.rest.framework.WebApi; \ No newline at end of file