MHL3060 / bentux

Automatically exported from code.google.com/p/bentux
0 stars 0 forks source link

Sign up form - phrase 2b #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sign Up form missing Item:

Contact Name 2 (Optional), 
Mobile No. 2 (Optional), 
Home Address vs Delivery Address, 
Office No (Optional), 
Fax No (Optional), 
Email Address 2 (Optional), 

Statement checkbox (agree to receive promotion … etc)  

Original issue reported on code.google.com by lhkh...@gmail.com on 12 Jul 2010 at 12:41

GoogleCodeExporter commented 9 years ago
Hi Mathew,

Do we really need this one?

the delivery address will be prompted when a customer check out their product.

"Whatever" 2 fields useless. I bet 99.9% people don't enter them.

and no other websites are creating this bloat fields.

Original comment by benli3...@gmail.com on 18 Jul 2010 at 11:56

GoogleCodeExporter commented 9 years ago
I bet nobody will use it but the client told me some of his customers do have 
secondary address and other info so I guess we will fullfill his needs.

I worked on this part yesterday on the signup controller with errors afterall, 
I guess i need to override the User too? 

Original comment by lhkh...@gmail.com on 19 Jul 2010 at 3:46

GoogleCodeExporter commented 9 years ago
There are 3 things you need to do if you decide to work on this

1). create a class and extends the user.java
    1). you need to use jpa singleTable annotation.
        for more details, goto http://www.oracle.com/technology/products/ias/toplink/jpa/howto/use-inheritance.html#single-table

2). userformController bean in dispatchServlet.xml
     1). add the <property name="commandClass" value=" your extends user.java name"
3). modify the userform.jsp to include the fields.
4). modify the user table to include new fields.
I think you haven't done anything like this before. If you have time to play 
around with it, that would be great. or I can do this part.

I think it is a good idea to play around with it. let me know if you need help.

Original comment by benli3...@gmail.com on 19 Jul 2010 at 4:05

GoogleCodeExporter commented 9 years ago
Ben,

what is the commandClass in the following? "     1). add the <property 
name="commandClass" value=" your extends user.java name"" 

wonder if you have seen this 
[tux] ERROR [Timer-2] DispatcherServlet.initServletBean(290) | Context 
initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'userFormController' defined in ServletContext resource 
[/WEB-INF/dispatcher-servlet.xml]: Initialization of bean failed; nested 
exception is java.lang.IllegalArgumentException: Validator 
[org.springmodules.validation.commons.DefaultBeanValidator@143b6f] does not 
support command class [local.tux.app.model.Users]

Original comment by lhkh...@gmail.com on 21 Jul 2010 at 4:30

GoogleCodeExporter commented 9 years ago
I haven't seen this one before. Can you check in your code so I can take a look?

Original comment by benli3...@gmail.com on 21 Jul 2010 at 4:35

GoogleCodeExporter commented 9 years ago
done, i created a new files to extend User

located under local.tux.app.model.Users 

thanks

Original comment by lhkh...@gmail.com on 21 Jul 2010 at 4:47

GoogleCodeExporter commented 9 years ago
I think it is most likely it is the validation.xml problem.

Original comment by benli3...@gmail.com on 21 Jul 2010 at 4:49

GoogleCodeExporter commented 9 years ago
I spent more time on this issue, and I think I have the validation.xml problem 
fixed according the research. 

http://raibledesigns.com/wiki/Wiki.jsp?page=ValidationAndListSpring#ref-Validati
onAndListSpring-2

However, the problem persists, I could have got over with this error msg and 
have the app running by rename the file to User.java . But then, i get another 
problem when going to userform.html

I am thinking if I have the Single table inheritance working properly and that 
causes most of the problem? I have modified the table (not sure if this is the 
final step) and userform page ready. 

Thanks, if u can take a look at the Users.java again 

Original comment by lhkh...@gmail.com on 23 Jul 2010 at 9:05

GoogleCodeExporter commented 9 years ago
I don't think it worth the effort to add another first name / last name into 
system.

if we do so, we  have to create the authentication system all over again. This 
will take a month or two.

there is the shipping address with different first name / last name. that 
suppose covers all the cases. 

if a user has two set of name. he should go to jail. (No one has two set of 
names legally)

Original comment by benli3...@gmail.com on 24 Jul 2010 at 8:38

GoogleCodeExporter commented 9 years ago
k, I will explain the process to the client later then and revert the code. 

BTW, is the user authentication system a build-in from the framework? why do we 
have to re-create it if modify it.

I will then move on to the entertainment page. Create the page and get info 
from entertainment service.  

Original comment by lhkh...@gmail.com on 25 Jul 2010 at 4:19

GoogleCodeExporter commented 9 years ago
Yes. the user authentication is a build-in feature.
we can change the user form, but it requires  a lot of coding. if we need to 
change the user form, we are not taking any advantage of reuse the framework 
code; moreover, as we use the User class across all our classes to keep track 
of User's activities(shopping cart), and identify the role of the Users.

if we need to add these two fields, we need to rewrite the whole authentication 
process.
this includes rewrite:

User.java
UserDao.java
UserDaoHibernate.java
UserManager.java
UserManagerImpl.java
Signupform.jsp
userform.jsp
userformController.java
Security.xml
MenuConfig.xml

and we need to change all our code that have reference to the original 
User.java.

Think about a real life scenario, 

a user can only have one first name and one last name, 
if he want to buy something for someone else.
he can use the shipping address to identify the recipient.

As I said,

to make all these changes just for these useless two fields are nonsense. 

To me, I strongly disagree we add these two fields for the sake of common sense.

Original comment by benli3...@gmail.com on 25 Jul 2010 at 6:45