Share via


CatalogConnectionManager.AddCatalogConnection method (CatalogConnectionSettings, String, String, String, Boolean)

Adds a catalog connection to the site that is specified in the constructor.

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Sub AddCatalogConnection ( _
    catalogInfo As CatalogConnectionSettings, _
    catalogItemUrlRewriteTemplate As String, _
    webServerRelativeUrl As String, _
    catalogTaxonomyManagedProperty As String, _
    isCustomCatalogItemUrlRewriteTemplate As Boolean _
)
'Usage
Dim instance As CatalogConnectionManager
Dim catalogInfo As CatalogConnectionSettings
Dim catalogItemUrlRewriteTemplate As String
Dim webServerRelativeUrl As String
Dim catalogTaxonomyManagedProperty As String
Dim isCustomCatalogItemUrlRewriteTemplate As Boolean

instance.AddCatalogConnection(catalogInfo, _
    catalogItemUrlRewriteTemplate, _
    webServerRelativeUrl, catalogTaxonomyManagedProperty, _
    isCustomCatalogItemUrlRewriteTemplate)
public void AddCatalogConnection(
    CatalogConnectionSettings catalogInfo,
    string catalogItemUrlRewriteTemplate,
    string webServerRelativeUrl,
    string catalogTaxonomyManagedProperty,
    bool isCustomCatalogItemUrlRewriteTemplate
)

Parameters

  • catalogItemUrlRewriteTemplate
    Type: System.String

    URL rewrite template to use to generate friendly URLs for items in this catalog. Any search managed property that is enclosed in "[", "]" are replaced dynamically. If isCustomCatalogItemUrlRewriteTemplate=true, then the template can be a web-relative page URL that can render different items based on a dynamic query parameter.

  • webServerRelativeUrl
    Type: System.String

    The server-relative URL of the web connecting to this catalog. If item URLs are rewritten by using managed navigation friendly URLs, the managed navigation settings for this SPWeb object will be used.

  • catalogTaxonomyManagedProperty
    Type: System.String

    The search managed property name of the taxonomy field that contains category information for catalog items.

Remarks

Use the GetPublishingCatalog() method to get catalog information.

The connection is added to store when an Update method is called.

Throws anArgumentNullException if the catalogInfo parameter is a null reference (Nothing in Visual Basic). URL rewrite is enabled only if non-empty values for the orderedPropertiesForUrlRewrite parameter, the webUrl parameter, and the catalogTaxonomyManagedProperty parameter are passed in.

See also

Reference

CatalogConnectionManager class

CatalogConnectionManager members

AddCatalogConnection overload

Microsoft.SharePoint.Publishing namespace

Microsoft.SharePoint.Publishing.CatalogConnectionSettings