|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Using the ProjTool Test Application
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.
The ProjTool test application source code in the Microsoft Office Project 2007 SDK download includes examples that use the Project, Resource, LookupTable, CustomFields, QueueSystem, Archive, Events, Security, and Admin Web services of the Project Server Interface (PSI). ProjTool is useful for creating data in a test installation of Microsoft Office Project Server 2007 and for examining how the PSI methods work. (The ProjTool source code was contributed by Robert Kennedy Murugan, Microsoft Corporation.)
The ProjTool source code and solution files for Microsoft Visual Studio 2005 is included in the Project 2007 SDK download. The source code language is Microsoft Visual C#. This article describes how to compile the ProjTool application and use the application's main features. This article does not explain most of the ProjTool code or how to use the PSI and datasets. For a link to the Project 2007 SDK download, see Welcome to the Microsoft Office Project 2007 SDK. For more information about using the PSI, see Working with the PSI and DataSets.
The ProjTool application is designed to be used only on a test installation of Project Server. ProjTool is not supported for use on a production server. ProjTool can easily delete or change data in the Draft and Published databases, as well as reset the Project Server Queuing Service, Project Server Eventing Service, and Internet Information Services (IIS), and restart Microsoft SQL Server.
The main purpose of ProjTool is to provide developers with a way to quickly populate the Project Server databases with data in a test installation so that they can more easily develop other applications. You can see how to use some of the PSI and DataSet methods that are at the heart of Project Server development. You can also learn about program flow and the state of variables and datasets by setting breakpoints in the source code while running the application. ProjTool does not use all of the PSI Web services or all of the methods in any one Web service, but it does provide a base for a fairly comprehensive test application.
This article includes the following sections:
We recommend that you back up all of the Project Server databases before you run ProjTool, and make additional database back up files after you create strategic sets of data. The source files include the CleanDBRestore.cmd script that you can use to quickly restore the Project Server database from backup files. Before you use the script, be sure to edit it to match your database names, file names, and locations.
The Project SDK download installs the ProjTool files by default in C:\2007 Office System Developer Resources\Project 2007 SDK\Code Samples\ProjTool. You can develop ProjTool on the Project Server test computer or on a remote development computer.
Whenever you install an updated build of Project Server, you must perform the following procedure.
To compile ProjTool:
When you run ProjTool.exe, you can log on with Windows or Forms authentication. Before you log on with Forms authentication or use impersonation, you must save the settings. For information about impersonation, see Using Impersonation in ProjTool.
You can also log on using a Secure Sockets Layer (SSL) URL, for example https://ServerName/ProjectServerName, if Project Server is set up for that.
Sometimes a logon fails on the first attempt, with a message such as ReadProjectsList call failed. If the first attempt fails, a second logon usually fixes the problem, after ProjTool saves the URL and other user settings.
Saving Settings for Forms Authentication and Impersonation
A ProjTool user must have a Project Server account with the same name and authentication type. The ProjTool - Project Server Logon dialog box has a Save Settings link for logging on and impersonation. You can save the settings before or after you log on.
To save settings for Forms authentication and impersonation
Using the ProjTool Main Window
The menu in the ProjTool main window includes the following items:
File Log on as a different user, or log on using impersonation.
New Create projects, projects from templates, custom fields, and enterprise resources.
LookupTable Create a simple lookup table, multilanguage lookup table, display lookup table values, and set languages to use for multilanguage lookup tables on the Project Server test computer.
Events Shows the Registered Project Server Event Handlers dialog box, where you can add or delete event handlers if ProjTool is running on the Project Server computer.
Tools Submenu items link to utilities that get an error description, reset the Project Server Queuing or Eventing services, restart SQL Server, reset IIS, or reset all services. ProjTool should be running on the Project Server computer.
Options Refresh the grid or clear the status messages. The Settings submenu brings up the ProjTool Settings dialog box (Figure 1).
Help Brings up the About ProjTool dialog box.
In addition to the menu items, the main window shows a series of action buttons above the project data grid (Figure 2). The buttons perform the following actions:
Delete Project Deletes one or more selected projects from both the Published and Draft databases.
Checkin Project(s) Enables you to select a simple or forced check-in of the selected projects. You can use forced check-in if a project is checked out by another user or with a different session ID.
Checkout Project(s) Enables you to check out one or more selected projects in the ProjTool main window, and check them in by using the Checkin Project(s) button. However, the session ID is not valid for checking in projects using another window, such as Project Details.
Publish Project(s) Saves projects from the Draft to the Published database. The publish process in ProjTool does not create or modify a project workspace. You can add that capability in ProjTool with additional user interface components and logic for the QueuePublishProject method. For more information about project workspaces, see How to: Create a Project Workspace and Link it to a Project.
Read Project Details Shows a dialog box with the entire ProjectDataSet data for the selected project (Figure 4). You can add tasks and make changes in the data.
If you check out the project in the main ProjTool window, and then edit data in the Project Details dialog box, you get an error when you update the data. The project is already checked out using a different session ID.
Rename Project Renames the selected project in the Draft and Published databases.
Backup / Restore Opens a dialog box that allows you to save a snapshot of each selected project in the Draft database to the Archive database. You can also restore projects from the Archive database to the Draft database.
Refresh Executes the ReadProjectsList method to repopulate the grid.
Exit Exits ProjTool.
The text box at the bottom of the main window records the status of actions, with the most recent at the top. The text box also shows XML data from SOAP errors. The status bar at the bottom of the main window shows the Project Server version number and the current date and time.
The Project Server version number shown in the status bar in Figure 2 is a build before Service Pack 1 (SP1) was released. The RTM version is 12.0.4518.1016 and the SP1 build is 12.0.6218.1000.
The Project Details dialog box in ProjTool shows the file version of the Microsoft.Office.Project.Server.Library.dll assembly. The status bar in the main ProjTool window shows the Project Server version from the ReadServerVersion PSI method. The file version of SP1 updates of Project Server assemblies is 12.0.6211.1000. The SP1 version of Microsoft Office Project Professional 2007 is also 12.0.6211.1000.
To create one or more test projects, click Projects on the New menu in the ProjTool main window. Figure 3 shows the Create ServerSide Projects dialog box. In addition to creating multiple projects, you can optionally add tasks to each project; create and add local resources of types Work, Material, and Cost; and publish the projects.
If the project name prefix is Proj and you create two projects, ProjTool increments the project names as Proj1 and Proj2.
The Project type drop-down list shows all types in the Project.ProjectType enumeration. The only valid project types the PSI can create are Project (a standard project), Template, LightweightProject (project proposal), MasterProject, and InsertedProject. The other project types are for internal use. The enumeration value appears to the right of the drop-down list.
When you click Create Projects and then Close, the ProjTool main window shows the new projects in the grid.
Modifying Project Data
To see the Project Details dialog box, select one project in the ProjTool main window grid, and then click Read Project Details (Figure 4).
The grid tabs show every DataTable in the ProjectDataSet for the project. For example, click the Task tab to show data in the TaskDataTable. The first task is the project summary task (TASK_ID = 0). If the project is not already checked out, you can add and delete tasks and set task properties. When you are finished making changes, click Update, and then click CheckinProject.
The Save DataSet to XML button saves an XML file that contains the complete contents of the ProjectDataSet that you can see in the grid tabs. To see only one field, type the field name in the Filter fields by text box. For example, type task_name; the action is case-insensitive.
To use local resources, click Add Assignment. To use enterprise resources, click Build Team.
The LookupTable menu in the ProjTool main window contains the following items.
Simple LookupTable Displays the Create and Manage LookupTables dialog box, and shows all of the data in the LookupTableDataSet in a grid with tabs for the datatables (LookupTables, LookupTableMasks, LookupTableTrees).
MultiLanguage LookupTable Creates multilanguage lookup tables for testing.
Display LookupTable Values Shows values in multilanguage lookup tables.
Set Server Language Creates Project Server database tables that can hold multilanguage lookup table data, for testing purposes (Figure 5).
You can check out, modify, update, and delete lookup tables in the Create and Manage LookupTables dialog box. With the Load Assembly and Create LT from Assembly buttons, you can open a Microsoft .NET Framework assembly and create a lookup table for testing purposes using the assembly namespace.
You can create multilanguage lookup tables on a test Project Server installation. ProjTool allows you to simulate installing multiple language database tables on the server for testing purposes. It is not necessary to install Project Server language packs to test creating multilanguage lookup tables. The languageList variable in ProjTool contains the list of active Project Server languages.
Do not run the lookup table actions, set languages, or make any changes with ProjTool on a production installation of Project Server.
To create and view a sample multilanguage lookup table:
To see the structure of the multilanguage lookup table that you created in ProjTool, open it in Project Web Access. On the Server Settings page, click Enterprise Custom Field Definition. On the Custom Fields and Lookup Tables page, for example, click LangTest. Project Web Access shows only the values for the Project Server language pack that is installed. The ÂÞæÛ eng 1033 value in the test example is one of the two top levels, each of which has three sublevels.
For more information about lookup tables and custom fields, see Local and Enterprise Custom Fields and Walkthrough: Creating a Hierarchical Lookup Table. For a list of language codes, see Locale ID (LCID) Chart.
The ProjTool main window includes the Events menu item to help manage Project Server event handlers on a test computer. The tsEvents_Click handler for the Events menu item brings up the Registered Project Server Event Handlers dialog box.
When you click Add or Delete, ProjTool checks whether it is running on the Project Server computer. ProjTool can manage events only when it runs on the Project Server computer, because it must read and install the event handler assembly in the global assembly cache and then reset IIS.
To register a Project Server event handler, you must either register the handler assembly in the GAC or copy it to the C:\Program Files\Microsoft Office Servers\12.0\Bin\ProjectServerEventHandlers directory on the Project Server computer. In the Add Project Server Event Handlers dialog box, paste the complete reference to the event handler assembly into the textbox. For example, paste the following:
TestEventHandler, Version=188.8.131.52, Culture=Neutral, PublicKeyToken=1e3db2b86a6e0210
For more information about creating and registering Project Server event handlers, see How to: Write and Debug a Project Server Event Handler.
Because ProjTool is designed for test and development purposes only, impersonation in ProjTool requires that the user's Windows credentials match the SSP service credentials for the Project Web Access instance.
To see the SSP service credentials, open the SharePoint 3.0 Central Administration page, and then navigate from the Application Management page to the Manage this Farm's Shared Services page. Pause the mouse pointer over the SSP name (for example, SharedServices1), click the down arrow, and then click Edit Properties. For more information about developing impersonation applications, see Using Impersonation in Project Server.
To use impersonation in ProjTool, in the File menu, click Logon As. In the Project Server Advanced Logon dialog box, you can set the site ID of the Project Web Access instance and select a name from the list of enterprise resources in the drop-down list (Figure 6). When you impersonate an enterprise resource to log on, you gain the permissions of that user. This is useful for testing security for applications that integrate with Project Server.