mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
RM-4012 - rebamed to fileplan components and used nodes service
This commit is contained in:
@@ -41,10 +41,18 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean class="org.alfresco.module.org_alfresco_module_rm.rest.api.RMNodesEntityResource">
|
<bean class="org.alfresco.module.org_alfresco_module_rm.rest.api.RMFileplanComponentsEntityResource">
|
||||||
</bean>
|
<property name="nodes" ref="rm.Nodes" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean class="org.alfresco.module.org_alfresco_module_rm.rest.api.FileplanChildrenRelation">
|
||||||
|
<property name="nodes" ref="rm.Nodes" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean class="org.alfresco.module.org_alfresco_module_rm.rest.api.CategoryEntityResource"/>
|
||||||
|
|
||||||
|
<bean class="org.alfresco.module.org_alfresco_module_rm.rest.api.CategoryChildrenRelation">
|
||||||
|
<property name="nodes" ref="rm.Nodes" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
<bean class="org.alfresco.module.org_alfresco_module_rm.rest.api.CategoryChildrenRelation">
|
|
||||||
<property name="nodes" ref="rm.Nodes" />
|
|
||||||
</bean>
|
|
||||||
</beans>
|
</beans>
|
@@ -38,7 +38,7 @@ import org.alfresco.rest.framework.resource.RelationshipResource;
|
|||||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
|
|
||||||
@RelationshipResource(name="category-children", entityResource = RMNodesEntityResource.class, title = "Children of Category type")
|
@RelationshipResource(name="category-children", entityResource = CategoryEntityResource.class, title = "Children of Category type")
|
||||||
public class CategoryChildrenRelation implements
|
public class CategoryChildrenRelation implements
|
||||||
RelationshipResourceAction.Create<Node>
|
RelationshipResourceAction.Create<Node>
|
||||||
{
|
{
|
||||||
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
* #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
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
* #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<Node>
|
||||||
|
{
|
||||||
|
private Nodes nodes;
|
||||||
|
|
||||||
|
public void setNodes(Nodes nodes)
|
||||||
|
{
|
||||||
|
this.nodes = nodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CollectionWithPagingInfo<Node> readAll(String parentFolderNodeId, Parameters parameters)
|
||||||
|
{
|
||||||
|
return nodes.listChildren(parentFolderNodeId, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -27,30 +27,31 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.rest.api;
|
package org.alfresco.module.org_alfresco_module_rm.rest.api;
|
||||||
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.rest.api.model.RMNode;
|
import org.alfresco.rest.api.Nodes;
|
||||||
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
|
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.EntityResource;
|
||||||
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
|
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
|
|
||||||
@EntityResource(name="nodes", title = "Nodes")
|
@EntityResource(name="fileplan-components", title = "Fileplan Components")
|
||||||
public class RMNodesEntityResource implements
|
public class RMFileplanComponentsEntityResource implements
|
||||||
EntityResourceAction.ReadById<String>,
|
EntityResourceAction.ReadById<Node>
|
||||||
EntityResourceAction.Update<RMNode>
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
private Nodes nodes;
|
||||||
public String readById(String arg0, Parameters arg1) throws EntityNotFoundException
|
|
||||||
|
public void setNodes(Nodes nodes)
|
||||||
{
|
{
|
||||||
return null;
|
this.nodes = nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@WebApiDescription(title = "Get Node Information", description = "Get information for the fileplan component with id 'nodeId'")
|
||||||
public RMNode update(String arg0, RMNode arg1, Parameters arg2)
|
@WebApiParam(name = "nodeId", title = "The node id")
|
||||||
|
public Node readById(String nodeId, Parameters parameters)
|
||||||
{
|
{
|
||||||
// TODO Auto-generated method stub
|
return nodes.getFolderOrDocument(nodeId, parameters);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@@ -27,15 +27,24 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.rest.api.impl;
|
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.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
|
public class RMNodesImpl extends NodesImpl
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
|
public Node getFolderOrDocument(final NodeRef nodeRef, NodeRef parentNodeRef, QName nodeTypeQName, List<String> includeParam, Map<String, UserInfo> mapUserInfo)
|
||||||
|
{
|
||||||
|
Node node = super.getFolderOrDocument(nodeRef, parentNodeRef, nodeTypeQName, includeParam, mapUserInfo);
|
||||||
|
Node node2 = new RMNode(node);
|
||||||
|
|
||||||
// @Override
|
return node2;
|
||||||
// public Node getFolderOrDocument(String nodeId, Parameters parameters)
|
}
|
||||||
// {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,16 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.rest.api.model;
|
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.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
|
public class RMNode extends Node
|
||||||
{
|
{
|
||||||
@@ -42,4 +51,29 @@ public class RMNode extends Node
|
|||||||
{
|
{
|
||||||
this.hasRetentionSchedule = 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user