C# Class Microsoft.Legal.MatterCenter.Web.Common.UploadHelperFunctions

Provide methods to perform document transfer functionalities.
Inheritance: IUploadHelperFunctions
Datei anzeigen Open project: Microsoft/mattercenter

Public Methods

Method Description
DocumentExists ( string clientUrl, ContentCheckDetails contentCheck, string documentLibraryName, string folderName, bool isMail ) : DuplicateDocument

PerformContentCheck ( ) : GenericResponseVM

PerformContentCheck ( string clientUrl, string folderUrl, IFormFile uploadedFile, string fileName ) : GenericResponseVM
SaveFields ( Client client, string folderPath, string fileName, MailMetaData mailMetadata, string documentLibraryName ) : void

Saves the fields for uploaded item in SharePoint library.

Upload ( Client client, ServiceRequest serviceRequest, string soapRequest, string attachmentOrMailID, bool isMailUpload, string fileName, string folderPath, bool isFirstCall, string &message, string originalFileName ) : GenericResponseVM

Acts as entry point from service to place the request to upload email/attachment. Reads the web request headers and requests applicable methods based on headers.

UploadHelperFunctions ( ISPOAuthorization spoAuthorization, IOptions errorSettings, IUserRepository userRepositoy, IDocumentRepository documentRepository, IOptions documentSettings, IUploadHelperFunctionsUtility uploadHelperFunctionsUtility ) : Microsoft.AspNetCore.Http

Private Methods

Method Description
CreateFileInsideFolder ( string folderPath, string filename, string extension, MemoryStream memoryStream, ClientContext clientContext ) : string

To create file inside SharePoint folder

GetEmailProperties ( XmlDocument xmlDocument, MailMetaData &mailMetaData ) : dynamic

Get properties of the Email being uploaded

GetMailProperties ( MailXPath mailXPath, MailMetaData &mailMetaData, XmlDocument xmlDocument ) : void

Get properties of the mail file to be uploaded

GetPropertyValueFromXml ( string xPath, XmlDocument document, XmlNamespaceManager namespaceManager ) : string

To get property value from the XML node

GetRecipientsField ( XmlNodeList xmlNodeList ) : string

To get recipients field from the Email headers

GetShortDateFromField ( string value ) : string

To get the short date from the field retrieved from headers

RetrieveNodeValue ( XmlDocument xmlDocument, XmlNamespaceManager nsmgr, string xmlPath, bool decodeNodeValue ) : string

Retrieves the specified node value from XML document

RetrieveXMLDocument ( HttpWebResponse webResponse ) : XmlDocument

Retrieves stream from web page and loads in XML document.

UploadAttachedMailExtBlank ( Client client, string folderPath, string fileName, string documentLibraryName, XmlDocument xmlDocument, string &message ) : void

Uploads the .msg file to specified folder in matter library.

UploadEMLFile ( string documentLibraryName, Client client, string folderPath, string fileName, string &message, XmlDocument xmlDocument, XmlNamespaceManager nsmgr, MailMetaData &mailMetaData, dynamic &bytes, string extension ) : void

Uploads the .eml file to specified folder in matter library.

UploadFilesMail ( bool isOverwrite, bool isContentCheckRequired, bool allowContentCheck, string documentLibraryName, HttpWebResponse webResponse, bool isMailUpload, Client client, string fileName, string folderPath, string &message ) : GenericResponseVM

Reads the XMLDocument and determines whether the request is to upload entire mail/attachment/.eml file/.msg file and calls respective method.

UploadFolderUtility ( Client client, string folderPath, string &filename, string extension, MemoryStream memoryStream, MailMetaData mailMetadata, string documentLibraryName, string &message, ClientContext clientContext ) : bool

Checks for folder existence and uploads the mail/attachment to specified folder in matter library. Returns the operation status (success/failure).

UploadMail ( Client client, string folderPath, string fileName, string documentLibraryName, XmlDocument xmlDocument, string &message ) : void

Uploads the email to specified folder in matter library.

UploadToFolder ( Client client, string folderPath, string filename, string extension, MemoryStream memoryStream, string documentLibraryName, MailMetaData mailMetaData, string &message ) : bool

Validates the email/attachment and request call to upload the content to specified folder in matter library.

Method Details

DocumentExists() public method

public DocumentExists ( string clientUrl, ContentCheckDetails contentCheck, string documentLibraryName, string folderName, bool isMail ) : DuplicateDocument
clientUrl string
contentCheck ContentCheckDetails
documentLibraryName string
folderName string
isMail bool
return DuplicateDocument

PerformContentCheck() public method

public PerformContentCheck ( ) : GenericResponseVM
return GenericResponseVM

PerformContentCheck() public method

public PerformContentCheck ( string clientUrl, string folderUrl, IFormFile uploadedFile, string fileName ) : GenericResponseVM
clientUrl string
folderUrl string
uploadedFile IFormFile
fileName string
return GenericResponseVM

SaveFields() public method

Saves the fields for uploaded item in SharePoint library.
public SaveFields ( Client client, string folderPath, string fileName, MailMetaData mailMetadata, string documentLibraryName ) : void
client Client Provider Service client
folderPath string folder path
fileName string Name of the file
mailMetadata MailMetaData MailMetadata object
documentLibraryName string Name of the document library
return void

Upload() public method

Acts as entry point from service to place the request to upload email/attachment. Reads the web request headers and requests applicable methods based on headers.
public Upload ( Client client, ServiceRequest serviceRequest, string soapRequest, string attachmentOrMailID, bool isMailUpload, string fileName, string folderPath, bool isFirstCall, string &message, string originalFileName ) : GenericResponseVM
client Client The client object
serviceRequest ServiceRequest The Service request object
soapRequest string The SOAP request
attachmentOrMailID string The attachment or mail identifier.
isMailUpload bool Mail upload check
fileName string Name of the file.
folderPath string The folder path.
isFirstCall bool Determines if it is first call or not
message string Reference object for the message to be returned
originalFileName string Original file name of the attachment
return GenericResponseVM

UploadHelperFunctions() public method

public UploadHelperFunctions ( ISPOAuthorization spoAuthorization, IOptions errorSettings, IUserRepository userRepositoy, IDocumentRepository documentRepository, IOptions documentSettings, IUploadHelperFunctionsUtility uploadHelperFunctionsUtility ) : Microsoft.AspNetCore.Http
spoAuthorization ISPOAuthorization
errorSettings IOptions
userRepositoy IUserRepository
documentRepository IDocumentRepository
documentSettings IOptions
uploadHelperFunctionsUtility IUploadHelperFunctionsUtility
return Microsoft.AspNetCore.Http