C# Class Terradue.OpenSearch.OpenSearchFactory

OpenSearch factory. Helper class with a set of static class with the most common manipulation functions for OpenSearch.
ファイルを表示 Open project: Terradue/DotNetOpenSearch

Public Methods

Method Description
BuildRequestUrlForTemplate ( OpenSearchDescriptionUrl remoteUrlTemplate, NameValueCollection searchParameters, NameValueCollection requestUrlTemplateDef, QuerySettings querySettings ) : OpenSearchUrl

Builds the request URL for template.

BuildRequestUrlForTemplate ( OpenSearchDescriptionUrl remoteUrlTemplate, NameValueCollection searchParameters, QuerySettings querySettings ) : OpenSearchUrl

Builds the request URL for template.

BuildRequestUrlFromTemplateNameParameters ( OpenSearchUrl remoteUrlTemplate, NameValueCollection templateSearchParameters ) : string

Builds the request URL from template name parameters.

FindOpenSearchable ( OpenSearchEngine ose, Uri baseUrl, string mimeType = null, bool soft = false ) : IOpenSearchable

Finds the open search description.

GetBaseOpenSearchParameter ( ) : NameValueCollection

Gets the base open search parameter.

GetCount ( NameValueCollection parameters ) : int
GetDefaultParametersDescription ( int maxCount ) : List
GetEnclosures ( IOpenSearchResultCollection result ) : SyndicationLink[]
GetIdFromParamName ( IOpenSearchable entity, string mimeType, string paramName ) : string

Gets the name of the identifier from parameter.

GetOpenSearchParameters ( OpenSearchDescriptionUrl osUrl ) : NameValueCollection

Gets the open search parameters.

GetOpenSearchUrlByRel ( OpenSearchDescription osd, string rel ) : OpenSearchDescriptionUrl

Gets the open search URL by rel.

GetOpenSearchUrlByType ( OpenSearchDescription osd, string type ) : OpenSearchDescriptionUrl

Gets the type of the open search URL by.

GetOpenSearchUrlByTypeAndMaxParam ( OpenSearchDescription osd, List mimeTypes, NameValueCollection osParameters ) : OpenSearchDescriptionUrl
GetParamNameFromId ( NameValueCollection parameters, string id ) : string

Gets the parameter name from identifier.

LoadOpenSearchDescriptionDocument ( OpenSearchUrl url ) : OpenSearchDescription

Loads the OpenSearch description document.

MergeOpenSearchParameters ( IOpenSearchable entities, string contentType ) : NameValueCollection

Merges the open search parameters.

PaginationFreeEqual ( NameValueCollection parameters, NameValueCollection parameters2 ) : bool

Paginations the free equal.

RemoveLinksByRel ( IOpenSearchResultCollection &results, string relType ) : void
ReplaceOpenSearchDescriptionLinks ( IOpenSearchable entity, IOpenSearchResultCollection osr ) : void
ReplaceSelfLinks ( IOpenSearchable entity, NameValueCollection parameters, IOpenSearchResultCollection osr, Func entryTemplate ) : void
ReplaceSelfLinks ( IOpenSearchable entity, NameValueCollection parameters, IOpenSearchResultCollection osr, Func entryTemplate, string contentType ) : void
ReplaceSelfLinks ( IOpenSearchable entity, OpenSearchRequest request, IOpenSearchResultCollection osr, Func entryTemplate ) : void
ReplaceTemplateByIdentifier ( NameValueCollection osParameters, OpenSearchDescriptionUrl osdUrl ) : NameValueCollection
ResolveTypeFromRequest ( HttpRequest request, OpenSearchEngine ose ) : Type
ReverseTemplateOpenSearchParameters ( NameValueCollection osdParam ) : NameValueCollection

Reverses the template open search parameters.

Method Details

BuildRequestUrlForTemplate() public static method

Builds the request URL for template.
public static BuildRequestUrlForTemplate ( OpenSearchDescriptionUrl remoteUrlTemplate, NameValueCollection searchParameters, NameValueCollection requestUrlTemplateDef, QuerySettings querySettings ) : OpenSearchUrl
remoteUrlTemplate Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl Remote URL template.
searchParameters System.Collections.Specialized.NameValueCollection Search parameters.
requestUrlTemplateDef System.Collections.Specialized.NameValueCollection
querySettings QuerySettings
return OpenSearchUrl

BuildRequestUrlForTemplate() public static method

Builds the request URL for template.
public static BuildRequestUrlForTemplate ( OpenSearchDescriptionUrl remoteUrlTemplate, NameValueCollection searchParameters, QuerySettings querySettings ) : OpenSearchUrl
remoteUrlTemplate Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl Remote URL template.
searchParameters System.Collections.Specialized.NameValueCollection Search parameters.
querySettings QuerySettings
return OpenSearchUrl

BuildRequestUrlFromTemplateNameParameters() public static method

Builds the request URL from template name parameters.
public static BuildRequestUrlFromTemplateNameParameters ( OpenSearchUrl remoteUrlTemplate, NameValueCollection templateSearchParameters ) : string
remoteUrlTemplate OpenSearchUrl Remote URL template.
templateSearchParameters System.Collections.Specialized.NameValueCollection Template search parameters.
return string

FindOpenSearchable() public static method

Finds the open search description.
public static FindOpenSearchable ( OpenSearchEngine ose, Uri baseUrl, string mimeType = null, bool soft = false ) : IOpenSearchable
ose Terradue.OpenSearch.Engine.OpenSearchEngine
baseUrl System.Uri Base URL.
mimeType string
soft bool
return IOpenSearchable

GetBaseOpenSearchParameter() public static method

Gets the base open search parameter.
public static GetBaseOpenSearchParameter ( ) : NameValueCollection
return System.Collections.Specialized.NameValueCollection

GetCount() public static method

public static GetCount ( NameValueCollection parameters ) : int
parameters System.Collections.Specialized.NameValueCollection
return int

GetDefaultParametersDescription() public static method

public static GetDefaultParametersDescription ( int maxCount ) : List
maxCount int
return List

GetEnclosures() public static method

public static GetEnclosures ( IOpenSearchResultCollection result ) : SyndicationLink[]
result IOpenSearchResultCollection
return SyndicationLink[]

GetIdFromParamName() public static method

Gets the name of the identifier from parameter.
public static GetIdFromParamName ( IOpenSearchable entity, string mimeType, string paramName ) : string
entity IOpenSearchable Entity.
mimeType string MIME type.
paramName string Parameter name.
return string

GetOpenSearchParameters() public static method

Gets the open search parameters.
public static GetOpenSearchParameters ( OpenSearchDescriptionUrl osUrl ) : NameValueCollection
osUrl Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl Os URL.
return System.Collections.Specialized.NameValueCollection

GetOpenSearchUrlByRel() public static method

Gets the open search URL by rel.
public static GetOpenSearchUrlByRel ( OpenSearchDescription osd, string rel ) : OpenSearchDescriptionUrl
osd Terradue.OpenSearch.Schema.OpenSearchDescription Osd.
rel string Rel.
return Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl

GetOpenSearchUrlByType() public static method

Gets the type of the open search URL by.
public static GetOpenSearchUrlByType ( OpenSearchDescription osd, string type ) : OpenSearchDescriptionUrl
osd Terradue.OpenSearch.Schema.OpenSearchDescription Osd.
type string Type.
return Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl

GetOpenSearchUrlByTypeAndMaxParam() public static method

public static GetOpenSearchUrlByTypeAndMaxParam ( OpenSearchDescription osd, List mimeTypes, NameValueCollection osParameters ) : OpenSearchDescriptionUrl
osd Terradue.OpenSearch.Schema.OpenSearchDescription
mimeTypes List
osParameters System.Collections.Specialized.NameValueCollection
return Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl

GetParamNameFromId() public static method

Gets the parameter name from identifier.
public static GetParamNameFromId ( NameValueCollection parameters, string id ) : string
parameters System.Collections.Specialized.NameValueCollection Parameters.
id string Identifier.
return string

LoadOpenSearchDescriptionDocument() public static method

Loads the OpenSearch description document.
public static LoadOpenSearchDescriptionDocument ( OpenSearchUrl url ) : OpenSearchDescription
url OpenSearchUrl URL.
return Terradue.OpenSearch.Schema.OpenSearchDescription

MergeOpenSearchParameters() public static method

Merges the open search parameters.
public static MergeOpenSearchParameters ( IOpenSearchable entities, string contentType ) : NameValueCollection
entities IOpenSearchable Entities.
contentType string Content type.
return System.Collections.Specialized.NameValueCollection

PaginationFreeEqual() public static method

Paginations the free equal.
public static PaginationFreeEqual ( NameValueCollection parameters, NameValueCollection parameters2 ) : bool
parameters System.Collections.Specialized.NameValueCollection Parameters.
parameters2 System.Collections.Specialized.NameValueCollection Parameters2.
return bool

RemoveLinksByRel() public static method

public static RemoveLinksByRel ( IOpenSearchResultCollection &results, string relType ) : void
results IOpenSearchResultCollection
relType string
return void

ReplaceOpenSearchDescriptionLinks() public static method

public static ReplaceOpenSearchDescriptionLinks ( IOpenSearchable entity, IOpenSearchResultCollection osr ) : void
entity IOpenSearchable
osr IOpenSearchResultCollection
return void

ReplaceSelfLinks() public static method

public static ReplaceSelfLinks ( IOpenSearchable entity, NameValueCollection parameters, IOpenSearchResultCollection osr, Func entryTemplate ) : void
entity IOpenSearchable
parameters System.Collections.Specialized.NameValueCollection
osr IOpenSearchResultCollection
entryTemplate Func
return void

ReplaceSelfLinks() public static method

public static ReplaceSelfLinks ( IOpenSearchable entity, NameValueCollection parameters, IOpenSearchResultCollection osr, Func entryTemplate, string contentType ) : void
entity IOpenSearchable
parameters System.Collections.Specialized.NameValueCollection
osr IOpenSearchResultCollection
entryTemplate Func
contentType string
return void

ReplaceSelfLinks() public static method

public static ReplaceSelfLinks ( IOpenSearchable entity, OpenSearchRequest request, IOpenSearchResultCollection osr, Func entryTemplate ) : void
entity IOpenSearchable
request Terradue.OpenSearch.Request.OpenSearchRequest
osr IOpenSearchResultCollection
entryTemplate Func
return void

ReplaceTemplateByIdentifier() public static method

public static ReplaceTemplateByIdentifier ( NameValueCollection osParameters, OpenSearchDescriptionUrl osdUrl ) : NameValueCollection
osParameters System.Collections.Specialized.NameValueCollection
osdUrl Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl
return System.Collections.Specialized.NameValueCollection

ResolveTypeFromRequest() public static method

public static ResolveTypeFromRequest ( HttpRequest request, OpenSearchEngine ose ) : Type
request System.Web.HttpRequest
ose Terradue.OpenSearch.Engine.OpenSearchEngine
return System.Type

ReverseTemplateOpenSearchParameters() public static method

Reverses the template open search parameters.
public static ReverseTemplateOpenSearchParameters ( NameValueCollection osdParam ) : NameValueCollection
osdParam System.Collections.Specialized.NameValueCollection Osd parameter.
return System.Collections.Specialized.NameValueCollection