You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by eg...@apache.org on 2003/06/06 10:29:01 UTC

cvs commit: cocoon-lenya/src/webapp/lenya/content/ac user-modify.xsp

egli        2003/06/06 01:29:01

  Added:       src/webapp/lenya/content/ac user-modify.xsp
  Log:
  Added screen for modifying an existing user.
  
  Revision  Changes    Path
  1.1                  cocoon-lenya/src/webapp/lenya/content/ac/user-modify.xsp
  
  Index: user-modify.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <xsp:page
    language="java"
    xmlns:xsp="http://apache.org/xsp"  
    xmlns:xsp-lenya="http://www.lenya.org/xsp/lenya/1.0"
    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
    >
    
    <xsp:structure>
      <xsp:include>org.apache.lenya.cms.ac.UserManager</xsp:include>
      <xsp:include>org.apache.lenya.cms.ac.User</xsp:include>
      <xsp:include>org.apache.lenya.cms.ac.Group</xsp:include>
      <xsp:include>java.util.Iterator</xsp:include>
    </xsp:structure>
  
    <page>
      <xsp:logic>
        String userId = <xsp-request:get-parameter name="user-id"/>;
        Publication pub = 
          (Publication)<input:get-attribute module="page-envelope" name="publication"/>;
  
        UserManager userManager = null;  
        try {
          userManager = UserManager.instance(pub);
        } catch (Exception e) {
          throw new ProcessingException("Exception when instantiating a UserManager", e);
        }
        User user = userManager.getUser(userId);
      </xsp:logic>
      <user>
        <id><xsp:expr>user.getId()</xsp:expr></id>
        <fullName><xsp:expr>user.getFullName()</xsp:expr></fullName>
        <email><xsp:expr>user.getEmail()</xsp:expr></email>
        <groups>
  	<xsp:logic>
  	  for (Iterator groups = user.getGroups(); groups.hasNext();) {
  	    Group group = (Group) groups.next();
  	    <xsp:content><group><xsp:expr>group.getName()</xsp:expr></group></xsp:content>
  	  }
  	</xsp:logic>
        </groups>
      </user>
    </page>
    
  </xsp:page>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org