Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Creating a custom Launch.jsp

  1. #1
    Join Date
    Oct 2006
    Posts
    219

    Default Creating a custom Launch.jsp

    Hi folks,

    Im looking to create a custom Launch.jsp depending on the user and / or group logged into the platform. The Launch.jsp is the main window you get after you log into the BI v3.x platform (the one with the three buttons for creating a new analysis view, report and schedule).

    Even though this screen is nice i would rather display a dashboard (or some other solution) here instead.

    The two things i need to do is determine the user / group that has logged in (so a little custom jsp is needed here) then after that we can use a switch to render the HTML or whatever we want that user / group to see.

    Of course what would be even better is if we could determine who logs in and then automatically execute a solution in a tab. Im pretty sure there are others out there that would also like this sort of functionality so im looking for idea's and information.

    A platform developer would be a good candidate to look over this post

    Cheers!
    www.ivy-is.co.uk - Ivy Information Systems

    Come join the non official Pentaho IRC chat room on irc.freenode.net in the ##pentaho channel

  2. #2

    Red face This could work...

    Haza,

    For people who don't know the launch JSP is located in the tomcat/webapps/pentaho/mantle/launch.jsp
    I'm no guru with this sort of stuff but maybe this can help you get a head start with the problem:

    1. Include the jquery library in launch.jsp
    2. Setup a system xaction to output the current User/Role in JSON
    3. Setup a xaction which will display your solution based on a User/Role
    4. Do a getJSON request to the system xaction
    5. On the success of getting the JSON forward the window.location of the page to the xaction defined in step 3 setting the parameters of User/Role in the URL

    The point of using jquery is to make it a flawless transition using AJAX - I have no idea if this will work or if it even makes sense but I'm just stabbing in the dark here.

    Let me know how you go!
    schone
    Last edited by pgraju; 08-29-2009 at 10:32 PM.
    Join ##Pentaho @ irc.freenode.net and start contributing!

    My blog: http://www.prashantraju.com/
    One guide to rule them all: Pentaho BI Server 3.6.0 with Microsoft SQL Server, MySQL, Oracle and PostgreSQL

  3. #3
    Join Date
    Jul 2007
    Posts
    1,013

    Default

    I know this is an old one, but in case anyone stumbles upon it...

    To get user information from a jsp page in the platform, you can import the "org.springframework.security.context.SecurityContextHolder" and "org.springframework.security.userdetails.User" classes, and then use any methods from the User class, i.e.:

    Code:
    User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    out.println("Username: " + user.getUsername());
    out.println("Roles:");
    for (Object o : user.getAuthorities()){
        out.println(o.toString());
    }
    Cheers!
    (en) Path to Pentaho knowledge: (1:Search the Wiki > 2:Search the Forums > 3:Ask) or (1:Get a Subscription)
    (es) El camino al conocimiento en Pentaho: (1:Buscar en la Wiki > 2:Buscar en los Foros > 3:Preguntar) o (1:Comprar una Subscripción)

  4. #4
    Join Date
    Mar 2006
    Posts
    142

    Default importing classes

    Not being a java developer but having a definite need for the functionality you describe here, could you explain to me what I would do to:

    "you can import the "org.springframework.security.context.SecurityCont extHolder" and "org.springframework.security.userdetails.User "

    I have a customer .js file which I use for all my CDF dashboards and would benefit from being able to store the logged in user (principalName) in a javascript variable.


    Thanks,
    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.