This documentation relates to an earlier version of the SharePoint Connector.
View

Unknown macro: {spacejump}

or visit the current documentation home.

The Confluence SharePoint Connector provides a federated search, allowing SharePoint to issue search requests to Confluence and display the results it gets back from Confluence. Federated searches use Confluence's own search engine to retrieve up-to-date and relevant results. This guide is for SharePoint 2010

On this page:

要件

  • SharePoint Server 2010: Only SharePoint Server 2010 (Standard or Enterprise) supports federated search locations.  This functionality is not included in SharePoint Foundation 2010.
  • The Confluence OpenSearch plugin and SharePoint search configuration: Your Confluence installation must include the OpenSearch plugin and must be configured to share search results with SharePoint. Optionally, you can also configure Confluence to use the SharePoint Decorators theme. See the guide to installing the Confluence SharePoint plugins.

SharePoint Configuration

Step 1. Configure the Federated Search Location

  1. Log in to your SharePoint Central Administration site as a SharePoint farm administrator.
  2. Click 'Manage service applications' under the 'Application Management' heading.
  3. Click 'Search Service Application'.
  4. Click 'Federated Locations' under the 'Queries and Results' heading in the left-hand navigation panel.
  5. Click 'New Location'.
  6. Fill in the information for the new federated location, and then click 'OK'. Here are some guidelines on the mandatory fields:

Field Name

意味

Example Value

Location Name

The name of this location. We suggest 'Confluence'.

Confluence

表示名

The name of the location which will be displayed to users.

Development Confluence Wiki

説明

A description of this location.

 

Location Type

The type of search to perform. We need OpenSearch.

OpenSearch 1.0/1.1

Query Template

This is the URL which will be used to perform the actual search. This URL depends on the authentication used by Confluence:
* Standard (forms) authentication: http://<CONFLUENCE_SERVER>/plugins/servlet/opensearch?query={searchTerms}&format=rss_1.0&os_authType=basic
* NTLM: http://<CONFLUENCE_SERVER>/plugins/servlet/opensearch?query={searchTerms}&format=rss_1.0

http://confluence:8080/plugins/servlet/opensearch?query={searchTerms}&format=rss_1.0&os_authType=basic

"More Results" Link Template

The link which users will go to if they click the "More Results" link:
http://<CONFLUENCE_SERVER>/dosearchsite.action?queryString={userQuery}

http://confluence:8080/dosearchsite.action?queryString={userQuery}

Specify Credentials

This specifies how Sharepoint will send the credentials for the searching user to Confluence. Make sure that you set the credentials in the 'User' section, not the 'Common' section. The actual credentials depend on the authentication used by Confluence:
* Standard (forms) authentication: choose "Basic Authentication"
* NTLM: choose "NTLM Authentication"

If you use the Secure Store Service (see the corresponding configuration guide), select the Use SSS option and enter the name of the Confluence application in the Target Application ID field.

If you do not use the Secure Store Service, then leave the Use SSS option unselected.

 

Federated Search Results Display Metadata: XSL

