• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Accessing JForum Variables from "External" JSP Pages

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys. Work is going along nicely with integrating JForum here. Now I'd like to be able to show the most recent posts elsewhere on our JSP based site, and also replies to posts submitted by the SSO'ed user. My main problem is I do not know how to access the JForum variables. For example, say I wanted to list all the forums:

<#list allCategories as category>
<#list category.getForums() as forum>
<#assign lpi = fir.getLastPostInfo(forum.id)/>
${forum.name?html}</h3>
</#list>
</#list>

Is there a way to access these variables? Should I perhaps create a .htm or .jsp file inside the templates/default JForum folder which creates the output I want from JForum variables, then include this in the JSP page I need it displayed in?

Thanks for any help.
[originally posted on jforum.net by akindo]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A lot of it depends on how you are integrating jForum. There are two ways to do this. One is to have jForum embedded into your application (a single webapp ). The other is to have jForum as a separate webapp with some sort of "embedding" code (iframes and the like).

In the single webapp format, you can add your own jforum commands (e.g., add a new method to a jForum action class like PostAction). So you could create your own command with it's own template file and variables. This could be an HTML "snippet" page that could be embedded in other pages via a JSP dynamic include.

In the multiple webapp situation, the problem becomes a little more complicated. You could add the same sort of commands as above, but produce the info you need and embed it via iFrames or XML/Ajax or XML/Java parsing code in your application. (FYI, the XML version of recent topics is already built in...) Alternatively, you could just go directly to the raw data either via native SQL or just by integrating the jForum DAO classes into your application.


[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for this Monroe.

I do have JForum embedded into my existing application (single webapp). I will try to add my own methods to a JForum class as you suggested. I'm currently working on Lucene searching of our website, so I'll get back to you with the results of JForum integration later.
[originally posted on jforum.net by akindo]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just an FYI... V2.1.8 of JForum... (in beta?..) will use Lucene for searching. You may want to take a look at the code in CVS to see how well your search and jForums might mesh..
[originally posted on jforum.net by monroe]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic