Somebody posed me this question recently. Basically I covered in my training that you can create a custom Out-of-Office page which allows you to set your Out-of-Office configure the Out-of-Office settings to use a Start Date and End Date. Now the question is how we can view the configured OOF users to see the StartDate and EndDate period.
The current Management Console interface doesn't allow you to see that currently (it probably will be enhanced in the future) but basically it isn't too hard to do with the SourceCode.Workflow.Management API.
Here's a simple code sample that I wrote in a Console Program to retrieve that information.
--------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using SourceCode.Hosting.Client.BaseAPI;
using SourceCode.Workflow.Management;
using SourceCode.Workflow.Management.OOF;
namespace ConsoleApplicationOOFList
{
class Program
{
static void Main(string[] args)
{
SCConnectionStringBuilder connStr = new SCConnectionStringBuilder();
connStr.Host = "localhost";
connStr.Port = 5555;
connStr.Integrated = true;
connStr.IsPrimaryLogin = true;
WorkflowManagementServer wfServer = new WorkflowManagementServer();
wfServer.CreateConnection();
wfServer.Connection.Open(connStr.ToString());
SourceCode.Workflow.Management.OOF.Users OOFUsers = wfServer.GetUsers(ShareType.OOF);
foreach (SourceCode.Workflow.Management.OOF.User OOFUser in OOFUsers)
{
WorklistShares wlss = wfServer.GetCurrentSharingSettings(OOFUser.FQN, ShareType.OOF);
foreach (WorklistShare wls in wlss)
{
Console.WriteLine("User Name: " + OOFUser.FQN);
Console.WriteLine("Start Date: " + wls.StartDate.ToString());
Console.WriteLine("End Date: " + wls.EndDate.ToString());
}
}
if(wfServer != null)
if(!wfServer.Connection.IsConnected)
wfServer.Connection.Close();
Console.ReadLine();
}
}
Posted
Thu, Dec 17 2009 2:33 PM
by
johnny