Click or drag to resize

PFSite Class

Represents a Packflow site. The site is the root object of an Packflow applicative site.
Inheritance Hierarchy

Namespace:  Packflow.Core
Assembly:  MicaSystems.Packflow.Core (in MicaSystems.Packflow.Core.dll) Version: 1.0.0.0 (3.2.0.295)
Syntax
C#
public sealed class PFSite : PFStructureObject, 
	IDisposable

The PFSite type exposes the following members.

Constructors
  NameDescription
Public methodPFSite
Initializes a new instance of the PFSite class.
Top
Properties
  NameDescription
Public propertyActivityLog
Gets a relation allowing to access timer jobs.
Public propertyAdminAccount
Gets the system admin account.
Public propertyAdministrationUrl
Url of the site administration.
Public propertyAdministrationUrl_Roles
Url of the site administration of roles.
Public propertyApplications
All applications installed on this site.
Public propertyBeforeSaveValues
Gets the previous values of modified fields before the latest Save.

Note: this feature is NOT persisted in the database and therefore only concerns this instance.

(Inherited from PFBaseObject.)
Public propertyCanDelete
Checks if the current permission context allows current user to delete this object.
(Inherited from PFBaseObject.)
Public propertyCanRead
Checks if the current permission context allows current user to access this object.
(Inherited from PFBaseObject.)
Public propertyCanUpdate
Checks if the current permission context allows current user to update this object.
(Inherited from PFBaseObject.)
Public propertyCreated
Indicates if this object has been created and is still in database (positive Id).
(Inherited from PFBaseObject.)
Public propertyCreatedAt
Gets the date of creation of this object in the database.
(Inherited from PFBaseObject.)
Public propertyCreatedBy
Gets the user who created this object in the database.
(Inherited from PFBaseObject.)
Public propertyCurrentUser
Gets the current PFUser of the site.
(Overrides PFStructureObjectCurrentUser.)
Public propertyDashboardId
Gets or sets the dashboard id, referencing the default dashboard shown to the user.
Public propertyDashboards
Gets a relation allowing to access all global and personal dashboards.
Public propertyData
Gets the data collection of this object.
(Inherited from PFBaseObject.)
Public propertyDateObjectCreation
Gets the date of the creation of this object in memory.
(Inherited from PFManagedObject.)
Public propertyDeleted
True if this object is flagged as deleted.
(Inherited from PFBaseObject.)
Public propertyDeletedAt
Date of the suppression of this object.
(Inherited from PFBaseObject.)
Public propertyDeletedBy
The user who deleted this object.
(Inherited from PFBaseObject.)
Public propertyDescription
Gets or sets the description of this object.
(Inherited from PFStructureObject.)
Public propertyDisablePerformanceTestAutoStart
Gets or sets a value indicating whether the performance test should be started when the next performance area is encountered.
Public propertyDisplayName
Gets or sets the display name of this object.
(Inherited from PFStructureObject.)
Public propertyEnableVersionMergeToResolveSaveConflicts

Read-only property. Can be modified if overridden.

If an object is saved with an older version than the last persisted (in database), the system will try to merge the versions values (if no conflicts between values) and will then save the merged item to database.

Note : this setting is NOT persisted and will affect this object instance only.

(Overrides PFBaseObjectEnableVersionMergeToResolveSaveConflicts.)
Public propertyEnableVersionMergeToResolveSaveConflicts_Global
If an object is saved with an older version than the last persisted (in database), the system will try to merge the versions values (if no conflicts between values) and will then save the merged item to database. Note : this setting is NOT persisted and will affect all objects loaded from this site instance.
Public propertyEngineVersion
Gets the version of Engine (Core) currently running for this site.
Public propertyEntryRecording
Gets performance test entry used to record this site performances.
Public propertyExists
Indicates if this object has been created, still exists in database and is not flagged for suppression.
(Inherited from PFBaseObject.)
Public propertyGroups
Gets a relation allowing to access all groups with a scope Site.
Public propertyGuid
Gets the GUID identifying this object. Must be used if Id is no more viable, example if content were merged.
(Inherited from PFBaseObject.)
Public propertyHasPendingModifications
Checks if there is pending changes. Will check if the values are different from the currently persisted values.
(Inherited from PFBaseObject.)
Public propertyHasPendingPermissionsModifications
Checks if there is pending modifications in permissions. Will compute permissions (RUD) and check if there is differences with current persisted permissions.
(Inherited from PFBaseObject.)
Public propertyHomeUrl
Home page of this site.
Public propertyId
Gets the id identifying this object. Must be used to find or identify an object because faster than Guid.
(Inherited from PFBaseObject.)
Public propertyInstallerAccount
Gets the system installer account.
Public propertyItemComments
Gets a relation allowing to access comments made on content-type items. It is usually best to use the relation from PFItem.
Public propertyItemsRelations
Gets a relation allowing to access items relations.
Public propertyKeepBeforeSaveValues
Gets or sets a value indicating whether the Save should keep a collection of the modified fields previous values.

Note: this feature is NOT persisted in the database and therefore only concerns this instance.

(Inherited from PFBaseObject.)
Public propertyLanguageCode
Gets the default language used on this site, in two-letters format.

This language is used for every user using the Default value in their settings.

Public propertyLicence
Gets the licence data.
Public propertyLoggedIdentity
Gets the initial identity used to retrieve this PFSite.
Public propertyLoggedUser
Gets the user having initially loaded this PFSite.
Public propertyLogger
Gets the logger, used to log any useful warning, error or information in the database.
(Inherited from PFManagedObject.)
Public propertyLogIdentification
Gets a technical text representing this object.
(Inherited from PFStructureObject.)
Public propertyLogs
Log entries related to this object.
(Inherited from PFStructureObject.)
Public propertyMembershipProviderAccount
Gets the membership provider account.
Public propertyName
Gets the name of this object.
(Inherited from PFStructureObject.)
Public propertyNavigationMap
Gets the navigation map. This map is used in quick launch bars and breadcrumbs.
Public propertyOrganisationalTypes
Gets a relation allowing to access organisational types.
Public propertyPerformanceEntries
Gets a relation allowing to access performance reports entries.
Public propertyPerformanceReports
Gets a relation allowing to access performance reports.
Public propertyPerformanceTest_IncludeHtmlGenerationDetails
Gets a value indicating whether the performance test will generate messages with HTML generation.
Public propertyPerformanceTest_IncludeItemBindingDetails
Gets a value indicating whether the performance test will include binding operations details.
Public propertyPermissionContext
Gets an object calculating permissions on demand.
Public propertyPermissions
Gets the permission set (RUD permissions) of this item.
(Inherited from PFBaseObject.)
Public propertyStatic memberPersistFileDuringSiteLifeCycle
Gets or sets a value indicating whether a file should be persisted for each site instance. When the site instance is disposed, the file is deleted. Such files are stored in the temp folder of Windows %temp%\PFSites\.
Public propertyPlugins
Gets the site plugins.
Public propertyRunningJobs
Gets a relation allowing to access running timer jobs.
Public propertyRunningPerformanceTestReportId
Gets or sets the id of the currently running test of performance.
Public propertySettings
Gets the site settings.
Public propertySite
Will return the current object.
(Overrides PFBaseObjectSite.)
Public propertyStoredProcedures
Gets a relation allowing to access stored procedures.
Public propertySubViews
Gets a relation allowing to access the subviews of this site's views.
Public propertySupportContact
Gets the address to contact for support.
Public propertyThemeId
Gets or sets the theme id, referencing the theme commonly used on the site.

See GetActiveTheme method for more information.

Public propertyThemes
Gets a relation allowing to access all global and personal themes.
Public propertyTimerJobs
Gets a relation allowing to access timer jobs.
Public propertyUpdatedAt
Gets the date of the last update of this object.
(Inherited from PFBaseObject.)
Public propertyUpdatedBy
Gets the user who last updated this object in the database.
(Inherited from PFBaseObject.)
Public propertyUrl
Url of the navigation of this site.
(Overrides PFStructureObjectUrl.)
Public propertyUserAlternativeIdentities
Gets a relation allowing to access all user alternative identities.
Public propertyUsers
Gets a relation allowing to access the users of this site.
Public propertyVersionNumber
Gets the version number of this object in database. Incremented after each save.
(Inherited from PFBaseObject.)
Public propertyViews
Gets a relation allowing to access all views with a scope Site.
Public propertyWaitOtherThreadsBeforeDisposing
Gets or sets a value indicating whether this site should wait for other threads using this site instance to close before disposing object and connection.

Default value: false.

Top
Methods
  NameDescription
Public methodCallPluginsT
Calls plugins of the specified type.
Public methodCloseCurrentThreadConnection
Closes the current thread connection. This method should always be called at the end of a (new) thread execution using a PFSite.
Public methodDelete
Flags this object as deleted.

If it fails, throws an error.

If the object could not be deleted because it does not yet exist in database, returns false.

If successful, returns true.

(Inherited from PFBaseObject.)
Public methodDeleteExpiredLocks
Deletes all the locks for which the expiration date is exceeded.
Public methodDispose
Disposes this site. Ensures that performances are not recorded anymore, disposes the data connection and calls the GC.
Public methodEnsureUser
Will check if PFUser exists based on principal or alternative identity. If not found, will validate login against AD or local accounts. If login exists, PFUser will be created and returned. Throws ValidationException is user could not be found in domain or Packflow.
Protected methodFinalize
PFSite destructor, ensuring that the data connection is disposed.
(Overrides ObjectFinalize.)
Public methodGetActiveTheme
Gets the theme currently active on the site.
Public methodGetApplicationVisibilitiesDisplay
Gets the list of all application visibilities. The results contain the display names of Application, Context and User.
Public methodGetConnections
Gets external connections across multiple content-types (or all if not specified) in one query.
Public methodGetContentTypes
Get content-types across multiple applications.
Public methodGetContentTypesByIds
Get content-types across multiple applications.
Public methodGetHomeDashboard
Gets the home dashboard.

Referenced by the CurrentUser.DashboardId if set, else the PFSite.DashboardId.

Public methodGetObjectRelationByName
Gets a children entities relation by its name.
(Inherited from PFRelationalObject.)
Public methodGetObjects
Gets all objects on specified relations.

Note : do NOT call this method with relations targeting the same SQL table!

Public methodGetPluginDefinitions
Gets all available plugins' definitions.
Public methodGetPluginInstancesDefinitions
Gets the definitions of plugin instances created on this site. (not using cache)
Public methodGetPluginsT
Gets plugins of the specified type.
Public methodStatic memberGetSite(String)
Gets a local Packflow Site by its name.
Public methodStatic memberGetSite(String, IIdentity)
Gets a local Packflow Site by its name using a specific identity.
Public methodStatic memberGetSite(String, WindowsIdentity)
Gets a local Packflow Site by its name using a specific identity.
Public methodStatic memberGetSite(String, PFConnectionSelectionMode, String)
Gets a local Packflow Site by its name.
Public methodStatic memberGetSite(String, IIdentity, PFConnectionSelectionMode, String)
Gets a local Packflow Site by its name using a specific identity.
Public methodStatic memberGetSite(String, WindowsIdentity, PFConnectionSelectionMode, String)
Gets a local Packflow Site by its name using a specific identity.
Public methodStatic memberGetSiteSettings
Gets the settings of a local Packflow Site by its name.
Public methodStatic memberGetSiteTheme
Gets the default theme for given site name.
Public methodGetUserNotifications
Gets user notifications across multiple users in one query.
Public methodGetUserVisibilities
Gets the complete application/context tree that a user can see from a PFSite.
Public methodLoadAllContentTypes
Ensures that all content-types are loaded in the cache of each application.

This method is optimized because only 2 requests are executed : one for applications and one for content-types.

Public methodStatic memberRunCodeInPerformanceArea
Will automatically start a performance recording/entry if not already started but in that case Entry name will be 'Unknown'.
Public methodRunInPerformanceArea
Will automatically start a performance recording/entry if not already started but in that case Entry name will be 'Unknown'.
Public methodRunInTransactionArea
Runs a code with a transaction on object connection. If there is no current transaction and if the code succeed, transaction is committed. If an exception is thrown, transaction is rollback.
(Inherited from PFBaseObject.)
Public methodSave
Applies the data of this object in the database.

