aspose file tools*
The moose likes JForum and the fly likes Putting JForum inside a webapp (like jforum.net) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Putting JForum inside a webapp (like jforum.net)" Watch "Putting JForum inside a webapp (like jforum.net)" New topic
Author

Putting JForum inside a webapp (like jforum.net)

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
An excellent way to summarise what I am after is by looking at jforum.net itself.

It has it's main page template (header with cool links, sidebar and footer etc).

It's "body" is dynamic, depending on what page user wants to see.
- the body can be a forum (community section)
- or a wiki (documentation section)

This is exactly the kind of layout I am after, except with a simple security so that user's have to be logged in first.

Right now, my custom webapp (the website) has a link to the forum which then opens JForum in its own page (ie: like http://www.jforum.net/jira ) - so it's basically a separate webapp.

How does jforum.net combine the wiki and forum under a template?
[originally posted on jforum.net by konstandinos]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi

Thanks for the great software.

We are wanting to integrate JForum and JSPWiki with a custom webapp we've developed - all under a single host for collaboration.

I can deploy them separately as forum.war, wiki.war and ROOT.war (our custom app) and implement SSO on the host.

However I'd like JForum to sit inside the custom webapp's header / sidebar / footer template (like it does on jforum.net)

Does this mean I have to combine JForum and our custom app under one WAR and fuse their respective web.xml's? On the bright side I don't have to worry about SSO.

How does jforum.net integrate JForum.war into their site? Is it all under one single webapp? Or are they seperate?

Thanks
[originally posted on jforum.net by konstandinos]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
...the magic word is "frames"... just have the "dynamic content" in a frame or iframe, and voila

Then you can load the jforum with target="framename"

This should be what you are looking for

forcing jforum users to log on before writing is a setting within jforum, disallowing any anonymous posts for instance, or you should make an SSO. whatever suits you best
[originally posted on jforum.net by Sid]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Thanks Sid!

I've done some more research and iframes are exactly what I need! :-)

Yup, using SSO to put a whole soup of open source webapps (JForum included) under one authentication umbrella.

And now I can make them look like they're all part of the same webapp. Great.

Cheers
[originally posted on jforum.net by konstandinos]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi, all I am New this forum.


can anybody explain me how to integrate JForum to my web application.
[originally posted on jforum.net by Uma Maheswari]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi Uma

I have a based webapp, available lets say at www.example.com - and my jforum.war is available at www.example.com/forum/

Now inside my main webapp's homepage (index.jsp) I have a link that takes the user to the forum. But the forum is opened up inside an <iframe> that is inside my index.jsp.

I achieve this by setting the target for the link like so: To the forum!

Then make sure you specify the name of your iframe: <iframe name="myiframe"></iframe>

--

But now I am also stuck. This iframe business is holding me back because an iframe doesn't expand to fill the page (like jforum.net). Also, when the iframe's contents take up more space (height for example) than the height of the window (or the iframe for that matter), the iframe gets scrolls bars inside of it on its edges - which I really really don't like.

Sid, Rafael: how did you guys get the jforum markup to be included in your jsp template? I have done view-source on this page and I see that it is all included in tables - no sign of iframes.

I am hoping to achieve the same effect as you guys, perhaps using divs instead of tables, but in essence avoiding iframes.

Pardon that I am asking something off-topic but please help.

Thanks.
[originally posted on jforum.net by konstandinos]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Another possible way to do this is to use the standard jForum template mechanism. Basically every page that jForum generates include the contents from the header.htm and bottom.htm template pages. You can use this to "wrap" jforum with the same heading, footing, and the like as your main site / application has. That's what this site does.

If you need "dynamic" information (e.g. JSP/code generated links in the header), you might think about doing the "mirror image" of what you are currently doing. E.g., modify the header.htm to use an iframe that "embeds" your jsp based header. This should be less size sensitive than the Jforum pages (plus, the back/refresh button will behave better).

FWIW, an iFrame link can target it's _parent or _top to replace the page it's on. For example, a "home" link back to your main app.

Another iFrame trick is to use some javaScript code with an onload event to resize the iFrame. Google for "iframe javascript resize" or similar and you should find some examples.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Thanks for the insightful post monroe.

I considered doing the "mirror" approach, but that has drawbacks in my case: we have our template (header, sidebar, footer) which is part of the "base" app, and the iframe is used to load up additional webapps (jforum, jspwiki, other oss webapps).

We are essentially planning to deploy a host of OSS webapps (www.example.com/forum/ - www.example.com/wiki/ - etc) and by making them viewable inside our base webapp's iframe, they look like they're part of the base app.

By doing the mirror approach, i'd have to have header, sidebar and footer files repeated for every webapp we deploy. This really doesn't make sense in the long run. (maybe I've misunderstood you?)

Ideally I want some way to "include" or "import" the jforum "page" inside the base webapp's body div. That way the div can resize itself (ie: expand downwards should the need arise) automatically.

So far the only way I have managed to import the jforum page into our base webapp is by using an iframe in the base webapp's body div. I'd prefer to avoid the user of iframes anyway, and using javascript (to resize the iframe) is something I'd like to avoid.

I hope what I want is doable - any suggestions?
[originally posted on jforum.net by konstandinos]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Putting JForum inside a webapp (like jforum.net)