C# Class Microsoft.Legal.MatterCenter.Repository.SPList

This file provide methods to get/update information from/in SP lists
Inheritance: ISPList
ファイルを表示 Open project: Microsoft/mattercenter

Public Methods

Method Description
AddItem ( ClientContext clientContext, List list, IList columns, IList values ) : bool
AddOneNote ( ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle ) : string
AddView ( ClientContext clientContext, List matterList, string viewColumnList, string viewName, string strQuery ) : bool

Creates a new view for the list

BreakItemPermission ( ClientContext clientContext, string listName, int listItemId, bool isCopyRoleAssignment ) : bool

Validates and breaks the item level permission for the specified list item under the list/library.

BreakPermission ( ClientContext clientContext, string libraryName, bool isCopyRoleAssignment ) : bool

Breaks the permissions of the list.

CheckItemModified ( ListItemCollection collection, string cachedItemModifiedDate ) : bool

Checks if item is modified after it is loaded on the client side

CheckPermissionOnList ( Client client, string listName, PermissionKind permission ) : bool

Determines whether user has a particular permission on the list

CheckPermissionOnList ( ClientContext clientContext, string listName, PermissionKind permission ) : bool

Determines whether user has a particular permission on the list

CheckPermissionOnList ( string url, string listName, PermissionKind permission ) : bool

Method will check the permission of the list that has been provided

CreateFileInsideFolder ( ClientContext clientContext, string folderPath, FileCreationInformation newFile ) : void
CreateList ( ClientContext clientContext, ListInformation listInfo ) : bool
Delete ( ClientContext clientContext, IList listsNames ) : bool
DownloadAttachments ( string attachmentUrl ) : Stream
Exists ( Client client, ReadOnlyCollection listsNames ) : List

Function to check whether list is present or not.

FetchUserPermissionForLibrary ( ClientContext clientContext, string libraryname ) : IEnumerable

FolderExists ( string folderPath, ClientContext clientContext, string documentLibraryName ) : bool
GetData ( Client client, string listName, string camlQuery = null ) : ListItemCollection

Gets the list items of specified list based on CAML query.

GetData ( ClientContext clientContext, string listName, string camlQuery = null ) : ListItemCollection

Gets the list items of specified list based on CAML query.

GetData ( string url, string listName, string camlQuery = null ) : ListItemCollection
GetDocumentAndClientGUID ( Client client ) : dynamic

Retrieves the document and List GUID

GetFolderHierarchy ( MatterData matterData ) : List

Method which will give matter folder hierarchy

GetListProperties ( ClientContext clientContext, string libraryName ) : PropertyValues
GetMatterAssignedUsersEmail ( ClientContext clientContext, Matter matter ) : string

Converts the project users emails in a form that can be stamped to library.

GetPropertyValueForList ( ClientContext context, string matterName, string propertyList ) : string

Fetches the values of property for specified matter.

MatterAssociatedLists ( ClientContext clientContext, ReadOnlyCollection listsNames ) : List

Function to check whether list is present or not.

PerformContentCheck ( ClientContext context, MemoryStream localMemoryStream, String serverFileURL ) : bool

Check if Content of local file and server file matches.

SPList ( ISPOAuthorization spoAuthorization, IOptions camlQueries, IOptions errorSettings, IOptions searchSettings, IOptions contentTypesConfig, ICustomLogger customLogger, IOptions logTables, IOptions mailSettings, IOptions generalSettings, IHostingEnvironment hostingEnvironment, IUsersDetails userDetails ) : Microsoft.SharePoint.Client

All the dependencies are injected into the constructor

SetItemPermission ( ClientContext clientContext, IList assignUserName, string listName, int listItemId, IList permissions ) : bool

Set permission to the specified list item

SetPermission ( ClientContext clientContext, IList assignUserName, IList permissions, string listName ) : bool

Sets permissions for the list.

SetPropertBagValuesForList ( ClientContext clientContext, PropertyValues props, string matterName, string>.Dictionary propertyList ) : void

Sets the value of the specified property.

SetUploadItemProperties ( ClientContext clientContext, string documentLibraryName, string fileName, string folderPath, string>.Dictionary mailProperties ) : void

Sets the upload item properties.

UploadDocument ( string folderPath, IFormFile uploadedFile, string fileName, string>.Dictionary mailProperties, string clientUrl, string folderName, string documentLibraryName ) : GenericResponseVM

Private Methods

Method Description
AddFolders ( ClientContext clientContext, List list, IList folderNames ) : List

Adds all the folders from Content type in matter library.

DocumentUpload ( string folderPath, IList listResponse, ClientContext clientContext, string documentLibraryName, Web web, string folderName, FileCreationInformation uploadFile ) : GenericResponseVM

Upload helper function for uploading documents to SharePoint library.

GetCategories ( string categories ) : string

Process the categories and trims the "category" word

GetFolderAssignment ( List list, ListItemCollection listItems, List allFolders ) : List

Retrieves folder hierarchy from document library.

Method Details

AddItem() public method

public AddItem ( ClientContext clientContext, List list, IList columns, IList values ) : bool
clientContext ClientContext
list List
columns IList
values IList
return bool

AddOneNote() public method

public AddOneNote ( ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle ) : string
clientContext ClientContext
clientAddressPath string
oneNoteLocation string
listName string
oneNoteTitle string
return string

AddView() public method

Creates a new view for the list
public AddView ( ClientContext clientContext, List matterList, string viewColumnList, string viewName, string strQuery ) : bool
clientContext ClientContext Client Context
matterList List List name
viewColumnList string Name of the columns in view
viewName string View name
strQuery string View query
return bool

BreakItemPermission() public method

Validates and breaks the item level permission for the specified list item under the list/library.
public BreakItemPermission ( ClientContext clientContext, string listName, int listItemId, bool isCopyRoleAssignment ) : bool
clientContext ClientContext Client Context
listName string List name
listItemId int Unique list item id to break item level permission
isCopyRoleAssignment bool Flag to copy permission from parent
return bool

BreakPermission() public method

Breaks the permissions of the list.
public BreakPermission ( ClientContext clientContext, string libraryName, bool isCopyRoleAssignment ) : bool
clientContext ClientContext Client context
libraryName string Name of list
isCopyRoleAssignment bool Flag to copy permission from parent
return bool

CheckItemModified() public method

Checks if item is modified after it is loaded on the client side
public CheckItemModified ( ListItemCollection collection, string cachedItemModifiedDate ) : bool
collection ListItemCollection List item collection
cachedItemModifiedDate string Date time when current user loaded the page to see/update configuration values.
return bool

CheckPermissionOnList() public method

Determines whether user has a particular permission on the list
public CheckPermissionOnList ( Client client, string listName, PermissionKind permission ) : bool
client Microsoft.Legal.MatterCenter.Models.Client
listName string List name
permission PermissionKind Permission to be checked
return bool

CheckPermissionOnList() public method

Determines whether user has a particular permission on the list
public CheckPermissionOnList ( ClientContext clientContext, string listName, PermissionKind permission ) : bool
clientContext ClientContext Client context
listName string List name
permission PermissionKind Permission to be checked
return bool

CheckPermissionOnList() public method

Method will check the permission of the list that has been provided
public CheckPermissionOnList ( string url, string listName, PermissionKind permission ) : bool
url string
listName string
permission PermissionKind
return bool

CreateFileInsideFolder() public method

public CreateFileInsideFolder ( ClientContext clientContext, string folderPath, FileCreationInformation newFile ) : void
clientContext ClientContext
folderPath string
newFile FileCreationInformation
return void

CreateList() public method

public CreateList ( ClientContext clientContext, ListInformation listInfo ) : bool
clientContext ClientContext
listInfo Microsoft.Legal.MatterCenter.Models.ListInformation
return bool

Delete() public method

public Delete ( ClientContext clientContext, IList listsNames ) : bool
clientContext ClientContext
listsNames IList
return bool

DownloadAttachments() public method

public DownloadAttachments ( string attachmentUrl ) : Stream
attachmentUrl string
return Stream

Exists() public method

Function to check whether list is present or not.
public Exists ( Client client, ReadOnlyCollection listsNames ) : List
client Microsoft.Legal.MatterCenter.Models.Client
listsNames ReadOnlyCollection List name
return List

FetchUserPermissionForLibrary() public method

public FetchUserPermissionForLibrary ( ClientContext clientContext, string libraryname ) : IEnumerable
clientContext ClientContext
libraryname string
return IEnumerable

FolderExists() public method

public FolderExists ( string folderPath, ClientContext clientContext, string documentLibraryName ) : bool
folderPath string
clientContext ClientContext
documentLibraryName string
return bool

GetData() public method

Gets the list items of specified list based on CAML query.
public GetData ( Client client, string listName, string camlQuery = null ) : ListItemCollection
client Microsoft.Legal.MatterCenter.Models.Client
listName string Name of the list
camlQuery string CAML Query that need to be executed on list
return ListItemCollection

GetData() public method

Gets the list items of specified list based on CAML query.
public GetData ( ClientContext clientContext, string listName, string camlQuery = null ) : ListItemCollection
clientContext ClientContext Client context
listName string Name of the list
camlQuery string CAML Query that need to be executed on list
return ListItemCollection

