Files
alfresco-community-repo/source/java/org/alfresco/rest/api/trashcan/TrashcanEntityResource.java
Ancuta Morarasu 95affed365 Merged HEAD (5.2) to 5.2.N (5.2.1)
126581 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      124740 gjames: RA-847, RA-848 Retrieving deleted nodes


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126926 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2016-05-11 12:12:13 +00:00

70 lines
2.5 KiB
Java

/*
* Copyright (C) 2005-2016 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* 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/>.
*/
package org.alfresco.rest.api.trashcan;
import org.alfresco.query.PagingRequest;
import org.alfresco.query.PagingResults;
import org.alfresco.repo.node.archive.ArchivedNodesCannedQueryBuilder;
import org.alfresco.repo.node.archive.NodeArchiveService;
import org.alfresco.rest.api.DeletedNodes;
import org.alfresco.rest.api.Nodes;
import org.alfresco.rest.api.impl.Util;
import org.alfresco.rest.api.model.Node;
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
import org.alfresco.rest.framework.resource.EntityResource;
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import java.util.ArrayList;
import java.util.List;
/**
* An implementation of an Entity Resource for handling archived content
*
* @author Gethin James
*/
@EntityResource(name="deleted-nodes", title = "Deleted Nodes")
public class TrashcanEntityResource implements
EntityResourceAction.ReadById<Node>, EntityResourceAction.Read<Node>
{
private DeletedNodes deletedNodes;
public void setDeletedNodes(DeletedNodes deletedNodes)
{
this.deletedNodes = deletedNodes;
}
@Override
public CollectionWithPagingInfo<Node> readAll(Parameters params)
{
return deletedNodes.listDeleted(params);
}
@Override
public Node readById(String id, Parameters parameters) throws EntityNotFoundException
{
return deletedNodes.getDeletedNode(id, parameters);
}
}