• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Struts + JForum Separate WAR Post Integration

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a ROOT war which is my main application. and I have JForum deployed in Tomcat as a second war. I've integrated them using SSO.

I now want to integrate posting a new thread in my main app. I have a business detail page like this:

http://www.fencechat.com/businessDetail.do?id=58741&dist=3.6&subcatnm=Tires&subcat=353

On this page I'd like a link that says "discuss this business". Now there can be a few problems here, one of which is two users clicking this link close together and starting separate threads for ths same business.

Any suggestions on how I can simplify the integration here? Lately I've been thinking I will have to import the JForum java code in my main app and use your helper classes.

An ideal way would be to use simple html that just calls back to the Jforum app in tomcat. I can't decide and need some suggestions.

Thanks,
Mark





[originally posted on jforum.net by conquest]
 
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
If your problem is getting two new topics for the same part of your website, how about you create the topic using some automated code, and then only let the users reply to it?

The best and easier approach I can suggest it is to send a httpd request to create the messages. I have been doing such tasks for a while in other projects, and it works very well.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
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
Right that sounds like an ok solution but it still has problems ... maybe there is something I'm missing.

1) user clicks "discuss this business"
2) I auto-generate a topic
3) I make an http request which brings the user to reply to this topic
4) User never clicks "submit" to reply to the topic

I don't want curious users just clicking "discuss this business" and leaving generated topics for hundreds of businesses. It then clutters my forums with these auto-generated messages which have no replies.

I'd be more than glad to write this scenario up for your integration wiki if we can get this worked out.

Thanks!
Mark
[originally posted on jforum.net by conquest]
 
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
Well, then you can just do a little of checking before saving the message to the db. I mean, before a call to the method which writes to the db, you check again to see if there isn't a topic created for the content.
If there is a topic, then you insert the message as a reply.

Like:

1) User A opens your content, and clicks to discuss. At this point he goes to the "write message" form.

2) User B opens the same content page, and also wants to discuss about it. He does the same steps of User A.

3) User B writes faster than User A and sends his data. You check the DB again to make sure that there's still no new topic created, and commits User B data as "new topic"

4) Later, User A sends its contents, and, at this point, a check should be done as well, which then detects that there is already a new topic created, and then you send the message as a reply to the previously send topic.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
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
Ok thanks Rafael ... I'll look into the JForum code. I suppose if I'm slick enough I won't have to share databases across the two WARs in order to determine if a user has already posted. I don't suppose we can story any metadata per post which is non-visible to the user?

These are the kinds of things we need to put together and contribute via the Wiki ... it would help with integrations.

I'll let you preview my code once it's complete.

Cheers,
Mark
[originally posted on jforum.net by conquest]
 
A timing clock, fuse wire, high explosives and a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic