Interface DirectionBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, DirectionAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Directions in bulk.
The data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create a
Direction , a DirectionForm is requested using
getDirectionFormsForCreate() specifying the desired recipes and record
Types or none if no record Types are needed. Each of the
returned DirectionForms will indicate that it is to be used with a
create operation and can be used to examine metdata or validate data prior
to creation. Once a DirectionForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each DirectionForm corresponds
to an attempted transaction.
The DirectionForms returned from
getDirectionFormsForCreate() may be linked to the originating request
through the peer Ids of the DirectionForm . In the case
where there may be duplicates, any DirectionForm of the same peer
Ids may be used for a create operation.
Once a batch of DirectionForms are submitted for create, a
CreateResponse is returned for each DirectionForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createDirections() ,
errors specific to an individual DirectionForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating DirectionForm through the
DirectionForm Id .
For updates, DirectionForms are requested to the
Direction Id that is to be updated using
getDirectionFormsForUpdate() where the reference Id in the
DirectionForm may be used to link the request. Similarly, the
DirectionForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The DirectionForm
can only be used once for a successful update and cannot be reused.
Once a batch of DirectionForms are submitted for update, an
UpdateResponse is returned for each DirectionForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateDirections() ,
errors specific to an individual DirectionForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating DirectionForm through the
DirectionForm Id .
The delete operations delete Directions in bulk. To unmap a
Direction from the current Cookbook , the
DirectionCookbookAssignmentSession should be used. These delete
operations attempt to remove the Direction itself thus removing it
from all known Cookbook catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasDirections(AliasRequestList aliasRequests) Adds anIdto aDirectionfor the purpose of creating compatibility.createDirections(DirectionBatchFormList directionForms) Creates a new set ofDirections.createIngredients(IngredientBatchFormList ingredientForms) Creates a new set ofIngredients.Deletes allDirectionsin thisCookbook.Deletes allIngredientsin thisCookbook.deleteDirections(IdList directionIds) Deletes directions for the givenIds.deleteDirectionsForRecipe(Id recipeId) Deletes directions for the given recipe.deleteIngredients(IdList ingredientsIds) Deletes ingredients for the givenIds.deleteIngredientsForDirection(Id directionId) Deletes ingredients for the given direction.getDirectionFormsForCreate(IdList recipeIds, Type[] directionRecordTypes) Gets the direction forms for creating a bunch of new directions.getDirectionFormsForUpdate(IdList directionIds) Gets the direction forms for updating an existing set of directions.getIngredientFormsForCreate(IdList directionIds, Type[] ingredientRecordTypes) Gets the ingredient forms for creating a bunch of new ingredients.getIngredientFormsForUpdate(IdList ingredientIds) Gets the ingredient forms for updating an existing set of ingredients.updateDirections(DirectionBatchFormList directionForms) Updates existing directions.updateIngredients(IngredientBatchFormList ingredientForms) Updates existing ingredients.Methods inherited from interface DirectionAdminSession
aliasDirection, canCreateDirections, canCreateDirectionWithRecordTypes, canCreateIngredientWithRecordTypes, canDeleteDirections, canManageDirectionAliases, canManageIngredients, canSequenceDirections, canUpdateDirections, createDirection, createIngredient, deleteDirection, deleteIngredient, getCookbook, getCookbookId, getDirectionFormForCreate, getDirectionFormForUpdate, getIngredientFormForCreate, getIngredientFormForUpdate, moveDirectionAhead, moveDirectionBehind, orderDirections, updateDirection, updateIngredientModifier and TypeMethodDescriptionvoidaliasDirection(Id directionId, Id aliasId) Adds anIdto aDirectionfor the purpose of creating compatibility.booleanTests if this user can createDirections.booleancanCreateDirectionWithRecordTypes(Type[] directionRecordTypes) Tests if this user can create a singleDirectionusing the desired record types.booleancanCreateIngredientWithRecordTypes(Type[] ingredientRecordTypes) Tests if this user can create a singleIngredientusing the desired record types.booleanTests if this user can deleteDirections.booleanTests if this user can manageIdaliases forDirections.booleanTests if this user can manageIngedredients.booleanTests if this user can orderDirections.booleanTests if this user can updateDirections.createDirection(DirectionForm directionForm) Creates a newDirection.createIngredient(IngredientForm ingredientForm) Creates a newIngredient.voiddeleteDirection(Id directionId) Deletes aDirection.voiddeleteIngredient(Id ingredientId) Deletes anIngredient.Gets theCookbookassociated with this session.Gets theCookbookIdassociated with this session.getDirectionFormForCreate(Id recipeId, Type[] directionRecordTypes) Gets the direction form for creating new directions.getDirectionFormForUpdate(Id directionId) Gets the direction form for updating an existing direction.getIngredientFormForCreate(Id directionId, Type[] ingredientRecordTypes) Gets the ingredient form for creating new ingredients.getIngredientFormForUpdate(Id ingredientId) Gets the ingredient form for updating an existing ingredient.voidmoveDirectionAhead(Id directionId, Id recipeId, Id referenceId) Reorders directions in a recipe by moving the specified direction in front of a reference direction.voidmoveDirectionBehind(Id directionId, Id recipeId, Id referenceId) Reorders directions in a recipe by moving the specified direction behind a reference direction.voidorderDirections(Id[] directionIds, Id recipeId) Reorders a set of directions in a recipe.voidupdateDirection(DirectionForm directionForm) Updates an existing direction.voidupdateIngredient(IngredientForm ingredientForm) Updates an existing ingredient.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getDirectionFormsForCreate
DirectionBatchFormList getDirectionFormsForCreate(IdList recipeIds, Type[] directionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the direction forms for creating a bunch of new directions. A form is returned for each supplied recipe.- Parameters:
recipeIds- a list of recipeIdsdirectionRecordTypes- array of direction record types to be included in each create operation or an empty list if none- Returns:
- the direction forms
- Throws:
NotFoundException- arecipeIdis not foundNullArgumentException-recipeIdsordirectionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createDirections
CreateResponseList createDirections(DirectionBatchFormList directionForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofDirections. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
directionForms- the direction forms- Returns:
- the create responses
- Throws:
NullArgumentException-directionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDirectionFormsForUpdate
DirectionBatchFormList getDirectionFormsForUpdate(IdList directionIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the direction forms for updating an existing set of directions. A new direction form should be requested for each update transaction.- Parameters:
directionIds- theIdsof theDirections- Returns:
- the direction forms
- Throws:
NotFoundException- adirectionIdis not foundNullArgumentException-directionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDirections
UpdateResponseList updateDirections(DirectionBatchFormList directionForms) throws OperationFailedException, PermissionDeniedException Updates existing directions. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
directionForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-directionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllDirections
Deletes allDirectionsin thisCookbook.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDirections
DeleteResponseList deleteDirections(IdList directionIds) throws OperationFailedException, PermissionDeniedException Deletes directions for the givenIds.- Parameters:
directionIds- theIdsof the directions to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-directionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDirectionsForRecipe
DeleteResponseList deleteDirectionsForRecipe(Id recipeId) throws OperationFailedException, PermissionDeniedException Deletes directions for the given recipe.- Parameters:
recipeId- theIdof a recipe- Returns:
- the delete responses
- Throws:
NullArgumentException-recipeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasDirections
AliasResponseList aliasDirections(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aDirectionfor the purpose of creating compatibility. The primaryIdof theDirectionis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another direction, it is reassigned to the given directionId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getIngredientFormsForCreate
IngredientBatchFormList getIngredientFormsForCreate(IdList directionIds, Type[] ingredientRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the ingredient forms for creating a bunch of new ingredients. A form is returned for each supplied recipe.- Parameters:
directionIds- a list of directionIdsingredientRecordTypes- array of ingredient record types to be included in each create operation or an empty list if none- Returns:
- the ingredient forms
- Throws:
NotFoundException- adirectionIdis not foundNullArgumentException-directionIdsoringredientRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createIngredients
CreateResponseList createIngredients(IngredientBatchFormList ingredientForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofIngredients. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
ingredientForms- the ingredient forms- Returns:
- the create responses
- Throws:
NullArgumentException-ingredientFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getIngredientFormsForUpdate
IngredientBatchFormList getIngredientFormsForUpdate(IdList ingredientIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the ingredient forms for updating an existing set of ingredients. A new ingredient form should be requested for each update transaction.- Parameters:
ingredientIds- theIdsof theIngredients- Returns:
- the ingredient forms
- Throws:
NotFoundException- aningredientIdis not foundNullArgumentException-ingredientIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateIngredients
UpdateResponseList updateIngredients(IngredientBatchFormList ingredientForms) throws OperationFailedException, PermissionDeniedException Updates existing ingredients. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
ingredientForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-ingredientFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllIngredients
DeleteResponseList deleteAllIngredients() throws OperationFailedException, PermissionDeniedExceptionDeletes allIngredientsin thisCookbook.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIngredients
DeleteResponseList deleteIngredients(IdList ingredientsIds) throws OperationFailedException, PermissionDeniedException Deletes ingredients for the givenIds.- Parameters:
ingredientsIds- theIdsof the ingredients to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-ingredientIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIngredientsForDirection
DeleteResponseList deleteIngredientsForDirection(Id directionId) throws OperationFailedException, PermissionDeniedException Deletes ingredients for the given direction.- Parameters:
directionId- theIdof a direction- Returns:
- the delete responses
- Throws:
NullArgumentException-directionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-