Extending the Project Workspace Template

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

By default, Microsoft Office Project Professional 2007 creates a project workspace site on Windows SharePoint Services 3.0 when it publishes a project. The project workspace template that is used for site creation can be extended and customized to better suit the needs of your organization. This article explains what makes a valid project workspace template, how to create an extended template, and how to install a custom template. (The code samples and procedures in this article were contributed by Eric Zenz, Microsoft Corporation.)

For an introduction to Project Server integration with Windows SharePoint Services, see Windows SharePoint Services Infrastructure for Project Server. For more sample code that addresses project workspaces, see How to: Create a Project Workspace and Link it to a Project.

Project Workspace Site Features

A valid project workspace is a Windows SharePoint Services site that includes the project workspace collaboration lists. Data in project workspaces, such as documents and list data, is saved in the related Windows SharePoint Services content database. A project workspace site includes the following specialized lists for team collaboration:

  • Project Documents

  • Project Issues

  • Project Risks

  • Project Deliverables

You can open a project workspace site from the home page or from the Project Center page in Project Web Access. On the Project Center page, select a project row and then click Project Workspace on the Go To drop-down menu. The Documents link in Quick Launch (Figure 1) goes to a page that contains a specialized list for project documents.

The Deliverables, Issues, and Risks folders in Figure 1 contain specialized lists that are specifically designed for project team collaboration. The other default lists in the All Site Content page (Announcements, Calendar, Links, and Tasks) are generic lists that are available in all Windows SharePoint Services sites.

Figure 1. The Lists page of a project workspace

The Lists page of a project workspace

The specialized lists for project workspaces include information that you can add as new columns in the list. For example, Figure 2 shows the extended columns available for the Issues list. Some of the extended columns include project-specific data.

Figure 2. Adding columns in the Issues list

Adding columns in the Issues list

You can link any site within a Windows SharePoint Services farm to a project plan, or extend the site with a custom project workspace template, if the site meets the following conditions:

  • The site is associated with a Shared Services Provider (SSP).

  • The SSP includes a Project Server Application Service instance.

If you are in the Site Collection Administrators group of Windows SharePoint Services, you can use the Central Administration page to determine whether the site qualifies.

Procedure 1: To determine whether a SharePoint site can use a project workspace template:

  1. Open the Central Administration page for Windows SharePoint Services, using one of the following methods:

    1. If you are logged on the Windows SharePoint Services server, on the Windows Start menu, click Microsoft Office Server. Then, on the All Programs menu, click SharePoint 3.0 Central Administration.

    2. If you know the URL, access the Central Administration page remotely. For example, if the server port of the Windows SharePoint Services Central Administration site in Internet Information Services (IIS) Manager is 18294, use the URL http://ServerName:18294/default.aspx.

  2. Click Application Management. On the Application Management page, click Create or Configure this Farm's Shared Services.

    If the SharePoint farm has an SSP, it is in the list on the Manage this Farm's Shared Services page. For example, if there is a site named SharedServices1, all of the Web sites that are associated with that SSP are listed under SharedServices1.

  3. To see if a Project Server Application Service is running for that SSP, click Operations on the page menu or in Quick Launch.

  4. In the Topology and Services section of the Operations page, click Servers in farm.

  5. The Servers in Farm page shows the services that are running on each server in the SharePoint farm. Determine whether the Project Application Service is running on the server that has the SSP Web site. If so, it can use a project workspace template.

Creating a Project Workspace Template

A good way to create a new project workspace template is to start with the Site Actions menu in the SharePoint 3.0 Central Administration application to create a clean Web site that you provision with the default project workspace template. You could also create a new project workspace site collection using the Application Management page, but it is not necessary to create an entire site collection just to get a new workspace template.

NoteNote

Do not use an existing project workspace site as the basis for a template Because the template is already linked to a project, you will get an error when trying to provision a new site for any other project.

