• 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

Automatic new topic creation

 
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 want to integrate this discussion board with my web site (E-Commerce). I want to create new topic whenever I add new product to my web. What is the best solution?
[
Do you have a standard API for doing this job?
if no,
Which table needed to be used for creating new topic?
]
[originally posted on jforum.net by kosol]
 
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
There currently is no autoposting api. But you can still do this a couple of ways.

First, look at the PostAction.insertSave() method. This is the code that creates a new post.

There are various ways to use this. You could create a program that does a standard HTTP post to the standard JForum action. E.g. Use the commons-http-client. Or just create a JSP "form" like the new topic form that gets its data from a bean you've set and then does an auto-submit. (but that requires a browser).

Alternatively, you could create a separate autopost servlet that uses the insertSave() as a template but does not get the input data from the request but from your code.

If you go this route, you probably want to look at the jForum.service() method to see how the security environment is set up. Then use this to "autologon" the person you want the post to come from.

Hmm, I was just thinking that the latter solution would be nice and generic if the input to the servlet could be XML like:



Contribution welcome!
[originally posted on jforum.net by monroe]
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic