epm customization taking your microsoft epm solution beyond the “box” epm customization series...
TRANSCRIPT
EPM Customization
Taking your Microsoft EPM Solution
Beyond the “box”
EPM Customization Series Part 2
November 21st, 2007
Brendan Giles , PMP, MCP
Slide Slide 22
Acronyms
EPM Enterprise Project Management – Centralized control,
Shared Resources, Portfolio / Project Reporting and tracking at the enterprise level.
VBA Visual Basic for Applications programming language
common to all Microsoft Office products including Microsoft Office Project.
PDS Project Data Service – Project Server 2003 API. XML based
request / reply. PSI
Project Server Interface – Project Server 2007 API. Web services based using ADO datasets and the .NET Framework.
SOAP Simple Object Access Protocol – Communication Protocol
used to transfer data in a Microsoft EPM Solution via Http.
Slide Slide 33
Overview
Microsoft Office Project Data Model Microsoft Office Project VBA Project Data Service API (Microsoft
EPM 2003) and Enterprise Data Maintenance
Project Server Interface (Microsoft EPM 2007)
Sharepoint Web Services Questions and Wrap-up
Slide Slide 44
Project Object Model
Slide Slide 55
VBA Benefits
VBA allows: Access to Microsoft Office Project Objects Access to other Office Applications Macro recordings to expose VBA Code Key data elements:
i. Project
ii. Task
iii. Task Time-Phased
iv. Resource
v. Resource Time-Phased
vi. Assignment
vii. Assignment Time-Phased
Slide Slide 66
VBA Code
Sub SavePlan(Share_Drive as String, Plan As String, SavedPlan As String)
'Retrieve the specified project plan from Project Server'and save it to the fileshare
FileOpen Name:="<>\" & Plan, ReadOnly:=True, _FormatID:="MSProject.MPP", Openpool:=pjDoNotOpenPool 'Don't Try to update this project on the server when I save it to a fileshare'besides it is read-only so it won't let you
FileSaveAs Name:=Share_Drive + ":\Latest Project Plans\" & SavedPlanFileClose pjSave
End Sub
Techie Alert
Slide Slide 77
VBA Retrieval of Assignments Time-Phased Data
For Each Assignment In Resource.Assignments ' Check if assignment is within our report range
If Assignment.Start <= EndOfPeriod _ And Assignment.Finish >= StartDate Then Set tsvs = Assignment.TimeScaleData(StartDate, EndOfPeriod, pjAssignmentTimescaledWork, pjTimescaleDays) Assignment_Remaining_Work_Hours = Assignment.RemainingWork / 60 For Each tsv In tsvs If tsv.Value <> "" Then Assignment_Work_Hours = tsv.Value / 60 'time is in mins ' Create a DBRecord Entry for this effort Add_DB_Assignment _ Project_Name:=Saved_Project_Name(prj.Name), _ Workgroup_Category:=Resource.EnterpriseOutlineCode4, _ Resource_Workgroup:=Resource.EnterpriseOutlineCode2, _ Resource_Name:=Resource.Name, _ Task_ID:=Assignment.TaskID, _ Task_Name:=Assignment.TaskName, _ Task_Start_Date:=tsv.StartDate, _ Task_Finish_Date:=tsv.EndDate, _ End If ' If tsv.value <> ..... Next tsv
End If ' If Assignment.Start <= .....
Next Assignment
Techie Alert
Slide Slide 88
VBA also Allows Office Integration
Set cnt = New ADODB.Connection With cnt .Open dbConnectStr 'Create the Assignments Table .Execute "CREATE TABLE Assignments_Table " & _ "([Assignment ID] COUNTER CONSTRAINT PrimaryKey PRIMARY KEY, " & _ "[Workgroup Category] Text(250) WITH Compression, " & _ "[Resource Workgroup] Text(250) WITH Compression, " & _ "[Resource Name] Text(250) WITH Compression, " & _ "[Project Name] Text(250) WITH Compression, " & _ "[Task ID] NUMBER, " & _ "[Task Name] Text(250) WITH Compression, " & _ "[Start Date] DATETIME, " & _ "[Finish Date] DATETIME, " & _ "[Assignment Remaining Work Hours] NUMBER, " & _ "[Assignment Remaining Work Days] NUMBER, " & _ "[Assignment Work Hours] NUMBER, " ' ' Create the Tasks Table ' .Execute "CREATE TABLE Tasks_Table " & _ "([Task ID] NUMBER, " & _ "[Project Name] Text(250) WITH Compression, " & _ "[Task Name] Text(250), " & _ "[Start Date] DATETIME, " & _ "[Finish Date] DATETIME, " & _ "[Task Remaining Work Hours] NUMBER, " & _ "[Task Remaining Work Days] NUMBER, " & _ "[Task Work Hours] NUMBER, " ‘End With Set cnt = NothingEnd Sub
Techie Alert
Slide Slide 99
VBA Object Model Changes
VBA changes in Project Professional 2007
Simplified custom fields and outline codes Multiple undo and redo actions Effective calendar dates and calendar exceptions Advanced desktop reporting using Visual Reports Task drivers and recalculation change highlighting to help clarify
scheduling processes Costs and budget Queuing Service events Importing of a Windows SharePoint Services 3.0 project Saving of a local copy of a Project Server project for sharing
Slide Slide 1010
Project Data Service
Steps to access all PDS Methods Logon to Project Server Programmatically using valid ID
and password Obtain Authentication Cookie Create a PDS Request in XML Call PDS Web Service with PDS Request and
authentication Cookie via a SOAP call Receive PDS XML Reply Parse PDS XML Reply
Slide Slide 1111
PDS Authentication Cookie
-<Reply><Hresult>0<Hresult><Cookie>(F55A3……..
</Cookie></Reply>
Slide Slide 1212
PDS Logon Cookieprivate void btnChkCookie_Click(object sender, System.EventArgs e)
{// Create a persistent cookie for the URL, if the cookie doesn't // exist or if the Project Server URL changes.
if (urlReset && ieCookiesOK) { CreateCookie(COOKIENAME, VALUENAME, txtMSPURL.Text, DAYSPERSIST);
urlReset = false; }
//Clear the listbox, for subsequent creations of the project listlblLogonStatus.Text = "";psLogonUrl = txtMSPURL.Text + "/LgnIntAu.asp";string textInReply = "";
if (Get_Cookie.LogonProjectServer(psLogonUrl, ref psCookie, ref textInReply)) { //Trace.Warn("Logon Okay"); lblLogonStatus.ForeColor = Color.Green; lblLogonStatus.Text = "Log on OK: " + txtMSPURL.Text; psURL = txtMSPURL.Text; //Check the PDS Call Here <----- }else { //Trace.Warn("Logon Failed");
//Trace.Warn(textInReply); lblLogonStatus.ForeColor = Color.Red; lblLogonStatus.Text = "Log on failed"; }
} Techie Alert
Slide Slide 1313
PSI Login via Web Service
public bool LogonPS(bool useWinLogon, string baseUrl, string userName, string password)
{ const string LOGINWINDOWS = "_vti_bin/PSI/LoginWindows.asmx"; const string LOGINFORMS = "_vti_bin/PSI/LoginForms.asmx"; bool logonSucceeded = false;
try {
if (useWinLogon)
{ loginWindows.Url = baseUrl + LOGINWINDOWS; loginWindows.Credentials =
CredentialCache.DefaultCredentials; if (loginWindows.Login()) logonSucceeded = true;
}
} // Catch statements
return logonSucceeded;
}
Techie Alert
Slide Slide 1414
Project Data Service
XML Based Request / Reply API Consists of:
Project Methods Enterprise Project Creation Methods Resource Methods Enterprise Custom Field Methods Timesheet / Assignment Methods Administrative Methods Version Methods
Slide Slide 1515
Enterprise Data Maintenance
Builds on the PDS to provide higher level data exchange
Uses “file drop” and SOAP programmatic interface
Adds a business layer mapping to integrate with existing Project server data
Tightly integrates Project server with other line of business applications
Resource data synchronization Project Team Synchronization Updating Custom field value lists
Slide Slide 1616
Microsoft EPM Solution 2003
Slide Slide 1717
Microsoft EPM Solution 2003
Slide Slide 1818
Microsoft EPM Solution 2007
Slide Slide 1919
Project Server Interface (PSI)
Web Services API using ADO.NET Datasets Over 350 Public Methods Firewall Friendly (Ports 80 and 443) Access via SOAP over Http Managed Code but supports managed and
unmanaged clients VB.NET, C#.NET and ASP.NET development Simply add a web reference
(http://servername/projectservername/_vti_bin/psi/..
Better Design Time Control
Slide Slide 2020
Project Server Interface (PSI)
Synchronous Methods aSynchronous (*Queue Methods) Bulk data changes Transactional / Restartable Over 100 Server Events to listen for ADO Datasets used for Data Transfer
Typed datasets that are familiar to developers and provide safety
Design Time Validation Improved Performance
Slide Slide 2121
Project Server Interface (PSI)
Slide Slide 2222
Project Server Interface (PSI)
Slide Slide 2323
Project Server Interface (PSI)
A Wealth of Web Services:
Admin Archive Authentication (Internal
Use)
Calendar
Cube Admin
Custom Fields
Events
Login Forms
LoginWindows
LookupTable
Notifications
ObjectLinkProvider Project PWA (Internal use)
QueueSystem
Resource
Security
Statusing
Timesheet
View (Internal Use)
WinProj (Internal Use)
WssInterop
Slide Slide 2424
Project Server Interface (PSI)
Simply add a web reference in Visual Studio (http://servername/projectservername/_vti_bin/psi/resource.asmx
Slide Slide 2525
Project Server Interface (PSI)
Simply add a web reference in Visual Studio (http://servername/projectservername/_vti_bin/psi/....
Slide Slide 2626
Project Server Interface (PSI)
View Web Service Properties:
Slide Slide 2727
Project Server Interface (PSI)
Expose the methods available ------ Retrieve data in an ADO DatasetPSI relies heavily on GUIDs (Globally Unique Identifier) in contrast to PDS that used IDs that were not always unique across Project Server Instances
Slide Slide 2828
Project Server Interface (PSI)
Slide Slide 2929
Project Server Events
Applications can listen for Project Server Events
Slide Slide 3030
Project Server Events
Applications can listen for Project Server Events
Slide Slide 3131
Project Server Interface (PSI)
Developers should not directly Access Project Server Databases other than the Reporting Database PSI Web Services and methods should be used
Slide Slide 3232
Sharepoint Web Services
Sharepoint Web Services give developers access to Sharepoint Sites and their content
Slide Slide 3333
Sharepoint Web Services
Windows Sharepoint Services 3.0 for EPM 2007 Ships with Windows Server 2003.
Slide Slide 3434
Sharepoint Web Services
Microsoft Office Sharepoint Server 2007 is recommended when using the workflow features of EPM 2007.
Slide Slide 3535
Sharepoint Web Services
Project Web Access is now a Sharepoint Site in EPM 2007
Slide Slide 3636
Fetching Issues via a Sharepoint Web Service
Techie Alert
Slide Slide 3737
Summary Customization of Microsoft EPM via:
Visual Basic for Applications Project Data Services API (2003) Project Server Interface (API) (2007) Sharepoint Web Services
Visual Studio
ADO.NET 2.0
.NET Framework
Slide Slide 3838
Questions and Answers
?? No such thing as a stupid question ?? Answers ---- we’ll try to have smart answers