public void CreateDetailForLink(IContentClassElement element, string name)
 {
     CreateDetail("LINK", element, name, AuthorizationType.DetailedLink);
     ForLinks.InvalidateCache();
     ;
 }
Beispiel #2
0
        internal static IContentClassElement GetEquivalentContentClassElementFromOtherProject(IContentClassElement cc,
                                                                                              IProject otherProject)
        {
            var folderName = cc.ContentClass.Folder.Name;
            IContentClassFolder otherFolder;

            if (!otherProject.ContentClassFolders.TryGetByName(folderName, out otherFolder))
            {
                throw new SmartAPIException(otherProject.Session.ServerLogin,
                                            string.Format("Missing content class folder {0} for project {1}", folderName,
                                                          otherProject));
            }

            IContentClass otherContentClass;

            if (!otherFolder.ContentClasses.TryGetByName(cc.ContentClass.Name, out otherContentClass))
            {
                throw new SmartAPIException(otherProject.Session.ServerLogin,
                                            string.Format("Missing content class {0} in  folder {1} for project {2}",
                                                          cc.ContentClass.Name, folderName, otherProject));
            }

            IContentClassElement otherElement;

            if (!otherContentClass.Elements.TryGetByName(cc.Name, out otherElement))
            {
                throw new SmartAPIException(otherProject.Session.ServerLogin,
                                            string.Format(
                                                "Missing element {3} for content class {0} in  folder {1} for project {2}",
                                                cc.ContentClass.Name, folderName, otherProject, cc.Name));
            }

            return(otherElement);
        }
 public void CreateDetailForElement(IContentClassElement element, string name)
 {
     CreateDetail("ELEMENT", element, name, AuthorizationType.DetailedElement);
     ForElements.InvalidateCache();
 }