API changes in Sitefinity CMS 9.0
Forms
FormEntriesSeed property in Telerik.Sitefinity.Forms.Model.FormDescription is obsolete. Use FormsManager.Provider.GetNextReferralCode(entry type name) as a value for ReferralCode of new entries.
Feather
IFieldConfigurator interface method Configure now receives backend control as reference parameter and has the following signature:
void Configure(ref FieldControl backendControl, IFormFieldController<IFormFieldModel> formFieldController);
Based on this, Configure method in all classes that implement this interface must be modified to follow the signature.
Libraries
LibrariesManager and LibrariesDataProvider contain new instance methods for:
- Compilation of media file urls –
RecompileMediaFileUrls to generate appropriate URLs for the file.
- Finding file link based on a given URL –
GetFileFromUrl
- Manipulation of
MediaFileLinks and MediaFileUrls that contain the information about the media file for a given culture - CreateMediaFileUrl, GetMediaFileUrls, CreateMediaFileLink, and GetMediaFileLinks.
IContentService and ContentServiceBase contain new methods for file link manipulations – CopyFileLink and GetMediaFileLinks.
Fields
Use GetString("FieldName") to construct anonymous types
For example:
.Select(d => new
{
FieldName = d.GetString("FieldName")
});
must be updated to explicitly case ToString() e.g.
.Select(d => new
{
FieldName = d.GetString("FieldName").ToString()
});
Content services
ContentItemContext has new property SfAdditionalInfo that holds the descendants' specific information that is consumed by the clients. For example, it is used for MediaContentService to pass specific information without breaking the generic contract. The information for MediaFile – TotalSize, DefaultFileName.
IAppSettings, AppSettings, SiteAppSettings
Method ResolveThumbnailFilePath has optional culture parameter:
string ResolveThumbnailFilePath(MediaContent media, string tmbName, string fromPath = null, string culture = null);
Multilingual
When you add or delete a language on your site, the changes are persisted on the file system, regardless the storage mode that you have configured. The changes are saved in the ResourceConfig file.
This is because languages are part of the building of the metadata source for connecting to the database. In addition, changing the languages changes the database structure and all structural changes are transferred through the deployment package