The new way to utilise pages and paths separately in Easysite
Changes in Easysite 6.5.1.0 have resulted in pages and their URLs (paths) being separated into two separate objects which may affect custom created plug-ins within your Easysite installations.
Additional Information
Prior to Easysite version 6.5.1.0, the API provided access to a page’s details such as the URL that the page exists against via either the 'IApiPage' interface or the 'EasySiteContext.Page' property.
Two separate objects now exist to allow for the possibility of a single page existing against multiple paths for use in sharing scenarios These two separate objects are explained in more detail below:
IApilPage Object
If you wish to obtain the following details of a page through the API, you still can via the IApiPage object by either using the 'EasySiteContext.Page' property (for the currently viewed page), or an 'IApiPage' which is a setting of the plug-in.
- Page ID (i.e. the page version ID)
- Page object ID (i.e., the persistent ID for a page, regardless of version)
- Page title
- Date created
- Page author
- Last modified date
- Expiration date
- Valid from date
- Review date
- Categories
- Culture
In addition to this, you also have the ability to obtain the 'first path' and 'all paths' for an IApiPage object allowing you to see which paths are available for any given page. Both of these properties expose IApiPath objects.
- The 'AllPaths' property will provide all paths that the page is accessible via for all sites.
- The 'FirstPath' property will pick one of these paths with priority given to favouring paths on the same site as you are currently viewing if applicable.
Note: the selection of the page is not always consistent, and so usage should be considered carefully.
IApilPath Object
The following properties have been dropped from IApiPage however these properties are now members of the IApiPath object:
- ReadOnlyGroups
- WriteOnlyGroups
- ReadWriteGroups
- ParentPage
The API in Easysite version 6.5.1.0 and above has a new concept known as the IApiPath. This gives detailed information about a path that a page exists at. These details are:
- Site
- The site which the path exists on. - ReadGroups
- Easysite groups which have read access to the path (since permissions are now governed by paths, not pages). - WriteGroups
- Easysite groups which have write access to the path (since permissions are now governed by paths, not pages). - ParentPath
- The IApiPath which is the parent of this path. Null if there is not parent. - Pages
- All pages available at this path, where this will include all locale alternate versions. In sites where there is only one language, the first item in the collection will represent the page at this path.
The current path being viewed can be accessed via EasySiteContext.Path and the path for a given page can be accessed via IApiPage.FirstPath or IApiPage.AllPaths. (see descriptions above)
Note: the three properties 'ReadOnlyGroups', 'WriteOnlyGroups' and 'ReadWriteGroups' from the old 'IApiPage' implementation have been rationalised down into two properties 'ReadGroups' and 'WriteGroups' in the 'IApiPath' implementation.
Any usages of these properties will need to be changed from 6.5.1.0 onwards or the plug-in targeting these properties may not work correctly.