This specifies how to display the results. This can optionally be changed using the example XML to use Confluence icons for Confluence search results.

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
               version="1.0" exclude-result-prefixes="xsl ddwrt msxsl srwrt"
               xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
               xmlns:srwrt="http://schemas.microsoft.com/WebParts/v3/searchresults/runtime"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
               xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom"
               xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
               xmlns:atom2="http://purl.org/atom/ns#">

    <xsl:param name="ResultsPerPage">3</xsl:param>
    <xsl:param name="IsDesignMode">True</xsl:param>
    <xsl:param name="UrlMaxLength">50</xsl:param>
    <xsl:param name="SummaryMaxLength">300</xsl:param>
    <xsl:param name="ShowMoreLink">true</xsl:param>
    <xsl:param name="MoreLink"></xsl:param>
    <xsl:param name="MoreLinkLabel"></xsl:param>
    <xsl:param name="IdPrefix"></xsl:param>
    <xsl:param name="WebpartTitle"></xsl:param>
    <xsl:param name="DefaultIconDescription"></xsl:param>
    <xsl:param name="BrandingIcon">/_layouts/images/blank.gif</xsl:param>
    <xsl:param name="IsFirstPage">true</xsl:param>

        <xsl:template match="rss">
            <xsl:call-template name="MainTemplate">
               <xsl:with-param name="Type" select="'rss'"/>
            </xsl:call-template>
        </xsl:template>
        <xsl:template match="rdf:RDF">
            <xsl:call-template name="MainTemplate">
               <xsl:with-param name="Type" select="'rdf'"/>
            </xsl:call-template>
        </xsl:template>
        <xsl:template match="atom:feed">
            <xsl:call-template name="MainTemplate">
               <xsl:with-param name="Type" select="'atom'"/>
            </xsl:call-template>
        </xsl:template>
        <xsl:template match="atom2:feed">
            <xsl:call-template name="MainTemplate">
               <xsl:with-param name="Type" select="'atom2'"/>
            </xsl:call-template>
        </xsl:template>
        <xsl:template name="GetLink" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
            <xsl:param name="Type"/>
            <xsl:choose>
                <xsl:when test="$Type = 'rss'">
                     <xsl:value-of select="link"/>
                </xsl:when>
                <xsl:when test="$Type = 'rdf'">
                     <xsl:value-of select="rss1:link"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom'">
                     <xsl:value-of select="atom:link/@href"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom2'">
                     <xsl:value-of select="atom2:link/@href"/>
                </xsl:when>
                <xsl:otherwise>
                     <xsl:value-of select="link"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <xsl:template name="GetTitle" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
            <xsl:param name="Type"/>
            <xsl:choose>
                <xsl:when test="$Type = 'rss'">
                     <xsl:value-of select="title"/>
                </xsl:when>
                <xsl:when test="$Type = 'rdf'">
                     <xsl:value-of select="rss1:title"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom'">
                     <xsl:value-of select="atom:title"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom2'">
                     <xsl:value-of select="atom2:title"/>
                </xsl:when>
                <xsl:otherwise>
                     <xsl:value-of select="title"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <xsl:template name="GetDescription" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
            <xsl:param name="Type"/>
            <xsl:choose>
                <xsl:when test="$Type = 'rss'">
                     <xsl:value-of select="description"/>
                </xsl:when>
                <xsl:when test="$Type = 'rdf'">
                     <xsl:value-of select="rss1:description"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom'">
                     <xsl:value-of select="atom:summary"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom2'">
                     <xsl:value-of select="atom2:summary"/>
                </xsl:when>
                <xsl:otherwise>
                     <xsl:value-of select="description"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <xsl:template name="GetItemIconDescription">
            <xsl:value-of select="$DefaultIconDescription"/>
        </xsl:template>

        <xsl:template name="GetItemIcon">
            <xsl:value-of select="string('/_layouts/images/Atlassian/confluence_favicon.png')" />
        </xsl:template>

        <xsl:template name="MainTemplate" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
            <xsl:param name="Type"/>
            <xsl:variable name="Rows" select="channel/item|rss1:item|atom:entry|atom2:entry" />
            <xsl:variable name="RowCount" select="count($Rows)"/>
            <xsl:variable name="ChannelTitle">
            <xsl:choose>
                <xsl:when test="$Type = 'rss'">
                     <xsl:value-of select="channel/title"/>
                </xsl:when>
                <xsl:when test="$Type = 'rdf'">
                     <xsl:value-of select="rss1:channel/rss1:title"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom'">
                     <xsl:value-of select="atom:title"/>
                </xsl:when>
                <xsl:when test="$Type = 'atom2'">
                     <xsl:value-of select="atom2:title"/>
                </xsl:when>
                <xsl:otherwise>
                     <xsl:value-of select="channel/title"/>
                </xsl:otherwise>
            </xsl:choose>
            </xsl:variable>
            <xsl:if test="($RowCount &gt; 0)">
               <div class="ms-searchsummarymain" >
                  <div class="ms-searchChannelTitle">
                        <span class="ms-searchChannelTitle">
                            <xsl:call-template name="GetBrandingImage" />
                            <xsl:value-of select="$ChannelTitle"/>
                        </span>
                  </div>
                  <xsl:call-template name="MainTemplate.body">
                    <xsl:with-param name="Rows" select="$Rows"/>
                    <xsl:with-param name="RowCount" select="count($Rows)"/>
                    <xsl:with-param name="ShowIcon" select="true()"/>
                    <xsl:with-param name="ShowUrl" select="true()"/>
                    <xsl:with-param name="StyleClassPrefix" select="string('ms-searchsummary')"/>
                    <xsl:with-param name="Type" select="$Type"/>
                  </xsl:call-template>
                  <xsl:call-template name="MoreLinkTemplate" >
                     <xsl:with-param name="StyleClassPrefix" select="string('ms-searchsummary')"/>
                  </xsl:call-template>
               </div>
            </xsl:if>
        </xsl:template>

        <xsl:template name="MainTemplate.body" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
            <xsl:param name="Rows"/>
            <xsl:param name="RowCount"/>
            <xsl:param name="ShowIcon"/>
            <xsl:param name="ShowUrl"/>
            <xsl:param name="StyleClassPrefix"/>
            <xsl:param name="Type"/>
            <xsl:variable name="BodyClass" select="concat($StyleClassPrefix,'body')" />
            <div class="{$BodyClass}">
              <xsl:for-each select="$Rows">
                <xsl:variable name="CurPosition" select="position()" />
                <xsl:variable name="CurrentId" select="concat($IdPrefix,$CurPosition)" />
                <xsl:variable name="link">
                   <xsl:call-template name="GetLink">
                      <xsl:with-param name="Type" select="$Type"/>
                   </xsl:call-template>
                </xsl:variable>
                <xsl:variable name="title">
                   <xsl:call-template name="GetTitle">
                      <xsl:with-param name="Type" select="$Type"/>
                   </xsl:call-template>
                </xsl:variable>
                <xsl:if test="($CurPosition &lt;= $ResultsPerPage)">
                   <xsl:variable name="TitleClass" select="concat($StyleClassPrefix,'Title')" />
                    <div class="{$TitleClass}" >
                      <xsl:variable name="SafeHtml">
                        <xsl:call-template name="GetSafeHtml">
                            <xsl:with-param name="Html" select="$title"/>
                        </xsl:call-template>
                      </xsl:variable>
                      <a id="{$CurrentId}" class="{$TitleClass}" href="{ddwrt:EnsureAllowedProtocol(string($link))}" >
                         <xsl:if test="$ShowIcon = true()">
                            <xsl:variable name="itemIconUrl">
                               <xsl:call-template name="GetItemIcon" />
                            </xsl:variable>
                            <xsl:variable name="itemIconDescription">
                               <xsl:call-template name="GetItemIconDescription" />
                            </xsl:variable>
                            <img src="{$itemIconUrl}" alt="{$itemIconDescription}"/>
                         </xsl:if>
                         <xsl:value-of select="$SafeHtml" disable-output-escaping="yes"/>
                      </a>
                    </div>
                    <xsl:call-template name="MainTemplate.description">
                       <xsl:with-param name="CurrentId" select="$CurrentId"/>
                       <xsl:with-param name="Link" select="$link"/>
                       <xsl:with-param name="ShowUrl" select="$ShowUrl"/>
                       <xsl:with-param name="StyleClassPrefix" select="$StyleClassPrefix"/>
                       <xsl:with-param name="Type" select="$Type"/>
                    </xsl:call-template>
                </xsl:if>
              </xsl:for-each>
            </div>
        </xsl:template>
	    <xsl:template name="MainTemplate.description" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
            <xsl:param name="CurrentId"/>
            <xsl:param name="Link"/>
            <xsl:param name="ShowUrl"/>
            <xsl:param name="StyleClassPrefix"/>
            <xsl:param name="Type"/>

            <xsl:variable name="DivId" select="concat($CurrentId,'_d')" />
            <xsl:variable name="LinkId" select="concat($CurrentId,'_l')" />
            <xsl:variable name="DescOuterClass" select="concat($StyleClassPrefix,'descouter')" />
                <div id="{$DivId}" class="{$DescOuterClass}">
                <xsl:variable name="description">
                   <xsl:call-template name="GetDescription">
                      <xsl:with-param name="Type" select="$Type"/>
                   </xsl:call-template>
                </xsl:variable>
                <xsl:if test="string-length($description) &gt; 0">
                    <xsl:variable name="DescLongText">
                        <xsl:call-template name="GetPlainTextFromHtml">
                            <xsl:with-param name="Html" select="$description"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="DescText">
                       <xsl:call-template name="TrimIfGreaterThanMax">
                          <xsl:with-param name="Source" select="$DescLongText"/>
                          <xsl:with-param name="MaxLength" select="$SummaryMaxLength"/>
                       </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="DescClass" select="concat($StyleClassPrefix,'desc')" />
                    <div class = "{$DescClass}">
                     <xsl:value-of select="$DescText"/>
                    </div>
                    <xsl:if test="$ShowUrl = true()">
                       <xsl:variable name="UrlClass" select="concat($StyleClassPrefix,'Url')" />
		               <div class="{$UrlClass}">
                       <xsl:variable name="ShortLink">
                          <xsl:call-template name="TrimIfGreaterThanMax">
                             <xsl:with-param name="Source" select="$Link"/>
                             <xsl:with-param name="MaxLength" select="$UrlMaxLength"/>
                          </xsl:call-template>
                       </xsl:variable>
                       <a id="{LinkId}" href="{ddwrt:EnsureAllowedProtocol(string($Link))}"><xsl:value-of select="$ShortLink"/></a>
                       </div>
                    </xsl:if>
                </xsl:if>
                <xsl:if test="string-length($description) &lt; 1">
                      <img src="/_layouts/images/blank.gif" width="0" height="0" />
                </xsl:if>
                </div>
        </xsl:template>
        <xsl:template name="MoreLinkTemplate">
          <xsl:param name="StyleClassPrefix"/>
          <xsl:variable name="MoreLinkClass" select="concat($StyleClassPrefix,'morelink')" />
          <xsl:if test="$ShowMoreLink = true() and string-length($MoreLink) &gt; 0">
             <div class="{$MoreLinkClass}">
                <a href="{ddwrt:EnsureAllowedProtocol(string($MoreLink))}">
                   <xsl:value-of select="$MoreLinkLabel"/>
                </a>
             </div>
          </xsl:if>
        </xsl:template>
        <xsl:template name="GetSafeHtml">
          <xsl:param name="Html"/>
            <xsl:choose>
                <xsl:when test="$IsDesignMode = 'True'">
                     <xsl:value-of select="$Html"/>
                </xsl:when>
                <xsl:otherwise>
                     <xsl:value-of select="srwrt:MakeSafe($Html)"/>
                </xsl:otherwise>
            </xsl:choose>
         </xsl:template>
        <xsl:template name="GetPlainTextFromHtml">
          <xsl:param name="Html"/>
            <xsl:choose>
                <xsl:when test="$IsDesignMode = 'True'">
                     <xsl:value-of select="$Html"/>
                </xsl:when>
                <xsl:otherwise>
                     <xsl:value-of select="srwrt:GetPlainTextFromHtml($Html)"/>
                </xsl:otherwise>
            </xsl:choose>
         </xsl:template>
        <xsl:template name="TrimIfGreaterThanMax">
          <xsl:param name="Source"/>
          <xsl:param name="MaxLength"/>
          <xsl:choose>
            <xsl:when test="string-length($Source) &gt; $MaxLength">
              <xsl:value-of select="substring($Source, 1, $MaxLength)"/>...
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="$Source"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:template>

        <xsl:template name="GetBrandingImage">
          <xsl:if test="string-length($BrandingIcon) &gt; 0">
             <img src="{$BrandingIcon}"/>
          </xsl:if>
        </xsl:template>


</xsl:stylesheet>

Step 2. Add Web Part to Search Results

(info) Note that you cannot edit the default search page, you need to create a new search site and alter the site settings so that this site is used for searching.  

  1. Go to your SharePoint Search Site and execute a search, which will take you to the search results screen.
  2. Click 'Site Actions', then 'Edit Page':
  3. Click 'Add a Web Part'. You can add the web part anywhere on the page. This is where the Confluence results will appear:
  4. The 'Add Web Parts' screen appears. Select the web part:
    • With SSS: If you are using the Secure Store Service and selected 'Use SSS' when setting up the federated location, then select 'Federated Results'.
    • Without SSS: If you are not using the Secure Store Service and did not select 'Use SSS' when setting up the federated location, then select 'Confluence Federated Search Results WebPart'.
  5. 追加」ボタンをクリックします。
  6. Open the 'Edit' menu for the web part which you have just added and select 'Edit Web Part'.
  7. The panel at the side opens up. Select 'Confluence' (or whatever you named the federated location) from the dropdown menu:
  8. Click 'OK', then 'Stop Editing'. Setup is complete.

トラブルシューティング

Please refer to our knowledge base, in particular the following:

関連トピック

Installing and Configuring the SharePoint Feature on SP 2010
Installing the SharePoint Connector

  • ラベルなし