Clarity

 View Only

ObsHtmlPortlet.zip Updated Version 

Nov 26, 2014 12:23 PM

I have updated the ObsHtmlPortlet to:

 

                Remove the SQL recursion (should now work on both Oracle and MSSQL).

                Added drop down boxes to select different OBS types and tree layout.

                Added waitUntil function for long running queries (large OBS structures).

 

ScreenHunter_99 Nov. 26 08.44.png

ScreenHunter_98 Nov. 26 08.44.png

 

 

In the html file one needs to update the following line to the query id to the name of the query saved in CA PPM.

 

  var queryCode = "ObsPortletGraph"; //Change this to the id of the nsql for obs

 

If you have access to an older browser (one that allows cross domain scripting e.g. IE9) you can test this directly.  Just modify the xml request inside the runQueryCode function to use name and password and comment out the sessionCookie line.

 

'<quer:Auth>' +

'<quer:Username>admin<\/quer:Username>' +

'<quer:Password>password<\/quer:Password>' +

//'<quer:SessionID>' + sessionCookie + '<\/quer:SessionID>' +

'<\/quer:Auth>' +

 

Then set the endpoint variable to your you instance of CA PPM.

       //

        // Debug in Stand-alone using your server

        //

        endpoint = "https://cppm.ondemand.ca.com/niku/xog";

 

Again, this will only work in a browser that either allows cross-domain scripting or one that you can override (maybe chrome).

 

V/r,

Gene

Statistics
0 Favorited
3 Views
1 Files
0 Shares
2 Downloads
Attachment(s)
zip file
ObsHtmlPortlet.zip   5 KB   1 version
Uploaded - May 29, 2019

Tags and Keywords

Comments

Dec 03, 2014 09:47 PM

Hi Gene,

 

At the moment, I got to file/open in IE8, and it prompts me to run the activex controls or not, to which I oblige. I then get what appears to be a warning saying 'Object is required' on a light blue background, a little under the Select Chart Orientation.

 

I think to protect myself and the dev server from any damage, I'd better stop myself from going any further

 

Thanks for your help though - I'm glad you could get this to work - it is a common request at client sites.

 

Kudos to you.

 

Regards,

Sam.

Dec 03, 2014 09:10 PM

So in IE8, do a file open to your html (ObsNetworkChart.html) page.  Once the page loads press F12.  You should be able to select the script tab and place breakpoints for debugging.

 

It appears for the javascript debugger statement to work, you need to install one. VS or Script Debugger which should work on your XP machine.

 

Download Script Debugger for Windows NT 4.0 and Later from Official Microsoft Download Center

 

V/r,

Gene

Dec 03, 2014 07:56 PM

I placed the "debugger;" exactly where you noted above, no debugger pop ups in any of my browsers... any further tips?

 

My environment is OnDemand

Dec 03, 2014 07:35 PM

You only have to worry about XSS if you are getting the HTML from one domain and pulling the XOG query from another domain.  In my case, I have the html page on my server and the XOG query hits OnDemand.  This is a cross-domain issue.

 

If you have Clarity On-Premise, you should be able drop you html page inside the root and be able open with out any XSS issues.

 

Another thing you can do is to place a debugger statement inside the code which will pop the debugger open at the point in the code.  I don't know if IE8 supported it but IE11 does and I believe Firefox does too.

Once the debugger is up, you should be able to view what is inside different variables.

 

So for example inside the buildNodeArray function if we place the debugger statement we should be able to view what is in our rows variable:

 

function buildNodeArray(){

        //

        // Loop through the nsql results and create our nodes

        //

        var rows = xmlDoc.getElementsByTagName("Record");

//

// fire up the debugger.

//

debugger;

 

        for (var i = 0; i < rows.length; i++) {

                //

                // Pull of our nsql results and define our node;

                //

                var row = rows.item(i);

                var parentId = getElementValue(row, "parent_id");

 

So for example.  On this run, my password was wrong and we see that by looking at the xmlDoc.

 

Dec 03, 2014 06:57 PM

Gene,

 

This looks like a great addition to the kitty, well done!

 

Personally, I'm having trouble getting it to work. I got the nsql in, and the portlet defined and one a page ok. It shows the two dropdowns for OBS, and Orientation. The issue I have is I'm getting a blank list in 'OBS' (Orientation shows horizontal and vertical selections ok) and hence can't select a tree to display.

 

Any tips? I'd really like to get this to work!

 

I'm on 13.1, and have access to browsers ie11 (win8.1), ie8(XP3) and mozilla 34 (both).

 

From your comments re cross site, I have a feeling it has to do with the XSS filter setting (Enable disable) (I'm thinking I'll have most luck with IE8 on XP3). I have currently added my dev server to the 'trusted sites' in IE8, and allowed its cross site to occur. I also set my own username and pass in the soap request, and uncommented the endpoint to my servers address - still no luck?...

 

Regards,

Sam.

 

Edit: The obs grid portlet shows the data i'm after, so the nsql is ok, just not the html, yet!

Dec 03, 2014 05:31 PM

got it. min-height overrides.

 

..now to get that connector line to nest under the 35 pixel high box..

Dec 03, 2014 05:12 PM

Great stuff Gene.

 

I've been hacking on the CSS. I added a little elbow room to the nodes with padding:

        padding-top: 2px;

        padding-right: 2px;

        padding-bottom: 2px;

        padding-left: 2px;

 

We'd like to see the full name of the node and have either the individual node 'auto fit' to text height or set a fixed height for all of about 1.5X of what it is now. I set the overflow to 'visible' but so far have been unable to come up with the right trick to affect or override node height. If anyone has any insight, I'd greatly appreciate it.

Nov 27, 2014 12:14 AM

Brilliant

 

Thanks for sharing this, Gene !

 

NJ

Related Entries and Links

No Related Resource entered.