Example #1
0
        public static Sitecore43Item GetItem(string sItemPath, Sitecore43.SitecoreClientAPI sitecoreApi)
        {
//            XmlNode node = sitecoreApi.GetItem(sItemPath);
            XmlNode        itemXml = sitecoreApi.GetItemXml(sItemPath, "", "");
            Sitecore43Item item    = new Sitecore43Item(itemXml, null, sitecoreApi);

            item.SetAPIConnection(sitecoreApi);
            return(item);
        }
Example #2
0
 private void AddItemToCache(Sitecore43Item item)
 {
     // Add to cache two times because we might request it by key or by path
     if (!_existingTemplates.ContainsKey(item.ID.ToLower()))
     {
         _existingTemplates.Add(item.ID.ToLower(), item);
     }
     if (!_existingTemplates.ContainsKey(item.Path.ToLower()))
     {
         _existingTemplates.Add(item.Path.ToLower(), item);
     }
 }
Example #3
0
        private Sitecore43Item GetSitecore43Item(string sItemPath)
        {
            if (_existingTemplates.ContainsKey(sItemPath.ToLower()))
            {
                Sitecore43Item item = null;
                _existingTemplates.TryGetValue(sItemPath.ToLower(), out item);
                return(item);
            }
            XmlNode itemXml = _sitecoreApi.GetItemXml(sItemPath, "", this.Options.Language);

            return(new Sitecore43Item(itemXml, null, _sitecoreApi));
        }
Example #4
0
        public string[] GetLanguages()
        {
            Sitecore43Item langRoot = GetSitecore43Item("/sitecore/system/Languages");

            IItem[] languages = langRoot.GetChildren();

            string[] result = new string[languages.Length];
            for (int t = 0; t < languages.Length; t++)
            {
                IField field = languages[t].Fields.GetFieldByName("Iso");
                result[t] = field.Content;
            }

            return(result);
        }