Interface BudgetEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
BudgetEntryBatchAdminSession
This session creates, updates, and deletes BudgetEntries . The
data for create and update is provided by the consumer via the form.
OsidForms are requested for each create or update and may not be
reused.
Create and update operations differ in their usage. To create an
BudgetEntry , an BudgetEntryForm is requested using
getBudgetEntryFormForCreate() specifying the desired budget, account
period, and record Types or none if no record Types are
needed. The returned BudgetEntryForm 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 BudgetEntryForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
BudgetEntryForm corresponds to an attempted transaction.
For updates, BudgetEntryForms are requested to the
BudgetEntry Id that is to be updated using
getBudgetEntryFormForUpdate() . Similarly, the BudgetEntryForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The BudgetEntryForm can
only be used once for a successful update and cannot be reused.
The delete operations delete BudgetEntryForms . To unmap an
BudgetEntry from the current Business , the
BudgetEntryBusinessAssignmentSession should be used. These delete
operations attempt to remove the BudgetEntryForm 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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasBudgetEntry(Id budgetEntryId, Id aliasId) Adds anIdto anBudgetEntryfor the purpose of creating compatibility.booleanTests if this user can createBudgetEntries.booleancanCreateBudgetEntryWithRecordTypes(Type[] budgetEntryRecordTypes) Tests if this user can create a singleBudgetEntryusing the desired record types.booleanTests if this user can deleteBudgetEntries.booleanTests if this user can manageIdaliases forBudgetEntries.booleanTests if this user can updateBudgetEntries.createBudgetEntry(BudgetEntryForm entryForm) Creates a newBudgetEntry.voiddeleteBudgetEntry(Id budgetEntryId) Deletes anBudgetEntry.getBudgetEntryFormForCreate(Id budgetId, Id accountId, Type[] budgetEntryRecordTypes) Gets the budget entry form for creating new budget entries.getBudgetEntryFormForUpdate(Id budgetEntryId) Gets the budget entry form for updating an existing budget entries.Gets theBusinessassociated with this session.Gets theBusinessIdassociated with this session.voidupdateBudgetEntry(BudgetEntryForm budgetEntryForm) Updates an existing budget entries.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
-
getBusinessId
Id getBusinessId()Gets theBusinessIdassociated with this session.- Returns:
- the
Business Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBusiness
Gets theBusinessassociated with this session.- Returns:
- the business
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateBudgetEntries
boolean canCreateBudgetEntries()Tests if this user can createBudgetEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anBudgetEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifBudgetEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateBudgetEntryWithRecordTypes
Tests if this user can create a singleBudgetEntryusing the desired record types. WhileFinancialsBudgetManager.getBudgetEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificBudgetEntry. Providing an empty array tests if anBudgetEntrycan be created with no records.- Parameters:
budgetEntryRecordTypes- array of budget entry record types- Returns:
trueifBudgetEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-budgetEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getBudgetEntryFormForCreate
BudgetEntryForm getBudgetEntryFormForCreate(Id budgetId, Id accountId, Type[] budgetEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the budget entry form for creating new budget entries. A new form should be requested for each create transaction.- Parameters:
budgetId- a budgetIdaccountId- an accountIdbudgetEntryRecordTypes- array of budget entry record types- Returns:
- the budget entry form
- Throws:
NotFoundException-budgetIdoraccountIdis not foundNullArgumentException-budgetId, accountId, orbudgetEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createBudgetEntry
BudgetEntry createBudgetEntry(BudgetEntryForm entryForm) throws OperationFailedException, PermissionDeniedException Creates a newBudgetEntry.- Parameters:
entryForm- the form for thisBudgetEntry- Returns:
- the new
BudgetEntry - Throws:
IllegalStateException-entryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-entryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-entryFormdid not originate fromgetBudgetEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateBudgetEntries
boolean canUpdateBudgetEntries()Tests if this user can updateBudgetEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anBudgetEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifBudgetEntrymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getBudgetEntryFormForUpdate
BudgetEntryForm getBudgetEntryFormForUpdate(Id budgetEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the budget entry form for updating an existing budget entries. A new budget entry form should be requested for each update transaction.- Parameters:
budgetEntryId- theIdof theBudgetEntry- Returns:
- the budget entry form
- Throws:
NotFoundException-budgetEntryIdis not foundNullArgumentException-budgetEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBudgetEntry
void updateBudgetEntry(BudgetEntryForm budgetEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing budget entries.- Parameters:
budgetEntryForm- the form containing the elements to be updated- Throws:
IllegalStateException-budgetEntryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-budgetEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-entryFormdid not originate fromgetBudgetEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteBudgetEntries
boolean canDeleteBudgetEntries()Tests if this user can deleteBudgetEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anBudgetEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifBudgetEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteBudgetEntry
void deleteBudgetEntry(Id budgetEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anBudgetEntry.- Parameters:
budgetEntryId- theIdof theBudgetEntryto remove- Throws:
NotFoundException-budgetEntryIdnot foundNullArgumentException-budgetEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageBudgetEntryAliases
boolean canManageBudgetEntryAliases()Tests if this user can manageIdaliases forBudgetEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifBudgetEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasBudgetEntry
void aliasBudgetEntry(Id budgetEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anBudgetEntryfor the purpose of creating compatibility. The primaryIdof theBudgetEntryis deentryined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another budget entry, it is reassigned to the given budget entryId.- Parameters:
budgetEntryId- theIdof anBudgetEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-budgetEntryIdnot foundNullArgumentException-budgetEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-