• 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

API for external application

 
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,
I need my java application ( being hosted apart from my JForum ) to be able to pass user authentication, read posts in threads and post replies.
Does JForum provide a good framework for that?
I can probably add some servlets to my JForum which do the job through JDBC but I prefer not to get into model implementation details if possible.
Thanks in advance
[originally posted on jforum.net by Grinnie]
 
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
The common way that folks are doing this is to use the HTTPClient (apache.org) package and submitting a "virtual form" to jForum. This isn't hard to do and is sort of a REST-ish API.

FYI - Going straight to updating the DB has problems because of jForum's caching mechanisms. The HTTPClient method means your going thru jForum's normal process and the appropriate cache info will be updated.
[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

monroe wrote:The common way that folks are doing this is to use the HTTPClient (apache.org) package and submitting a "virtual form" to jForum. This isn't hard to do and is sort of a REST-ish API.

FYI - Going straight to updating the DB has problems because of jForum's caching mechanisms. The HTTPClient method means your going thru jForum's normal process and the appropriate cache info will be updated.


Thanks a lot for stressing the issue with direct DB update!
Regarding submit from HTTPClient, it seems to be quite easy. However I also need an ability get list of topics and get messages in a certain topic. Probably I can launch HTTP GET for that, however in response I will receive an HTML which is quite complicate to parse.
Perhaps you have another brilliant idea how can I get list of topics and pass through messages in some of them?
[originally posted on jforum.net by Grinnie]
 
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 couple of quick thoughts:

First, reading directly from the DB tables isn't a big deal... it's the writing part that causes cache problems. One minor thing to think about in this is if you want to use jForum's Data Access Object layer (DAO) or not.

Using the DAO mechanism in the same webapp as jforum (e.g. a quartz job), is simple and would make your code more "jForum version free". (e.g., the DAO API SHOULD stay mostly the same but the DB might change).

Using the DAO in another webapp can be a little challenging... going directly to the tables might be faster/easier in this case.

An alternative to direct access would be to tap into the RSS feed system. You can use this with something like the ROME RSS library to get forum topics and topic replies.
[originally posted on jforum.net by monroe]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic