Share via


Web Parts and SharePoint Portal Server

Microsoft® Office SharePoint™ Portal Server 2003 is a server application built on the Microsoft Windows® SharePoint Services platform that provides a superset of Windows SharePoint Services functions. SharePoint Portal Server 2003 has a number of advantages for team Web sites. For example, you can consolidate multiple Windows SharePoint Services sites into one portal, aggregate information from all parts of your organization, use powerful full-text search functions across the sites, and use management and collaboration tools that save time and have greater capabilities than those in Windows SharePoint Services.

Microsoft Office Project Server 2003 includes an option to connect with SharePoint Portal Server, but the standard Project Server Web Parts require modification of the Web Part description files (.dwp files) before they will work with SharePoint Portal Server. This is a simple change in the script that gets the URL of the Project Server virtual directory. You could get the Project Server URL in several ways in addition to using the existing script in the .dwp files. The example in this topic uses the first (and easiest) method; other possible methods are listed here for reference only.

  • Replace the script with the hard-coded URL. This is the easiest method, and is shown in the example in this topic. This method works well if there is only one Project Server in your organization.
  • Embed the URL in a Windows SharePoint Services template and use a script in the .dwp file to extract it.
  • Set up a Web site with one page that returns the URL. When you call the page, it would return the current location of the Project Server.
  • Create an XML Web service that returns a Project Server URL. This would be the most flexible method, and could be developed to return other data. For example, you might return different versions of Web Parts that have built-in SimpleUI values based on some input you provide.

Note  Another option is to bypass the standard Project Server Web Parts entirely and install a custom .NET assembly on the computer that is running SharePoint Portal Server. For more information, see Installing and Using the Custom Web Parts .NET Assembly.

Following are the steps to get the Project Server Web Parts working with SharePoint Portal Server.

  • Connect Project Server with SharePoint Portal Server.
  • Modify the .dwp files.
  • Import the modified Web Parts.

After you create and import the Web Parts for SharePoint Portal Server, you can create shared Web Part Pages just as you do for Windows SharePoint Services. For more information, see the topic Web Parts Pages and Windows SharePoint Services.

To connect Project Server with SharePoint Portal Server:

You can choose to connect to SharePoint Portal Server when you install Project Server. If you did not make the connection at that time, you can do it now by using the following procedure (you need Administrator permission for both Project Server and SharePoint Portal Server).

If you plan to have more than one project team site, you should have a top-level site on the SharePoint Portal Server that you link to Project Server. You can then create multiple Project Server team subsites below the top-level site, and import Project Server Web Parts and Web Part Pages that you can easily share with all of the Project Server sites. You can also create Web Parts and Web Part Pages that are specific to each subsite. The following procedure assumes that you have already created a top-level site on the SharePoint Portal Server that will be connected with Project Server, for example http://PortalServer/sites/Projects. For more information, see the topic "Creating Sites and Subsites" in the Microsoft Office SharePoint Portal Server 2003 Administrator's Guide.

  1. On the Project Web Access menu bar, click Admin, and then in the Options pane click Connect to SharePoint Portal Server. You can also do this step to check if a connection has already been made.

  2. On the Connect to SharePoint Portal Site page, click Connect to portal site, and then type in the Portal Web Address and a Portal Name. For example, the top-level site http://PortalServer/sites/Projects could have the name Project Server Connection.

  3. Click Save Changes. You will see the following message:

    Project Server is updating the site properties for all project sites on the server running Windows SharePoint Services. Please wait...

    Please wait for the validation to finish. Don't close the browser or click away from this page.

Project Server is now connected with SharePoint Portal Server.

To modify the .dwp files:

Following are the six Project Server Web Part description files and a summary of their functions:

  • ANALYZE.DWP creates the Project Portfolio Analyzer Web Part to access all of the PivotChart® and PivotTable® views of online analytical processing (OLAP) data.
  • ASSIGN.DWP creates the Project Resource Assignments Web Part.
  • PORTVIEW.DWP creates the Project Center Web Part for the project portfolio grid view.
  • PROJECTS.DWP creates the Project Report Web Part for drill-down into specific project data.
  • TASKS.DWP creates the Project Timesheet Web Part to allow team members to view and edit timesheet data.
  • UPDATES.DWP creates the Project Manager Updates Web Part for project managers to accept or reject timesheet changes.

The .dwp files are installed in the following directory:

[Program Files]\Common Files\Microsoft Shared\web server extensions
    \60\TEMPLATE\1033\PWA\LISTS\WPLIB\DWP

