Package org.dspace.authorize
Class PolicySet
java.lang.Object
org.dspace.authorize.PolicySet
Was Hack/Tool to set policies for items, bundles, and bitstreams. Now has
helpful method, setPolicies();
- Version:
- $Revision$
- Author:
- dstuve
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCommand line interface to setPolicies - run to see argumentsstatic voidsetPolicies(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly) Useful policy wildcard tool.static voidsetPolicies(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly, String name, String description, LocalDate startDate, LocalDate endDate) static voidsetPoliciesFilter(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly, String filter) Useful policy wildcard tool.static voidsetPoliciesFilter(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly, String filter, String name, String description, LocalDate startDate, LocalDate endDate) Useful policy wildcard tool.
-
Method Details
-
main
Command line interface to setPolicies - run to see arguments- Parameters:
argv- the command line arguments given- Throws:
Exception- if error
-
setPolicies
public static void setPolicies(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly) throws SQLException, AuthorizeException Useful policy wildcard tool. Can set entire collections' contents' policies- Parameters:
c- current contextcontainerType- type, Constants.ITEM or Constants.COLLECTIONcontainerID- ID of container (DB primary key)contentType- type (BUNDLE, ITEM, or BITSTREAM)actionID- action IDgroupID- group ID (database key)isReplace- iftrue, existing policies are removed first, otherwise add to existing policiesclearOnly- iftrue, just delete policies for matching objects- Throws:
SQLException- if database error if database problemAuthorizeException- if authorization error if current user is not authorized to change these policies
-
setPolicies
public static void setPolicies(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly, String name, String description, LocalDate startDate, LocalDate endDate) throws SQLException, AuthorizeException - Parameters:
c- current contextcontainerType- type, Constants.ITEM or Constants.COLLECTIONcontainerID- ID of container (DB primary key)contentType- ID of container (DB primary key)actionID- action ID (e.g. Constants.READ)groupID- group ID (database key)isReplace- iftrue, existing policies are removed first, otherwise add to existing policiesclearOnly- if non-null, only process bitstreams whose names contain filtername- policy namedescription- policy descriptionstartDate- policy start dateendDate- policy end date- Throws:
SQLException- if database errorAuthorizeException- if authorization error
-
setPoliciesFilter
public static void setPoliciesFilter(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly, String filter) throws SQLException, AuthorizeException Useful policy wildcard tool. Can set entire collections' contents' policies- Parameters:
c- current contextcontainerType- type, Constants.ITEM or Constants.COLLECTIONcontainerID- ID of container (DB primary key)contentType- type (BUNDLE, ITEM, or BITSTREAM)actionID- action ID (e.g. Constants.READ)groupID- group ID (database key)isReplace- iftrue, existing policies are removed first, otherwise add to existing policiesclearOnly- iftrue, just delete policies for matching objectsfilter- if non-null, only process bitstreams whose names contain filter- Throws:
SQLException- if database error if database problemAuthorizeException- if authorization error if current user is not authorized to change these policies
-
setPoliciesFilter
public static void setPoliciesFilter(Context c, int containerType, UUID containerID, int contentType, int actionID, UUID groupID, boolean isReplace, boolean clearOnly, String filter, String name, String description, LocalDate startDate, LocalDate endDate) throws SQLException, AuthorizeException Useful policy wildcard tool. Can set entire collections' contents' policies- Parameters:
c- current contextcontainerType- type, Constants.ITEM or Constants.COLLECTIONcontainerID- ID of container (DB primary key)contentType- type (BUNDLE, ITEM, or BITSTREAM)actionID- action IDgroupID- group ID (database key)isReplace- iftrue, existing policies are removed first, otherwise add to existing policiesclearOnly- iftrue, just delete policies for matching objectsfilter- if non-null, only process bitstreams whose names contain filtername- policy namedescription- policy descriptionstartDate- policy start dateendDate- policy end date- Throws:
SQLException- if database error if database problemAuthorizeException- if authorization error if current user is not authorized to change these policies
-