public override void PackagingProperty(Umbraco.Courier.Core.Item item, Umbraco.Courier.ItemProviders.ContentProperty propertyData) { if (propertyData.DBType.ToLower() == "ntext") { List <string> replacedIds = new List <string>(); propertyData.Value = Umbraco.Courier.Core.Helpers.XmlDependencies.ReplaceIds( propertyData.Value.ToString(), "//mediaItem/*", "id", Umbraco.Courier.Core.Enums.IdentifierReplaceDirection.FromNodeIdToGuid, out replacedIds); //replaced ids are populated by found and confirmed ids.. foreach (var s in replacedIds) { item.Dependencies.Add(s, Umbraco.Courier.ItemProviders.ProviderIDCollection.mediaItemProviderGuid); } //for good measure we are also replace parentId, but not adding it as a dependency... propertyData.Value = Umbraco.Courier.Core.Helpers.XmlDependencies.ReplaceIds( propertyData.Value.ToString(), "//mediaItem/*", "parentID", Umbraco.Courier.Core.Enums.IdentifierReplaceDirection.FromNodeIdToGuid, out replacedIds); } }
public override void ExtractingProperty(Umbraco.Courier.Core.Item item, Umbraco.Courier.ItemProviders.ContentProperty propertyData) { if (propertyData.DBType.ToLower() == "ntext") { List <string> replacedIds = new List <string>(); propertyData.Value = Umbraco.Courier.Core.Helpers.XmlDependencies.ReplaceIds( propertyData.Value.ToString(), "//mediaItem/*", "id", Umbraco.Courier.Core.Enums.IdentifierReplaceDirection.FromGuidToNodeId, out replacedIds); propertyData.Value = Umbraco.Courier.Core.Helpers.XmlDependencies.ReplaceIds( propertyData.Value.ToString(), "//mediaItem/*", "parentID", Umbraco.Courier.Core.Enums.IdentifierReplaceDirection.FromGuidToNodeId, out replacedIds); Umbraco.Courier.Core.Helpers.Logging._Debug(propertyData.Value.ToString()); } }