Ejemplo n.º 1
0
        private void LoadSlotInfoMap(ContentTypeManager contentTypeManager,
                                     TemplateNameManager templateNameManager)
        {
            PSTemplateSlot[] slotData = PSWSUtils.LoadSlots(_assemblyService);

            _slotMap = new Dictionary <string, SlotInfo>();
            foreach (PSTemplateSlot slot in slotData)
            {
                SlotInfo info = new SlotInfo(slot.name, new PercussionGuid(slot.id));
                foreach (PSTemplateSlotContent idPair in slot.AllowedContent)
                {
                    PercussionGuid            contentTypeID   = new PercussionGuid(idPair.contentTypeId);
                    PercussionGuid            templateID      = new PercussionGuid(idPair.templateId);
                    string                    contentTypeName = contentTypeManager[contentTypeID];
                    string                    templateName    = templateNameManager[templateID];
                    ContentTypeToTemplateInfo pairData
                        = new ContentTypeToTemplateInfo(contentTypeName, contentTypeID, templateName, templateID);
                    info.AllowedContentTemplatePairs.Add(pairData);
                }

                if (!_slotMap.ContainsKey(slot.name))
                {
                    _slotMap.Add(slot.name, info);
                }
            }
        }
Ejemplo n.º 2
0
 private void MakeNavonPublic(string folderPath)
 {
     // Get the Navon's content ID.
     PSSearchResults[] searchResults = PSWSUtils.FindItemByFieldValues(_contentService, NavonContentType, folderPath, true, null);
     if (searchResults.Length < 1)
     {
         throw new CMSOperationalException(string.Format("Navon not found for folder {0}.", folderPath));
     }
     PSWSUtils.TransitionItems(_systemService, new long[] { PercussionGuid.GetID(searchResults[0].id) }, NavonPublicTransitionName);
 }
Ejemplo n.º 3
0
        public static bool FolderExists(contentSOAP contentSvc, string folderPath)
        {
            bool found = false;

            PSFolder[] folders = PSWSUtils.LoadFolders(contentSvc, folderPath);
            if (folders != null && folders.Length > 0)
            {
                found = true;
            }

            return(found);
        }
Ejemplo n.º 4
0
        private void LoadTemplateIDMap()
        {
            PSContentTypeSummary[] contentTypeData = PSWSUtils.LoadContentTypes(_contentService);

            _contentTypeMap = new Dictionary <string, PercussionGuid>();
            Array.ForEach(contentTypeData, contentType =>
            {
                if (!_contentTypeMap.ContainsKey(contentType.name))
                {
                    _contentTypeMap.Add(contentType.name, new PercussionGuid(contentType.id));
                }
            });
        }
Ejemplo n.º 5
0
        private void LoadTemplateIDMap()
        {
            PSAssemblyTemplate[] templateData = PSWSUtils.LoadAssemblyTemplates(_assemblyService);

            _templateMap = new Dictionary <string, PercussionGuid>();
            Array.ForEach(templateData, template =>
            {
                if (!_templateMap.ContainsKey(template.name))
                {
                    _templateMap.Add(template.name, new PercussionGuid(template.id));
                }
            });
        }