RE: Creation of PSMLs files

2002-11-27 Thread Aurelien Pernoud

First sorry david, I send it to you only at first so you'll have it twice !

 De : David Sean Taylor [mailto:[EMAIL PROTECTED]]

 I think that perhaps you have found a new feature to add to the core.
 That is, if the user doesn't have a profile, create one or
 direct them to the customizer.

I (for my project needs) will implement a fully working one, cause we
already have an application that creates user, but we don't want to
completely modify it so that it creates psml, roles... so I said I'll do it
at the login, all that our other app will have to do is create a
turbine_user (or equivalent).
I saw Pierre has completed my first draw and is not so far from the solution
too, so when I'll get back to user creation in jetspeed I may have not much
to do !

Another feature that I'd like to have : CHECK that the psml retrieved is
still good... Else you have a Unable to fetch pane error (it happens when
tomcat is not properly shut down, and recently I had this error on the
anonymous pane... and noone here do log as anonymous so I don't understand
how it happened ).

This bug is clearly awful, you have to rebuild the psml at the end in
db... So I wanted something that checked if the psml was good, and if not
replace it by the default one... Or better, I'll take a look at the part
where Tomcat writes those psml (in my case I'm using dbpsml, nice work)
cause I think it should commit after checking that the psml is good or
something like that.

 However, if one were extending JLoginUser and wanted to still get the
 default logon behavior, wouldn't you call its doPerform first
 like this:

 public class MyLogin extends JLoginUser
 {

 public void doPerform(RunData data) throws Exception
 {
 super.doPerform(data);
 
 }

Sure, that's what my own login does (also I do it at the end if there was no
trouble in my part ...), this was only a try to understand the working of
classes :)

 Also take a look at the JetspeedAccessController. It is
 responsible for
 getting the profile.

Didn't know that one, I'll take a look.

Thx for comments,
Aurelien


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




RE: Creation of PSMLs files

2002-11-27 Thread Luta, Raphael (VUN)
De : Aurelien Pernoud [mailto:[EMAIL PROTECTED]]
 
 First sorry david, I send it to you only at first so you'll 
 have it twice !
 
  De : David Sean Taylor [mailto:[EMAIL PROTECTED]]
 
  I think that perhaps you have found a new feature to add to 
 the core.
  That is, if the user doesn't have a profile, create one or
  direct them to the customizer.
 
 I (for my project needs) will implement a fully working one, cause we
 already have an application that creates user, but we don't want to
 completely modify it so that it creates psml, roles... so I 
 said I'll do it
 at the login, all that our other app will have to do is create a
 turbine_user (or equivalent).
 I saw Pierre has completed my first draw and is not so far 
 from the solution
 too, so when I'll get back to user creation in jetspeed I may 
 have not much
 to do !
 

Sorry to jump late on this thread but I think a clean way to proceed
would be to add to the Profile interface a new method:

public boolean isNew()

And change the Profiler algorithm so that if it doesn't find any
user PSML resource, it'll load a default PSML resource based either
on group/role membership or default user and mark the profile as
new.

That way, the accesscontroller can check the Profile status and if
is new can redirect the user to customize its profile and then save it.

Would that work for you ?

 Another feature that I'd like to have : CHECK that the psml 
 retrieved is
 still good... Else you have a Unable to fetch pane error 
 (it happens when
 tomcat is not properly shut down, and recently I had this error on the
 anonymous pane... and noone here do log as anonymous so I 
 don't understand
 how it happened ).
 
 This bug is clearly awful, you have to rebuild the psml at 
 the end in
 db... So I wanted something that checked if the psml was 
 good, and if not
 replace it by the default one... Or better, I'll take a look 
 at the part
 where Tomcat writes those psml (in my case I'm using dbpsml, 
 nice work)
 cause I think it should commit after checking that the psml is good or
 something like that.
 

This should be pretty simple to fix, we simply need to act on the
execptions recieved rather than simply log them.

--
Raphaël Luta - [EMAIL PROTECTED]
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/

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




RE: Creation of PSMLs files

2002-11-26 Thread Aurelien Pernoud

I'd say at the creation of user :

org.apache.jetspeed.services.security.turbine.TurbineUserManagement

When addUser() method is called, at the end it calls addDefaultPSML(), so
I'm pretty sure of what I'm saying.

But I think you'd be able to create it at login, if you added the user
directly in database (via another app for example), then you just have to
test that the user exists, and if it hasn't a psml associated, then do the
same that addDefaultPSML... for the user that has just logged in !

Aurelien

 -Message d'origine-
 De : Jefferson Anselmo [mailto:[EMAIL PROTECTED]]
 Envoyé : lundi 25 novembre 2002 18:32
 À : Jetspeed Users List
 Objet : Creation of PSMLs files
 
 
Hi all,
 
Does anybody know when the PSML file for a given user is 
 created ? At the first user´s logon, at account´s creation or 
 none of these ?
 
Thanks in advance,
Jefferson

attachment: winmail.dat--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


RE: Creation of PSMLs files

2002-11-26 Thread Pierre Henry
Aurelien, that's just what I want to do. 

I see from the TurbieUM.addDefaultPSML how to create a new PSML for a user,
but how would you suggest that I test if PSML exists for this user ?



-Original Message-
 From: Jefferson Anselmo [mailto:[EMAIL PROTECTED]]
 Sent: mardi, 26. novembre 2002 13:50
 To: Jetspeed Users List
 Subject: RES: Creation of PSMLs files
 
 
 Thanks, Aurelien!
 
 -Mensagem original-
 De: Aurelien Pernoud [mailto:[EMAIL PROTECTED]]
 Enviada em: terça-feira, 26 de novembro de 2002 8:52
 Para: 'Jetspeed Users List'
 Assunto: RE: Creation of PSMLs files
 
 
 
 I'd say at the creation of user :
 
 org.apache.jetspeed.services.security.turbine.TurbineUserManagement
 
 When addUser() method is called, at the end it calls 
 addDefaultPSML(), so I'm pretty sure of what I'm saying.
 
 But I think you'd be able to create it at login, if you added 
 the user directly in database (via another app for example), 
 then you just have to test that the user exists, and if it 
 hasn't a psml associated, then do the same that 
 addDefaultPSML... for the user that has just logged in !
 
 Aurelien
 
  -Message d'origine-
  De : Jefferson Anselmo [mailto:[EMAIL PROTECTED]]
  Envoyé : lundi 25 novembre 2002 18:32
  À : Jetspeed Users List
  Objet : Creation of PSMLs files
  
  
 Hi all,
  
 Does anybody know when the PSML file for a given user is 
  created ? At the first user´s logon, at account´s creation or 
  none of these ?
  
 Thanks in advance,
 Jefferson
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 



RE: Creation of PSMLs files

2002-11-26 Thread Aurelien Pernoud

 -Message d'origine-
 De : Pierre Henry [mailto:[EMAIL PROTECTED]]

 Aurelien, that's just what I want to do.

 I see from the TurbieUM.addDefaultPSML how to create a new
 PSML for a user,
 but how would you suggest that I test if PSML exists for this user ?

I wanted to try that later, but I tried it now then :)

Here's something that seems to work not so bad, if you have a TURBINE_USER
but no profile associated.
I didn't had group or role to this user, so the test may be incomplete but
not far from solution... :

I made my own login (change the JS.PR default one), attached with this mail

Here's what it does correctly :

user does not exist : Prints User unknown
user exists and has a PSML : Prints Everything is ok, let's login (tried
it with admin, turbine, anon)
user exists in TURBINE_USER but has no PSML : Prints No Profile Found
(had it manually in database, only in table turbine_user)

Although here i didn't test the password supply (JetspeedSecurity has other
methods, I took the shortest !), and I'm not sure it's the right way to do
this, but it seems to work... If any dev have comments I'll take them ;)

Hope this helps,
Aurelien

PS : If you manage to do something working with only a turbine_user (or
maybe turbine_user created and its roles associated in
turbine_user_group_role), I'd be very interested for the future :)