GetData() public method

public GetData ( string url, string listName, string camlQuery = null ) : ListItemCollection
url string
listName string
camlQuery string
return ListItemCollection

GetDocumentAndClientGUID() public method

Retrieves the document and List GUID
public GetDocumentAndClientGUID ( Client client ) : dynamic
client Microsoft.Legal.MatterCenter.Models.Client Client object containing list data
return dynamic

GetFolderHierarchy() public method

Method which will give matter folder hierarchy
public GetFolderHierarchy ( MatterData matterData ) : List
matterData Microsoft.Legal.MatterCenter.Models.MatterData
return List

GetListProperties() public method

public GetListProperties ( ClientContext clientContext, string libraryName ) : PropertyValues
clientContext ClientContext
libraryName string
return PropertyValues

GetMatterAssignedUsersEmail() public method

Converts the project users emails in a form that can be stamped to library.
public GetMatterAssignedUsersEmail ( ClientContext clientContext, Matter matter ) : string
clientContext ClientContext ClientContext object
matter Microsoft.Legal.MatterCenter.Models.Matter Matter object
return string

GetPropertyValueForList() public method

Fetches the values of property for specified matter.
public GetPropertyValueForList ( ClientContext context, string matterName, string propertyList ) : string
context ClientContext Client context
matterName string Name of matter
propertyList string List of properties
return string

MatterAssociatedLists() public method

Function to check whether list is present or not.
public MatterAssociatedLists ( ClientContext clientContext, ReadOnlyCollection listsNames ) : List
clientContext ClientContext Client context object for SharePoint
listsNames ReadOnlyCollection List name
return List

PerformContentCheck() public method

Check if Content of local file and server file matches.
public PerformContentCheck ( ClientContext context, MemoryStream localMemoryStream, String serverFileURL ) : bool
context ClientContext SP client context
localMemoryStream System.IO.MemoryStream Memory stream of local file
serverFileURL String Server relative URL of file with filename
return bool

SPList() public method

All the dependencies are injected into the constructor
public SPList ( ISPOAuthorization spoAuthorization, IOptions camlQueries, IOptions errorSettings, IOptions searchSettings, IOptions contentTypesConfig, ICustomLogger customLogger, IOptions logTables, IOptions mailSettings, IOptions generalSettings, IHostingEnvironment hostingEnvironment, IUsersDetails userDetails ) : Microsoft.SharePoint.Client
spoAuthorization ISPOAuthorization
camlQueries IOptions
errorSettings IOptions
searchSettings IOptions
contentTypesConfig IOptions
customLogger ICustomLogger
logTables IOptions
mailSettings IOptions
generalSettings IOptions
hostingEnvironment IHostingEnvironment
userDetails IUsersDetails
return Microsoft.SharePoint.Client

SetItemPermission() public method

Set permission to the specified list item
public SetItemPermission ( ClientContext clientContext, IList assignUserName, string listName, int listItemId, IList permissions ) : bool
clientContext ClientContext Client context object
assignUserName IList Users to give permission
listName string List name
listItemId int Unique list item id to break item level permission
permissions IList Permissions for the users
return bool

SetPermission() public method

Sets permissions for the list.
public SetPermission ( ClientContext clientContext, IList assignUserName, IList permissions, string listName ) : bool
clientContext ClientContext Client Context
assignUserName IList Users to give permission
permissions IList Permissions for the users
listName string List name
return bool

SetPropertBagValuesForList() public method

Sets the value of the specified property.
public SetPropertBagValuesForList ( ClientContext clientContext, PropertyValues props, string matterName, string>.Dictionary propertyList ) : void
clientContext ClientContext Client context
props PropertyValues Property Bag
matterName string Name of matter to which property is to be attached
propertyList string>.Dictionary List of properties
return void

SetUploadItemProperties() public method

Sets the upload item properties.
public SetUploadItemProperties ( ClientContext clientContext, string documentLibraryName, string fileName, string folderPath, string>.Dictionary mailProperties ) : void
clientContext ClientContext The client context.
documentLibraryName string Name of the document library.
fileName string Name of the file.
folderPath string Path of the folder.
mailProperties string>.Dictionary The mail properties.
return void

UploadDocument() public method

public UploadDocument ( string folderPath, IFormFile uploadedFile, string fileName, string>.Dictionary mailProperties, string clientUrl, string folderName, string documentLibraryName ) : GenericResponseVM
folderPath string
uploadedFile IFormFile
fileName string
mailProperties string>.Dictionary
clientUrl string
folderName string
documentLibraryName string
return Microsoft.Legal.MatterCenter.Models.GenericResponseVM