Clarity

 View Only
  • 1.  Automating resource Clarity data to SharePoint

    Posted Oct 06, 2015 12:31 PM

    We are copying and pasting resource data extracted from Clarity into SharePoint currently and are looking at reducing the effort this involves.  With the exception of the SharePoint Connector, has anyone linked Clarity and SharePoint before?  We are looking at potentially using "Business Connectivity Services" in SharePoint as a solution



  • 2.  Re: Automating resource Clarity data to SharePoint

    Posted Oct 06, 2015 06:04 PM

    We send data to SharePoint via BCS. It does what it says it does - works fine.



  • 3.  Re: Automating resource Clarity data to SharePoint

    Posted Oct 06, 2015 06:11 PM

    Robert,

     

    Do you have any issues authenticating the web service or do you go right to the tables?

     

    V/r,

    Gene



  • 4.  Re: Automating resource Clarity data to SharePoint

    Posted Oct 06, 2015 06:21 PM

    Very nice solution Gene!

        We're kind of simple. We have a simple SQL feed - it's in a View that I maintain in the CA PPM database. The SharePoint team has a domain user account with read only access to that one view. I'm responsible & accountable for the view, the SharePoint team is responsible & accountable for their BDC and the customer's UI and the SQL team is pleased that this is a super restricted domain account connection. If the customer wants something added, I add it to the view, the SharePoint team re-generates their BDC and works with the customer on the UI. It's been doing it's things since about 2008 (it was a business data catalog back then). What I like about this is it is low tech. There are no dependencies between our systems that could impede upgrading either of our applications (as I've seen with the SharePoint Connector).

     

    HTH.



  • 5.  Re: Automating resource Clarity data to SharePoint

    Posted Nov 11, 2015 06:48 AM

    HI Robert

     

    Thanks for the feedback on this.  We are running Clarity on an Oracle DB and our SharePoint guy has found difficulties on connecting with BCS.  Is your Clarity instance hosted on Oracle too. His feedback is below.  Is this your experience too?

     

    "so using the oracle client I may be able to connect to oracle and display data but I'd need to install it on every SharePoint server, along with JAVA runtime that it need to use, however this still isn't going to do what we need it to do, ideally we need to configure BCS and for that we need a DEV to create a BCS Model for the datasource and that's where we need the dev as this is created via .Net and visual studio"



  • 6.  Re: Automating resource Clarity data to SharePoint

    Posted Nov 11, 2015 08:09 AM

    Hi Robert.

       Our PPM Database is MSSQL so we didn't run into this challenge. Here's a good little article on the challenges your SharePoint team is facing:

    The Reality of Connecting SharePoint to Oracle using BDC | SharePoint MMMan

     

    Looks like there are solutions - you'll need to evaluate 'Build vs Buy'.

     

    Build:

    Option #2 in the article is Gene's solution below - use CA PPM's web service interface. Your SharePoint team should be able create and maintain this 'in house' with very little effort, Gene has a fantastic soup starter below. We have a SOAP integration as well as a BDC integration, reviewing the project in CA PPM it came in under 100 hours. 30 of my time (development, project management), 40 hours SharePoint development & the rest was BA & Testing.

     

    Buy:

    The Lightning Tools company the article references has a product called a Data Viewer Web Part. If you just want to see a list, this may be simple, easy and cost effective: "Data Viewer Web Part 2013 - No Code required, display data from BCS, SQL, Oracle, ODATA, SPLists"

     

    If you want to do more than just produce a list, you'll want to evaluate the IT ROI suite. While the Lightning Tools products look to be simple read-only integrations, IT ROI has a suite of bi-directional integrations that may provide you more value.

    CA PPM Integrated with SharePoint - Productivity Suite

     

    HTH,

    Rob



  • 7.  Re: Automating resource Clarity data to SharePoint

    Posted Oct 06, 2015 06:10 PM

    It looks like you should be able to use Business Connectivity Services by pointing it to a NSQL query which delivers your resource ODATA .  The authentication to use the NSQL might give you a little problem but it looks like you can build a .NET Connectivity Assembly that would allow you to overcome any authentication issues that you might run into.

     

    I am not sure this will help but this would be a pretty simple one way interface.

     

    In my younger days, I built a few SharePoint integration.  SharePoint has an extensive API for handling such tasks.  Depending on where you are storing the resource data (a list or maybe a shared Excel  document), it is pretty straight forward.

    I would approach it this way:

     

    • Build a NSQL to get the resource data that you desire. This provides you a Query web service and the wsdl url for getting the required resource data.
    • The SharePoint List wsdl url or shared xlsx document wsdl url depending on where you want to store the resource data is available.
    • Generate client stubs for the NSQL and Sharepoint web services.
    • Build a simple console application that queries Clarity for the resources and the current SharePoint list.  Loop through the Clarity resource records comparing them to the ones in the SharePoint list.  Update existing resource with records that have changes, Add new resources to the list and Delete any resources in the list that are no longer in Clarity.
    • Schedule the console application to run on given schedule.

     

    The console application looks something like this:

     

    using System;
    using System.Linq;
    namespace TestResourceSharePoint
    {
        public class Program
        {
            public static void Main(string[] args)
            {
                var p = new Program();
                p.SyncResource();
            }
            public void SyncResource()
            {
                try
                {
                    // Generated from the Query WSDL for my NSQL query log into Clarity
                    var clarityQuery = new ClarityQuery.GeneResouceQueryQueryService(); 
                    var login = new ClarityQuery.Login { Username = "admin", Password = "password" };
                    var sessionId = clarityQuery.Login(login);
                    clarityQuery.AuthValue = null;
                    if (String.IsNullOrEmpty(sessionId)) clarityQuery.AuthValue = new ClarityQuery.Auth { SessionID = sessionId };
                    if (clarityQuery.AuthValue  == null) Environment.Exit(-1); //Didn't login into Clarity
                    // Preform the query against Clarity
                    var geneResouceQuery = new ClarityQuery.GeneResouceQueryQuery { Code = "GeneResouceQuery", Filter = new ClarityQuery.GeneResouceQueryFilter() };
                    var geneResouceResult = clarityQuery.Query(geneResouceQuery);
                    if (geneResouceResult.Records.Any()) //Only update if we have any resouce records
                    { 
                        // Set up our sharepoint get our resource list items
                        var sharePointList = new SharePoint.Lists {UseDefaultCredentials = true};
                        var doc = new System.Xml.XmlDocument();
                        doc.LoadXml("<Document><Query /><ViewFields /><QueryOptions /></Document>");
                        var listQuery = doc.SelectSingleNode("//Query");
                        var listViewFields = doc.SelectSingleNode("//ViewFields");
                        var listQueryOptions = doc.SelectSingleNode("//QueryOptions");
                        var resouceListItems = sharePointList.GetListItems("Resources", String.Empty, listQuery, listViewFields, String.Empty, listQueryOptions, null);
                        // Check for update and new resources
                        foreach (var geneResouceRecord in geneResouceResult.Records)
                        {
                            //
                            // Add logic to see if each geneResouceRecord is in the list or needs to be addded
                            // If exists then update the field values in the resource item
                            // otherwise add a new resouce item to the list
                            //
                        }
                        // Remove resouces that are no longer in the Clarity Query results
                        foreach (var resouceListItem in resouceListItems)
                        {
                            //
                            // Add logic to see if there is a resouceListItem that doesn't exists in geneResouceResults.Records
                            // If there isn't a matching record then delete the resouceListItem from the resourceListItems
                            //
                        }
                        sharePointList.UpdateListItems("Resource", resouceListItems); //Update the sharepoint list
                    }
                    clarityQuery.Logout(sessionId); //Log out of Clarity
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
    }
    

     

     

    V/r,

    Gene