Procedure 2: To create an empty new project workspace:

  1. In the SharePoint 3.0 Central Administration application, click the Site Actions menu on the upper right of any page, and then click Create.

  2. On the Create page, click Sites and Workspaces in the Web Pages section.

  3. On the New SharePoint Site page, select the Microsoft Office Project Workspace template, and fill in the site title, description, and URL name. For example, the site title could be Sample Workspace Template and the URL name could be http://ServerName:20977/SampleWorkspace.

  4. Click Use unique permissions, and then click No in both the Navigation and Navigation Inheritance sections.

  5. Click Create. SharePoint creates the site and then shows the Set Up Groups for this Site page. Because the site is going to be a template, you can use the existing Farm Administrators group for the Visitors, Members, and Owners sections.

You can extend the new project workspace template using an application such as Microsoft Office SharePoint Designer 2007, or modify the standard Windows SharePoint Services pages by adding custom Web Parts.

Project workspace site extensions include, but are not limited to, the following:

  • Adding standard Windows SharePoint Services lists.

  • Adding custom lists.

  • Adding sample data.

  • Adding columns to lists.

  • Adding views.

  • Adding Web Parts to the home page of the site.

  • Customizing the look and feel of the site.

Adding and customizing Web Parts are easy and flexible ways to extend a workspace home page. For information about how to add Project Server and custom Web Parts to pages, see Project Server Web Parts. For more information about customizing sites, lists, Web Parts, and other features of Windows SharePoint Services, see the How Do I… in Windows SharePoint Services 3.0 overview article in the Windows SharePoint Services 3.0 SDK.

For one way to change the look and feel of the site, click Site Settings on the Site Actions menu. Experiment with the options in the Look and Feel section on the Site Settings page. For example, change the site theme.

You could also create a new image to use in the right zone of the page. For example, copy HOMEPAGE.GIF in the [Program Files]\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES directory to a new file named homepage_workspace.gif. Click Edit Page on the Site Actions menu, click Edit in the Site Image Web Part, and then change the relative path or URL to the new image. For example, change /_layouts/images/homepage.gif to /_layouts/images/homepage_workspace.gif.

After you modify the workspace site, you can create a site template (.stp) file.

Procedure 3: To create a project workspace site template:

  1. Navigate to the project workspace site you want for the template source. For example, if the site name you created in Procedure 2 is Sample Workspace Template, use the workspace home page URL such as http://ServerName:20977/SampleWorkspace/default.aspx.

    Use one of the two following steps to save the workspace as a template:

    1. On the Site Actions menu, click Site Settings. On the Site Settings page, in Look and Feel, click Save site as a template.

    2. Type the URL of the Save Site as Template page. For the Sample Workspace Template example, type the following in the Address bar of Internet Explorer:

      http://ServerName:20977/SampleWorkspace/_layouts/savetmpl.aspx.

  2. On the Save Site as Template page, type a file name, title, and description for the template, and then choose whether to include content. For example, save the template file as MyWorkspaceTemplate.stp, with the template name My Project Workspace.

  3. If you included custom workflows, lists with content, or documents in the site, check Include Content.

  4. Click OK

  5. On the Operation Completed Successfully page, click Site template gallery.

  6. Right-click the name of the new template in the Site Template Gallery list, and then click Save Target As to save the template .stp file.

NoteNote

To fully administer a site, you need Administrator permission in Windows SharePoint Services. To determine if you have permission, see the list of site collection administrators and advanced permissions on the Site Settings pages of the workspace site and the SSP administration site.

Registering a Template

After you create a project workspace template, you must promote it to global status before Project Server allows it to be used for Project Workspace provisioning.

Procedure 4: To promote a project workspace template to global status:

  1. Log on to any one of the servers in the farm that hosts Project Web Access.

  2. Open a Command Prompt window and navigate to the drive where Project Server is installed. For example, type the following command.

    cd %ProgramFiles%"\Common Files\Microsoft Shared\web server extensions\12\BIN"
    
  3. Run the command to add the template to the global list of templates, as shown in the following example.

    stsadm -o addtemplate -filename "<template path>\MyWorkspaceTemplate.stp" -title "Test Workspace Title"
    
  4. Run the command IISReset. Your new template is now registered for global use within Web applications associated with the SSP that contains the instance of Project Web Access.

  5. To see the list of registered templates, run the command stsadm -o enumtemplates. For the example template, the command outputs the following.

    Test Workspace Title - Language: 1033 - Site Template: _GLOBAL_#0 - Template Id: 6215

