Hi Guys, I tried all this. Maybe somebody can give some completing hints. I described all in the file email.txt
Thank You Wolfgang *>> *Since the the "new role" function in the portal sample is mapped to *<new-role uri="cocoon:raw:/sunrise-newrole"/> uri, it is using this sitemap *snippet right? * * <map:match pattern="sunrise*"> * <map:generate src="resources/sunrise{1}.xml"/> * <map:transform type="session"/> * <map:transform type="cinclude"/> * <map:transform type="write-source"/> * <map:transform src="styles/portal.xsl"/> * <map:serialize type="xml"/> * </map:match> * *and the documentations says that * *The new-role resource creates a new role in the system. It gets the *parameters "type" with the value "role" and "role" with the new rolename. * *Where is the "type" and "role" parameter? *and why does it have to serialized in an xml type in the end? *<< * *You need to take a look at the file sunrise-newrole.xml. That file contains *most of the dirty work. The transformers session, cinclude and writesource *act on the information contained in there. Because sunrise-newrole.xml also *flows through the pipeline it is then formatted by the stylesheet and *returned to the browser. It is serialized to xml because it is being used *inside the portal (in this case). * *If you wanted to write this to a database you would need to change the *sunrise-newrole.xml and use the sqltransformer instead of cinclude and *write-source. In all this should take you around 5 minutes or less to adapt. *:-) * *So it really is quite simple really. * *Matthew *-- *Open Source Group Cocoon { Consulting, Training, Projects } *================================================================= *Matthew Langham, S&N AG, Klingenderstrasse 5, D-33100 Paderborn *Tel:+49-5251-1581-30 [EMAIL PROTECTED] - http://www.s-und-n.de *----------------------------------------------------------------- *Cocoon book: * http://www.amazon.com/exec/obidos/ASIN/0735712352/needacake-20 *Weblog: * http://radio.weblogs.com/0103021/ *================================================================= * * -----Original Message----- * From: Richard Reyes [mailto:[EMAIL PROTECTED]] * Sent: Tuesday, November 12, 2002 12:53 PM * To: cocoon-users * Subject: RE: Cocoon Portal - User Roles * * * * * Hi Matthew / Guys, * * Just want to confirm some things.... * * Since the the "new role" function in the portal sample is mapped to *<new-role uri="cocoon:raw:/sunrise-newrole"/> uri, it is using this sitemap *snippet right? * * <map:match pattern="sunrise*"> * <map:generate src="resources/sunrise{1}.xml"/> * <map:transform type="session"/> * <map:transform type="cinclude"/> * <map:transform type="write-source"/> * <map:transform src="styles/portal.xsl"/> * <map:serialize type="xml"/> * </map:match> * * and the documentations says that * * The new-role resource creates a new role in the system. It gets the *parameters "type" with the value "role" and "role" with the new rolename. * * Where is the "type" and "role" parameter? * and why does it have to serialized in an xml type in the end? * * Also, for the sunrise-newrole resource, the only thing this pipeline does *is save a new role in the xml file ( sunrise-roles.xml )? whose responsible *for displaying the next page after saving the new role? * * And since this sitemap snippet is called inside a map:pipeline internal *only clause I think it is being called by the portal generator or action. * * If in case I'd used custom actions over this pipeline, How would I know *the parameters that * have been passed and are being expected by the caller of this pipeline? * * Thanks a lot * Richard * ----- Original Message ----- * From: Richard Reyes * To: cocoon-users * Cc: Alex * Sent: Tuesday, November 12, 2002 7:18 PM * Subject: Re: Cocoon Portal - User Roles * * * Hi Matthew, * * Thanks for the reminder! * * ======================================================== * Hi, * * each function of the portal is mapped to a pipeline. So in order to *change the storage - all you have to do is to modify the pipeline to use say *the SQLGenerator etc. * * Read the documentation. *http://xml.apache.org/cocoon/developing/webapps/authentication.html * * It explains this in detail (see under User Administration). Then look at *the pipelines that are currently used to get a feel for how it works at the *moment. * * Matthew * * -- * Open Source Group Cocoon { Consulting, Training, Projects } * ================================================================= * Matthew Langham, S&N AG, Klingenderstrasse 5, D-33100 Paderborn * Tel:+49-5251-1581-30 [EMAIL PROTECTED] - http://www.s-und-n.de * ----------------------------------------------------------------- * Cocoon book: * http://www.amazon.com/exec/obidos/ASIN/0735712352/needacake-20 * Weblog: * http://radio.weblogs.com/0103021/ * ================================================================= * * -----Original Message----- * From: Richard Reyes [mailto:[EMAIL PROTECTED]] * Sent: Tuesday, November 12, 2002 10:06 AM * To: [EMAIL PROTECTED] * Subject: Re: Cocoon Portal - User Roles * * * Hi again guys, * * I have checked the source codes of the portal sample... * * I found out that if I am to add new user or to add new roles, both *task * will end up submitting forms with different parameters to this *resource * * /cocoon/myportal/sunspotdemo-sunriseconf * * which inturn would exactly match this sitemap snippet in the *process... * *
Hi Guys / Richard / Matthew, I read all the documentations and also this e-mail conversation to manage the Portal-roles/users by database. this is what I tried for checking if the user exits in the database: 1. modifed the pipeline/authentification-manager: <authentication uri="cocoon:raw:/sunrise-login"/> 2. modified the internal-pipeline: <map:match pattern="sunrise-login"> <map:generate src="resources/sunrise-login.xml"/> <map:transform type="session"/> <map:transform src="styles/login.xsl"> <map:parameter name="use-request-parameters" value="true"/> </map:transform> <map:transform type="sql"> <map:parameter name="use-connection" value="MyConnection"/> </map:transform> <map:transform src="styles/login-2.xsl"/> <map:serialize type="xml"/> </map:match> 3. created the file sunrise-login.xml: <?xml version="1.0" encoding="iso-8859-1"?> <login/> 4. created the stylesheet login.xsl: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <!-- Make the request parameter available --> <xsl:param name="name"/> <xsl:param name="password"/> <xsl:param name="role"/> <xsl:template match="login"> <authentication> <execute-query xmlns="http://apache.org/cocoon/SQL/2.0"> <query> SELECT id, password,role FROM users WHERE id= '<xsl:value-of select="$name"/>' and password= '<xsl:value-of select="$password"/>' </query> </execute-query> </authentication> </xsl:template> </xsl:stylesheet> 5. created the stylesheet login-2.xsl <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://apache.org/cocoon/SQL/2.0"> <xsl:template match="authentication"> <authentication> <ID><xsl:value-of select="sql:rowset/sql:row/sql:id"/></ID> <role><xsl:value-of select="sql:rowset/sql:row/sql:role"/></role> <data> </data> </authentication> </xsl:template> </xsl:stylesheet> This is what I am supposed to do? Is that right? Indeed it does not work, but i am not shure why? (the database-connection works for other things). Do I have to modify another file? Thanks a lot Wolfgang
--------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>