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. These instructions apply to the connector for SharePoint 2007.

On this page:

要件

  • Microsoft Office SharePoint Server (WSS is not enough): Only Microsoft Office SharePoint Server ('MOSS') supports the new federated search. Plain Windows SharePoint Services ('WSS') does not support federated search.

    The federated search feature in SharePoint Connector 1.1 and later relies on new functionality in SharePoint. At least one of the following updates to SharePoint must be installed on your MOSS Server(s):
  • The Confluence OpenSearch plugin and MOSS search configuration: Your Confluence installation must include the OpenSearch plugin and must be configured to share search results with MOSS. 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. Go the SharePoint central administration section and select the shared services for which to add the federated search:


  2. Choose 'Search Administration':


  3. Choose 'Federated Locations'. Note that this will only be present if the infrastructure update has been installed:


  4. Add a federated location:


  5. Enter the information for the federated location. 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 (

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 Microsoft SSO, check "Use SSO" and select the Confluence SSO application, if you do not use Microsoft SSO then leave it unchecked.

 

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

  1. Go to the main Sharepoint site and go 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 SSO: If you are using SSO and checked 'Use SSO' when setting up the federated location, then select 'Federated Results'.
    • Without SSO: If you are not using SSO and did not check 'Use SSO' when setting up the federated location, then select 'Confluence Federated Search Results WebPart'.

  5. Click the 'Add' button.

  6. Open the 'Edit' menu for the web part which you have just added and select 'Modify Shared 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 'Exit Edit Mode'. Setup is complete.
関連トピック

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