MyLogin.java
Description: JavaScript source
--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


RE: Creation of PSMLs files

2002-11-26 Thread Pierre Henry
Title: RE: Creation of PSMLs files





I managed to make a complete solution which automatically creates the default PSML if no PSML exists.


It seems to work, with a problem that it gives the user only the user role, and the default PSML (by me) includes potlets that a simple user isn't allowed to see. And I think the code is not really elegant, and I didn't test it completely, just tried it once or twice.

I extended the class TurbineAuthentication with my class PcsAuthentication (attached), in order to check if there is a profile for the user, and if there is not, create one, based on the method creatDefaultPSML from the class TurbineUserManagement. It also grants th role user. Of course a role named user has to exist, and this should be extended to maybe add other roles as well.

I'd be interested in any feed back to this class. Hope it helps somebody.


Pierre


 -Original Message-
 From: Aurelien Pernoud [mailto:[EMAIL PROTECTED]]
 Sent: mardi, 26. novembre 2002 15:26
 To: 'Jetspeed Users List'
 Subject: RE: Creation of PSMLs files
 
 
 
  -Message d'origine-
  De : Pierre Henry [mailto:[EMAIL PROTECTED]]
 
  Aurelien, that's just what I want to do.
 
  I see from the TurbieUM.addDefaultPSML how to create a new
  PSML for a user,
  but how would you suggest that I test if PSML exists for this user ?
 
 I wanted to try that later, but I tried it now then :)
 
 Here's something that seems to work not so bad, if you have a 
 TURBINE_USER
 but no profile associated.
 I didn't had group or role to this user, so the test may be 
 incomplete but
 not far from solution... :
 
 I made my own login (change the JS.PR default one), attached 
 with this mail
 
 Here's what it does correctly :
 
 user does not exist : Prints User unknown
 user exists and has a PSML : Prints Everything is ok, let's 
 login (tried
 it with admin, turbine, anon)
 user exists in TURBINE_USER but has no PSML : Prints No 
 Profile Found
 (had it manually in database, only in table turbine_user)
 
 Although here i didn't test the password supply 
 (JetspeedSecurity has other
 methods, I took the shortest !), and I'm not sure it's the 
 right way to do
 this, but it seems to work... If any dev have comments I'll 
 take them ;)
 
 Hope this helps,
 Aurelien
 
 PS : If you manage to do something working with only a 
 turbine_user (or
 maybe turbine_user created and its roles associated in
 turbine_user_group_role), I'd be very interested for the future :)
 







PcsAuthentication.java
Description: Binary data
--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


RE: Creation of PSMLs files

2002-11-26 Thread Pierre Henry
I forgot :
in order to use this class, you have to specify it in
JetspeedSecurity.properties :
services.PortalAuthentication.classname=ch.pcs.portal.security.services.PcsA
uthentication
(and comment the existing line)
and the class has to be in the right directory according to the package
name.



RE: Creation of PSMLs files

2002-11-26 Thread David Sean Taylor


 -Original Message-
 From: Jefferson Anselmo [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 25, 2002 9:32 AM
 To: Jetspeed Users List
 Subject: Creation of PSMLs files


Hi all,

Does anybody know when the PSML file for a given user is
 created ? At the first user´s logon, at account´s creation or
 none of these ?

PSML files are created at Account Creation.
The default algorithm is to copy from the PSML from another account as
configured in JetspeedResources.properties:

# When a new user is created, this account's psml is cloned to the new
account psml
# Setting this account to nothing configures role-based psml as the default
method for new users
services.Profiler.newuser.template=turbine

# Media types template to create for user. (comma separated)
services.Profiler.newuser.media_types=html,wml

You can also configure the roles assigned to a new user in
JetspeedSecurity.properties:

# Role(s) to assign to new user.  Multiple Role must be comma separated.
services.JetspeedSecurity.newuser.roles=user

If you want to change this behavior for creating new accounts, recommend
overriding the Profiler, specifically the createProfile method.



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