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

This file provide methods to get/update information from/in SP lists
Inheritance: ISPList
Afficher le fichier Open project: Microsoft/mattercenter

Méthodes publiques

Méthode 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

Méthode 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 méthode

public AddItem ( ClientContext clientContext, List list, IList columns, IList values ) : bool
clientContext ClientContext
list List
columns IList
values IList
Résultat bool

AddOneNote() public méthode

public AddOneNote ( ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle ) : string
clientContext ClientContext
clientAddressPath string
oneNoteLocation string
listName string
oneNoteTitle string
Résultat string

AddView() public méthode

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
Résultat bool

BreakItemPermission() public méthode

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
Résultat bool

BreakPermission() public méthode

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
Résultat bool

CheckItemModified() public méthode

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.
Résultat bool

CheckPermissionOnList() public méthode

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
Résultat bool

CheckPermissionOnList() public méthode

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
Résultat bool

CheckPermissionOnList() public méthode

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
Résultat bool

CreateFileInsideFolder() public méthode

public CreateFileInsideFolder ( ClientContext clientContext, string folderPath, FileCreationInformation newFile ) : void
clientContext ClientContext
folderPath string
newFile FileCreationInformation
Résultat void

CreateList() public méthode

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

Delete() public méthode

public Delete ( ClientContext clientContext, IList listsNames ) : bool
clientContext ClientContext
listsNames IList
Résultat bool

DownloadAttachments() public méthode

public DownloadAttachments ( string attachmentUrl ) : Stream
attachmentUrl string
Résultat Stream

Exists() public méthode

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
Résultat List

FetchUserPermissionForLibrary() public méthode

public FetchUserPermissionForLibrary ( ClientContext clientContext, string libraryname ) : IEnumerable
clientContext ClientContext
libraryname string
Résultat IEnumerable

FolderExists() public méthode

public FolderExists ( string folderPath, ClientContext clientContext, string documentLibraryName ) : bool
folderPath string
clientContext ClientContext
documentLibraryName string
Résultat bool

GetData() public méthode

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
Résultat ListItemCollection

GetData() public méthode

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
Résultat ListItemCollection

GetData() public méthode

public GetData ( string url, string listName, string camlQuery = null ) : ListItemCollection
url string
listName string
camlQuery string
Résultat ListItemCollection

GetDocumentAndClientGUID() public méthode

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

GetFolderHierarchy() public méthode

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

GetListProperties() public méthode

public GetListProperties ( ClientContext clientContext, string libraryName ) : PropertyValues
clientContext ClientContext
libraryName string
Résultat PropertyValues

GetMatterAssignedUsersEmail() public méthode

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
Résultat string

GetPropertyValueForList() public méthode

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
Résultat string

MatterAssociatedLists() public méthode

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
Résultat List

PerformContentCheck() public méthode

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
Résultat bool

SPList() public méthode

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
Résultat Microsoft.SharePoint.Client

SetItemPermission() public méthode

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
Résultat bool

SetPermission() public méthode

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
Résultat bool

SetPropertBagValuesForList() public méthode

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
Résultat void

SetUploadItemProperties() public méthode

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.
Résultat void

UploadDocument() public méthode

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
Résultat Microsoft.Legal.MatterCenter.Models.GenericResponseVM