How to customize the Home Page?

0

After upgrading JasperServer from 3.0 to 5.6, our repository appears to work fine, and all webpages appear to work fine. However, we need to customize some web pages. The first change was the login page. Our Login Page looks very similar to the example in JS-Ultimate-Guide-5.5.pdf, "9.4 Customizing JSP and JavaScript for the Login Page". It works fine.

Next, we need to customize the Home Page. The JS-Ultimate-Guide-5.5.pdf did not have any example of customizing the Home Page, except replacing it with the library page. On our Home Page, we don't need the popular resouces, recently viewed items, data sources, domains, or dashboards panels. We need custom icons, labels, layout, and links for:

  • list of analysis views,
  • list of adhoc reports,
  • create adhoc report,
  • manage user settings (for admins only)

Has anyone done something similar? Is there any documentation on customizing the Home Page?

rieman's picture
2
Joined: Mar 16 2007 - 5:47am
Last seen: 4 years 6 months ago

The JRS Ultimate Guide provides ideas for making customizations of jsp.  So I would check the few different means for determing what gets displayed after login.   See these two:

http://community.jaspersoft.com/wiki/customizing-home-or-login-page

http://community.jaspersoft.com/wiki/how-set-role-based-home-page-versio...

To use entirely new JSP's read  the JRS Ultimate Guide's chapter "11.9 Adding a Custom JSP Page in a Spring Web Flow" and use the proHomePageByRole stuff to "flow" to this new jsp upon login.   For deeper info look into how the LoginController servlet creates calls into spring webflow..... and \WEB-INF\flows\homeFlow.xml defines the route for "homeFlow" as going to modules\home\home.jsp, and you can potentially create your own flows routing to your own jsp's and get as fancy as your budget/time allows.

 

 

ghudson_1 - 5 years 2 months ago

In addition to ghudson's suggestions, note that in 5.5 (I think), we introduced optimization of the javascript pages. So if you make any changes to any js files, you will not see them unless you reoptimize.  This takes a few steps. You can disable JavaScript optimization by setting javascript.optimize=false in the <js-webapp>/WEB-INF/js.config.properties file and then reloading the web application.  This can be useful during development and testing. The upcoming 5.6 Ultimate Guide will have instructions on how to optimize.  

Look at this question for more information about optimization:

community.jaspersoft.com/questions/842095/jasperserver-56-how-regenerate-optimized-js-files

elizam - 5 years 2 months ago

1 Answer:

0

Here's an outline to replace the Home Page and the admin Manage Page.

I would attach some sample jsp files, but I don't see an option to attach files.


Replace home page:

  • delete folder \optimized-scripts

  • \scripts\home:

    • AdminWorkflowPage.js - comment out line:

      .append(adminWorkflowsView.$el);
  • \scripts\home\view:

    • HomeView.js - under render: function () :

      comment out lines with workflowsView, popularLinksBlock, recentItemsBlock

  • \scripts\home\template:

    • homeTemplate.htm - remove content, leave empty file

    • adminWorkflowTemplate.htm - remove content, leave empty file

  • \WEB-INF\jsp\modules\home:

    • home.jsp:

      • if role admin, inlcude homePageForAdmin.jsp

      • if role user, include homePageForUser.jsp

    • homePageForAdmin.jsp:

      • in bodyContent, include homeBodyForAdmin.htm

    • homePageForUser.jsp
      • in bodyContent, include homeBodyForUser.htm

    • homeBodyForAdmin.htm - custom home page for admin role

      • contains links:

        view adhoc reports: flow.html?_flowId=searchFlow&mode=search&filterId=resourceTypeFilter&filterOption=resourceTypeFilter-reports
        create adhoc report: flow.html?_flowId=adhocFlow
        analyze (olap views): flow.html?_flowId=searchFlow&mode=search&filterId=resourceTypeFilter&filterOption=resourceTypeFilter-view
        manage app: flow.html?_flowId=adminHomeFlow
    • homeBodyForUser.htm - custom home page for user role

      • contains links:

        view adhoc reports: flow.html?_flowId=searchFlow&mode=search&filterId=resourceTypeFilter&filterOption=resourceTypeFilter-reports
        create adhoc report: flow.html?_flowId=adhocFlow
        analyze (olap views): flow.html?_flowId=searchFlow&mode=search&filterId=resourceTypeFilter&filterOption=resourceTypeFilter-view

Replace admin manage page:

  • \WEB-INF\jsp\modules\home\manage:
    • manageHome.jsp:

      • if role superuser, include managePageForSuper.jsp

      • if role admin, include managePageForAdmin.jsp

    • managePageForSuper.jsp:
      • in bodyContent, include manageBodyForSuper.htm

    • managePageForAdmin.jsp:

      • in bodyContent, include manageBodyForAdmin.htm
      • manageBodyForSuper.htm - custom manage page for superuser role

        • contains links:

          repository: flow.html?_flowId=searchFlow
          users: flow.html?_flowId=userListFlow
          roles: flow.html?_flowId=roleListFlow
          analysis settings: flow.html?_flowId=mondrianPropertiesFlow
      • manageBodyForAdmin.htm - custom manage page for admin role

        • contains links:

          repository: flow.html?_flowId=searchFlow
          users: flow.html?_flowId=userListFlow
          roles: flow.html?_flowId=roleListFlow

rieman's picture
2
Joined: Mar 16 2007 - 5:47am
Last seen: 4 years 6 months ago
Feedback