Пример #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;
     }
 }
Пример #2
0
        /// <summary>
        /// Constructor for DataRow class
        /// </summary>
        /// <param name="values">DataRow Values</param>
        /// <param name="security">ObjectSecurity object</param>
        /// <param name="keyValue">Key column value in case of KeyColumn it set on collection</param>
        public DataRow(Dictionary <string, string> values, ObjectSecurity security, string keyValue) :
            this()
        {
            if (values != null)
            {
                foreach (var key in values.Keys)
                {
                    Values.Add(key, values[key]);
                }
            }

            this.Security = security;
            this.Key      = keyValue;
        }
Пример #3
0
 /// <summary>
 /// Constructor for Directory class
 /// </summary>
 /// <param name="src">Source Name</param>
 /// <param name="folder">Folder Path</param>
 /// <param name="overwrite">Overwrite property</param>
 /// <param name="level">File Level</param>
 /// <param name="recursive">Recursive property</param>
 /// <param name="includeExtensions">Extensions which can be included in directory files</param>
 /// <param name="excludeExtensions">Extensions which are excluded in drectory files</param>
 /// <param name="metadataMappingFile">Metadata Mapping File</param>
 /// <param name="security">ObjectSecurity</param>
 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;
     }
 }
Пример #4
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)
 {
 }
Пример #5
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;
 }
Пример #6
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;
            }
        }
Пример #7
0
 /// <summary>
 /// Constructor for BaseClientSidePage class
 /// </summary>
 public BaseClientSidePage()
 {
     this._sections = new CanvasSectionCollection(this.ParentTemplate);
     Security       = new ObjectSecurity();
 }
Пример #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);
 }
Пример #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)
 {
 }
Пример #10
0
 /// <summary>
 /// Constructor for the File class
 /// </summary>
 /// <param name="src">Source name of the file</param>
 /// <param name="folder">Targer Folder of the file</param>
 /// <param name="overwrite">Overwrite flag of the file</param>
 /// <param name="webParts">Webparts in the file</param>
 /// <param name="properties">Properties of the file</param>
 /// <param name="security">Security Rules of the file</param>
 /// <param name="level">Level status for the file</param>
 public File(string src, string folder, bool overwrite, IEnumerable <WebPart> webParts, IDictionary <string, string> properties, ObjectSecurity security = null, FileLevel level = FileLevel.Draft) :
     this()
 {
     this.Src       = src;
     this.Overwrite = overwrite;
     this.Level     = level;
     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;
     }
 }
Пример #11
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)
 {
 }
Пример #12
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)
 {
 }