IUserSession Interface Ingeniux CMS Content Store API

Represents a communication session used to retrieve objects from the content store. It is also the place to get all manager instances.

Namespace: Ingeniux.CMS
Assembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 9.0.565.0 (9.0.565)
Syntax

public interface IUserSession : IManagersHost, 
	IDisposable

The IUserSession type exposes the following members.

Properties

  NameDescription
Public propertyAssetSecurityManager
Gets the manager of asset permissions.
(Inherited from IManagersHost.)
Public propertyClosed
Checks if this session was already closed.
Public propertyContentFreezeStartingTime
Gets the time when content freeze is about to start. Null if no content freeze looming.
Public propertyGlobalExports
Gets the definition of exports that will be included as attributes in every link and navigation entry.
(Inherited from IManagersHost.)
Public propertyGlobalVariables
Gets the collection of global variables.
(Inherited from IManagersHost.)
Public propertyId
Gets the unique ID of this session.
Public propertyIP
The IP address this session was created for. Could be null if request is from http access
Public propertyLingualMappingManager (Inherited from IManagersHost.)
Public propertyLocalesManager
Gets the manager of built-in locales and custom locales.
(Inherited from IManagersHost.)
Public propertyLoggingManager
Gets the manager of publishing logs and replication logs
(Inherited from IManagersHost.)
Public propertyMobileDeviceManager
Gets the manager of device bundles for mobile preview emulation.
(Inherited from IManagersHost.)
Public propertyOperatingUser
Gets the user who owns this session.
Public propertyPageCreationRulesManager
Gets the manager of page creation rules.
(Inherited from IManagersHost.)
Public propertyPCRDescriptorsManager
Gets the manager of site tree PCRs.
(Inherited from IManagersHost.)
Public propertyPresentationsManager
Gets the presentations manager for managing presentation content units.
(Inherited from IManagersHost.)
Public propertyPublishingManager
Gets the manager of publishing targets and publishing profiles
(Inherited from IManagersHost.)
Public propertyReferencesManager
Gets the manager of references between pages.
(Inherited from IManagersHost.)
Public propertySchemasManager
Gets the manager of schemas.
(Inherited from IManagersHost.)
Public propertySecurityDescriptorsManager
Gets the manager of site tree security.
(Inherited from IManagersHost.)
Public propertySettings
Gets the CMS settings collection.
(Inherited from IManagersHost.)
Public propertySite
Gets the manager of pages, page versions, and pages tree structure.
(Inherited from IManagersHost.)
Public propertySiteContentLocalizationProvider
Gets the manager of translations of page creation rules, schemas, workstates and workflow definitions.
(Inherited from IManagersHost.)
Public propertySiteMap
Gets the manager of branding types like sites and user agents
(Inherited from IManagersHost.)
Public propertyStartTime
Gets the time that this session was opened.
Public propertyTaxonomyManager
Gets the manager of category nodes as well as their structure.
(Inherited from IManagersHost.)
Public propertyUserManager (Inherited from IManagersHost.)
Public propertyWorkflowAdministrator
Gets the manager of workflow definitions, workstates, and workflows
(Inherited from IManagersHost.)
Top
Methods

  NameDescription
Public methodCompositeGetT, TManager
Retrieves an entity with given ID and objects related to the entity. The includeExpression defines what to include.
Public methodCompositeListT
Retrieves the collection of all objects of a given type as well as all objects related to the object type. The includeExpression defines what to include.
Public methodCountT
Gets the count of query results
Public methodExists
Checks whether an object with given unique ids exists or not
Public methodGetT
Retrieves an object that implements the IObjectWithId interface by its unique ID, from the content store.
Public methodGetEntitiesT, TManager
Public methodGetEntityT, TManager
Public methodGetManagerT
Public methodListT
Retrieves the collection of all objects of a given type.
Public methodCode exampleLuceneQueryAllT, TIndex

Queries the content store using Lucene query syntax, returning a collection of objects of the given type.

The CSAPI creates indexes in the content store to expedite object lookup. The CSAPI comes with a set of indexes for its basic functionality. All strong-typed queries go through this method. Additional custom indexes can be created to provide further flexibility on fast lookup. Please refer to the Indexing topic for more information on indexes and custom indexes.

Public methodQueryT, TIndex

Queries the content store and returns a collection of objects of a given type. The query is based on the type of index provided.

THe CSAPI creates indexes in the content store to expedite object lookup. CSAPI comes with a set of indexes for its basic functionality. All strong-typed queries go through this method. Additional custom indexes can be created to provide even further flexibilities on fast lookup. Please refer to the Indexing topic for more information on indexes and custom indexes.

Top
Exceptions

ExceptionCondition
ArgumentExceptionWhen any objects retrieved within a read-only UserSession are modified.
Remarks

Objects retrieved within the session are only usable before the session is disposed. Their methods do not work outside the created session, and their properties are not guaranteed to work outside of the created session.

UserSessions are created from a persisting ContentStore object via the method OpenReadSession(IReadonlyUser). The best way to open a UserSession, and to make sure it is closed properly, is with a "using" statement:

Examples

C#
using (IUserSession session = store.OpenReadSession(currentUser))
{
    ...
}

Objects retrieved via UserSession are read-only. An error is thrown upon closing the session if any of the objects were updated.

If the objects are intended to be changed, use the UserWriteSession object.

See Also

Reference