• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Add post forms

 
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 have 2.1.8 version of jForum and i would like to personalize the post form :

add a drop down list and check lists to specify the scope of the post
what are the treatements behind these fields
in any java class :
post.class, postrepository.class,...


thanks for help
[originally posted on jforum.net by walido]
 
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 are several places you can start looking at this:

First, you should look at the Post entity class. This will probably have to be modified to include your new properties.

To manage setting and storing this new property, you will need to look at the methods that handle processing the post form(s). These are: PostAction.insertSave() and PostAction.editSave().

To make the information in the POJO entity object persistent, you will have to make a custom PostDAO implimentation. This will have to handle saving and loading the information from/to the DB table/column.

As to displaying the extra information, once it is part of the Post object, the templates can just use it as needed.

[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
Thank very much for the ideas

but i think that i should have a conceptual view of the database
to be able to add columns about the drop down list

and one more thing there is not a FAQ in jForum like other forums?

thanks monroe nice avatar
[originally posted on jforum.net by walido]
 
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 DB structure is pretty straight forward when you dig into it. A couple of exceptions are in how rights are stored but that shouldn't matter much.

Basically, you have two choices in adding fields to posts. You could add columns to the post table. Or you can just create your own tables to store things and like it by the post_id key.

This is a nice part of having all database access go thru the DAO interface. All the code/templates care about are the entity objects. The DAO methods used to fill / store these objects can get that information from as many data sources as needed. E.g., select from the
normal table to fill the current properties. Then select from your "add-on" table, to fill your custom properties.

Re: FAQ - Always looking for volunteers to create stuff like this...

Here's looking at you, kid..

JForum - It's the stuff dreams are made of.
[originally posted on jforum.net by monroe]
 
Destroy anything that stands in your way. Except this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic