Thanks for the advice Scott.

It is always good to get advice on this list.  I often
feel like I get a response but no advice.  Do you
think I should build from source?

I must admit, I do not build the tdk from source. 
Alas, I am just a user.  Is the javadoc built from src
much different from that which is under
/webapps/site/turbine-docs/apidocs/? (is it updated)  

The reason I ask is:
I view the api often - in fact that's how I found
DBSecurityService.  But all that says is that it
implements SecurityService (in a diff package) and
this makes no mention of TurbineSecurity.  Now that I
know to look for the facade in the same package as the
Service ..... it's simple.

Terry

--- "Weaver, Scott" <[EMAIL PROTECTED]> wrote:
> Hi Terry,
> 
> The facade is generally located in the same package
> as the service itself
> (no official mappings unfortunately).  I highly
> recommend building the
> javadoc if haven't already done so.  There is a lot
> of great stuff in
> Turbine that is not readily documented so having the
> javadoc on-hand is a
> must.
> 
> Regards,
> Scott 
> 
> -----Original Message-----
> From: Terry McBride [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 08, 2002 6:30 PM
> To: Turbine Users List
> Subject: RE: User Registration - addUser 
> 
> 
> Thanks Scott,
> 
> I thought it was related to the service.  I figured
> it
> was a singleton "so why am I using the constructor"
> but didn't see getInstance.  Newbie didn't think to
> look for a facade; doh!.  
> 
> I was not aware that every turbine service has a
> facade (I was aware that Log is the facade for
> LoggingService).
> 
> There is probably a documented list mapping the
> facades to the service but I missed it - if not
> maybe
> TR.props could have the facade in comments next to
> the
> service registration.
> 
> Thanks again,
> Terry
> 
> --- "Weaver, Scott" <[EMAIL PROTECTED]> wrote:
> > This is not how you access services in Turbine. 
> To
> > access the Security
> > Service use the static methods provided by the
> > facade class TurbineSecurity
> > instead.
> > 
> > >           DBSecurityService dbum = new
> > DBSecurityService();
> > 
> > Services are singleton classes that are
> initialized
> > when Turbine starts and
> > therefore you do not ever create new instances of
> > them.  So just change
> > references to dbnum to TurbinSecurity 
> > 
> > So, this
> > dbum.accountExists(uName)
> > 
> > becomes:
> > 
> > TurbinSecurity .accountExists(uName)
> > 
> > hth,
> > Scott
> > 
> > 
> > > -----Original Message-----
> > > From: Terry McBride
> [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 08, 2002 4:42 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: User Registration - addUser 
> > > 
> > > 
> > > Hi everyone,
> > > 
> > > I'm trying to write an action for registering
> > users. 
> > > I'm including the simple dev version I'm
> starting
> > > with.  I get null pointer exceptions with
> > > accountExists() and addUser().  Get somebody
> clue
> > me
> > > in to what I'm doing wrong?
> > > 
> > > Thanks in advance,
> > > Terry
> > > 
> > > code and log follows......
> > > 
> > >     public void doPerform(RunData data, Context
> > > context)
> > >         throws Exception
> > >     {
> > >       Log.info("Registering a new user");
> > >           TurbineUser user = new TurbineUser();
> > >           DBSecurityService dbum = new
> > DBSecurityService();
> > > 
> > >           // get the parameters passed in
> > >           String fName =
> > > data.getParameters().get("FirstName");
> > >           String lName =
> > data.getParameters().get("LastName");
> > >           String uName =
> > data.getParameters().get("UserName");
> > >           String email =
> > data.getParameters().get("Email");
> > >           String password =
> > > data.getParameters().get("Password");
> > > 
> > >           Log.debug("parameterParser: " +
> > > data.getParameters());
> > >           Log.debug("local vars: " + uName + password +
> > fName
> > > + lName + email);
> > >           
> > >           // set the properties
> > >           user.setFirstName(fName);
> > >           user.setLastName(lName);
> > >           user.setUserName(uName);
> > >           user.setEmail(email);
> > > 
> > >       Log.info("checking for user: " + uName);
> > >           // check if username already exists
> > >           try 
> > >           {
> > >                   if (dbum.accountExists(uName))
> > >                   {
> > >                           data.setMessage("A user with 
> > > this user name
> > > already exsits.  Please choosea nother name");
> > >                           
> > > data.setScreenTemplate("RegistrationForm.vm");
> > >                           return;
> > >                   }
> > >           }
> > >           catch (Exception e)
> > >           {
> > >                   Log.error("Error checking in username 
> > > pre-exists",
> > > e);
> > >           }
> > >           
> > >           // store the user info
> > >       Log.info("Attempting to create user: " +
> > uName);
> > >           dbum.addUser(user, password);
> > > 
> > >           // assign role
> > >           Group group = dbum.getGlobalGroup();
> > >           Role role = dbum.getRole("curriculum_editor");
> > >           dbum.grant(user, group, role);
> > > 
> > >           // authenticate
> > >           dbum.getAuthenticatedUser(uName, password);
> > >           Log.debug("created account: " + user);
> > >         
> > >     }
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > [Fri Feb 08 13:28:22 PST 2002] -- INFO --
> > Registering
> > > a new user
> > > 
> > > [Fri Feb 08 13:28:22 PST 2002] -- DEBUG --
> > > parameterParser: {action=RegisterUser}
> > > {username=test}
> > > {firstname=test}
> > > {lastname=test}
> > > {eventsubmit_doperform=Register}
> > > {email=}
> > > {template=Index.vm}
> > > {password=test}
> > > 
> > > 
> > > [Fri Feb 08 13:28:22 PST 2002] -- DEBUG -- local
> > vars:
> > > testtesttesttest
> > > 
> > > [Fri Feb 08 13:28:22 PST 2002] -- INFO --
> checking
> > for
> > > user: test
> > > 
> > > [Fri Feb 08 13:28:22 PST 2002] -- ERROR -- Error
> > > checking in username pre-exists
> > > 
> > >   Exception:  java.lang.NullPointerException
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to