The following procedure shows an example of how to use the PORTVIEW.DWP file.

  1. Copy each of the six Project Server Web Part .dwp files to different file names before you make any changes. For example, copy PORTVIEW.DWP to PORTVIEW_new.DWP. You can use any text editor, such as Notepad, to edit the copied files. The following code in step 1 is the original XML of PORTVIEW.DWP. You will mainly be concerned with the <Title>, <Description>, and <Assembly> tags, and the script section (shown in bold in the following code).

    <?xml version="1.0" encoding="utf-8" ?>
    <!-- _lcid="1033" _version="11.0.5329" _dal="1" -->
    <!-- _LocalBinding -->
    
    <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns="http://schemas.microsoft.com/WebPart/v2">
      <Title>Project Center</Title>
      <FrameType>Default</FrameType>
      <Description>Project Center</Description>
      <PartImageLarge>/_layouts/images/pswebprt.gif</PartImageLarge>
      <FrameState>Normal</FrameState>
      <AllowRemove>true</AllowRemove>
      <AllowZoneChange>true</AllowZoneChange>
      <AllowMinimize>true</AllowMinimize>
      <IsVisible>true</IsVisible>
      <Assembly>Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>  
      <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
      <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
      <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[
        <script language="JScript">
           var sLoc = window.location.toString();
           if(typeof(L_Menu_BaseUrl) == 'undefined')
             var sPostUrl = sLoc.substr(0, sLoc.lastIndexOf('/')) + "/_layouts/pwainc/getprop.aspx";
           else
             var sPostUrl = L_Menu_BaseUrl + "/_layouts/pwainc/getprop.aspx";
    
           var sRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
           sRequest += "<XMLFormData>";
           sRequest += "  <READONLY>1</READONLY>";
           sRequest += "</XMLFormData>";
    
           var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
           xmlhttp.open("POST", sPostUrl, false);
           xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
           xmlhttp.send(sRequest);
    
           var sResult = xmlhttp.responseXML;
           if(sResult.childNodes.length > 0)
           {
              var sMSPWAURL = sResult.selectSingleNode("//PWAURL").text;
              var sMSPROJID = sResult.selectSingleNode("//PWAPROJID").text;
    
              document.write("<iframe src=\"" + sMSPWAURL + "Views/PortfolioView.asp?SimpleUI=125\" 
                             width=100% height=100%></iframe>");
           }
        </script>
       ]]></Content>
      <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    </WebPart>
    
  2. Edit the Microsoft JScript® section of the file to hard-code the URL of your virtual Project Server default page. You should also change the Title element, and change the Description element if you want, and then replace the JScript code as shown in the following XML code. In the example, http://ProjectServerName/sample/ is the URL of the Project Server sample database virtual directory. The ending slash (/) is necessary to get the correct value when the script concatenates the strings.

    Important  The Assembly element must remain as a single line, and must exactly match the Assembly line in the .dwp files in your Project Server installation. Otherwise, Windows SharePoint Services will not recognize the assembly signature as safe, and will not import or display the Web Part.

    <?xml version="1.0" encoding="utf-8" ?>
    <!-- _lcid="1033" _version="11.0.5329" _dal="1" -->
    <!-- _LocalBinding -->
    
    <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns="http://schemas.microsoft.com/WebPart/v2">
      <Title>Project Center - New</Title>
      <FrameType>Default</FrameType>
      <Description>Project Center with hardwired virtual directory</Description>
      <PartImageLarge>/_layouts/images/pswebprt.gif</PartImageLarge>
      <FrameState>Normal</FrameState>
      <AllowRemove>true</AllowRemove>
      <AllowZoneChange>true</AllowZoneChange>
      <AllowMinimize>true</AllowMinimize>
      <IsVisible>true</IsVisible>
      <Assembly>Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
      <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
      <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
      <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[
        <script language="JScript">
           var sMSPWAURL = "http://ProjectServerName/sample/"
           document.write("<iframe src=\"" + sMSPWAURL + "Views/PortfolioView.asp?SimpleUI=125\" width=100% height=100%></iframe>");
        </script>
       ]]></Content>
      <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    </WebPart>
    

    Note  The line that starts with document.write must remain as one line. Be sure that you make no changes to the Assembly line in your .dwp files; it may contain different values than the example shown here.

  3. You can add other URL options, or a different SimpleUI option, if you want. For example, to show the full Project Web Access page with all of the UI elements, set SimpleUI=0. For more information, see URL Options: Modifying the Query String Parameters.

To import the modified Web Parts:

You can import Web Parts for each team subsite, or share them globally for all project subsites. The following example shows how to share them globally.

  1. In your browser, open the Home page of your top-level project site on SharePoint Portal Server. For example, the URL might be:

    http://PortalServer/sites/projects/default.aspx
    
  2. Click Site Settings in the menu bar, and then click Go to Site Administration.

  3. On the Top-level Site Administration page, click Manage Web Part gallery in the Site Collection Galleries section.

  4. On the Web Part Gallery page, click Upload Web Part.

  5. Click Browse and select the modified Web Part you want to import. Select a group or type in a group name if you want, and then click Save and Close.

Your modified Project Server Web Part is now available to build Web Part Page documents that you can share with your project teams. The topic Web Parts and Windows SharePoint Services shows how to create shared Web Part Pages.

Note  To remove a Web Part on the Web Part Gallery page, click the Edit icon for the Web Part, and then click Delete.