mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126503 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 122758 gjames: RA-211: Added new interface for WithResponse. Revert>Java7 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126847 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -33,6 +33,7 @@ import org.alfresco.rest.framework.resource.content.BinaryResource;
|
|||||||
import org.alfresco.rest.framework.resource.content.FileBinaryResource;
|
import org.alfresco.rest.framework.resource.content.FileBinaryResource;
|
||||||
import org.alfresco.rest.framework.resource.content.NodeBinaryResource;
|
import org.alfresco.rest.framework.resource.content.NodeBinaryResource;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permissible actions for binary resources of an Entity Resource
|
* Permissible actions for binary resources of an Entity Resource
|
||||||
@@ -61,6 +62,22 @@ public interface BinaryResourceAction
|
|||||||
public BinaryResource readProperty (String entityId, Parameters parameters) throws EntityNotFoundException;
|
public BinaryResource readProperty (String entityId, Parameters parameters) throws EntityNotFoundException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP GET - Retrieve a binary resource
|
||||||
|
*/
|
||||||
|
public static interface ReadWithResponse extends ResourceAction
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Retrieves a binary property by returning a BinaryResource object. The specific property is specified in the {@link Parameters} object.
|
||||||
|
* See {@link Parameters#hasBinaryProperty(String)} or {@link Parameters#getBinaryProperty()}
|
||||||
|
* @param entityId unique id
|
||||||
|
* @param parameters {@link Parameters}
|
||||||
|
* @return BinaryResource - Either {@link FileBinaryResource} or {@link NodeBinaryResource}
|
||||||
|
* @throws EntityNotFoundException
|
||||||
|
*/
|
||||||
|
public BinaryResource readProperty (String entityId, Parameters parameters, WithResponse withResponse) throws EntityNotFoundException;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP DELETE - Deletes a binary resource
|
* HTTP DELETE - Deletes a binary resource
|
||||||
*/
|
*/
|
||||||
@@ -76,6 +93,21 @@ public interface BinaryResourceAction
|
|||||||
public void deleteProperty (String entityId, Parameters parameters);
|
public void deleteProperty (String entityId, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP DELETE - Deletes a binary resource
|
||||||
|
*/
|
||||||
|
public static interface DeleteWithResponse extends ResourceAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a binary property. The specific property is specified in the {@link Parameters} object.
|
||||||
|
* See {@link Parameters#hasBinaryProperty(String)} or {@link Parameters#getBinaryProperty()}
|
||||||
|
* @param entityId unique id
|
||||||
|
* @param parameters {@link Parameters}
|
||||||
|
*/
|
||||||
|
public void deleteProperty (String entityId, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP PUT - Updates a binary resource if it exists, error if not
|
* HTTP PUT - Updates a binary resource if it exists, error if not
|
||||||
*/
|
*/
|
||||||
@@ -93,4 +125,20 @@ public interface BinaryResourceAction
|
|||||||
public E updateProperty (String entityId, BasicContentInfo contentInfo, InputStream stream, Parameters params);
|
public E updateProperty (String entityId, BasicContentInfo contentInfo, InputStream stream, Parameters params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP PUT - Updates a binary resource if it exists, error if not
|
||||||
|
*/
|
||||||
|
public static interface UpdateWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates a binary property. The specific property is specified in the {@link Parameters} object.
|
||||||
|
* See {@link Parameters#hasBinaryProperty(String)} or {@link Parameters#getBinaryProperty()}
|
||||||
|
* @param entityId unique id
|
||||||
|
* @param stream An inputstream
|
||||||
|
* @param contentInfo Basic information about the content stream
|
||||||
|
* @param params {@link Parameters}
|
||||||
|
*/
|
||||||
|
public E updateProperty (String entityId, BasicContentInfo contentInfo, InputStream stream, Parameters params, WithResponse withResponse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@ import java.util.List;
|
|||||||
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
|
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
|
||||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
import org.springframework.extensions.webscripts.Cache;
|
import org.springframework.extensions.webscripts.Cache;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
import org.springframework.extensions.webscripts.Status;
|
||||||
|
|
||||||
@@ -51,6 +52,14 @@ public interface EntityResourceAction
|
|||||||
public List<E> create (List<E> entity, Parameters parameters);
|
public List<E> create (List<E> entity, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP POST - Create a new entity
|
||||||
|
*/
|
||||||
|
public static interface CreateWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
public List<E> create (List<E> entity, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP GET - Retrieve list of entities
|
* HTTP GET - Retrieve list of entities
|
||||||
*/
|
*/
|
||||||
@@ -67,14 +76,36 @@ public interface EntityResourceAction
|
|||||||
public CollectionWithPagingInfo<E> readAll (Parameters params);
|
public CollectionWithPagingInfo<E> readAll (Parameters params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP GET - Retrieve list of entities
|
||||||
|
*/
|
||||||
|
public static interface ReadWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads all the entries from the collection.
|
||||||
|
*
|
||||||
|
* Paging information is provided.
|
||||||
|
* @param params - will never be null and will have the PAGING default values
|
||||||
|
* @return CollectionWithPagingInfo<E>
|
||||||
|
*/
|
||||||
|
public CollectionWithPagingInfo<E> readAll (Parameters params, WithResponse withResponse);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP GET - Retrieve an entity by its unique id
|
* HTTP GET - Retrieve an entity by its unique id
|
||||||
*/
|
*/
|
||||||
public static interface ReadById<E> extends ResourceAction
|
public static interface ReadById<E> extends ResourceAction
|
||||||
{
|
{
|
||||||
public E readById (String id, Parameters parameters) throws EntityNotFoundException;
|
public E readById (String id, Parameters parameters) throws EntityNotFoundException;
|
||||||
// public E readById (String id, Parameters parameters, Status status, Cache cache) throws EntityNotFoundException;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP GET - Retrieve an entity by its unique id
|
||||||
|
*/
|
||||||
|
public static interface ReadByIdWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
public E readById (String id, Parameters parameters, WithResponse withResponse) throws EntityNotFoundException;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,6 +116,14 @@ public interface EntityResourceAction
|
|||||||
public E update (String id, E entity, Parameters parameters);
|
public E update (String id, E entity, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP PUT - Update entity if it exists, error if not
|
||||||
|
*/
|
||||||
|
public static interface UpdateWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
public E update (String id, E entity, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP DELETE - Deletes an entity
|
* HTTP DELETE - Deletes an entity
|
||||||
*/
|
*/
|
||||||
@@ -92,4 +131,12 @@ public interface EntityResourceAction
|
|||||||
{
|
{
|
||||||
public void delete (String id, Parameters parameters);
|
public void delete (String id, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP DELETE - Deletes an entity
|
||||||
|
*/
|
||||||
|
public static interface DeleteWithResponse extends ResourceAction
|
||||||
|
{
|
||||||
|
public void delete (String id, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@ import java.util.List;
|
|||||||
import org.alfresco.rest.framework.core.exceptions.RelationshipResourceNotFoundException;
|
import org.alfresco.rest.framework.core.exceptions.RelationshipResourceNotFoundException;
|
||||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permissible actions for an Relationship Resources
|
* Permissible actions for an Relationship Resources
|
||||||
@@ -56,6 +57,22 @@ public interface RelationshipResourceAction
|
|||||||
public CollectionWithPagingInfo<E> readAll (String entityResourceId, Parameters params);
|
public CollectionWithPagingInfo<E> readAll (String entityResourceId, Parameters params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP GET - Retrieve list of related entities by its related entityResource Id
|
||||||
|
*/
|
||||||
|
public static interface ReadWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Reads all the relationship entities from the collection using the related entityResourceId.
|
||||||
|
*
|
||||||
|
* Paging information is provided.
|
||||||
|
* @param entityResourceId Entity resource context for this relationship
|
||||||
|
* @param params - will never be null and will have the PAGING default values
|
||||||
|
* @return CollectionWithPagingInfo<E>
|
||||||
|
*/
|
||||||
|
public CollectionWithPagingInfo<E> readAll (String entityResourceId, Parameters params, WithResponse withResponse);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP GET - Retrieve a relation by its unique id & entity context
|
* HTTP GET - Retrieve a relation by its unique id & entity context
|
||||||
*/
|
*/
|
||||||
@@ -64,6 +81,14 @@ public interface RelationshipResourceAction
|
|||||||
public E readById (String entityResourceId, String id, Parameters parameters) throws RelationshipResourceNotFoundException;
|
public E readById (String entityResourceId, String id, Parameters parameters) throws RelationshipResourceNotFoundException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP GET - Retrieve a relation by its unique id & entity context
|
||||||
|
*/
|
||||||
|
public static interface ReadByIdWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
public E readById (String entityResourceId, String id, Parameters parameters, WithResponse withResponse) throws RelationshipResourceNotFoundException;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP PUT - Update entity (by its related entityResource Id) if it exists, error if not
|
* HTTP PUT - Update entity (by its related entityResource Id) if it exists, error if not
|
||||||
*/
|
*/
|
||||||
@@ -72,6 +97,14 @@ public interface RelationshipResourceAction
|
|||||||
public E update (String entityResourceId, E entity, Parameters parameters);
|
public E update (String entityResourceId, E entity, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP PUT - Update entity (by its related entityResource Id) if it exists, error if not
|
||||||
|
*/
|
||||||
|
public static interface UpdateWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
public E update (String entityResourceId, E entity, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP POST - Create one or more new entity
|
* HTTP POST - Create one or more new entity
|
||||||
*/
|
*/
|
||||||
@@ -80,6 +113,14 @@ public interface RelationshipResourceAction
|
|||||||
public List<E> create (String entityResourceId, List<E> entity, Parameters parameters);
|
public List<E> create (String entityResourceId, List<E> entity, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP POST - Create one or more new entity
|
||||||
|
*/
|
||||||
|
public static interface CreateWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
public List<E> create (String entityResourceId, List<E> entity, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP DELETE - Deletes a relation by its unique id & entity context
|
* HTTP DELETE - Deletes a relation by its unique id & entity context
|
||||||
*/
|
*/
|
||||||
@@ -88,4 +129,11 @@ public interface RelationshipResourceAction
|
|||||||
public void delete (String entityResourceId, String id, Parameters parameters);
|
public void delete (String entityResourceId, String id, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP DELETE - Deletes a relation by its unique id & entity context
|
||||||
|
*/
|
||||||
|
public static interface DeleteWithResponse extends ResourceAction
|
||||||
|
{
|
||||||
|
public void delete (String entityResourceId, String id, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,7 @@ import org.alfresco.rest.framework.resource.content.BinaryResource;
|
|||||||
import org.alfresco.rest.framework.resource.content.FileBinaryResource;
|
import org.alfresco.rest.framework.resource.content.FileBinaryResource;
|
||||||
import org.alfresco.rest.framework.resource.content.NodeBinaryResource;
|
import org.alfresco.rest.framework.resource.content.NodeBinaryResource;
|
||||||
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
||||||
|
import org.alfresco.rest.framework.webscripts.WithResponse;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
@@ -37,6 +38,23 @@ public interface RelationshipResourceBinaryAction
|
|||||||
public BinaryResource readProperty(String entityId, String entityResourceId, Parameters parameters) throws EntityNotFoundException;
|
public BinaryResource readProperty(String entityId, String entityResourceId, Parameters parameters) throws EntityNotFoundException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP GET - Retrieve a binary resource
|
||||||
|
*/
|
||||||
|
public static interface ReadWithResponse extends ResourceAction
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Retrieves a binary property by returning a BinaryResource object. The specific property is specified in the {@link Parameters} object.
|
||||||
|
* See {@link Parameters#hasBinaryProperty(String)} or {@link Parameters#getBinaryProperty()}
|
||||||
|
* @param entityId unique id
|
||||||
|
* @param entityResourceId Entity resource context for this relationship
|
||||||
|
* @param parameters {@link Parameters}
|
||||||
|
* @return BinaryResource - Either {@link FileBinaryResource} or {@link NodeBinaryResource}
|
||||||
|
* @throws EntityNotFoundException
|
||||||
|
*/
|
||||||
|
public BinaryResource readProperty(String entityId, String entityResourceId, Parameters parameters, WithResponse withResponse) throws EntityNotFoundException;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP DELETE - Deletes a binary resource
|
* HTTP DELETE - Deletes a binary resource
|
||||||
*/
|
*/
|
||||||
@@ -53,6 +71,21 @@ public interface RelationshipResourceBinaryAction
|
|||||||
public void deleteProperty(String entityId, String entityResourceId, Parameters parameters);
|
public void deleteProperty(String entityId, String entityResourceId, Parameters parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP DELETE - Deletes a binary resource
|
||||||
|
*/
|
||||||
|
public static interface DeleteWithResponse extends ResourceAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a binary property. The specific property is specified in the {@link Parameters} object.
|
||||||
|
* See {@link Parameters#hasBinaryProperty(String)} or {@link Parameters#getBinaryProperty()}
|
||||||
|
* @param entityId unique id
|
||||||
|
* @param entityResourceId Entity resource context for this relationship
|
||||||
|
* @param parameters {@link Parameters}
|
||||||
|
*/
|
||||||
|
public void deleteProperty(String entityId, String entityResourceId, Parameters parameters, WithResponse withResponse);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* HTTP PUT - Updates a binary resource if it exists, error if not
|
* HTTP PUT - Updates a binary resource if it exists, error if not
|
||||||
*/
|
*/
|
||||||
@@ -71,4 +104,22 @@ public interface RelationshipResourceBinaryAction
|
|||||||
public E updateProperty(String entityId, String entityResourceId, BasicContentInfo contentInfo, InputStream stream, Parameters params);
|
public E updateProperty(String entityId, String entityResourceId, BasicContentInfo contentInfo, InputStream stream, Parameters params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP PUT - Updates a binary resource if it exists, error if not
|
||||||
|
*/
|
||||||
|
public static interface UpdateWithResponse<E> extends ResourceAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates a binary property. The specific property is specified in the {@link Parameters} object.
|
||||||
|
* See {@link Parameters#hasBinaryProperty(String)} or {@link Parameters#getBinaryProperty()}
|
||||||
|
* @param entityId unique id
|
||||||
|
* @param entityResourceId Entity resource context for this relationship
|
||||||
|
* @param stream An inputstream
|
||||||
|
* @param contentInfo Basic information about the content stream
|
||||||
|
* @param params {@link Parameters}
|
||||||
|
*/
|
||||||
|
public E updateProperty(String entityId, String entityResourceId, BasicContentInfo contentInfo,
|
||||||
|
InputStream stream, Parameters params, WithResponse withResponse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user