This is on the Tridion 2011 SP1.
I use the save component event in the Tridion event system to create the corresponding page and associate some metadata with this page. When I specify a scheme, I get event logs that indicate that the UUID of the scheme cannot be found.
The UUID that is in the error is for the metadata scheme that I want to use, and I also use the local TcmUri for the metadata scheme. At the moment, I am a little lost.
Below is .NET and the resulting error:
the code
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); } }
Error
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) [...]
source share