This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JForum and the fly likes Custom backend with different table layout? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Custom backend with different table layout?" Watch "Custom backend with different table layout?" New topic

Custom backend with different table layout?

Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424

Can I exchange JForum's backend against a custom backend that I design myself? How hard would it be (e.g. developer months)?

This might seem utterly crazy, I realize, but the situation is this that the company where I work has already developed a server, a client (which is somewhat similar to a Web browser, but does very different things (it runs [code stored in our database] on an user's computer)), and uses a data base with our own custom table layout and our own manner of storing users and data values etcetra. For the forum to be available in our client application, we need to store the forum data in our regular database tables, so our server can retrieve data and deliver to the client. We would store at least forum user data and thread messages and [forum and sub-forum hierarchy information] in these tables.

We also want a Web version of our forum -- hence my interest in JForum, and in modifying the JForum source code.

I know nothing about the internals of JForum, but my wild guess is that we would attempt to exchange [all JForum classes that write to database] with our own classes, which instead store data in our own tables.

( Some details:
1. Our database tables store data in a virtual folder hierarchy: There is a table that looks something like FOLDERS( folder_id NUMBER, child_folder_id NUMBER ).
2. We store files, text, binary data and images in these folders. The data value table looks something like: DATA( data_id NUMBER, data_value BLOB, folder_id, ...)
3. We also have a USERS table.
Of course we could modify the database structure if needed, e.g. add some random columns to the USERS table :-)

(Again, I hope this is not too crazy.)

Kind regards,
[originally posted on by LeoMaheo]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Well, JForum 2.x uses a fairly well defined set of Data Access Object Interfaces (DAO) to access it's information. So, from the point of view of adding in your own DAO implementations, that's fairly straight forward.

I suspect that the big challenge is that all of these are based on the underlying DB being a fairly standard Relational (e.g. SQL) database. So, how easy it would be to convert to your proprietary system depends on how much Relational syntax it supports... like foreign keys and the like.

One thing to consider is that AFAIK jForum 3.0 will be dropping the DAO structures in favor of a Hibernate data access implementation. This means that there may be some major rework required if you want to upgrade to 3.0.

Also, I'm not sure how the new Lucene search code will play with a proprietary DB.. but I haven't dug in to that new code yet. Just something to look at.
[originally posted on by monroe]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hibernate. Hmm. And all this (that I wrote about) was supposed to be done with few resources, fairly quickly

I guess a more reasonable approach might be to keep the JForum backend unchanged, but in some way add [an interface to the Web server] that [delivers JForum database contents to our client] in a format the client understands.


(By the way, concerning foreign keys and the like: we use Oracle.)

[originally posted on by LeoMaheo]
It is sorta covered in the JavaRanch Style Guide.
subject: Custom backend with different table layout?
Similar Threads
Customisation/Feature Request List
Table driven form
Add post forms
Limit on the number of users that can subscribe to Jforum installation?
Complex integration question - multiple jforums -> caching problem?