|
|
Index
| Recent Threads
| Who's Online
| User List
| Register
| Search
| Help
| |
Synyx created an OpenCms 7.0.4 Live CD, based on SLAX Linux, which is now available.
If you want to order a free CD copy, please write, including your postal address, to 
![]() |
OpenCms Forum » List all forums » Forum: Questions about Programming » Thread: about CmsDbContext |
|
Thread Status: Normal Total posts in this thread: 6 |
[Add To My Favorites] [Watch this Thread] [Post new Thread] |
| Author |
|
|
Stranger
|
Hello. I'd like to use createUser of CmsUserDriver. I don't know why I have a nullpointer exception for the parameter CmsDbContext cdb = new CmsDbContext(); this is my code: CmsUser cms_first = new CmsUser(); Map info =cms_first.getAdditionalInfo(); CmsUserDriver necms = new CmsUserDriver() ; String username = "pippo"; String password = "pippo"; String description = "Mr. pippo number one"; String firstname = "pip"; String lastname = "ppo"; String email = "fra@tin.it"; long lastlogin = 0; int flags = 0; long dateCreated = cms_first.getDateCreated(); CmsUUID uid = new CmsUUID(); CmsRequestContext crt = cms.getRequestContext(); CmsDbContext cdb = new CmsDbContext(crt ); necms.createUser(cdb, uid, username ,password,firstname, lastname, email, lastlogin, flags, dateCreated , info ); someone can help me? thank you |
||
|
|
Advanced Member Joined: May 7, 2004 Posts: 457 Status: Offline |
Why do you want to insert the values manually using CmsUserDriver? ---------------------------------------- /** * Florian Hopf * Synyx GmbH & Co. KG */ |
||
|
|
Stranger
|
because if I use: String username = "testest"; String password = "654321"; String description = "Mr. test number one"; String configPath = pageContext.getServletContext().getRealPath("/") + "WEB-INF/config/"; CmsConfigurationManager configurationManager = new CmsConfigurationManager(configPath); CmsUser cmsu = new CmsUser(); Map info =cmsu.getAdditionalInfo(); obj.createUser(username ,password,description ,info); I can't insert other information like email,firstname o lastname. how i have to do to insert those values? for "addWebUser" is the same: String username = "frafra"; String password = "123456"; String description = "Mr. Cara number one"; String group = "Guests"; CmsUser user = obj.addWebUser(username, password, group, "Web User", new Hashtable() ); obj.writeWebUser(user); Can you say me how insert other information? |
||
|
|
Stranger
|
I Need to insert into db users manually. con you help me? Now i do Insert but no with some information like email, lastname and so on... I can only do a classic insert with sql for example: stmt.executeUpdate("insert into cms_users values('0000','fra','frafra','asd','qaz','fra@tin.it','0','0','/','0000000')"); But I'd like to know class and method of OpenCms. |
||
|
|
Advanced Member Joined: May 7, 2004 Posts: 457 Status: Offline |
Hi, you have to create the user first and then modify it immediately. Try this:
HTH Flo ---------------------------------------- /** * Florian Hopf * Synyx GmbH & Co. KG */ |
||
|
|
Stranger
|
thanks Flo. really thank you very much. Ciao, Fra |
||
|
| [Show Printable Version of Thread] [Post new Thread] |