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
catalogInfo
Type: Microsoft.SharePoint.Publishing.CatalogConnectionSettingsThe connection settings to be added. This should include the CatalogUrl property, the CatalogId property, and the CatalogSiteUrl property, which are returned by the GetPublishingCatalog() method. This parameter should not be a null reference (Nothing in Visual Basic).
catalogItemUrlRewriteTemplate
Type: System.StringURL 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.StringThe 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.StringThe search managed property name of the taxonomy field that contains category information for catalog items.
isCustomCatalogItemUrlRewriteTemplate
Type: System.BooleanIndicates whether the URL rewrite template is based on structured navigation. This parameter sets the IsManualCatalogItemUrlRewriteTemplate property.
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