ContextController Methods |
The ContextController type exposes the following members.
Name | Description | |
---|---|---|
![]() | BuildCacheKey |
Builds a cache key for use with GetFromCacheIfPresent.
The cache key is not hashed because we have experienced a collision using GetHashCode()
ie. the cache keys are quite long and there is a price in dictionary size in memory
and in dictionary lookups.
(Inherited from ControllerBase.) |
![]() | CheckAndCreateDefaultContextType |
Creates a ContextType data object for ORGUNIT if there are no ContextType data objects in the system.
Method is mainly used for test purposes.
|
![]() | CheckObjectOperationSecurity |
Checks that the active user is allowed to perform an CRUD operation on a specific configuration object.
(note: except that a Create operation is not for a specific object).
Throws a SecurityException if not.
Method can be used for all configuration objects that are represented by a ConfigurationObjectType (except those that have a compound key).
Method checks auth role security as well as whether it is allowed to modify builtin/feature package objects.
(Inherited from ControllerBase.) |
![]() | CheckObjectSaveOperationSecurity |
Checks that the active user is allowed to Create a new - or Update an existing configuration object.
Throws a SecurityException if not.
Method can be used for all configuration objects that are represented by a ConfigurationObjectType (except those that have a compound key).
Method checks auth role security as well as whether it is allowed to modify builtin/feature package objects.
(Inherited from ControllerBase.) |
![]() | ConvertId(Int32, ConfigurationObjectType) |
Converts the integer id of an object to its transport-safe unique id (UId).
(Inherited from ControllerBase.) |
![]() | ConvertId(String, ConfigurationObjectType) |
Converts a string representation of an integer or Guid id to an integer id.
(Inherited from ControllerBase.) |
![]() | ConvertId(Guid, ConfigurationObjectType, Boolean) |
Converts the transport-safe unique id (UId) of an object to its integer id.
(Inherited from ControllerBase.) |
![]() | ConvertIds(IEnumerableGuid, ConfigurationObjectType) |
Converts the transport-safe unique ids (UId) of a number of objects to integer ids.
(Inherited from ControllerBase.) |
![]() | ConvertIds(IEnumerableInt32, ConfigurationObjectType) |
Converts the integer ids of a number of objects to their transport-safe unique ids (UId).
(Inherited from ControllerBase.) |
![]() | CreateCommand(SQLBuilder) | (Inherited from ControllerBase.) |
![]() | CreateCommand(String) | (Inherited from ControllerBase.) |
![]() | CreateContextAssignment(Int32, Int32) | |
![]() | CreateContextAssignment(Int32, Int32, DateTime, DateTime) |
The data object security model is respected.
|
![]() | CreateSqlBulkCopy |
Create a new SqlBulkCopy instance using the connection, transaction and timeout values from the controller
(Inherited from ControllerBase.) |
![]() | DoInConnection(ControllerBaseActionWithNoResult) |
Executes an action that doesn't return a result. If no current connection exists, it will establish a connection to the database and close it afterwards.
An existing connection will be reused. Inside the action, the connection is available as DbConnection.
(Inherited from ControllerBase.) |
![]() | DoInConnection(ActionSqlConnection, SqlTransaction, Boolean) |
Executes an action that doesn't return a result. If no current connection exists, it will establish a connection to the database and close it afterwards.
Connection and Transaction are passed to delegate, to allow passing to other controllers
An existing connection will be reused. Inside the action, the connection is available as DbConnection.
To ensure a new connection set forceNew to true.
(Inherited from ControllerBase.) |
![]() | DoInConnectionT(ControllerBaseActionWithResultT) |
Executes an action and returns the result.
If no current connection exists, it will establish a connection to the database and close it afterwards.
An existing connection will be reused. Inside the action, the connection is available as DbConnection.
(Inherited from ControllerBase.) |
![]() | DoInTransaction(ControllerBaseActionWithNoResult) |
Executes an action (that doesn't return a result) in a transaction.
If no current connection and/or transaction exists, it will establish it and commit and close it afterwards.
An existing connection/transaction will be reused.
Inside the action, the connection is available as DbConnection and
the transaction as DbTransaction.
(Inherited from ControllerBase.) |
![]() | DoInTransactionT(ControllerBaseActionWithResultT) |
Executes an action in a transaction and returns the result.
If no current connection and/or transaction exists, it will establish it and commit and close it afterwards.
An existing connection/transaction will be reused.
Inside the action, the connection is available as DbConnection and
the transaction as DbTransaction.
(Inherited from ControllerBase.) |
![]() | DoInTransactionT(FuncSqlConnection, SqlTransaction, T, Boolean) |
Executes an action in a transaction and returns the result.
Connection and Transaction are passed to delegate, to allow passing to other controllers
If no current connection and/or transaction exists, it will establish it and commit and close it afterwards.
An existing connection/transaction will be reused. Set forceNew to true to ensure new connection and transaction
Inside the action, the connection is available as DbConnection and
the transaction as DbTransaction.
(Inherited from ControllerBase.) |
![]() | DoInTransactionUnlessPostponedDueToPreviousDefaultResultT |
The method can postpone a SQL transaction implemented by action if the method returns a default number, eg. 0.
If the the action method throws a SQL transitent error, then the next call to action is also postponed.
(Inherited from ControllerBase.) |
![]() | DoUnlessPostponedDueToPreviousDefaultResultT |
The method can postpone a method invocation if the previous call returned a default number, eg. 0.
(Inherited from ControllerBase.) |
![]() | ExecScalarResultQueryT |
Executes a query with a scalar result.
(Inherited from ControllerBase.) |
![]() | ExecuteMutexOperation(String, Action, Boolean) | (Inherited from ControllerBase.) |
![]() | ExecuteMutexOperationT(String, FuncT, Boolean) | (Inherited from ControllerBase.) |
![]() | ExpireCacheItem | (Inherited from ControllerBase.) |
![]() | GetContextDataObjectTypeIds | |
![]() | GetContextIdentityIds |
Returns the ids of the identities that are members of a specific context.
Only identities that are direct members are returned - not those that are member of a sibling contexts.
A context membership is either due to a ContextAssignment data object or due to a context being stated in the "membership" reference property on the identity data object.
Memberships of contexts with status "Deleted (accepted)" are excluded from the result.
Memberships that are either not yet active or expired are also excluded from the result.
|
![]() | GetContextMemberships(IEnumerableDataObject, Int32, Boolean) |
Returns the context memberships that a number of identities have.
Only direct memberships are returned - not memberships of ancestor contexts.
A context membership is either due to a ContextAssignment data object or due to a context being stated in the "membership" reference property on the identity data object.
The validity of a membership is the minimum validity (if any) of the ContextAssignment data object (if any) and the validity (if any) of the context data object.
Memberships of contexts with status "Deleted (accepted)" are excluded from the result.
Memberships that are either not yet active or expired are (depending on includeNonValidMemberships) also excluded from the result.
|
![]() | GetContextMemberships(Int32, Int32, Boolean, FuncContextMembership, Boolean) |
Returns the context memberships that a number of identities have.
Only direct memberships are returned - not memberships of ancestor contexts.
A context membership is either due to a ContextAssignment data object or due to a context being stated in the "membership" reference property on the identity data object.
The validity of a membership is the minimum validity (if any) of the ContextAssignment data object (if any) and the validity (if any) of the context data object.
Memberships of contexts with status "Deleted (accepted)" are excluded from the result.
Memberships that are either not yet active or expired are (depending on includeNonValidMemberships) also excluded from the result.
|
![]() | GetContextMembershipsFromARContextView |
Returns the context memberships, filtered by the AR_CONTEXT lookup view, that a number of identities have.
Only direct memberships are returned - not memberships of ancestor contexts.
A context membership is either due to a ContextAssignment data object or due to a context being stated in the "membership" reference property on the identity data object.
The validity of a membership is the minimum validity (if any) of the ContextAssignment data object (if any) and the validity (if any) of the context data object.
Memberships of contexts with status "Deleted (accepted)" are excluded from the result.
Memberships that are either not yet active or expired are also excluded from the result.
|
![]() | GetContextOwners |
Returns the owners (users and/or groups) of a context.
|
![]() | GetContextType |
Return a ContextType data object by its id.
The security model is not respected.
The result is cached.
|
![]() | GetContextTypeDataObjectTypeId |
Returns the id of the data object type which a specified context type represents.
|
![]() | GetContextTypeId(Int32) |
Returns the context type data object id that a context data object belongs to.
|
![]() | GetContextTypeId(String) |
Returns the id of a context type data object that represents context data objects of a specified data object type.
|
![]() | GetContextTypes |
Returns all ContextType data objects.
The security model is not respected.
The result is cached.
|
![]() | GetContextTypes(Boolean) |
Returns all ContextType data objects.
The security model is not respected.
The result is cached.
|
![]() | GetDataObjectTypeContextTypes | |
![]() | GetDataObjectTypeContextTypes(Boolean) | |
![]() | GetDbUTCNow | (Inherited from ControllerBase.) |
![]() | GetDescendantContexts |
Returns the ids of the contexts that are descendants (children on any sublevel) of a specified context data object.
Note: doesn't rely on the data object tree structure!
|
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultIntegerList, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultAppIdentity, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultBoolean, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultIListGuid, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultListGuid, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultListInt32, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultGuid, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultInt32, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresent(String, ControllerBaseActionWithResultTimeZoneInfo, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresentT(String, ControllerBaseActionWithResultListT, ControllerBaseCacheOptions) | (Inherited from ControllerBase.) |
![]() | GetFromCacheIfPresentT(String, ControllerBaseActionWithResultT, ControllerBaseCacheOptions) |
Retrieves some data from the cache or (if it is not there) executes an action and stores the result in the cache.
Caching is not applied if the IgnoreCacheContext is used (depending on the parameter for it).
Note: caching should only be used with great care as there are a number of potential issues involved in using it!
(Inherited from ControllerBase.) |
![]() | GetIdentitiesAssignedToContexts | |
![]() | GetIdentityContextIds(Int32, Int32) |
Returns the ids of the "business context" data objects that an identity is direct member of.
Only direct memberships are returned - not memberships of ancestor contexts.
A context membership is either due to a ContextAssignment data object or due to a context being stated in the "membership" reference property on the identity data object.
Memberships of contexts with status "Deleted (accepted)" are excluded from the result.
Memberships that are either not yet active or expired are also excluded from the result.
|
![]() | GetIdentityContextIds(Int32, Int32, Boolean, FuncContextMembership, Boolean) |
Returns the ids of the "business context" data objects that one or more of a number of identities are direct members of.
Only direct memberships are returned - not memberships of ancestor contexts.
A context membership is either due to a ContextAssignment data object or due to a context being stated in the "membership" reference property on the identity data object.
Memberships of contexts with status "Deleted (accepted)" are excluded from the result.
Memberships that are either not yet active or expired are also excluded from the result.
|
![]() | GetManagerIds(IEnumerableInt32, ContextControllerCrawlMode) |
Returns the "managers" of an identity.
The managers are the owners of the identity's primary context (or the owner of an ancestor context if the primary context itself has no owners).
If one or more supervisors are stated (according to the identity's primary context type) on the identity then these are returned as priority one.
|
![]() | GetManagerIds(Int32, ContextControllerCrawlMode) |
Returns the "managers" of an identity.
The managers are the owners of the identity's primary context (or the owner of an ancestor context if the primary context itself has no owners).
If one or more supervisors are stated (according to the identity's primary context type) on the identity then these are returned as priority one.
|
![]() | GetMembershipProperties |
Returns the system names of all membership properties stated on all context types
|
![]() | GetNewRowIdentity | (Inherited from ControllerBase.) |
![]() | GetObjectDataVersion |
Gets the data version of an object.
(Inherited from ControllerBase.) |
![]() | GetOwnedContextIds(Int32, SubTree, IEnumerableInt32, ListOwnerProperty) |
Returns the ids of the contexts (data objects) that a user is specified as the owner of.
|
![]() | GetOwnedContextIds(Int32, IEnumerableInt32, Boolean, ListOwnerProperty) |
Returns the ids of the contexts (data objects) that a user is specified as the owner of.
|
![]() | GetPrimaryContextIdsPerIdentity |
Returns the ids of identities' primary contexts.
The primary contexts are those he is member of that belongs to the context type specified as his primary (and that are valid).
Contexts with status "Deleted (accepted)" are excluded.
|
![]() | GetPrimaryIdentityContextIds |
Returns the ids of an identity's primary contexts.
The primary contexts are those he is member of that belongs to the context type specified as his primary (and that are valid).
Contexts with status "Deleted (accepted)" are excluded.
|
![]() | GetUserContextIds |
Returns the ids of the "business context" data objects that a user is direct member of.
Only direct memberships are returned - not memberships of ancestor contexts.
A context membership is either due to a ContextAssignment data object or due to a context being stated in the "membership" reference property on the identity data object.
Memberships of contexts with status "Deleted (accepted)" are excluded from the result.
Memberships that are either not yet active or expired are also excluded from the result.
|
![]() | IncrementDataVersion | (Inherited from ControllerBase.) |
![]() | IncrementObjectDataVersion(IEntityObject) |
Increments the data version of an entity object.
The data version is incremented in the db as well as on the object itself.
Method is used to update the data version of an object when an aggregated object is created/modified/deleted.
The purpose is to ensure that the id-based cache (in AppIdentity) is updated properly.
(Inherited from ControllerBase.) |
![]() | IncrementObjectDataVersion(Int32, EntityObjectType) |
Increments the data version of an entity object in the db.
Method is used to update the data version of an object when an aggregated object is created/modified/deleted.
The purpose is to ensure that the id-based cache (in AppIdentity) is updated properly.
(Inherited from ControllerBase.) |
![]() | IsContextOwner |
Returns whether a user is amongst the (non-delegated) owners of a context.
|
![]() | IsIdentityInContext |
Returns whether an identity is directly in a specific context.
Returns false if the context has status "Deleted (accepted)".
|
![]() | PopulateTempTableT |
Creates a temporary db table with a single column and populates it with values.
(Inherited from ControllerBase.) |
![]() | PostponeTransientErrorT |
If the action throws a transient sql error, the exception is eaten.
An entry is written to the log with level Information.
The entire exception is written to the log with level Debug.
(Inherited from ControllerBase.) |
![]() | TransferUIdsToIdsLoadOption |
Converts/transfers one or more specified uids in a loadoptions object to ids.
The purpose is to enable caching as IEntityObjectsLoadOptions.IdList only works with ids (and not uids).
(Inherited from ControllerBase.) |
![]() | ValidateDataVersionT |
Validates that the data version of an object corresponds to the data version in the DB.
Method is used for validation before saving an object.
(Inherited from ControllerBase.) |
Name | Description | |
---|---|---|
![]() | ToBool |
Converts object to boolean.
(Defined by ObjectExtensions.) |
![]() | ToDateTime |
Converts object to DateTime.
(Defined by ObjectExtensions.) |
![]() | ToInt |
Converts object to integer.
(Defined by ObjectExtensions.) |