You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reusable fields applied to Content Items are not importable through ContentItemLanguageData.ContentItemData since the the column names for the actual content type do not contain those fields and they are contained in the ContentItemCommonData.
Using the example sample say you have a Reusable field schema withe a property name MetadataTitle shown below defined in the ContentItem dictionary. This will fail the check in the GenericAdapter for "Info doesn't contain column with name 'MetadataTitle' - _CustomProperties has invalid key, key SHALL have same name as column in target Info object" since this field exists in the ContentItemCommonData table and is not contained in the ColumnNames for the ContentItemModel loaded when adapting the
LanguageData.
ContentItemSimplifiedModel simplified =new(){ContentItemGUID=SampleArticleContentItemGuid,Name="SimplifiedModelSample",IsSecured=false,ContentTypeName= DataClassSamples.ArticleClassSample.ClassName,IsReusable=true,// channel name is required only for web site content itemsChannelName= ChannelSamples.SampleChannelForWebSiteChannel.ChannelName,// required when content item type is website content itemPageData=new(){ParentGuid=null,TreePath="/simplified-sample",PageUrls=[new(){UrlPath="en-us/simplified-sample",PathIsDraft=true,LanguageName= ContentLanguageSamples.SampleContentLanguageEnUs.ContentLanguageName!},new(){UrlPath="en-gb/simplified-sample",PathIsDraft=true,LanguageName= ContentLanguageSamples.SampleContentLanguageEnGb.ContentLanguageName!}]},LanguageData=[new(){LanguageName= ContentLanguageSamples.SampleContentLanguageEnUs.ContentLanguageName!,DisplayName="Simplified model sample - en-us",VersionStatus= VersionStatus.InitialDraft,UserGuid= UserSamples.SampleAdminGuid,ContentItemData=newDictionary<string,object?>{["ArticleTitle"]="en-US UMT simplified model creation",["ArticleText"]="This article is only example of creation UMT simplified model for en-US language",["RelatedArticles"]=null,["RelatedFaq"]=null.["MetadataTitle"]="Some Value"}},new(){LanguageName= ContentLanguageSamples.SampleContentLanguageEnGb.ContentLanguageName!,DisplayName="Simplified model sample - en-gb",VersionStatus= VersionStatus.Published,UserGuid= UserSamples.SampleAdminGuid,ContentItemData=newDictionary<string,object?>{["ArticleTitle"]="en-GB UMT simplified model creation",["ArticleText"]="This article is only example of creation UMT simplified model for en-GB language",["RelatedArticles"]=null,["RelatedFaq"]=null.["MetadataTitleCommon"]="Some Value"}}],
ContentItemSimplifiedModel.cs
publicclassContentItemLanguageData{[Required]publicrequiredstringLanguageName{get;set;}[Required]publicrequiredstringDisplayName{get;set;}publicVersionStatusVersionStatus{get;set;}= VersionStatus.InitialDraft;[Required]publicrequiredGuid?UserGuid{get;set;}publicDictionary<string,object?>?ContentItemData{get;set;}publicDictionary<string,object?>?ContentItemCommonData{get;set;}// Added property to contain common data fields}
ContentItemSimplifiedAdapter.cs line: 118
varcontentItemCommonDataModel=new ContentItemCommonDataModel
{ContentItemCommonDataGUID=contentItemCommonDataInfoGuid?? Guid.NewGuid(),ContentItemCommonDataContentItemGuid= contentItemInfo.ContentItemGUID,ContentItemCommonDataContentLanguageGuid= contentLanguageInfo.ContentLanguageGUID,ContentItemCommonDataVersionStatus= languageData.VersionStatus,ContentItemCommonDataIsLatest=true,ContentItemCommonDataPageBuilderWidgets=null,ContentItemCommonDataPageTemplateConfiguration=null,CustomProperties= languageData?.ContentItemCommonData ??[]// Allow custom properties to be adapted into the common data for things like metadata schema};
The text was updated successfully, but these errors were encountered:
Reusable fields applied to Content Items are not importable through
ContentItemLanguageData.ContentItemData
since the the column names for the actual content type do not contain those fields and they are contained in the ContentItemCommonData.Using the example sample say you have a Reusable field schema withe a property name MetadataTitle shown below defined in the ContentItem dictionary. This will fail the check in the GenericAdapter for "Info doesn't contain column with name 'MetadataTitle' - _CustomProperties has invalid key, key SHALL have same name as column in target Info object" since this field exists in the ContentItemCommonData table and is not contained in the ColumnNames for the ContentItemModel loaded when adapting the
LanguageData.
ContentItemSimplifiedModel.cs
ContentItemSimplifiedAdapter.cs line: 118
The text was updated successfully, but these errors were encountered: