Ejemplo n.º 1
0
        // From the entity ID, get the Sitecore ID.
        // Also can creates the new ID if one does not exist.
        private ID getSitecoreId(Guid id, ID parentId, Boolean createIfNotExist = true)
        {
            var tableEntry = IDTable.GetID(IDTablePrefix, id.ToString());

            if (tableEntry == null && createIfNotExist)
            {
                tableEntry = IDTable.GetNewID(IDTablePrefix, id.ToString(), parentId);
            }
            if (tableEntry != null)
            {
                Trace.WriteLine(String.Format("{0} (repository) is {1} (sitecore)", id, tableEntry.ID), "ProductDataProvider");
                return(tableEntry.ID);
            }
            Trace.WriteLine(String.Format("{0} doesn't have a Sitecore id", id), "ProductDataProvider");
            return(null);
        }
Ejemplo n.º 2
0
 public override IDList GetChildIDs(ItemDefinition itemDefinition, CallContext context)
 {
     if (itemDefinition.ID == ID.Parse(_parentItem))
     {
         context.Abort();
         XmlNodeList videos   = VideoData.SelectNodes("/response/videos/video");
         IDList      videoIDs = new IDList();
         foreach (XmlNode video in videos)
         {
             string       videoKey = video.Attributes["key"].Value;
             IDTableEntry mappedID = IDTable.GetID(ID_TABLE_PREFIX, videoKey);
             if (mappedID == null)
             {
                 mappedID = IDTable.GetNewID(ID_TABLE_PREFIX, videoKey, ID.Parse(_parentItem));
             }
             videoIDs.Add(mappedID.ID);
         }
         return(videoIDs);
     }
     return(base.GetChildIDs(itemDefinition, context));
 }
Ejemplo n.º 3
0
        public IDTableEntry GetNewID(string prefix, string key, ID parentId)
        {
            IDTableEntry newId = IDTable.GetNewID(prefix, key, parentId);

            return(newId);
        }
 public IDTableEntry GetNewID(string prefix, string key, ID parentID, string customData)
 {
     return(IDTable.GetNewID(prefix, key, parentID, customData));
 }
 public IDTableEntry GetNewID(string prefix, string key, ID parentID)
 {
     return(IDTable.GetNewID(prefix, key, parentID));
 }
 public IDTableEntry GetNewID(string prefix, string key)
 {
     return(IDTable.GetNewID(prefix, key));
 }