If this object does not exist in the database yet, the children tables will be ensured.

After the save, Insert permissions of children objects are updated in the database (RLS).

(Inherited from PFStructureObject.)
Public methodSavePlugins
Saves site plugins to database.

Important : access will be denied if the user is not Site Admin.

Important : this saves a separated instance of PFSite. To save this site again, you have to reload this object.

Public methodSaveSettings
Saves site settings to database.

Important : access will be denied if the user is not Site Admin.

Important : this saves a separated instance of PFSite. To save this site again, you have to reload this object.

Public methodSendMail(String, String, PFUser, Boolean, Boolean, PFMailInvitation)
Sends an email to a Packflow user.
Public methodSendMail(String, String, ListPFUser, Boolean, Boolean, PFMailInvitation)
Sends an email to multiple Packflow users.
Public methodSendMail(String, String, String, Boolean, Boolean, PFMailInvitation, String)
Sends an email to a given address.
Public methodSendMailFromCustomHost
Sends an email to a Packflow user, using a different host from default.
Public methodSetLicence
Sets the licence for this Site.
Public methodSetPlugins
Saves the plugin definitions.
Public methodStartPerformanceTest

Starts a global performance test filling a given performance report.

This test will include all web requests targeting this PFSite, but not the current one.

Use the method StopPerformanceTest to stop the global test.

Public methodStartRecordingPerformances
Starts recording performance on this site.
Public methodStopPerformanceTest
Stops the global performance test started with the method StartPerformanceTest.
Public methodStopRecordingPerformances
Saves the current performance entry and stops the recording.
Public methodSynchronizeAllExternalContent
Synchronizes the external connections of all content-types.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberTryGetSite(String)
Tries to get a local Packflow Site by its name.
Public methodStatic memberTryGetSite(String, IIdentity)
Tries to get a local Packflow Site by its name using a specific identity.
Public methodStatic memberTryGetSite(String, WindowsIdentity)
Tries to get a local Packflow Site by its name using a specific identity.
Public methodStatic memberTryTranslateApplicationContextId
Tries to get corresponding application context id from an application to another using reference group. If an application context with the same reference group is found, his id is returned. Else -1.
Top
Events
  NameDescription
Public eventStatic memberLockDeleted
Event called if lock deleted.
Public eventStatic memberTaskCreated
Event called if a task is created.
Public eventStatic memberUserNotified
Event called when a user has been notified.
Top
Fields
  NameDescription
Public fieldStatic memberFieldName_DashboardId
Column name in database.
Public fieldStatic memberFieldName_EngineVersion
Column name in database.
Public fieldStatic memberFieldName_RunningPerformanceTestReportId
Column name in database.
Public fieldStatic memberFieldName_ThemeId
Column name in database.
Top
Extension Methods
  NameDescription
Public Extension MethodAsT
Casts an object to another type. Returns default(T) if the object is null.
(Defined by Utils_Other.)
Public Extension MethodEqualsAll
Checks that this object is equal to every object in parameters.
(Defined by Utils_Other.)
Public Extension MethodEqualsAny
Checks that this object is equal to at least one of the parameters.
(Defined by Utils_Other.)
Public Extension MethodGetString
Converts an object to String using ToString() method, else returns String.Empty.
(Defined by Utils_Other.)
Public Extension MethodIsGenericListOverloaded.
Checks if this object is a System.Collections.Generic.List.
(Defined by Utils_Linq.)
Public Extension MethodIsGenericList(Type)Overloaded.
Checks if this object is a System.Collections.Generic.List using type as T.
(Defined by Utils_Linq.)
Public Extension MethodSerializeOverloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.)
Public Extension MethodSerialize(String)Overloaded.
Serializes an object into an XML document.
(Defined by Utils_Xml.)
Public Extension MethodSerializeJsonOverloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Public Extension MethodSerializeJson(ListType)Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Public Extension MethodSerializeJson(DataContractJsonSerializerSettings)Overloaded.
Serializes an object using a DataContractJsonSerializer.
(Defined by Utils_String.)
Top
See Also