public interface DirectionAdminSession extends OsidSession
This session creates, updates, and deletes Directions.
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
getDirectionFormForCreate()
specifying the desired recipe
and record Types
or none if no record Types
are needed. The returned DirectionForm
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 the 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.
For updates, DirectionForms
are requested to the
Direction
Id
that is to be updated using
getDirectionFormForUpdate().
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.
The delete operations delete Directions.
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.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasDirection(Id directionId,
Id aliasId)
Adds an
Id to a Direction for the
purpose of creating compatibility. |
boolean |
canCreateDirections()
Tests if this user can create
Directions. |
boolean |
canCreateDirectionWithRecordTypes(Type[] directionRecordTypes)
Tests if this user can create a single
Direction using
the desired record types. |
boolean |
canCreateIngredientWithRecordTypes(Type[] ingredientRecordTypes)
Tests if this user can create a single
Ingredient using
the desired record types. |
boolean |
canDeleteDirections()
Tests if this user can delete
Directions. |
boolean |
canManageDirectionAliases()
Tests if this user can manage
Id aliases for
Directions. |
boolean |
canManageIngredients()
Tests if this user can manage
Ingedredients. |
boolean |
canSequenceDirections()
Tests if this user can order
Directions. |
boolean |
canUpdateDirections()
Tests if this user can update
Directions. |
Direction |
createDirection(DirectionForm directionForm)
Creates a new
Direction. |
Ingredient |
createIngredient(IngredientForm ingredientForm)
Creates a new
Ingredient. |
void |
deleteDirection(Id directionId)
Deletes a
Direction. |
void |
deleteIngredient(Id ingredientId)
Deletes an
Ingredient. |
Cookbook |
getCookbook()
Gets the
Cookbook associated with this session. |
Id |
getCookbookId()
Gets the
Cookbook Id associated with
this session. |
DirectionForm |
getDirectionFormForCreate(Id recipeId,
Type[] directionRecordTypes)
Gets the direction form for creating new directions.
|
DirectionForm |
getDirectionFormForUpdate(Id directionId)
Gets the direction form for updating an existing direction.
|
IngredientForm |
getIngredientFormForCreate(Id directionId,
Type[] ingredientRecordTypes)
Gets the ingredient form for creating new ingredients.
|
IngredientForm |
getIngredientFormForUpdate(Id ingredientId)
Gets the ingredient form for updating an existing ingredient.
|
void |
moveDirectionAhead(Id directionId,
Id recipeId,
Id referenceId)
Reorders directions in a recipe by moving the specified direction in
front of a reference direction.
|
void |
moveDirectionBehind(Id directionId,
Id recipeId,
Id referenceId)
Reorders directions in a recipe by moving the specified direction
behind a reference direction.
|
void |
orderDirections(Id[] directionIds,
Id recipeId)
Reorders a set of directions in a recipe.
|
void |
updateDirection(DirectionForm directionForm)
Updates an existing direction.
|
void |
updateIngredient(IngredientForm ingredientForm)
Updates an existing ingredient.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCookbookId()
Cookbook
Id
associated with
this session. Cookbook Id
associated with this sessionmandatory
- This method must be implemented. Cookbook getCookbook() throws OperationFailedException, PermissionDeniedException
Cookbook
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateDirections()
Directions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Direction
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if Direction
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateDirectionWithRecordTypes(Type[] directionRecordTypes)
Direction
using
the desired record types. While
RecipeManager.getDirectionRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Direction.
Providing
an empty array tests if a Direction
can be created with
no records.directionRecordTypes
- array of direction record types true
if Direction
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- directionRecordTypes
is null
mandatory
- This method must be implemented. DirectionForm getDirectionFormForCreate(Id recipeId, Type[] directionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
recipeId
- a recipe Id
directionRecordTypes
- array of direction record typesNotFoundException
- recipeId
Is not
foundNullArgumentException
- recipeId
or
directionRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Direction createDirection(DirectionForm directionForm) throws OperationFailedException, PermissionDeniedException
Direction.
directionForm
- the form for this Direction
Direction
IllegalStateException
- directionForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- directionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- directionForm
did
not originate from getDirectionFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateDirections()
Directions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Direction
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false
if Direction
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. DirectionForm getDirectionFormForUpdate(Id directionId) throws NotFoundException, OperationFailedException
directionId
- the Id
of the Direction
NotFoundException
- directionId
is not
foundNullArgumentException
- directionId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void updateDirection(DirectionForm directionForm) throws OperationFailedException, PermissionDeniedException
directionForm
- the form containing the elements to be updatedIllegalStateException
- directionForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- directionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- directionForm
did
not originate from getDirectionFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteDirections()
Directions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Direction
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false
if Direction
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteDirection(Id directionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Direction.
directionId
- the Id
of the Direction
to removeNotFoundException
- directionId
not
foundNullArgumentException
- directionId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageDirectionAliases()
Id
aliases for
Directions.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if Direction
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasDirection(Id directionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Direction
for the
purpose of creating compatibility. The primary Id
of
the Direction
is determined by the provider. The new
Id
performs as an alias to the primary Id
. If the alias is a pointer to another direction, it is
reassigned to the given direction Id.
directionId
- the Id
of a Direction
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- directionId
not
foundNullArgumentException
- directionId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageIngredients()
Ingedredients.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known changing an alias will result in a
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer sequencing operations to an
unauthorized user. false
if Ingredient
management
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateIngredientWithRecordTypes(Type[] ingredientRecordTypes)
Ingredient
using
the desired record types. While
RecipeManager.getIngreientRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Ingredient.
Providing
an empty array tests if an Ingredient
can be created
with no records.ingredientRecordTypes
- array of ingredient record types true
if Ingredient
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- ingredientRecordTypes
is null
mandatory
- This method must be implemented. IngredientForm getIngredientFormForCreate(Id directionId, Type[] ingredientRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
directionId
- an ingredient Id
ingredientRecordTypes
- array of ingredient record typesNotFoundException
- directionId
Is not
foundNullArgumentException
- directionId
or
ingredientRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Ingredient createIngredient(IngredientForm ingredientForm) throws OperationFailedException, PermissionDeniedException
Ingredient.
ingredientForm
- the form for this Ingredient
Ingredient
IllegalStateException
- ingredientForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- ingredientForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- ingredientForm
did not originate from geIngredientFormForCreate()
mandatory
- This method must be implemented. IngredientForm getIngredientFormForUpdate(Id ingredientId) throws NotFoundException, OperationFailedException
ingredientId
- the Id
of the Ingredient
NotFoundException
- ingredientId
is not
foundNullArgumentException
- ingredientId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void updateIngredient(IngredientForm ingredientForm) throws OperationFailedException, PermissionDeniedException
ingredientForm
- the form containing the elements to be updatedIllegalStateException
- ingredientForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- ingredientForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- ingredientForm
did not originate from getIngredientFormForUpdate()
mandatory
- This method must be implemented. void deleteIngredient(Id ingredientId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ingredient.
ingredientId
- the Id
of the Ingredient
to removeNotFoundException
- ingredientId
not
foundNullArgumentException
- ingredientId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canSequenceDirections()
Directions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known changing an alias will result in a
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer sequencing operations to an
unauthorized user. false
if Direction
ordering is
not authorized, true
otherwisemandatory
- This method must be implemented. void moveDirectionAhead(Id directionId, Id recipeId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
directionId
- the Id
of a Direction
recipeId
- the Id
of a Recipe
referenceId
- the reference direction Id
NotFoundException
- directionId, recipeId,
or referenceId
not found or,
directionId
or referenceId
not related
to recipeId
NullArgumentException
- directionId, recipeId
or referenceId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void moveDirectionBehind(Id directionId, Id recipeId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
directionId
- the Id
of a Direction
recipeId
- the Id
of a Recipe
referenceId
- the reference direction Id
NotFoundException
- directionId, recipeId,
or referenceId
not found or,
directionId
or referenceId
not related
to recipeId
NullArgumentException
- directionId, recipeId
or referenceId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void orderDirections(Id[] directionIds, Id recipeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
directionIds
- the Ids
for a set of
Directions
recipeId
- the Id
of a Recipe
NotFoundException
- recipeId
not found
or, a directionId
not related to
recipeId
NullArgumentException
- directionIds
or
recipeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.