File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JForum and the fly likes Adding a New User's Information Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "Adding a New User Watch "Adding a New User New topic

Adding a New User's Information

Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi Guys!

I would like to add a new obligatory information when a new user register himself.

In Brazil, for example, almost every citizen has an ID number named CPF. With this number is possible to check if that number is from that user, just visiting a government page!
There you can try the following CPF number: 44444444444, discovering that its number owned to MARIA FERRO PERON, for example! ;)

So, I tried to do some changes, like you can see on the below step-by-step:

1. Add a new column to the database:
ALTER TABLE jforum_users ADD user_cpf VARCHAR(11);

2. Edit the file \WEB-INF\config\languages\

3. Edit the file \config\database\generic\generic_queries.sql

4. Edit the file \src\net\jforum\view\forum\

5. Edit the file \src\net\jforum\entities\

6. Edit the file \src\net\jforum\dao\generic\

7. Edit the file \templates\default\user_new.htm

8. Deploy the JForum application with Ant

Finally, the screen created in a new register (/user/ has the field CPF: * correctly added!

And now, with all these changes, the CPF's value is recorded at user_cpf on jforum_users table!

This post was edited sometimes... but could be instructive for future references!

Enjoy it!!!
[originally posted on by leandro_salvador]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Maybe the following explanation can help other JForum's newbies in the future:

1. user_new.htm calls via
getMessage("User.fillCpf") and

2. user_new.htm calls via

3. calls via

4. calls via
setCpf(String cpf) { this.cpf = cpf; }

5. calls generic_queries.sql via
p.setString(6, user.getCpf());

6. generic_queries.sql calls the database via
UserModel.addNew = INSERT INTO jforum_users (username, user_password,
user_email, user_regdate, user_actkey, user_cpf) VALUES (?, ?, ?, ?, ?, ?)

If anybody whose knows this flow better, please, will be a pleasure be corrected and really understand what JForum does in fact! :P

[ ]'s
[originally posted on by leandro_salvador]
I agree. Here's the link:
subject: Adding a New User's Information
It's not a secret anymore!