The site template title is the name that appears in the Default Project Workspace template list on the Project Workspace Provisioning Settings page in Project Web Access.

Changing the Default Template

After you register a template for global use, you can select it as the default template that Project Server uses to create workspace sites when projects are published.

Procedure 5: To select the default workspace template in Project Web Access:

  1. On the home page of Project Web Access, click Server Settings.

  2. In Operational Policies, click Project Workspace Provisioning Settings.

  3. In the Default Project Workspace template list on the Project Workspace Provisioning Settings page, select the project workspace template you created. For example, select Test Workspace Title.

  4. Click Save.

You can also change the site settings for a workspace template programmatically using the Project Server Interface (PSI). The example code shows how to change settings that are on the Project Workspace Provisioning Settings page. You can change the following settings:

  • Site URL

  • Default workspace template

  • Default workspace properties

  • Automatic provisioning

  • Workspace permissions

The WssInterop PSI Web service includes the WssInterop class and the DataSet classes for managing project workspace settings. You can create a simple test application using Microsoft Visual Studio 2005 that shows how to get and set workspace provisioning settings. The following example uses Microsoft Visual C#.

Procedure 6: To create and test an application that uses the WssInterop Web service:

  1. Create a workspace site template using the previous procedures, but do not change the template in Project Web Access. For example, create and register a template with the ID _GLOBAL_#1.

  2. Create a project using the Visual C# Empty Project template. Name the project, for example, WorkspaceProperties.

  3. Add a class to the WorkspaceProperties project. For example, add Program.cs. Adding a class also adds the System, System.Data, and System.Xml references and the following code in Program.cs.

    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace WorkspaceProperties
    {
        class Program
        {
            /* Test code goes here */
        }
    }
    
  4. In Solution Explorer, add a reference to System.Windows.Forms. Add another reference to Microsoft.Office.Project.Server.Library: browse to [Program Files]\Microsoft Office Servers\12.0\Bin\Microsoft.Office.Project.Server.Library.dll.

  5. Add the following statements in Program.cs.

    using System.Windows.Forms;
    using System.Net;
    using System.Data;
    using System.Web.Services.Protocols;
        // Add for SoapException error handler:
    using System.Web.Services.Protocols;
    using PSLibrary = Microsoft.Office.Project.Server.Library;
    
  6. In Solution Explorer, add the following Web references and name them WebSvcLoginWindows and WebSvcWssInterop.

    http://[ServerName]/[ProjectServerName]/_vti_bin/psi/LoginWindows.asmx 
    http://[ServerName]/[ProjectServerName]/_vti_bin/psi/WssInterop.asmx 
    

    For more information about the virtual path for PSI Web services, see Finding the PSI Web Services.

  7. For the test application, there is only the Main method. Add the following constants, method, and method variables initialization within the Program class definition. The loginWindows and wssInterop objects instantiate the LoginWindows and WssInterop classes.

                  // Name of server where Project Web Access is installed
    private const string SERVERNAME = "ServerName";
                  // Name of Project Web Access instance
    private const string PWANAME = "ProjectServer";  
    
    static void Main(string[] args)
    {
        Guid wssWebAppID = new Guid();
        string wssWebAppURL = string.Empty;
        string siteTemplate = string.Empty;
        string siteCollection = string.Empty;
        int templateLCID;
        byte defaultAutoCreateSubwebs;
        byte defaultAutoSyncUsers;
    
        string psiBaseUrl = "http://" + SERVERNAME + "/" + PWANAME + 
            "/_vti_bin/psi/";
    
        WebSvcLoginWindows.LoginWindows loginWindows =
            new WorkspaceProperties.WebSvcLoginWindows.LoginWindows();
        WebSvcWssInterop.WssInterop wssInterop =
            new WorkspaceProperties.WebSvcWssInterop.WssInterop();}
    
  8. Add the framework for log on and log off. In this simple case, show success or failure with a message box. For more information about the properties required to use PSI Web service objects, see How to: Log on to Project Server Programmatically.

        CookieContainer cookies = new CookieContainer();
    
        // Set properties of Web service objects
        loginWindows.Url = psiBaseUrl + "loginwindows.asmx";
        loginWindows.Credentials = CredentialCache.DefaultCredentials;
        loginWindows.CookieContainer = cookies;
    
        wssInterop.Url = psiBaseUrl + "wssinterop.asmx";
        wssInterop.Credentials = CredentialCache.DefaultCredentials;
        wssInterop.CookieContainer = cookies;
    
        // Log on Project Web Access 
        if (loginWindows.Login())
        {
            MessageBox.Show("Logon succeeded", SERVERNAME,
                MessageBoxButtons.OK, MessageBoxIcon.Information);
    
            /* Remainder of test code goes here */
    
            loginWindows.Logoff();
        }
        else
        {
            MessageBox.Show("Logon failed", SERVERNAME,
                MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    
  9. The remainder of the test code is in two parts: (a) getting and displaying provisioning information; and (b) setting workspace provisioning information.

    1. Add the test code for getting and displaying provisioning information.

      #region Get workspace provisioning information
      // Get the current DataSet for workspace provisioning settings 
      WebSvcWssInterop.WssSettingsDataSet dsCurrentWssInfo =
          wssInterop.ReadWssSettings();
      WebSvcWssInterop.WssSettingsDataSet.WssAdminRow adminRow =
          dsCurrentWssInfo.WssAdmin[0];
      
      // Get the default Web application GUID for project workspace provisioning
      wssWebAppID = dsCurrentWssInfo.WssAdmin[0].WADMIN_CURRENT_STS_SERVER_UID;
      
      // Iterate through all Web applications known to Project Server, 
      // and get the URL for the application with ID = defaultWssWebAppID
      WebSvcWssInterop.WssServersDataSet dsWssServerInfoDataSet =
          wssInterop.ReadWssServerInfo();
      
      foreach (WebSvcWssInterop.WssServersDataSet.WssServersRow rowServer
          in dsWssServerInfoDataSet.WssServers)
      {
          if (rowServer.WSTS_SERVER_UID == wssWebAppID)
          {
              wssWebAppURL = rowServer.WSS_SERVER_URL;
          }
      }
      // Get the default site path for project workspace provisioning 
      siteCollection = dsCurrentWssInfo.WssAdmin[0].WADMIN_DEFAULT_SITE_COLLECTION;
      
      // Get the current project workspace language
      templateLCID = dsCurrentWssInfo.WssAdmin[0].WADMIN_STS_TEMPLATE_LCID;
      
      // Get the current project workspace template ID
      siteTemplate = dsCurrentWssInfo.WssAdmin[0].WADMIN_STS_TEMPLATE_ID;
      
      // Get the workspace provisioning mode (automatic = 1, manual=0)
      autoCreateSubwebs = dsCurrentWssInfo.WssAdmin[0].WADMIN_AUTO_CREATE_SUBWEBS;
      
      // Determine whether user synchronization is automatic (1) or 
      // manual (0)
      autoSyncUsers = dsCurrentWssInfo.WssAdmin[0].WADMIN_AUTO_ADD_USER_TO_SUBWEB;
      
      string provisionInfo = "Default values:\n\nWeb application UID:\t" + wssWebAppID;
      provisionInfo += "\nURL:\t\t\t" + wssWebAppURL;
      provisionInfo += "\nSite collection:\t" + siteCollection;
      provisionInfo += "\nTemplate LCID:\t\t" + Convert.ToString(templateLCID);
      provisionInfo += "\nSite template:\t\t" + siteTemplate;
      provisionInfo += "\nAuto-create subwebs:\t" + Convert.ToString(autoCreateSubwebs);
      provisionInfo += "\nAuto-sync users:\t\t" + Convert.ToString(autoSyncUsers);
      
      MessageBox.Show(provisionInfo, "Default Project Workspace Provisions");
      #endregion
      
    2. Add the test code for setting workspace provisioning information.

      #region Set workspace provisioning information
      // Set the default Web application and site URL for project 
      // workspace provisioning. Use the server URL of your choice. 
      // Note: The Web application and site collection must exist in the SSP.
      wssWebAppURL = "http://" + NEWSERVERNAME;
      
      foreach (WebSvcWssInterop.WssServersDataSet.WssServersRow rowServer
          in dsWssServerInfoDataSet.WssServers)
      {
          if (rowServer.WSS_SERVER_URL == wssWebAppURL)
          {
              dsCurrentWssInfo.WssAdmin[0].WADMIN_CURRENT_STS_SERVER_UID =
                  rowServer.WSTS_SERVER_UID;
          }
      }
      // Specify that new workspaces get provisioned under a new site 
      // collection, for example: http://ServerName/NewSite
      // Note: The new site must exist in the SSP.
      siteCollection = "";
      dsCurrentWssInfo.WssAdmin[0].WADMIN_DEFAULT_SITE_COLLECTION = siteCollection;
      
      // Set the current project workspace language
      templateLCID = Convert.ToInt32("1033");
      dsCurrentWssInfo.WssAdmin[0].WADMIN_STS_TEMPLATE_LCID = templateLCID;
      
      // Set the default project workspace site template name
      // To get the site template names: stsadm -o enumtemplates
      siteTemplate = "_GLOBAL_#1";
      dsCurrentWssInfo.WssAdmin[0].WADMIN_STS_TEMPLATE_ID = siteTemplate;
      
      // Set the workspace provisioning mode to manual (0)
      autoCreateSubwebs = Convert.ToByte(0);
      dsCurrentWssInfo.WssAdmin[0].WADMIN_AUTO_CREATE_SUBWEBS = autoCreateSubwebs;
      
      // Set the user synchronization to manual (0)
      autoSyncUsers = Convert.ToByte(0);
      dsCurrentWssInfo.WssAdmin[0].WADMIN_AUTO_ADD_USER_TO_SUBWEB = autoSyncUsers;
      
      try
      {
          // Update all project workspace provisioning settings                
          wssInterop.UpdateWssSettings(dsCurrentWssInfo);
      
          provisionInfo = "Reset values for Web application:";
          provisionInfo += "\nURL:\t\t\t" + wssWebAppURL;
          provisionInfo += "\nSite collection:\t" + siteCollection;
          provisionInfo += "\nTemplate LCID:\t\t" + 
              Convert.ToString(templateLCID);
          provisionInfo += "\nSite template:\t\t" + siteTemplate;
          provisionInfo += "\nAuto-create subwebs:\t" + 
              Convert.ToString(autoCreateSubwebs);
          provisionInfo += "\nAuto-sync users:\t\t" + 
              Convert.ToString(autoSyncUsers);
      
          MessageBox.Show(provisionInfo, "Changed Project Workspace Provisioning");
      }
      catch (SoapException ex)
      {
          string errMess = "";
          // Pass the exception to the PSClientError constructor to get 
          // all error information.
          PSLibrary.PSClientError error = new PSLibrary.PSClientError(ex);
          PSLibrary.PSErrorInfo[] errors = error.GetAllErrors();
      
          for (int j = 0; j < errors.Length; j++)
          {
              errMess += errors[j].ErrId.ToString() + "\n";
          }
          errMess += "\n" + ex.Message.ToString();
      
          MessageBox.Show(errMess, "SoapException Error", MessageBoxButtons.OK,
              MessageBoxIcon.Error);
      }
      #endregion
      
  10. Set the startup object and output type. On the Visual Studio Project menu, click WorkspaceProperties Properties. Click the Application tab, and then select WorkspaceProperties.Program in the Startup object list. In the Output type list, select Windows Application.

  11. Compile and run the application.

  12. Because the application set the workspace provisioning mode to manual, when you publish a new project, it will not have a workspace. Try publishing a new project and then go to the Server Settings page in Project Web Access. Click ProjectWorkspaces in OperationalPolicies.

  13. The new project has a blank site address. Click the project row to select it and then click Create Site.

  14. Click the project workspace site address and verify that the workspace is using the _GLOBAL_#1 template that you created.

See Also

Tasks

How to: Create a Project Workspace and Link it to a Project

How to: Log on to Project Server Programmatically

Concepts

Windows SharePoint Services Infrastructure for Project Server

Finding the PSI Web Services

Other Resources

Project Server Web Parts