Exemplo n.º 1
0
 public static ContentItem MakeNew(string Name, ContentItemType cit, BusinessLogic.User u, int ParentId)
 {
     Guid newId = Guid.NewGuid();
     // Updated to match level from base node
     CMSNode n = new CMSNode(ParentId);
     int newLevel = n.Level;
     newLevel++;
     CMSNode.MakeNew(ParentId,_objectType, u.Id, newLevel,  Name, newId);
     ContentItem tmp = new ContentItem(newId);
     tmp.CreateContent(cit);
     return tmp;
 }
Exemplo n.º 2
0
 public static void DeleteFromType(ContentItemType cit)
 {
     var objs = Content.getContentOfContentType(cit);
     foreach (Content c in objs)
     {
         // due to recursive structure document might already been deleted..
         if (CMSNode.IsNode(c.UniqueId))
         {
             ContentItem tmp = new ContentItem(c.UniqueId);
             tmp.delete();
         }
     }
 }
Exemplo n.º 3
0
        public static ContentItem MakeNew(string Name, ContentItemType cit, BusinessLogic.User u, int ParentId)
        {
            Guid newId = Guid.NewGuid();
            // Updated to match level from base node
            CMSNode n        = new CMSNode(ParentId);
            int     newLevel = n.Level;

            newLevel++;
            CMSNode.MakeNew(ParentId, _objectType, u.Id, newLevel, Name, newId);
            ContentItem tmp = new ContentItem(newId);

            tmp.CreateContent(cit);
            return(tmp);
        }
Exemplo n.º 4
0
        public static void DeleteFromType(ContentItemType cit)
        {
            var objs = Content.getContentOfContentType(cit);

            foreach (Content c in objs)
            {
                // due to recursive structure document might already been deleted..
                if (CMSNode.IsNode(c.UniqueId))
                {
                    ContentItem tmp = new ContentItem(c.UniqueId);
                    tmp.delete();
                }
            }
        }