Custom Protocols and Localization

Microsoft® Office Project 2003 includes three custom protocols for accessing Project Guide files. The gbui:// protocol, introduced in Microsoft Project 2002, enables easy access to the default Project Guide files that are installed for different locales. The pgcontent:// and pgmainpage:// protocols, introduced in Project 2003, provide access to location-independent custom Project Guides and custom views.

Important  Microsoft Windows XP Service Pack 2 (SP2) includes security patches that break the pgcontent:// and pgmainpage:// custom protocols for the Project Guide. Custom Project Guides that use the custom protocols currently do not work with Windows XP SP2. A fix is in development. You can still create and use custom Project Guides with Windows XP SP2 if you use hard-coded paths for the custom Project Guide files instead of using the custom protocols.

Localization

All of the default Project Guide files for Microsoft® Office Project 2003 are compiled into the PjIntl.dll file. The default Project Guide files include the following (see Default Project Guide Files for a complete list):

  • mainpage.htm, the default functionality and layout page
  • gbui.xml, the default content file
  • HTML files (*.htm) and related Microsoft JScript® files (*.js) for the various GoalAreas and GoalAreaTasks
  • util.js, the utility JScript file used by the various GoalAreas and GoalAreaTasks
  • Cascading StyleSheet files (*.css) used by the GoalAreas and GoalAreaTasks
  • Graphic Interchange Format image files (*.gif) used by the GoalAreas and GoalAreaTasks
  • fields_data.xml, the content files used by the Add columns of custom information sidepane of the Tasks and Resources goal areas
  • HTML files (*.htm) for generic Project Guide error pages
  • HTML files (*.htm) and JScript files (*.js) for sidepanes specific to On Object User Interface (OOUI)

PjIntl.dll is the international file that contains localized resources for the Project Guide; it is located in a different Locale ID (LCID) subdirectory for each language. For example, for U.S. English, PjIntl.dll is installed in the 1033 subdirectory of the Project shared directory. Following is the path for the default English-language installation:

[Program Files]\Common Files\Microsoft Shared\Microsoft Office Project 11\1033\PJINTL.DLL

You could access the default Project Guide files using the res protocol:

res://<LCID>/pjintl.dll/filename

Note  The res protocol can be used to access files that are compiled into a DLL. For more information, see res Protocol.

To use the res protocol as shown, you would have to modify the URL references in all of the Project Guide files for different international versions of Project, and change the LCID to the appropriate value for each language. Instead, to avoid having to change the LCID, Project uses the Microsoft Internet Explorer concept of pluggable protocols. For more information, see Asynchronous Pluggable Protocols.

Custom Protocol for Default Files

Project includes its own URL protocol and protocol handler, using the Asynchronous Pluggable Protocols API. The custom protocol scheme is called GBUI. When the WebBrowser control hosted within Project encounters a URL that uses the gbui:// protocol, such as gbui://mainpage.htm, it calls the custom gbui:// protocol handler to resolve the URL. The protocol handler translates the gbui:// URL into a res:// URL that references PjIntl.dll in the appropriate LCID folder.

Note  GBUI is an abbreviation of the early name for the Project Guide: Goal-Based User Interface. The Project Guide name changed, but the protocol and file names didn't. In the source code, you also often see Project Guide abbreviated as PG.

The custom gbui:// protocol provides the following benefits:

  • The URLs in the default Project Guide files don't need to be modified for different international versions of Project.
  • Organizations can easily reference the default Project Guide files and any custom Project Guides by referring to these files using the gbui:// protocol. They don't have to worry about exactly where the files have been installed.
  • When you create a custom Project Guide, if you want to include some GoalAreaTask pages from the default Project Guide, you can easily reference the default files in your custom XML document by using the gbui:// protocol.

Custom Protocols for Location-independent Project Guide Files

Project 2002 requires hardwired pathnames to custom files in Project Guide XML, HTML, and scripts. Project 2003 includes two new custom protocols that support relative paths for custom Project Guide files. The pgcontent:// protocol refers to the directory for the custom XML content schema such as custom_gbui.xml. The pgmainpage:// protocol refers to the directory for the custom functionality and layout page, for example custom_mainpage.htm. If you point Project to a main page on a network share such as \\CentralServer\CustomPG\Bavaria\custom_mainpage.htm, you can access other files in that directory and relative directories as follows:

pgmainpage://scripts.js  
     (resolves to \\CentralServer\CustomPG\Bavaria\scripts.js)
pgmainpage://subdirectory/sidepane.htm 
     (resolves to \\CentralServer\CustomPG\Bavaria\subdirectory\sidepane.htm)

Note  Microsoft Internet Explorer implicitly trusts files on the local computer. To use Project Guide files on a remote computer, you must add the URL to the list of Trusted Sites in Internet Explorer. For more information about trusted sites, see Project Guide Security. In the example, since the main page is specified as path to a file share, add the following URL to Trusted Sites: file://CentralServer/CustomPG/Bavaria

To manually set the custom Project Guide directory paths in Project 2003, click the Tools menu, and then click Options. In the Options dialog, click the Interface tab. For the custom page directory, click Use a custom page, and then type the URL of the custom main page in the text box. For the custom schema directory, click Use custom content, and then type the URL of the custom XML file. To programmatically set the Project Guide directory paths, you can use the Project object model in Microsoft Visual Basic® for Applications (VBA). For more information, see Defining the Project Guide.