roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akshay Bhatia" <Akshay.Bha...@morse.com>
Subject RE: Create Roller DB Users Programmitically
Date Wed, 30 Apr 2008 16:08:18 GMT
Found the error, email was not being set.
Thanks
Akshay 

-----Original Message-----
From: Akshay Bhatia 
Sent: 30 April 2008 16:30
To: user@roller.apache.org
Subject: Create Roller DB Users Programmitically

Hi
I am trying to create Roller DB users programmitically, but somehow
these users are not being created in DB. Find below the snippet of code
i.e. trying to create roller user accounts, I check in the logs that
there are only SELECT queries of underlying JPA mechanism but cannot
locate any INSERT queries, i see insert queries in logs when I go
through the standard Roller user register page.
I have checked the code for Register action as well and cannot find any
differences, so any help is appreciated.
Thanks
Akshay
 
 
UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();

User user = new User();

user .setDateCreated(new java.util.Date());

user .setFullName(username);

user .setUserName(username);

user .setScreenName(username);

user .setEnabled(Boolean.TRUE);

user .setPassword("password");

user.setLocale(Locale.getDefault().toString());

try {

// logger.debug("Assigning editor role");

// user.grantRole("editor");

logger.debug("ADD USER START:"+user);

mgr.addUser(user);

logger.debug("ADD USER END"+user);

logger.debug("Checking user exists :"+mgr.getUserByUserName(username));

WebloggerFactory.getWeblogger().flush();

logger.debug("Checking user exists :"+mgr.getUserByUserName(username)); 

} catch (WebloggerException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

 

 



If you have received this e-mail in error, please return it to the
sender immediately and delete it and any attachments from your system.
Morse plc is the UK holding company for various international
subsidiaries trading as Morse. The registered office for Morse Group
Limited (Company Number 2212268) and its UK group undertakings is
Profile West, 950 Great West Road, Brentford, Middlesex TW8 9EE.  VAT
Registration 673 0084 47.


 Click
https://www.mailcontrol.com/sr/wh6Dzjr!QotkQVG73bHPzw7TpdVq6ykcjSjFMbbxC
DZBO0vP+7uOvHeWIgVMpMvua0JEUvfSaRDB5Vj8xXtgTle569ATUpK!3LKF5UFPl46kQdrc+
7tdT5DftwTs31DhQsADSdgKu1stJY6YMaoukFzv8tSufWLO8YesxfyhMuEKfEFVQMBDG0BnE
Kyt1WdI5baaOSB!TnbFT1kIm+0mydkzRWvZw8j!  to report this email as spam.

Mime
View raw message