這是Tridion 2011 SP1上的錯誤。Tridion:在事件系統中設置頁面元數據模式時出錯
我在Tridion事件系統中使用組件保存事件來創建相應的頁面並將某些元數據與該頁面關聯。指定模式時,我收到表明無法找到模式的UUID的事件日誌。
錯誤中的UUID是我想要使用的元數據模式,我也使用本地TcmUri作爲元數據模式。我目前有點虧損。
的.NET和產生的誤差低於:
代碼
public static TcmUri CreatePage(TcmUri parentSgId, Component component, TcmUri componentTemplateUri, TcmUri metaDataSchemaUri = null)
{
Logging.Debug("Attempting to create page in " + parentSgId.ToString());
Page page = new Page(component.Session, parentSgId);
page.Title = component.Title;
page.FileName = component.Title;
// Add a metadata schema
if (metaDataSchemaUri != null)
{
TcmUri localMetaDataSchemaUri = TransformTcmUri(metaDataSchemaUri, parentSgId);
page.MetadataSchema = (Schema)page.Session.GetObject(localMetaDataSchemaUri);
}
// Add the CP
TcmUri localComponentUri = Helpers.TransformTcmUri(component.Id, parentSgId);
TcmUri localComponentTemplateUri = Helpers.TransformTcmUri(componentTemplateUri, parentSgId);
page.ComponentPresentations.Add(new ComponentPresentation(new Component(localComponentUri, component.Session), new ComponentTemplate(localComponentTemplateUri, component.Session)));
try
{
page.Save(true);
Logging.Debug("Created page successfully " + page.Id.ToString());
return page.Id;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
錯誤
Unable to find uuid:C42EE4FC-D2A2-49F5-92C7-BF6DCB014343:Metadata.
Component: Tridion.ContentManager Errorcode: 0 User: EMAKINA\MTSUser
StackTrace Information Details: at
Bair.Tridion.Events.Utilities.Helpers.CreatePage(TcmUri parentSgId,
Component component, TcmUri componentTemplateUri, TcmUri
metaDataSchemaUri) [...]
我也試了這一點,但遺憾的是具有相同的錯誤結果。 – 2012-03-01 09:26:28
該死的,你想出來之前,我設法發佈我的解決方案...:/ – 2012-03-01 11:38:15
對不起。非常感謝你深入挖掘這一個。我猛撞了一會兒,解決方案剛剛彈出;) – 2012-03-01 15:24:51