Index: lams_admin/conf/xdoclet/struts-forms.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/conf/xdoclet/struts-forms.xml,v
diff -u -r1.5 -r1.6
--- lams_admin/conf/xdoclet/struts-forms.xml 22 Jun 2006 05:41:36 -0000 1.5
+++ lams_admin/conf/xdoclet/struts-forms.xml 23 Jun 2006 06:58:44 -0000 1.6
@@ -34,3 +34,9 @@
+
+
+
+
+
+
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/UserOrgAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/src/java/org/lamsfoundation/lams/admin/web/UserOrgAction.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/UserOrgAction.java 23 Jun 2006 06:58:44 -0000 1.1
@@ -0,0 +1,136 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id: UserOrgAction.java,v 1.1 2006/06/23 06:58:44 jliew Exp $ */
+package org.lamsfoundation.lams.admin.web;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.apache.struts.action.DynaActionForm;
+import org.lamsfoundation.lams.usermanagement.Organisation;
+import org.lamsfoundation.lams.usermanagement.User;
+import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
+import org.lamsfoundation.lams.util.WebUtil;
+import org.lamsfoundation.lams.web.util.HttpSessionManager;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * @author Jun-Dir Liew
+ *
+ */
+
+/**
+ * struts doclets
+ *
+ * @struts:action path="/userorg"
+ * name="UserOrgForm"
+ * scope="request"
+ * validate="false"
+ *
+ * @struts:action-forward name="userorg"
+ * path=".userorg"
+ */
+public class UserOrgAction extends Action {
+
+ private static final Logger log = Logger.getLogger(UserOrgAction.class);
+ private static WebApplicationContext ctx = WebApplicationContextUtils
+ .getWebApplicationContext(HttpSessionManager.getInstance()
+ .getServletContext());
+ private static IUserManagementService service = (IUserManagementService)ctx
+ .getBean("userManagementServiceTarget");
+
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws Exception {
+
+ ActionMessages errors = new ActionMessages();
+ Integer orgId = WebUtil.readIntParam(request,"orgId",true);
+ log.debug("orgId: "+orgId);
+ // get org name
+ Organisation organisation = (Organisation)service.findById(Organisation.class,orgId);
+
+ if((orgId==null)||(orgId<=0)||organisation==null){
+ errors.add("orgId",new ActionMessage("error.org.invalid"));
+ saveErrors(request,errors);
+ return mapping.findForward("error");
+ }
+
+ String orgName = organisation.getName();
+ log.debug("orgName: "+orgName);
+ Organisation parentOrg = organisation.getParentOrganisation();
+
+ // check user permission
+ //String username = request.getRemoteUser();
+
+ // get list of users in org
+ List users = service.getUsersFromOrganisation(parentOrg.getOrganisationId());
+ request.setAttribute("userlist",users);
+ /*if(users==null){
+ errors.add("org",new ActionMessage("error.org.invalid"));
+ saveErrors(request,errors);
+ return mapping.findForward("error");
+ }*/
+
+ // create form object
+ //UserListDTO userListForm = new UserListDTO();
+ DynaActionForm userOrgForm = (DynaActionForm)form;
+ userOrgForm.set("orgId",orgId);
+ userOrgForm.set("orgName",orgName);
+ //userOrgForm.set("userlist",users);
+ /*userListForm.setOrgId(orgId);
+ userListForm.setOrgName(orgName);
+ List userManageBeans = new ArrayList();
+ for(int i=0; i memberUsers = service.getUsersFromOrganisation(orgId);
+ String[] userIds = new String[memberUsers.size()];
+ for(int i=0; i userIdList = Arrays.asList(userIds);
+ log.debug("userIdList: "+userIdList);
+
+ // remove UserOrganisations that aren't in form data
+ Iterator iter = uos.iterator();
+ while(iter.hasNext()){
+ UserOrganisation uo = (UserOrganisation)iter.next();
+ Integer userId = uo.getUser().getUserId();
+ if(userIdList.indexOf(userId.toString())<0){
+ iter.remove();
+ log.debug("removed: "+userId);
+ }
+ }
+ // add UserOrganisations that are in form data
+ for(int i=0; i :
-' />
+' />
|
Index: lams_admin/web/userorg.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/userorg.jsp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_admin/web/userorg.jsp 23 Jun 2006 06:58:44 -0000 1.1
@@ -0,0 +1,58 @@
+<%@ page contentType="text/html; charset=utf-8" language="java" %>
+
+<%@ taglib uri="tags-html-el" prefix="html-el" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-bean" prefix="bean" %>
+<%@ taglib uri="tags-logic" prefix="logic" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+
+
+
+
+ Add Users to Course/Class:
+
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
\ No newline at end of file
Index: lams_admin/web/WEB-INF/tiles/tiles-defs.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/WEB-INF/tiles/Attic/tiles-defs.xml,v
diff -u -r1.10 -r1.11
--- lams_admin/web/WEB-INF/tiles/tiles-defs.xml 16 Jun 2006 06:57:54 -0000 1.10
+++ lams_admin/web/WEB-INF/tiles/tiles-defs.xml 23 Jun 2006 06:58:44 -0000 1.11
@@ -2,6 +2,14 @@
+
+
+
+
+
+
+
+