Example #1
0
 /// <summary>
 /// Constructor for the Folder class
 /// </summary>
 /// <param name="name">Name of the folder</param>
 /// <param name="folders">List of the folders</param>
 /// <param name="security">ObjectSecurity for the folder</param>
 public Folder(String name, List <Folder> folders = null, ObjectSecurity security = null) :
     this()
 {
     this.Name = name;
     this.Folders.AddRange(folders);
     if (security != null)
     {
         this.Security = security;
     }
 }
Example #2
0
        public DataRow(Dictionary <string, string> values, ObjectSecurity security)
        {
            if (values != null)
            {
                foreach (var key in values.Keys)
                {
                    Values.Add(key, values[key]);
                }
            }

            this.Security = security;
        }
Example #3
0
        public Page(string url, bool overwrite, WikiPageLayout layout, IEnumerable <WebPart> webParts, bool welcomePage = false, ObjectSecurity security = null)
        {
            this.Url         = url;
            this.Overwrite   = overwrite;
            this.Layout      = layout;
            this.WelcomePage = welcomePage;

            if (webParts != null)
            {
                this.WebParts.AddRange(webParts);
            }

            this.Security = security;
        }
Example #4
0
 public File(string src, string folder, bool overwrite, IEnumerable <WebPart> webParts, IDictionary <string, string> properties, ObjectSecurity security = null) :
     this()
 {
     this.Src       = src;
     this.Overwrite = overwrite;
     this.Folder    = folder;
     this.WebParts.AddRange(webParts);
     if (properties != null)
     {
         foreach (var property in properties)
         {
             this.Properties.Add(property.Key, property.Value);
         }
     }
     if (security != null)
     {
         this.Security = security;
     }
 }
Example #5
0
 public Directory(string src, string folder, bool overwrite,
                  FileLevel level            = FileLevel.Draft, bool recursive = false,
                  string includeExtensions   = null, string excludeExtensions  = null,
                  string metadataMappingFile = null, ObjectSecurity security   = null) :
     this()
 {
     this.Src                 = src;
     this.Folder              = folder;
     this.Overwrite           = overwrite;
     this.Level               = level;
     this.Recursive           = recursive;
     this.IncludedExtensions  = includeExtensions;
     this.ExcludedExtensions  = excludeExtensions;
     this.MetadataMappingFile = metadataMappingFile;
     if (security != null)
     {
         this.Security = security;
     }
 }
Example #6
0
 public Page(string url, bool overwrite, WikiPageLayout layout, IEnumerable <WebPart> webParts, bool welcomePage = false, ObjectSecurity security = null, Dictionary <String, String> fields = null) :
     this(url, overwrite, layout, webParts, security, fields)
 {
 }
Example #7
0
 public Page(string url, bool overwrite, WikiPageLayout layout, IEnumerable <WebPart> webParts, bool welcomePage = false, ObjectSecurity security = null) :
     this(url, overwrite, layout, webParts, welcomePage, security, null)
 {
 }
Example #8
0
 /// <summary>
 /// Constructor for the ListInstance class
 /// </summary>
 /// <param name="contentTypeBindings">ContentTypeBindings of the list</param>
 /// <param name="views">Views of the list</param>
 /// <param name="fields">Fields of the list</param>
 /// <param name="fieldRefs">FieldRefs of the list</param>
 /// <param name="dataRows">DataRows of the list</param>
 /// <param name="fieldDefaults">FieldDefaults of the list</param>
 /// <param name="security">Security Rules of the list</param>
 /// <param name="folders">List Folders</param>
 /// <param name="userCustomActions">UserCustomActions of the list</param>
 public ListInstance(IEnumerable <ContentTypeBinding> contentTypeBindings,
                     IEnumerable <View> views, IEnumerable <Field> fields, IEnumerable <FieldRef> fieldRefs, List <DataRow> dataRows, Dictionary <String, String> fieldDefaults, ObjectSecurity security, List <Folder> folders, List <CustomAction> userCustomActions) :
     this()
 {
     this.ContentTypeBindings.AddRange(contentTypeBindings);
     this.Views.AddRange(views);
     this.Fields.AddRange(fields);
     this.FieldRefs.AddRange(fieldRefs);
     this.DataRows.AddRange(dataRows);
     if (fieldDefaults != null)
     {
         this._fieldDefaults = fieldDefaults;
     }
     if (security != null)
     {
         this.Security = security;
     }
     this.Folders.AddRange(folders);
     this.UserCustomActions.AddRange(userCustomActions);
 }
Example #9
0
 /// <summary>
 /// Constructor for ListInstance class
 /// </summary>
 /// <param name="contentTypeBindings">ContentTypeBindings  of the list</param>
 /// <param name="views">Views of the list</param>
 /// <param name="fields">Fields of the list</param>
 /// <param name="fieldRefs">FieldRefs of the list</param>
 /// <param name="dataRows">DataRows of the list</param>
 /// <param name="fieldDefaults">FieldDefaults of the list</param>
 /// <param name="security">Security Rules of the list</param>
 /// <param name="folders">List Folders</param>
 public ListInstance(IEnumerable <ContentTypeBinding> contentTypeBindings,
                     IEnumerable <View> views, IEnumerable <Field> fields, IEnumerable <FieldRef> fieldRefs, List <DataRow> dataRows, Dictionary <String, String> fieldDefaults, ObjectSecurity security, List <Folder> folders) :
     this(contentTypeBindings, views, fields, fieldRefs, dataRows, fieldDefaults, security, folders, null)
 {
 }
Example #10
0
        public ListInstance(IEnumerable <ContentTypeBinding> contentTypeBindings,
                            IEnumerable <View> views, IEnumerable <Field> fields, IEnumerable <FieldRef> fieldRefs, List <DataRow> dataRows, Dictionary <String, String> fieldDefaults, ObjectSecurity security)
        {
            if (contentTypeBindings != null)
            {
                this.ContentTypeBindings.AddRange(contentTypeBindings);
            }

            if (views != null)
            {
                this.Views.AddRange(views);
            }

            if (fields != null)
            {
                this.Fields.AddRange(fields);
            }

            if (fieldRefs != null)
            {
                this._fieldRefs.AddRange(fieldRefs);
            }
            if (dataRows != null)
            {
                this._dataRows.AddRange(dataRows);
            }
            if (fieldDefaults != null)
            {
                this._fieldDefaults = fieldDefaults;
            }
            if (security != null)
            {
                this._security = security;
            }
        }
Example #11
0
        /// <summary>
        /// Constructor for Page class
        /// </summary>
        /// <param name="url">Url of the page</param>
        /// <param name="overwrite">Overwrite flag for the page</param>
        /// <param name="layout">Page Layout</param>
        /// <param name="webParts">Webparts of the page</param>
        /// <param name="security">Security Rules for the page</param>
        /// <param name="fields">Fields used in the page</param>
        public Page(string url, bool overwrite, WikiPageLayout layout, IEnumerable <WebPart> webParts, ObjectSecurity security = null, Dictionary <String, String> fields = null) :
            this()
        {
            this.Url       = url;
            this.Overwrite = overwrite;
            this.Layout    = layout;
            this.WebParts.AddRange(webParts);

            if (security != null)
            {
                this.Security = security;
            }

            if (fields != null)
            {
                this.Fields = fields;
            }
        }
Example #12
0
 /// <summary>
 /// Constructor for BaseClientSidePage class
 /// </summary>
 public BaseClientSidePage()
 {
     this._sections = new CanvasSectionCollection(this.ParentTemplate);
     Security       = new ObjectSecurity();
 }
Example #13
0
 /// <summary>
 /// Constructor for DataRow class
 /// </summary>
 /// <param name="values">DataRow Values</param>
 /// <param name="security">ObjectSecurity object</param>
 public DataRow(Dictionary <string, string> values, ObjectSecurity security) : this(values, security, null)
 {
 }
Example #14
0
 /// <summary>
 /// Constructor for DataRow class
 /// </summary>
 public DataRow()
 {
     this.Security = new ObjectSecurity();
 }
Example #15
0
        public PublishingPage(string name, bool overwrite, string layout, IEnumerable <WebPart> webParts, ObjectSecurity security = null, Dictionary <String, String> fields = null) :
            this()
        {
            this.Name      = name;
            this.Overwrite = overwrite;
            this.Layout    = layout;
            this.WebParts.AddRange(webParts);

            if (security != null)
            {
                this.Security = security;
            }

            if (fields != null)
            {
                this.Fields = fields;
            }
        }
Example #16
0
 /// <summary>
 /// This method is provided for tests to assign new Security object.
 /// It is unclear why the Security setter is private in the Page class
 /// but not for instance in the ListInstance class.
 /// A class redesign to make this implementation identical in the classes are recommended.
 /// </summary>
 /// <param name="security"></param>
 internal void SetSecurity(ObjectSecurity security)
 {
     this.Security = security;
 }