Hi Claus, thanks for the response.
I think i lack some understanding of the AuthenticationFw/ SessionContext, and that makes my questions not really clear.
Now i can read/get any fragment with InputModule/Java(my 1st question was stupid java question sorry)/Flow /XspSessionFw logicsheet and set them at login. But what if i need to apply some changes?
Example:
Say i put nickname in the data section,
<data><nickname>toto</nickname></data>
and i want to afford the possibility for the user to change it's Nickname via a form, then change it in DB and session without having to login again.
Should i re-process the internal-only pipeline (sunrise-authuser) with the new parameters?
Or try to use some methods like org.apache.cocoon.webapps.session.setContextFragment() or appendContextFragment()?
This is why i was meaning it seems to me complicated to manipulate compare to session.setAttribute("nickname").
Regards,
Phil
Claus Straube wrote:
Hello Phil,
pherhaps I don't understand the second question right, but you can add any element under the data element. For example <data><foo>bar</foo></data>... If you use an action you can give the content 'foo' to your action with the parameter element:
<map:act type="youraction">
<map:parameter name="foosomething" value="{foo}/>
</map:act>
I hope that'll help. Best regards - Claus
__________________________________________
Claus Straube
Franc�strasse 31
80997 M�nchen
+49 (089) 14 16 682
=> -----Urspr�ngliche Nachricht-----
=> Von: Philippe Guillard [mailto:[EMAIL PROTECTED]
=> Gesendet: Freitag, 25. M�rz 2005 06:01
=> An: [email protected]
=> Betreff: [AuthFW] authentication/ID from Java code
=> => Hi all,
=> => I found this wiki: http://wiki.apache.org/cocoon/AuthFWWithFlow, tried
=> this in an action to get thie ID of the user in the Portal, added the
=> import statements that seem to be needed :
=> => ......
=> import org.apache.cocoon.webapps.session.SessionManager;
=> import org.apache.cocoon.components.*;
=> => public class auth extends ServiceableAction implements ThreadSafe {
=> => public Map act(Redirector redirector, SourceResolver resolver,
=> Map objectModel, String src, Parameters par) throws Exception
=> {
=> => org.apache.avalon.framework.component.ComponentManager
=> componentManager = CocoonComponentManager.getSitemapComponentManager();
=> SessionManager sessionManager =
=> (SessionManager)componentManager.lookup(org.apache.cocoon.webapps.session
=> .SessionManager.ROLE);
=> String user = sessionManager.getContextFragment(
=> "authentication", "/authentication/ID").getFirstChild().getNodeValue();
=> => Eclipse says : "CocoonComponentManager cannot be resolved". I can't
=> find why. My knowledge in Java is still poor...(cocoon 2.1.6rls)
=> => Somebody can help ?
=> => Another related question : I use Portal so it uses Authentication
=> Framwork anyway, but until now i was adding some attributes with Java
=> Session object, just because it is easier for mee to get that parameters
=> in java actions. Is there something wrong with this practice ?
=> It looks like this in authentication part:
=> <ID>userName</ID>
=> <role>guest</role>
=> <data><!-- i don't use it</data>
=> <xsp-session:set-attribute
=> name="foo"><xsp:expr>foo</xsp:expr></xsp-session:set-attribute>
=> => => Regards,
=> => Phil
=> => ---------------------------------------------------------------------
=> To unsubscribe, e-mail: [EMAIL PROTECTED]
=> For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
