public interface BudgetAdminSession extends OsidSession
This session creates, updates, and deletes Budgets. 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
Budget, a BudgetForm is requested using
getBudgetFormForCreate() specifying the desired activity, fiscal
period, and record Types or none if no record Types
are needed. The returned BudgetForm 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 BudgetForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
BudgetForm corresponds to an attempted transaction.
For updates, BudgetForms are requested to the
Budget Id that is to be updated using
getBudgetFormForUpdate(). Similarly, the BudgetForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The BudgetForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Budgets. To unmap a
Budget from the current Business, the
BudgetBusinessAssignmentSession should be used. These delete
operations attempt to remove the Budget itself thus
removing it from all known Business 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 |
aliasBudget(Id budgetId,
Id aliasId)
Adds an
Id to a Budget for the purpose
of creating compatibility. |
boolean |
canCreateBudgets()
Tests if this user can create
Budgets. |
boolean |
canCreateBudgetWithRecordTypes(Type[] budgetRecordTypes)
Tests if this user can create a single
Budget using the
desired record types. |
boolean |
canDeleteBudgets()
Tests if this user can delete
Budgets. |
boolean |
canManageBudgetAliases()
Tests if this user can manage
Id aliases for
Budgets. |
boolean |
canUpdateBudgets()
Tests if this user can update
Budgets. |
Budget |
createBudget(BudgetForm budgetForm)
Creates a new
Budget. |
void |
deleteBudget(Id budgetId)
Deletes a
Budget. |
BudgetForm |
getBudgetFormForCreate(Id activityId,
Id fiscalPeriodId,
Type[] budgetRecordTypes)
Gets the budget form for creating new budgets.
|
BudgetForm |
getBudgetFormForUpdate(Id budgetId)
Gets the budget form for updating an existing budget.
|
Business |
getBusiness()
Gets the
Business associated with this session. |
Id |
getBusinessId()
Gets the
Business Id associated with
this session. |
void |
updateBudget(BudgetForm budgetForm)
Updates an existing budget.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getBusinessId()
Business Id associated with
this session. Business Id associated with this sessionmandatory - This method must be implemented. Business getBusiness() throws OperationFailedException, PermissionDeniedException
Business associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateBudgets()
Budgets. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Budget 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 Budget creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateBudgetWithRecordTypes(Type[] budgetRecordTypes)
Budget using the
desired record types. While
FinancialsBudgetManager.getBudgetRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Budget. Providing
an empty array tests if a Budget can be created with no
records.budgetRecordTypes - array of budget record types true if Budget creation using
the specified record Types is supported,
false otherwiseNullArgumentException - budgetRecordTypes
is null mandatory - This method must be implemented. BudgetForm getBudgetFormForCreate(Id activityId, Id fiscalPeriodId, Type[] budgetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId - the Id of the associated Activity fiscalPeriodId - the Id of the fiscal periodbudgetRecordTypes - array of budget record typesNotFoundException - activityId or
fiscalPeriodId not foundNullArgumentException - activityId,
fiscalPeriodId, or budgetRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Budget createBudget(BudgetForm budgetForm) throws OperationFailedException, PermissionDeniedException
Budget. budgetForm - the form for this Budget Budget IllegalStateException - budgetForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - budgetForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - entryForm did not
originate from getBudgetFormForCreate() mandatory - This method must be implemented. boolean canUpdateBudgets()
Budgets. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Budget 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 Budget modification is
not authorized, true otherwisemandatory - This method must be implemented. BudgetForm getBudgetFormForUpdate(Id budgetId) throws NotFoundException, OperationFailedException, PermissionDeniedException
budgetId - the Id of the Budget NotFoundException - budgetId is not
foundNullArgumentException - budgetId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateBudget(BudgetForm budgetForm) throws OperationFailedException, PermissionDeniedException
budgetForm - the form containing the elements to be updatedIllegalStateException - budgetForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - budgetForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - entryForm did not
originate from getBudgetFormForUpdate() mandatory - This method must be implemented. boolean canDeleteBudgets()
Budgets. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Budget 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 Budget deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteBudget(Id budgetId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Budget. budgetId - the Id of the Budget to
removeNotFoundException - budgetId not foundNullArgumentException - budgetId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageBudgetAliases()
Id aliases for
Budgets. 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 Budget aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasBudget(Id budgetId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Budget for the purpose
of creating compatibility. The primary Id of the
Budget is determined by the provider. The new Id
performs as an alias to the primary Id. If the
alias is a pointer to another budget, it is reassigned to the given
budget Id. budgetId - the Id of a Budget aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - budgetId not foundNullArgumentException - budgetId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.