Common links in all pages

2010-08-12
2013-02-05
  • Oswald Quek
    Oswald Quek
    2010-08-12

    Hi,
    I'm new to openxava and am evaluating it. I want to ask if there is a strategy for making all the pages of the web application to have a common header section of some sort? For example many websites have their logo and common links such as "About", "Products", "Contact" etc in all the pages of their website. How would I do this in openxava? I would know how to do this in JSF / Apache Tomahawk by just including another .jsf/.jsp/.xhtml etc but am not too sure how to do it in openxava.
    Thanks,
    Oswald

     
  • Hi oswaldquek.

    For example many websites have their logo and common links such as "About", "Products", "Contact" etc in all the pages of their website. How would I do this in openxava?

    Well, you can't (at least easily) , OpenXava modules are portlets, that means that they can be integrated with several portals like Liferay.
    Check: http://www.liferay.com/web/guest/community/wiki/-/wiki/1071674/How+to+install+an+OpenXava+application+on+Liferay
    You'll see that this is a richer and simpler way to accomplish what you are looking for.

    Federico

     
  • Oswald Quek
    Oswald Quek
    2010-08-13

    Ah, ok. Thanks for the info. I'm very unfamiliar with portlets and portals as the projects i've been on in my company haven't used them before. Looks like I'll have to do more research on these. Thanks again.

     
  • Predrag Cicic
    Predrag Cicic
    2012-01-09

    HI,
    I have this problem too.
    I need to create some default JSP header( with menus)  for all modules, without using Portals.
    Do you have some idea how to do this?

    Thanks,
    Predrag

     
  • florian_adler
    florian_adler
    2012-01-09

    Hi,

    When not working with portlet and wanted to use OX as as standalone web app, I was also confronted to this problem.
    I solve it by copying module.jsp into home.jsp and making some adaptations:
    I added under

        if (!isPortlet) {
    %>
    </head>
    <body bgcolor="#ffffff">
    

    The snippet

        <div id="menu">
            <%@ include file="../mp/menu.jsp"%> 
        </div>
    

    To have a menu module

    And after

        if (!isPortlet) {
    %>
    <%=style.getNoPortalModuleEndDecoration()%>
        </div>
    

    The snippet
    <div id="content">
    <%@ include file="../mp/footer.jsp"%>
    </div>
    For the footer

    Then not forget that the URL do not contain module.jsp but home.jsp

    You can get some example at
    http://minuteproject.blogspot.com/2011/06/minuteproject-4-openxava-lazuly.html
    And at http://minuteproject.wikispaces.com/OpenXava

    One drawback of this method is when you change of OX version, module.jsp can be modified and you have to perform again this operation on home.jsp.

    Hope it helps,

    Florian.

     
  • Javier Paniza
    Javier Paniza
    2012-01-10

    Hi,

    One drawback of this method is when you change of OX version

    One option to avoid this drawback is to include module.jsp from menu.jsp

     
  • Predrag Cicic
    Predrag Cicic
    2012-01-11

    Thank both of you. I solved my problem.

     
  • Predrag Cicic
    Predrag Cicic
    2012-01-11

    Thank both of you. I solved my problem.

     
  • Scott Jacobs
    Scott Jacobs
    2012-02-04

    Javier - I too have a similar need to Oswald - and I am not sure I need all of the function/complexity involved with something like Liferay. I have just started taking a look at it - and I have been working with OpenXava using you book and working through the project contained in that. My site would require typical nav links - that would for some at least - correspond to various modules within the Openxava portion of the app. But as I think Oswald was alluding to - I don't want to lose that common header/footer. Using the technique as you described above - including the module.jsp within menu.jsp - are there any drawbacks or gotchas to that approach that you can think of?

    Don't want to go down that path if it means more effort than it would be to just bite the bullet and use a portal based approach to begin with.

     
  • Javier Paniza
    Javier Paniza
    2012-02-10

    Hi Scott,

    are there any drawbacks or gotchas to that approach that you can think of?

    No. In fact, when you run your OpenXava app inside Liferay, it does a include of module.jsp. Moreover, in OpenXavaTest I have a JSP (severalModules.jsp) when I include several module.jsp from a main JSP page. I do it to test multiportlet pages without use a portal.

    Don't want to go down that path if it means more effort than it would be to just bite the bullet and use a portal based approach to begin with.

    It depends of the features you need. A simple link menu can be easy to create, but if you want work with users, roles, access to modules, etc. then maybe you have to reconsider the issue.
    BTW, you can also have a look at NaviOX:
    http://www.openxava.org/naviox
    An add-on that adds security and navigation to an OpenXava application.

     
  • Javier Paniza
    Javier Paniza
    2013-01-08

    Hi Vishnu,

    1) NaviOX is very expensive

    NaviOX LITE is FREE and you can use it for commercial applications. NaviOX lite offers you navigation and login. Try it before create your own solution.

    2) Ading

    Include the OX modules from your own pages. It works fine.


    Ask OpenXava questions on StackOverflow

     
  • Vishnu
    Vishnu
    2013-01-23

    NaviOX LITE is FREE...

    NaviOX LITE is only for single user (test/test) and developer cannot bypass this login URL if they need to use it.Header and Footer are not that fancy and customizable.

    Include the OX modules from your own pages....
    what does include of OX mean? you mean OpenXava project. how does that help?

    Which files to modify in OpenXava project? Kindly please explain in detail.

     
    Last edit: Vishnu 2013-01-23
  • Javier Paniza
    Javier Paniza
    2013-01-25

    Hi Vishnu,

    NaviOX LITE is only for single user (test/test)

    That is not true. You can add all the users you want with the password you choose in the property file naviox-users.properties.

    Header and Footer are not that fancy and customizable.

    That is not true. You can modify the naviox.css to give your own style to the application. Moreover, you can modify naviox/index.jsp to add new headers and footers.

    what does include of OX mean?

    In your own JSPs write:

    <jsp:include page="xava/module.jsp">
        <jsp:param name="application" value="YourApplication" />
        <jsp:param name="module" value="YourModule" />
    </jsp:include>
    

    Ask OpenXava questions on StackOverflow

     
  • Vishnu
    Vishnu
    2013-02-02

    I put the file at "application\web\index.jsp" and it works.

    Really Javier I am thank full to you.
    I will try NaviOX later.

     
  • Javier Paniza
    Javier Paniza
    2013-02-05

    Hi Vishnu,

    I am thank full to you

    The best way to give me thanks is helping others in this forum.


    Ask OpenXava questions on StackOverflow