C# Class Microsoft.Research.DataOnboarding.RepositoryAdapters.MerritAdapter

Inheritance: Microsoft.Research.DataOnboarding.RepositoryAdapters.BaseAdapter, IRepositoryAdapter
Mostra file Open project: CDLUC3/dataup2

Public Methods

Method Description
CheckIfFileExists ( string downloadURL, string fileIdentifier, string authorization ) : OperationStatus

Verifies if the file exists in the repository

DownloadFile ( string downloadUrl, string authorization, string fileName ) : Microsoft.Research.DataOnboarding.Utilities.Model.DataFile

Method to download the fiel from the specific repository.

IgnoreBadCertificates ( ) : void

Together with the AcceptAllCertifications method right below this causes to bypass errors caused by SLL-Errors.

MerritAdapter ( ) : Ionic.Zip

Initializes a new instance of the MerritAdapter class.

RefreshToken ( string refreshToken ) : AuthToken

Retreives the RefreshToken

Private Methods

Method Description
AcceptAllCertifications ( object sender, X509Certificate certification, X509Chain chain, SslPolicyErrors sslPolicyErrors ) : bool

In Short: the Method solves the Problem of broken Certificates. Sometime when requesting Data and the sending Webserverconnection is based on a SSL Connection, an Error is caused by Servers whoes Certificate(s) have Errors. Like when the Cert is out of date and much more... So at this point when calling the method, this behaviour is prevented

CreateFile ( Microsoft.Research.DataOnboarding.Utilities.MerritConstants fileCreationType, string filePath, MerritQueryData request, Encoding encoding, Microsoft.Research.DataOnboarding.DomainModel file, Microsoft.Research.DataOnboarding.DomainModel repository, IEnumerable fileColumnTypes = null, IEnumerable fileColumnUnits = null ) : void
DownloadFile ( string fileName, byte fileContents, string fileExtentsion, bool isCompressed, string tempFolder ) : void

Method to download the file to temp directory

GenerateCheckSum ( byte byteArray ) : string
GetIdentifier ( MerritQueryData queryData, RepositoryModel repositoryModel ) : string
GetIdentifierRequestBody ( MerritQueryData request ) : string
GetStandardUnits ( ) : List
ManageAttributeListElement ( XmlDocument emlDocument ) : void
ManageContactElement ( XmlDocument emlDocument ) : void
ManageEntityNameElement ( XmlDocument emlDocument ) : void
ManageGeographicLocationCoordinates ( XmlDocument emlDocument ) : void
ManageProjectTitleElement ( XmlDocument emlDocument ) : void
ManageTemporalCoverage ( XmlDocument emlDocument ) : void
PostFile ( PublishFileModel publishFileModel ) : OperationStatus
RemoveEmptyElements ( XmlDocument emlDocument ) : void
RemoveEmptyElements ( XmlNode nodes ) : void
RemoveEmptyParentNodes ( XmlNode nodes ) : void
ReplaceMetadata ( Microsoft.Research.DataOnboarding.DomainModel file, XmlDocument emlDocument, XmlNamespaceManager nsmgr, Microsoft.Research.DataOnboarding.DomainModel repositoryMetadata ) : void
WriteEML ( MerritQueryData request, string filePath, Microsoft.Research.DataOnboarding.DomainModel file, Microsoft.Research.DataOnboarding.DomainModel repositoryData, IEnumerable fileColumnTypes = null, IEnumerable fileColumnUnits = null ) : void
WriteParamMetadata ( MerritQueryData request, XmlDocument emlDocument, Microsoft.Research.DataOnboarding.DomainModel file, IEnumerable fileColumnTypes = null, IEnumerable fileColumnUnits = null ) : void

Method Details

CheckIfFileExists() public method

Verifies if the file exists in the repository
public CheckIfFileExists ( string downloadURL, string fileIdentifier, string authorization ) : OperationStatus
downloadURL string
fileIdentifier string File Identifier
authorization string AccessToken in case of skydrive and username password for Merrit
return Microsoft.Research.DataOnboarding.Utilities.OperationStatus

DownloadFile() public method

Method to download the fiel from the specific repository.
public DownloadFile ( string downloadUrl, string authorization, string fileName ) : Microsoft.Research.DataOnboarding.Utilities.Model.DataFile
downloadUrl string
authorization string
fileName string
return Microsoft.Research.DataOnboarding.Utilities.Model.DataFile

IgnoreBadCertificates() public static method

Together with the AcceptAllCertifications method right below this causes to bypass errors caused by SLL-Errors.
public static IgnoreBadCertificates ( ) : void
return void

MerritAdapter() public method

Initializes a new instance of the MerritAdapter class.
public MerritAdapter ( ) : Ionic.Zip
return Ionic.Zip

RefreshToken() public method

Retreives the RefreshToken
public RefreshToken ( string refreshToken ) : AuthToken
refreshToken string refreshToken
return Microsoft.Research.DataOnboarding.DomainModel.AuthToken