Clarity

  • 1.  How to default to project instance within NSQL portlet?

    Posted Jun 08, 2010 09:51 AM
    Hi All,

    I have a question regarding defaulting value within NSQL, I hope someone knows the answer to. We develop NSQL to support a custom portlet. The portlet is added as a Tab to the Project object. So my question is, how do I default the NSQL statement to default to the project which is calling the portlet? In order word, if I pull up a project, I want this portlet/NSQL to only show information related this this project. Is this something that must be done within the NSQL or is this something you can set in the portlet?

    Thanks in advance!

    -Tom


  • 2.  RE: How to default to project instance within NSQL portlet?

    Posted Jun 08, 2010 10:59 AM
    You just need to include the NSQL construct;
    @WHERE:PARAM:XML:INTEGER:/data/ProjectID/@value@
    in your NSQL, this will grap the ProjectID from the URL of the page you are on and you can then match that with the INV_INVESTMENTS.ID in your NSQL code.

    This is documented in the Studio Developer's Guide under "NSQL / XPATH (XML Parameter) Constuct"

    (Check the exact syntax in the manual and on the page you are adding the portlet to; the important bit is the "ProjectID" part because that is looking for the explicit text ProjectID=nnnnnn in the URL)


  • 3.  RE: How to default to project instance within NSQL portlet?

    Posted Jun 08, 2010 12:25 PM
    Hi Dave,

    Thank you for your response. Is this XPath construct available for Clarity 8.1? If not, are there any other ways within Clarity 8.1 that can meet the need?

    Thanks,

    -Tom


  • 4.  RE: How to default to project instance within NSQL portlet?
    Best Answer

    Posted Jun 08, 2010 12:38 PM
    ^ yep - 7.5.x, 8.x, 12.x

    You can use a similar technique to build "drill down" portlets, i.e. to pass values from one portlet to another. Your "calling portlet" includes the parameters that your "called portlet" needs and passes them on the URL to a linkable portlet-page, the "called portlet" then uses a similar NSQL construct to read the values from the URL. Again this works in 7.5.x +

    (there are a few threads on the boards about that trick)


  • 5.  RE: How to default to project instance within NSQL portlet?

    Posted Jun 08, 2010 02:35 PM
    Hi Dave,

    I just tried it on my 8.1 system and it worked like a charm. Thanks so much for your help.

    Thanks,

    -Tom


  • 6.  RE: How to default to project instance within NSQL portlet?

    Posted Aug 26, 2011 12:15 AM
    Hi Dave,

    Can I do this in the same page? i.e. I have 2 portlets on the same page. The first one on the left is the resource drilldown portlet and when i select any resource from it, his assignments are shown in the second portlet on the right.

    Is that possible in any way?

    Thanks in advance,
    Georgy


  • 7.  RE: How to default to project instance within NSQL portlet?

    Posted Aug 26, 2011 12:36 AM
    Can you just get the page to drill down to "itself"?

    i.e. you have a PORTLET PAGE with two portlets on it - PORTLET 1 display the resources, PORTLET 2 displays the assignment for a resource identified by a URL parameter (so is initially empty)

    When you select a resource from PORTLET1 is links to the PAGE again (this time with a resource in the URL).

    ?

    (I have not implemented anything like this, I always drill down to a new PORTLET PAGE, it would be interesting to see if this behaves "well")


  • 8.  RE: How to default to project instance within NSQL portlet?

    Posted Aug 26, 2011 01:58 AM
    Hi Dave,

    Thanks a lot. We tried it and it worked.

    But when we select a resource in the resource drilldown portlet1, the portlet page is reloading giving us the resource id in the URL butwe lose the resource selection we made in the first portlet :(

    Any method to keep the resource selection in the first portlet intact?

    Thanks,
    Georgy


  • 9.  RE: How to default to project instance within NSQL portlet?

    Posted Aug 26, 2011 02:17 AM
    Have to "code" that into your logic for PORTLET 1.

    Perhaps highlight the selected row (assuming its a grid portlet) - i.e. you build a column that contains a '1' when the resource id matches the resource id on the URL and '0' otherwise, then highlight the row based on that column (in the portlet Options screen)