Share via


Persisting the Project Guide's State

If a user opens a Microsoft® Office Project 2003 document and sees the same Project Guide side pane that was shown at the time the document was closed, the Project Guide shows persistence. To enable Project Guide persistence, Project can save an XML representation of the Project Guide state in the Project.ProjectGuideSaveBuffer property. The default main page uses the following Microsoft JScript® functions in the file mainpage.js: createSaveXML formats the data to be saved, saveState saves the data, and the functions loadSavedSidepaneProperties and loadSavedStartPage load the saved state. The Project Guide uses straightforward XML manipulation to persist the data between sessions using the ProjectGuideSaveBuffer property. Take a look at the following saved state in XML, from the default main page:

<GBUIBuffer Version="1.00">
   <SidepanePersistanceInfo SidepaneDisplayState="open">
      <SidepaneWidth>200</SidepaneWidth>
      <GoalAreaID>1</GoalAreaID>
      <TaskID>10</TaskID>
   </SidepanePersistanceInfo>
</GBUIBuffer>

The XML data persists the current side pane width, goal area, and TaskID within that goal area. You can find the names of GoalAreaID 1 and TaskID 10 in the default gbui.xml Project Guide content schema. The XML data in ProjectGuideSaveBuffer tells the Project Guide to navigate to the Publish Project Information to Web side pane of the Task goal area on load. Project takes the GoalAreaID and TaskID from the XML content schema of the Project Guide that was in use when the project was last saved. If a file is saved while using one XML content schema and loaded under a different content schema, data in ProjectGuideSaveBuffer can cause unexpected results. Using a different content schema would not cause the Project Guide to stop responding, but probably would load the wrong side pane on startup.

You can customize the XML data saved in ProjectGuideSaveBuffer, as long as you respect two rules:

  • Add content only within the GBUIBuffer element. If GBUIBuffer is not the root element, the default main page rejects the saved schema.
  • Don't change anything within the SidepanePersistanceInfo element, which is reserved for default saved data. ProjectGuideSaveBuffer can store up to 64K of data, so there's plenty of room for expansion.

Note  The saved data doesn't necessarily have to be XML. ProjectGuideSaveBuffer can accommodate any type of data you need. It stores XML by default only because the default main page uses XML for its save functionality. If you're willing to forego support on the main page for the saved state, you can use your own format for ProjectGuideSaveBuffer data.

For a sample custom Project Guide that uses ProjectGuideSaveBuffer, see Interviewer Wizard Project Guides: BizTalk Server Deployment and Product Launch.