You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(141) |
Sep
(184) |
Oct
(159) |
Nov
(77) |
Dec
(114) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(212) |
Feb
(302) |
Mar
(323) |
Apr
(360) |
May
(302) |
Jun
(392) |
Jul
(299) |
Aug
(858) |
Sep
(499) |
Oct
(489) |
Nov
(324) |
Dec
(438) |
2008 |
Jan
(449) |
Feb
(388) |
Mar
(811) |
Apr
(583) |
May
(949) |
Jun
(1431) |
Jul
(943) |
Aug
(527) |
Sep
(576) |
Oct
(440) |
Nov
(1046) |
Dec
(658) |
2009 |
Jan
(259) |
Feb
(192) |
Mar
(495) |
Apr
(2322) |
May
(2023) |
Jun
(1387) |
Jul
(722) |
Aug
(771) |
Sep
(167) |
Oct
(142) |
Nov
(384) |
Dec
(884) |
2010 |
Jan
(344) |
Feb
(82) |
Mar
(248) |
Apr
(341) |
May
(389) |
Jun
(289) |
Jul
(19) |
Aug
(478) |
Sep
(274) |
Oct
(431) |
Nov
(322) |
Dec
(207) |
2011 |
Jan
(125) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John C. <jc...@us...> - 2007-02-17 01:02:37
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8322/src/org/tolven/ajax Modified Files: InstantiateServlet.java AjaxServlet.java Log Message: Activate new security (Thanks Joe, good job) Index: InstantiateServlet.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax/InstantiateServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InstantiateServlet.java 16 Feb 2007 04:17:59 -0000 1.1 --- InstantiateServlet.java 17 Feb 2007 01:02:33 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- import org.tolven.app.bean.MenuPath; import org.tolven.app.entity.MenuData; + import org.tolven.core.entity.AccountUser; import org.tolven.doc.DocumentLocal; import org.tolven.gen.PersonGenerator; *************** *** 70,81 **** String uri = req.getRequestURI(); ! TopAction top = null; ! Object topObj = req.getSession(false).getAttribute("top"); ! if (topObj==null) { ! throw new IllegalStateException( "[docServlet] Top Obj is null - how can that be"); ! } ! if (topObj instanceof TopAction) { ! top = (org.tolven.web.TopAction)topObj; ! } resp.setContentType("text/xml"); resp.setHeader("Cache-Control", "no-cache"); --- 71,75 ---- String uri = req.getRequestURI(); ! AccountUser accountUser = (AccountUser) req.getAttribute("accountUser"); resp.setContentType("text/xml"); resp.setHeader("Cache-Control", "no-cache"); *************** *** 93,97 **** String context = req.getParameter( "context"); MenuData md; ! md = creatorBean.createTRIMInstance(top.getAccountId(), templateId, context, now ); writer.write(md.getPath()); // writer.write( "</element>" ); --- 87,91 ---- String context = req.getParameter( "context"); MenuData md; ! md = creatorBean.createTRIMInstance(accountUser.getAccount().getId(), templateId, context, now ); writer.write(md.getPath()); // writer.write( "</element>" ); Index: AjaxServlet.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax/AjaxServlet.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AjaxServlet.java 16 Feb 2007 04:17:59 -0000 1.19 --- AjaxServlet.java 17 Feb 2007 01:02:33 -0000 1.20 *************** *** 48,51 **** --- 48,53 ---- import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; + import org.tolven.core.ActivationLocal; + import org.tolven.core.entity.AccountUser; import org.tolven.doc.DocumentLocal; import org.tolven.doc.entity.DocImage; *************** *** 64,67 **** --- 66,70 ---- import org.tolven.web.RequestPerformanceItem; import org.tolven.web.TopAction; + import org.tolven.web.security.VestibuleSecurityFilter; /** * A Servlet that responds to Live Grid data requests. See http://openrico.org/docs/RicoLiveGrid.pdf for details of *************** *** 79,82 **** --- 82,86 ---- private DocumentLocal documentLocal; + private ActivationLocal activationBean; private PersonGenerator personDAO; *************** *** 140,143 **** --- 144,148 ---- documentLocal = (DocumentLocal) ctx.lookup("tolven/DocumentBean/local"); menuLocal = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); + activationBean = (ActivationLocal) ctx.lookup("tolven/ActivationBean/local"); } catch (NamingException e) *************** *** 150,162 **** @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ! InitialContext ctx; ! UserTransaction ut = null; ! try { ! ctx = new InitialContext(); ! ut = (UserTransaction) ctx.lookup("UserTransaction"); ! ut.begin(); ! } catch (Exception e) { ! throw new ServletException("[AjaxServlet] Error setting up UserTransaction or starting a transaction", e); ! } long beginNanoTime = 0; --- 155,167 ---- @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ! InitialContext ctx; ! UserTransaction ut = null; ! try { ! ctx = new InitialContext(); ! ut = (UserTransaction) ctx.lookup("UserTransaction"); ! ut.begin(); ! } catch (Exception e) { ! throw new ServletException("[AjaxServlet] Error setting up UserTransaction or starting a transaction", e); ! } long beginNanoTime = 0; *************** *** 173,187 **** String sortCol = req.getParameter( "sort_col"); String sortDir = req.getParameter( "sort_dir"); - TopAction top = null; - Object topObj = req.getSession(false).getAttribute("top"); - if (topObj==null) { - throw new IllegalStateException( "[docServlet] Top Obj is null - how can that be"); - } - if (topObj instanceof TopAction) { - top = (org.tolven.web.TopAction)topObj; - } - // Figure out timeZone ! TimeZone timeZone = TimeZone.getTimeZone(top.getTimeZone()); if (sortDir==null) { --- 178,184 ---- String sortCol = req.getParameter( "sort_col"); String sortDir = req.getParameter( "sort_dir"); // Figure out timeZone ! AccountUser accountUser = (AccountUser) req.getAttribute("accountUser"); ! TimeZone timeZone = TimeZone.getTimeZone(accountUser.getTimeZone()); if (sortDir==null) { *************** *** 196,200 **** String element = req.getParameter( "element"); MenuPath path = new MenuPath( element ); ! long accountId = top.getAccountId(); MenuStructure ms = menuLocal.findMenuStructure( accountId, path.getPath() ); String repeatingBase = ms.getRepeating(); --- 193,197 ---- String element = req.getParameter( "element"); MenuPath path = new MenuPath( element ); ! long accountId = accountUser.getAccount().getId(); MenuStructure ms = menuLocal.findMenuStructure( accountId, path.getPath() ); String repeatingBase = ms.getRepeating(); |
From: John C. <jc...@us...> - 2007-02-17 01:02:37
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8322/src/org/tolven/web/security Modified Files: GeneralSecurityFilter.java VestibuleSecurityFilter.java Log Message: Activate new security (Thanks Joe, good job) Index: VestibuleSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/VestibuleSecurityFilter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** VestibuleSecurityFilter.java 16 Feb 2007 05:06:41 -0000 1.5 --- VestibuleSecurityFilter.java 17 Feb 2007 01:02:33 -0000 1.6 *************** *** 68,216 **** public void init(FilterConfig config) throws ServletException { ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.filter.activate"))) { ! try { ! InitialContext ctx = new InitialContext(); ! activation = (ActivationLocal) ctx.lookup("tolven/ActivationBean/local"); ! loginBean = (LoginLocal) ctx.lookup("tolven/LoginBean/local"); ! invitationBean = (InvitationLocal) ctx.lookup("tolven/InvitationBean/local"); ! //TODO: This needs to be done once per deployment and thus may need to be moved ! if (tolvenContext == null) { ! tolvenContext = new TolvenContext(); ! tolvenContext.initialize(); ! } ! } catch (NamingException e) { ! throw new ServletException(e); } } } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.filter.activate"))) { ! try { ! HttpServletRequest request = (HttpServletRequest) servletRequest; ! HttpServletResponse response = (HttpServletResponse) servletResponse; ! //System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); ! if (!request.isRequestedSessionIdValid()) { ! logout("INVALID SESSION", request, response); ! return; ! } ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); ! if (subject == null) { ! logout("NO SUBJECT", request, response); ! return; ! } ! Principal principal = null; ! Object obj = null; ! for (java.util.Iterator iter = subject.getPrincipals().iterator(); iter.hasNext();) { ! obj = iter.next(); ! if (obj instanceof Principal && !(obj instanceof Group)) { ! principal = (Principal) obj; ! break; ! } ! } ! if (principal == null) { ! logout("NO PRINCIPAL", request, response); ! return; } ! String principalName = principal.getName(); ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); ! if (privateCredentials.isEmpty()) { ! logout("NO PRIVATE KEY RING", request, response); ! return; ! } ! PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! // PHASE ONE: User Authentication ! HttpSession session = request.getSession(); ! TopAction top = (TopAction) session.getAttribute(TOP); ! if (top == null) { ! top = new TopAction(); ! session.setAttribute(TOP, top); ! } ! TolvenUser user = top.getUser(); ! boolean justLoggedIn = user == null; ! if (justLoggedIn) { ! user = activation.loginUser(principalName, (Date) request.getAttribute(TOLVEN_NOW)); ! top.setUser(user); ! session.setAttribute("pass", "true"); ! } ! if ((user == null || Status.NEW_LOGIN.value().equalsIgnoreCase(user.getStatus())) && request.getParameter(INVITATION_ID) != null) { ! // Since we have no user yet, we'll try executing an activation invitation (if it works) ! long invitationId = Long.parseLong(request.getParameter(INVITATION_ID)); ! Date now = (Date) request.getAttribute(TOLVEN_NOW); ! if (!loginBean.activate(principalName, invitationId, now)) { ! logout("COULD NOT ACTIVATE INVITATION", request, response); ! return; ! } ! // try TolvenUser again ! user = activation.loginUser(principalName, now); ! if (user == null) { ! logout("COULD NOT COMPLETE ACTIVATION", request, response); ! return; ! } else { ! top.setUser(user); ! } ! invitationBean.executeInvitation(invitationId, now); } if (user == null) { ! logout("USER IS NULL", request, response); return; } ! if (!user.hasUserPrivateKey()) { ! addKeysToUser(user, subject); ! } ! //If the user has a pass, they don't need to supply a password again ! if ("true".equals(session.getAttribute("pass")) || request.getRequestURL().indexOf("password.jsf") != -1) { ! // Let the user have the request ! } else { ! ((HttpServletResponse) servletResponse).sendRedirect("password.jsf"); return; } ! ! // PHASE TWO: Account Authentication ! String accountUserIdString = request.getParameter(ACCOUNTUSER_ID); ! if (accountUserIdString != null && accountUserIdString.trim().length() > 0) { ! // User has selected an account home page, identify the page and let them through ! AccountUser accountUser = activation.findAccountUser(Long.parseLong(accountUserIdString.trim())); ! if (accountUser == null) { ! logout("ACCOUNTUSER IS NULL", request, response); ! return; ! } ! // SAFETY CHECK HERE - Don't trust the accountUserId alone, it must match user. ! if (accountUser.getUser().getId() != user.getId()) { ! logout("ACCOUNTUSER DOES NOT BELONG TO USER", request, response); ! return; ! } ! // Give TolvenUser the AccountPrivateKey for the selected account ! privateKeyRing.setAccountPrivateKey(accountUser.getAccountPrivateKey()); ! session.removeAttribute("pass"); ! session.setAttribute(ACCOUNTUSER_ID, accountUser.getId()); ! ((HttpServletResponse) servletResponse).sendRedirect("../private/" + accountUser.getAccount().getAccountType().getHomePage()); return; } ! // If user has not been sent on there way by here, remove all account related information...they are in the vestibule ! privateKeyRing.setAccountPrivateKey(null); ! top.setAccountUser(null); ! session.removeAttribute(ACCOUNTUSER_ID); ! } catch (PolicyContextException ex) { ! ex.printStackTrace(); ! throw new ServletException(ex); ! } catch (NamingException ex) { ! ex.printStackTrace(); ! throw new ServletException(ex); ! } catch (InvitationException ex) { ! ex.printStackTrace(); ! throw new ServletException(ex); ! } catch (JAXBException ex) { ! ex.printStackTrace(); ! throw new ServletException(ex); ! } catch (GeneralSecurityException ex) { ! ex.printStackTrace(); ! throw new ServletException(ex); } } chain.doFilter(servletRequest, servletResponse); --- 68,212 ---- public void init(FilterConfig config) throws ServletException { ! try { ! InitialContext ctx = new InitialContext(); ! activation = (ActivationLocal) ctx.lookup("tolven/ActivationBean/local"); ! loginBean = (LoginLocal) ctx.lookup("tolven/LoginBean/local"); ! invitationBean = (InvitationLocal) ctx.lookup("tolven/InvitationBean/local"); ! //TODO: This needs to be done once per deployment and thus may need to be moved ! if (tolvenContext == null) { ! tolvenContext = new TolvenContext(); ! tolvenContext.initialize(); } + } catch (NamingException e) { + throw new ServletException(e); } } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { ! try { ! HttpServletRequest request = (HttpServletRequest) servletRequest; ! HttpServletResponse response = (HttpServletResponse) servletResponse; ! //System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); ! if (!request.isRequestedSessionIdValid()) { ! logout("INVALID SESSION", request, response); ! return; ! } ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); ! if (subject == null) { ! logout("NO SUBJECT", request, response); ! return; ! } ! Principal principal = null; ! Object obj = null; ! for (java.util.Iterator iter = subject.getPrincipals().iterator(); iter.hasNext();) { ! obj = iter.next(); ! if (obj instanceof Principal && !(obj instanceof Group)) { ! principal = (Principal) obj; ! break; } ! } ! if (principal == null) { ! logout("NO PRINCIPAL", request, response); ! return; ! } ! String principalName = principal.getName(); ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); ! if (privateCredentials.isEmpty()) { ! logout("NO PRIVATE KEY RING", request, response); ! return; ! } ! PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! // PHASE ONE: User Authentication ! HttpSession session = request.getSession(); ! TopAction top = (TopAction) session.getAttribute(TOP); ! if (top == null) { ! top = new TopAction(); ! session.setAttribute(TOP, top); ! } ! TolvenUser user = top.getUser(); ! boolean justLoggedIn = user == null; ! if (justLoggedIn) { ! user = activation.loginUser(principalName, (Date) request.getAttribute(TOLVEN_NOW)); ! top.setUser(user); ! session.setAttribute("pass", "true"); ! } ! if ((user == null || Status.NEW_LOGIN.value().equalsIgnoreCase(user.getStatus())) && request.getParameter(INVITATION_ID) != null) { ! // Since we have no user yet, we'll try executing an activation invitation (if it works) ! long invitationId = Long.parseLong(request.getParameter(INVITATION_ID)); ! Date now = (Date) request.getAttribute(TOLVEN_NOW); ! if (!loginBean.activate(principalName, invitationId, now)) { ! logout("COULD NOT ACTIVATE INVITATION", request, response); ! return; } + // try TolvenUser again + user = activation.loginUser(principalName, now); if (user == null) { ! logout("COULD NOT COMPLETE ACTIVATION", request, response); return; + } else { + top.setUser(user); } ! invitationBean.executeInvitation(invitationId, now); ! } ! if (user == null) { ! logout("USER IS NULL", request, response); ! return; ! } ! if (!user.hasUserPrivateKey()) { ! addKeysToUser(user, subject); ! } ! //If the user has a pass, they don't need to supply a password again ! if ("true".equals(session.getAttribute("pass")) || request.getRequestURL().indexOf("password.jsf") != -1) { ! // Let the user have the request ! } else { ! ((HttpServletResponse) servletResponse).sendRedirect("password.jsf"); ! return; ! } ! ! // PHASE TWO: Account Authentication ! String accountUserIdString = request.getParameter(ACCOUNTUSER_ID); ! if (accountUserIdString != null && accountUserIdString.trim().length() > 0) { ! // User has selected an account home page, identify the page and let them through ! AccountUser accountUser = activation.findAccountUser(Long.parseLong(accountUserIdString.trim())); ! if (accountUser == null) { ! logout("ACCOUNTUSER IS NULL", request, response); return; } ! // SAFETY CHECK HERE - Don't trust the accountUserId alone, it must match user. ! if (accountUser.getUser().getId() != user.getId()) { ! logout("ACCOUNTUSER DOES NOT BELONG TO USER", request, response); return; } ! // Give TolvenUser the AccountPrivateKey for the selected account ! privateKeyRing.setAccountPrivateKey(accountUser.getAccountPrivateKey()); ! session.removeAttribute("pass"); ! session.setAttribute(ACCOUNTUSER_ID, accountUser.getId()); ! ((HttpServletResponse) servletResponse).sendRedirect("../private/" + accountUser.getAccount().getAccountType().getHomePage()); ! return; } + // If user has not been sent on there way by here, remove all account related information...they are in the vestibule + privateKeyRing.setAccountPrivateKey(null); + // top.setAccountUser(null); + session.removeAttribute(ACCOUNTUSER_ID); + } catch (PolicyContextException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (NamingException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (InvitationException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (JAXBException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (GeneralSecurityException ex) { + ex.printStackTrace(); + throw new ServletException(ex); } chain.doFilter(servletRequest, servletResponse); Index: GeneralSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/GeneralSecurityFilter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GeneralSecurityFilter.java 8 Feb 2007 08:29:30 -0000 1.4 --- GeneralSecurityFilter.java 17 Feb 2007 01:02:33 -0000 1.5 *************** *** 49,129 **** public void init(FilterConfig config) throws ServletException { ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.filter.activate"))) { ! try { ! InitialContext ctx = new InitialContext(); ! activation = (ActivationLocal) ctx.lookup("tolven/ActivationBean/local"); ! } catch (NamingException e) { ! throw new ServletException(e); ! } } } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.filter.activate"))) { ! try { ! HttpServletRequest request = (HttpServletRequest) servletRequest; ! HttpServletResponse response = (HttpServletResponse) servletResponse; ! //System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); ! if (!request.isRequestedSessionIdValid()) { ! logout("INVALID SESSION", request, response); ! return; ! } ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); ! if (subject == null) { ! logout("NO SUBJECT", request, response); ! return; ! } ! Principal principal = null; ! Object obj = null; ! for (java.util.Iterator iter = subject.getPrincipals().iterator(); iter.hasNext();) { ! obj = iter.next(); ! if (obj instanceof Principal && !(obj instanceof Group)) { ! principal = (Principal) obj; ! break; ! } ! } ! if (principal == null) { ! logout("NO PRINCIPAL", request, response); ! return; } ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); ! if (privateCredentials.isEmpty()) { ! logout("NO PRIVATE KEY RING", request, response); ! return; ! } ! PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! if (privateKeyRing.getAccountPrivateKey() == null) { response.sendRedirect("../vestibule/selectAccount.jsf"); return; } ! if (request.getRequestURL().indexOf("dispatch.jsf") != -1) { ! HttpSession session = request.getSession(); ! TopAction top = (TopAction) session.getAttribute(TOP); ! try { ! if (top == null) { ! top = new TopAction(); ! session.setAttribute(TOP, top); ! } ! AccountUser accountUser = activation.findAccountUser(top.getAccountUserId()); ! if (accountUser == null) { ! response.sendRedirect("../vestibule/selectAccount.jsf"); ! return; ! } ! ((HttpServletResponse) servletResponse).sendRedirect("../private/" + accountUser.getAccount().getAccountType().getHomePage()); ! } catch (Exception ex) { ! ex.printStackTrace(); ! response.sendRedirect("../vestibule/selectAccount.jsf"); ! return; ! } } ! } catch (PolicyContextException ex) { ! ex.printStackTrace(); ! throw new ServletException(ex); } } - chain.doFilter(servletRequest, servletResponse); } --- 49,125 ---- public void init(FilterConfig config) throws ServletException { ! try { ! InitialContext ctx = new InitialContext(); ! activation = (ActivationLocal) ctx.lookup("tolven/ActivationBean/local"); ! } catch (NamingException e) { ! throw new ServletException(e); } } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { ! HttpServletRequest request = (HttpServletRequest) servletRequest; ! HttpServletResponse response = (HttpServletResponse) servletResponse; ! try { ! //System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); ! if (!request.isRequestedSessionIdValid()) { ! logout("INVALID SESSION", request, response); ! return; ! } ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); ! if (subject == null) { ! logout("NO SUBJECT", request, response); ! return; ! } ! Principal principal = null; ! Object obj = null; ! for (java.util.Iterator iter = subject.getPrincipals().iterator(); iter.hasNext();) { ! obj = iter.next(); ! if (obj instanceof Principal && !(obj instanceof Group)) { ! principal = (Principal) obj; ! break; } + } + if (principal == null) { + logout("NO PRINCIPAL", request, response); + return; + } ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); ! if (privateCredentials.isEmpty()) { ! logout("NO PRIVATE KEY RING", request, response); ! return; ! } ! PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! if (privateKeyRing.getAccountPrivateKey() == null) { ! response.sendRedirect("../vestibule/selectAccount.jsf?" + request.getQueryString()); ! return; ! } ! if (request.getRequestURL().indexOf("dispatch.jsf") != -1) { ! HttpSession session = request.getSession(); ! Object accountUserIdObj = session.getAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); ! if (accountUserIdObj == null) { response.sendRedirect("../vestibule/selectAccount.jsf"); return; } ! AccountUser accountUser = activation.findAccountUser(((Long) accountUserIdObj).longValue()); ! if (accountUser == null) { ! response.sendRedirect("../vestibule/selectAccount.jsf"); ! return; } ! ((HttpServletResponse) servletResponse).sendRedirect("../private/" + accountUser.getAccount().getAccountType().getHomePage()); ! return; } + HttpSession session = request.getSession(); + // If we don't have an accountUserId, we have no business being here + Long accountUserId = (Long) session.getAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); + // Set accountUser in request for the duration of this request + request.setAttribute("accountUser", activation.findAccountUser( accountUserId )); + chain.doFilter(servletRequest, servletResponse); + } catch (PolicyContextException ex) { + ex.printStackTrace(); + throw new ServletException(ex); } } |
From: John C. <jc...@us...> - 2007-02-17 01:02:37
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/index In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8322/src/org/tolven/index Modified Files: BrowseSecurityFilter.java Log Message: Activate new security (Thanks Joe, good job) Index: BrowseSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/index/BrowseSecurityFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BrowseSecurityFilter.java 23 Jan 2007 09:12:42 -0000 1.2 --- BrowseSecurityFilter.java 17 Feb 2007 01:02:33 -0000 1.3 *************** *** 230,236 **** // Expose AccountUser to the application for this request. request.setAttribute("accountUser", accountUser); ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! updatePrivateKeyRing( accountUser ); ! } chain.doFilter(request, response); } catch (Exception e) { --- 230,234 ---- // Expose AccountUser to the application for this request. request.setAttribute("accountUser", accountUser); ! updatePrivateKeyRing( accountUser ); chain.doFilter(request, response); } catch (Exception e) { |
From: John C. <jc...@us...> - 2007-02-17 01:02:37
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8322/src/org/tolven/web Modified Files: RegisterAction.java TopAction.java Log Message: Activate new security (Thanks Joe, good job) Index: TopAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TopAction.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** TopAction.java 16 Feb 2007 05:18:33 -0000 1.41 --- TopAction.java 17 Feb 2007 01:02:33 -0000 1.42 *************** *** 29,32 **** --- 29,33 ---- import javax.security.jacc.PolicyContext; import javax.security.jacc.PolicyContextException; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; *************** *** 65,70 **** private TolvenPerson tp; ! private AccountUser accountUser; ! private long accountUserId; --- 66,70 ---- private TolvenPerson tp; ! // private long accountUserId; *************** *** 134,143 **** } tolven.initialize(); ! AccountUser accountUser = null; ! if (accountUserId!=0) { ! accountUser = activation.findAccountUser(accountUserId ); setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); return "dispatch"; ! } info = "Login Processing: " + getTp().getUid(); System.out.println( info ); --- 134,147 ---- } tolven.initialize(); ! ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext(); ! HttpSession session = ((HttpSession) ctx.getSession(true)); ! Object obj = session.getAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); ! // If accountUser is already set, then dispatch ! if (obj != null) { ! long accountUserId = ((Long) obj).longValue(); ! AccountUser accountUser = activation.findAccountUser(accountUserId ); setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); return "dispatch"; ! } info = "Login Processing: " + getTp().getUid(); System.out.println( info ); *************** *** 174,184 **** } ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! if (!getUser().hasUserPrivateKey()) { ! addKeysToUser(); ! } } ! accountUserId = getRequestParameterAsLong( "accountUserId" ); // Otherwise, we dispatch based on the defaultAccount or the one the user selected. if (accountUserId!=0) { --- 178,187 ---- } ! if (!getUser().hasUserPrivateKey()) { ! addKeysToUser(); } ! long accountUserId = getRequestParameterAsLong( "accountUserId" ); ! AccountUser accountUser = null; // Otherwise, we dispatch based on the defaultAccount or the one the user selected. if (accountUserId!=0) { *************** *** 193,197 **** } } ! if (accountUser==null && !this.isIgnoreDefault()) { accountUser = activation.findDefaultAccountUser(getUser()); } --- 196,201 ---- } } ! // See if there's a default available ! if (accountUser==null && !this.isIgnoreDefault()) { accountUser = activation.findDefaultAccountUser(getUser()); } *************** *** 206,226 **** return "dispatch"; } ! setAccountUser(accountUser); ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) ! updatePrivateKeyRing(); setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); return "dispatch"; } ! ! public void setAccountUser(AccountUser accountUser) throws PolicyContextException, GeneralSecurityException { ! this.accountUser = accountUser; ! if (accountUser == null) { ! setAccountUserId(0); ! } else { ! accountUserId = accountUser.getId(); ! // Ensure that this user has a menu structure setup ! menuLocal.createDefaultMenuStructure(accountUser.getAccount()); ! } } public Properties getProperties( ) { --- 210,235 ---- return "dispatch"; } ! // Save accountUserId in session for subsequent request ! session.setAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID, new Long( accountUser.getId())); ! updatePrivateKeyRing(); setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); return "dispatch"; } ! /** ! * Return the accountUser from current request based on the selected accountUserId stored in session. ! * If the accountUser is not in request, query it and stick it there. ! * If we can't find accountUserId, then return null. ! * @return ! */ ! public AccountUser getAccountUser() { ! AccountUser accountUser = (AccountUser) getRequestAttribute("accountUser"); ! // if (accountUser==null) { ! // accountUser = activation.findAccountUser(getAccountUserId() ); ! // HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest(); ! // request.setAttribute("accountUser", accountUser); ! // } ! return accountUser; } + public Properties getProperties( ) { *************** *** 329,333 **** private void updatePrivateKeyRing() throws PolicyContextException, GeneralSecurityException { PrivateKeyRing privateKeyRing = getPrivateKeyRing(); ! AccountUser accountUser = activation.findAccountUser(accountUserId); if (accountUser == null) throw new GeneralSecurityException(": No AccountUser found for " + getUser().getLdapUID()); --- 338,342 ---- private void updatePrivateKeyRing() throws PolicyContextException, GeneralSecurityException { PrivateKeyRing privateKeyRing = getPrivateKeyRing(); ! AccountUser accountUser = activation.findAccountUser(getAccountUserId()); if (accountUser == null) throw new GeneralSecurityException(": No AccountUser found for " + getUser().getLdapUID()); *************** *** 400,425 **** public long getAccountUserId() { ! if (accountUserId == 0) { ! ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext(); ! HttpSession session = ((HttpSession) ctx.getSession(true)); ! Object obj = session.getAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); ! // The AccountUser is for TopAction, so remove it and use it ! session.removeAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); ! if (obj != null) { ! long sessionAccountUserId = ((Long) obj).longValue(); ! try { ! // setting the AccountUser will populate the accountUserId (backward compatibility) ! setAccountUser(activation.findAccountUser(sessionAccountUserId)); ! } catch (Exception ex) { ! // If the AccountUser has not been set yet, then accoutUserId will be returned ! } ! } } ! return accountUserId; } - public void setAccountUserId(long accountUserId) { - this.accountUserId = accountUserId; - } /** * Only used for initial setup, impractical for anything else. --- 409,421 ---- public long getAccountUserId() { ! ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext(); ! HttpSession session = ((HttpSession) ctx.getSession(true)); ! Object obj = session.getAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); ! if (obj != null) { ! return ((Long) obj).longValue(); } ! return 0; } /** * Only used for initial setup, impractical for anything else. *************** *** 444,460 **** public long getAccountId() { ! if(accountUser == null) { return 0; } else { ! return accountUser.getAccount().getId(); } } public String getAccountTitle() { ! if(accountUser == null) { return null; } else { ! return accountUser.getAccount().getTitle(); ! } } --- 440,456 ---- public long getAccountId() { ! if(getAccountUser() == null) { return 0; } else { ! return getAccountUser().getAccount().getId(); } } public String getAccountTitle() { ! if(getAccountUser() == null) { return null; } else { ! return getAccountUser().getAccount().getTitle(); ! } } *************** *** 465,472 **** */ public boolean isAccountAdmin() { ! if(accountUser == null) { return false; } else { ! return accountUser.isAccountPermission(); } } --- 461,468 ---- */ public boolean isAccountAdmin() { ! if(getAccountUser() == null) { return false; } else { ! return getAccountUser().isAccountPermission(); } } *************** *** 484,489 **** */ public String getTimeZone() throws IOException { if (timeZone==null && getUser()!=null) timeZone = getUser().getTimeZone(); - if (timeZone==null) timeZone = getAccountTimeZone(); if (timeZone==null) timeZone = System.getProperty("tolven.timezone"); if (timeZone==null) timeZone = java.util.TimeZone.getDefault().getID(); --- 480,485 ---- */ public String getTimeZone() throws IOException { + if (null!=getAccountUser()) return getAccountUser().getTimeZone(); if (timeZone==null && getUser()!=null) timeZone = getUser().getTimeZone(); if (timeZone==null) timeZone = System.getProperty("tolven.timezone"); if (timeZone==null) timeZone = java.util.TimeZone.getDefault().getID(); *************** *** 496,515 **** public String getAccountTimeZone() { ! if(accountUser == null) { return null; } else { ! return accountUser.getAccount().getTimeZone(); } } public String getAccountType() { ! if(accountUser == null) { return null; } else { ! return accountUser.getAccount().getAccountType().getKnownType(); } } public boolean getCanSelectAccounts() { ! return accountUserId != 0 && "true".equalsIgnoreCase(System.getProperty("tolven.security.filter.activate")); } --- 492,511 ---- public String getAccountTimeZone() { ! if(getAccountUser() == null) { return null; } else { ! return getAccountUser().getAccount().getTimeZone(); } } public String getAccountType() { ! if(getAccountUser() == null) { return null; } else { ! return getAccountUser().getAccount().getAccountType().getKnownType(); } } public boolean getCanSelectAccounts() { ! return getAccountUserId() != 0; } Index: RegisterAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/RegisterAction.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** RegisterAction.java 16 Feb 2007 05:52:50 -0000 1.40 --- RegisterAction.java 17 Feb 2007 01:02:33 -0000 1.41 *************** *** 389,400 **** ldap.updatePerson( getTp() ); boolean forceLogin = false; ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! if (getOldUserPassword() != null && getOldUserPassword().trim().length() > 0) { ! UserPrivateKey userPrivateKey = UserPrivateKey.getInstance(); ! userPrivateKey.initNewPassword(getUser().getUserPrivateKey(), getOldUserPassword().toCharArray(), getTp().getUserPassword().toCharArray()); ! getUser().setUserPrivateKey(userPrivateKey); ! // force user login in order to update the Subject with the new UserPrivateKey ! forceLogin = true; ! } } // And update the user object now, too --- 389,398 ---- ldap.updatePerson( getTp() ); boolean forceLogin = false; ! if (getOldUserPassword() != null && getOldUserPassword().trim().length() > 0) { ! UserPrivateKey userPrivateKey = UserPrivateKey.getInstance(); ! userPrivateKey.initNewPassword(getUser().getUserPrivateKey(), getOldUserPassword().toCharArray(), getTp().getUserPassword().toCharArray()); ! getUser().setUserPrivateKey(userPrivateKey); ! // force user login in order to update the Subject with the new UserPrivateKey ! forceLogin = true; } // And update the user object now, too *************** *** 686,701 **** } AccountUser accountUser = null; ! if (!"true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! //TODO: For backward compatibility, a null UserPublicKey is allowed, to support the existence of no encryption keys existed ! accountUser = accountBean.inviteAccountUser(getAccount(), activation.findAccountUser(getTop().getAccountUserId()), user, null, getNow(), false); ! } else { ! UserPrivateKey userPrivateKey = null; ! try { ! userPrivateKey = getTop().getUserPrivateKey(); ! } catch (Exception ex) { ! throw new RuntimeException("When invited to an Account, a user must have UserPublicKey to protect the AccountPrivateKey"); ! } ! accountUser = accountBean.inviteAccountUser(getAccount(), activation.findAccountUser(getTop().getAccountUserId()), user, userPrivateKey, getNow(), false); } FacesContext.getCurrentInstance().addMessage( "accountAdmin:uid", new FacesMessage("Demo user " + uid + " added, id: " + accountUser.getUser().getId())); // force a refresh of the list --- 684,694 ---- } AccountUser accountUser = null; ! UserPrivateKey userPrivateKey = null; ! try { ! userPrivateKey = getTop().getUserPrivateKey(); ! } catch (Exception ex) { ! throw new RuntimeException("When invited to an Account, a user must have UserPublicKey to protect the AccountPrivateKey"); } + accountUser = accountBean.inviteAccountUser(getAccount(), activation.findAccountUser(getTop().getAccountUserId()), user, userPrivateKey, getNow(), false); FacesContext.getCurrentInstance().addMessage( "accountAdmin:uid", new FacesMessage("Demo user " + uid + " added, id: " + accountUser.getUser().getId())); // force a refresh of the list |
From: John C. <jc...@us...> - 2007-02-17 01:01:38
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7872/src/org/tolven/core/bean Modified Files: AccountDAOBean.java ActivationBean.java Log Message: Activate new security (Thanks Joe, good job) Index: AccountDAOBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean/AccountDAOBean.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AccountDAOBean.java 16 Feb 2007 05:53:37 -0000 1.26 --- AccountDAOBean.java 17 Feb 2007 01:01:37 -0000 1.27 *************** *** 140,146 **** */ public AccountUser inviteAccountUser(Account account, AccountUser inviterAccountUser, TolvenUser invitedUser, UserPrivateKey anInviterUserPrivateKey, Date now, boolean accountPermission) { - if (!"true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { - return addAccountUser(account, invitedUser, now, accountPermission); - } else { try { if (invitedUser.getPublicKey() == null) { --- 140,143 ---- *************** *** 163,167 **** throw new RuntimeException(getClass() + ": Problem with inviteAccountUser for " + ejbContext.getCallerPrincipal() + " CAUSE: " + ex.getMessage()); } - } } /** --- 160,163 ---- *************** *** 216,221 **** // experimental, then developers are free to play by setting System // property tolven.security.keys.activate ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) ! setupAccountKeys(account, au, invitation, user); em.persist( au ); return au; --- 212,216 ---- // experimental, then developers are free to play by setting System // property tolven.security.keys.activate ! setupAccountKeys(account, au, invitation, user); em.persist( au ); return au; Index: ActivationBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean/ActivationBean.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ActivationBean.java 28 Jan 2007 06:52:29 -0000 1.31 --- ActivationBean.java 17 Feb 2007 01:01:37 -0000 1.32 *************** *** 198,202 **** */ public TolvenUser loginUser( String principal, Date now) { - if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { // Verify that we have a subject to work with if (!principal.equals(ejbContext.getCallerPrincipal().getName())) { --- 198,201 ---- *************** *** 211,215 **** if (subject == null) throw new IllegalStateException("[EJB]No Subject found in PolicyContext"); - } TolvenUser user = findUser( principal ); if (user!=null) { --- 210,213 ---- |
From: John C. <jc...@us...> - 2007-02-17 01:01:38
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7872/src/org/tolven/doc/entity Modified Files: DocBase.java Log Message: Activate new security (Thanks Joe, good job) Index: DocBase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity/DocBase.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DocBase.java 23 Jan 2007 09:12:46 -0000 1.20 --- DocBase.java 17 Feb 2007 01:01:36 -0000 1.21 *************** *** 166,174 **** */ public byte[] getContent() { ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! return getDecryptedContent(content); ! } else { ! return content; ! } } --- 166,170 ---- */ public byte[] getContent() { ! return getDecryptedContent(content); } *************** *** 237,245 **** public void setContent(byte[] content) { ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! this.content = getEncryptedContent(content); ! } else { ! this.content = content; ! } } --- 233,237 ---- public void setContent(byte[] content) { ! this.content = getEncryptedContent(content); } |
From: John C. <jc...@us...> - 2007-02-17 01:01:38
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7872/src/org/tolven/core/entity Modified Files: AccountUser.java Log Message: Activate new security (Thanks Joe, good job) Index: AccountUser.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/AccountUser.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AccountUser.java 28 Jan 2007 06:52:29 -0000 1.10 --- AccountUser.java 17 Feb 2007 01:01:37 -0000 1.11 *************** *** 85,88 **** --- 85,106 ---- public AccountUser() { } + + /** + * Get the timezone. Timezone is not stored in this entity. User and account may have timezones and + * if they don't, we look for a system default. + * @return + */ + public String getTimeZone( ) { + String timeZone; + timeZone = getUser().getTimeZone(); + if (timeZone!=null) return timeZone; + timeZone = getAccount().getTimeZone(); + if (timeZone!=null) return timeZone; + timeZone = System.getProperty("tolven.timezone"); + if (timeZone!=null) return timeZone; + timeZone = java.util.TimeZone.getDefault().getID(); + return timeZone; + } + /** * The account to which this user is associated. By this means, a TolvenUser can be associated with any number of Accounts and will normally be |
From: John C. <jc...@us...> - 2007-02-17 01:01:38
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/security/auth In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7872/src/org/tolven/security/auth Modified Files: KeyLoginModule.java Log Message: Activate new security (Thanks Joe, good job) Index: KeyLoginModule.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/auth/KeyLoginModule.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KeyLoginModule.java 11 Feb 2007 21:19:50 -0000 1.3 --- KeyLoginModule.java 17 Feb 2007 01:01:37 -0000 1.4 *************** *** 118,159 **** } if (!allRolesExists) ! group.addMember(new TolvenPrincipal("*")); ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! // Obtain the UserKeyPair if it exists ! InitialContext ictx = new InitialContext(); ! LoginLocal activation = (LoginLocal) ictx.lookup("tolven/LoginBean/local"); ! if (activation == null) ! throw new LoginException(getClass() + ": Could not locate the LoginLocal"); ! UserPrivateKey userPrivateKey = null; ! UserPublicKey userPublicKey = null; ! UserKeyRing userKeyRing = activation.findUserKeyRing(principalName); ! if (userKeyRing == null || userKeyRing.getUserPrivateKey() == null) { ! // Create the keys ! System.out.println("Create new keys for " + principalName); ! userPrivateKey = UserPrivateKey.getInstance(); ! PublicKey publicKey = userPrivateKey.init(password); ! userPublicKey = UserPublicKey.getInstance(); ! userPublicKey.init(publicKey); ! } else { ! userPrivateKey = userKeyRing.getUserPrivateKey(); ! userPublicKey = userKeyRing.getUserPublicKey(); ! } ! userPrivateKey.unlockPrivateKey(password); ! // Populate the Subject ! System.out.println(getClass() + ": Adding UserPrivateKey to Subject " + principalName); ! // UserPrivateKey: Ensure there is only one PrivateKeyRing in a Subject by removing any that might be there ! for (Iterator iter = subject.getPrivateCredentials(PrivateKeyRing.class).iterator(); iter.hasNext();) { ! iter.next(); ! iter.remove(); ! } ! subject.getPrivateCredentials().add(new PrivateKeyRing(userPrivateKey)); ! System.out.println(getClass() + ": Adding getUserPublicKey to Subject " + principalName); ! // UserPublicKey: Ensure there is only one UserPublicKey in a Subject by removing any that might be there ! for (Iterator iter = subject.getPublicCredentials(UserPublicKey.class).iterator(); iter.hasNext();) { ! iter.next(); ! iter.remove(); ! } ! subject.getPublicCredentials().add(userPublicKey); } System.out.println(getClass() + ": completing login for " + principalName); } catch (Exception ex) { --- 118,157 ---- } if (!allRolesExists) ! group.addMember(new TolvenPrincipal("*")); ! // Obtain the UserKeyPair if it exists ! InitialContext ictx = new InitialContext(); ! LoginLocal activation = (LoginLocal) ictx.lookup("tolven/LoginBean/local"); ! if (activation == null) ! throw new LoginException(getClass() + ": Could not locate the LoginLocal"); ! UserPrivateKey userPrivateKey = null; ! UserPublicKey userPublicKey = null; ! UserKeyRing userKeyRing = activation.findUserKeyRing(principalName); ! if (userKeyRing == null || userKeyRing.getUserPrivateKey() == null) { ! // Create the keys ! System.out.println("Create new keys for " + principalName); ! userPrivateKey = UserPrivateKey.getInstance(); ! PublicKey publicKey = userPrivateKey.init(password); ! userPublicKey = UserPublicKey.getInstance(); ! userPublicKey.init(publicKey); ! } else { ! userPrivateKey = userKeyRing.getUserPrivateKey(); ! userPublicKey = userKeyRing.getUserPublicKey(); ! } ! userPrivateKey.unlockPrivateKey(password); ! // Populate the Subject ! System.out.println(getClass() + ": Adding UserPrivateKey to Subject " + principalName); ! // UserPrivateKey: Ensure there is only one PrivateKeyRing in a Subject by removing any that might be there ! for (Iterator iter = subject.getPrivateCredentials(PrivateKeyRing.class).iterator(); iter.hasNext();) { ! iter.next(); ! iter.remove(); } + subject.getPrivateCredentials().add(new PrivateKeyRing(userPrivateKey)); + System.out.println(getClass() + ": Adding getUserPublicKey to Subject " + principalName); + // UserPublicKey: Ensure there is only one UserPublicKey in a Subject by removing any that might be there + for (Iterator iter = subject.getPublicCredentials(UserPublicKey.class).iterator(); iter.hasNext();) { + iter.next(); + iter.remove(); + } + subject.getPublicCredentials().add(userPublicKey); System.out.println(getClass() + ": completing login for " + principalName); } catch (Exception ex) { |
From: John C. <jc...@us...> - 2007-02-17 01:00:43
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7792/src/org/tolven/gen/model Modified Files: WellBabyGen.java Log Message: Fix duration of well baby care in generator Index: WellBabyGen.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/model/WellBabyGen.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WellBabyGen.java 16 Feb 2007 07:10:17 -0000 1.2 --- WellBabyGen.java 17 Feb 2007 01:00:41 -0000 1.3 *************** *** 12,16 **** addMatcher( new DemogMatcher( 0, 6, "F", 0.99)); Scenario annualAppt = new AppointmentScenario( "Routine well-baby checkup", null, null, null); ! this.setScenario(new RepeatScenario(GregorianCalendar.MONTH, 12,1.5, false, 0, 0, annualAppt)); } --- 12,16 ---- addMatcher( new DemogMatcher( 0, 6, "F", 0.99)); Scenario annualAppt = new AppointmentScenario( "Routine well-baby checkup", null, null, null); ! this.setScenario(new RepeatScenario(GregorianCalendar.MONTH, 12,1.5, false, 0, 6, annualAppt)); } |
From: John C. <jc...@us...> - 2007-02-16 07:10:31
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7072/src/org/tolven/gen/model Modified Files: WellBabyGen.java Log Message: fix allergy/hay fever examples Index: WellBabyGen.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/model/WellBabyGen.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WellBabyGen.java 16 Feb 2007 04:02:33 -0000 1.1 --- WellBabyGen.java 16 Feb 2007 07:10:17 -0000 1.2 *************** *** 14,20 **** this.setScenario(new RepeatScenario(GregorianCalendar.MONTH, 12,1.5, false, 0, 0, annualAppt)); } @Override protected void apply(GenMedical patient, Date eventTime) { ! patient.generateAllergy(eventTime, "Hay Fever", "Active"); super.apply(patient, eventTime); } --- 14,28 ---- this.setScenario(new RepeatScenario(GregorianCalendar.MONTH, 12,1.5, false, 0, 0, annualAppt)); } + @Override protected void apply(GenMedical patient, Date eventTime) { ! if (rng.nextUniform(0.0, 1.0) < 0.8) { ! patient.generateProblem(eventTime, "Hay Fever", "Active"); ! patient.generateAllergy(eventTime, "Ragweed", "Active"); ! patient.generateAllergy(eventTime, "Cedar Pollen", "Active"); ! } ! if (rng.nextUniform(0.0, 1.0) < 0.5) { ! patient.generateAllergy(eventTime, "Leaf Mold", "Active"); ! } super.apply(patient, eventTime); } |
Update of /cvsroot/tolven/tolvenClient In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7760 Added Files: weight.trim glucose.trim bloodPressure.trim rash.trim pulse.trim temperature.trim bodyMassIndex.trim Log Message: Trim support --- NEW FILE: pulse.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Pulse</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: temperature.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>gcs.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C0017594"/> </code> <title> <ST>Temperature</ST> </title> <effectiveTime> <TS>123</TS> </effectiveTime> <activityTime> <null>ASKU</null> </activityTime> <observation> <value> <PQ> <value>23.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>echr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: bloodPressure.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>gcs.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C0017594"/> </code> <title> <ST>Blood Pressure</ST> </title> <effectiveTime> <TS>123</TS> </effectiveTime> <activityTime> <null>ASKU</null> </activityTime> <observation> <value> <PQ> <value>23.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>echr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: weight.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>weight.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <id> <xxx>a</xxx> <II extension="abc"/> <II extension="abc"/> <II extension="abc"/> </id> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C0017594"/> </code> <title> <ST>Weight</ST> </title> <effectiveTime> <TS>123</TS> </effectiveTime> <activityTime> <null>ASKU</null> </activityTime> <priorityCode> <CE code="123"> <originalText> <ST>My origianl text</ST> </originalText> </CE> <CE code="123"/> </priorityCode> <languageCode> <CE code="en"/> </languageCode> <observation> <value> <PQ> <value>23.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: glucose.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Serum Glucose</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: bodyMassIndex.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Body Mass Index</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: rash.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Rash</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> |
From: John C. <jc...@us...> - 2007-02-16 05:54:31
|
Update of /cvsroot/tolven/tolvenClient/src/org/tolven/client In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7744/src/org/tolven/client Modified Files: LoadTRIM.java TolvenClient.java TestLogin.java Log Message: Trim support Index: TestLogin.java =================================================================== RCS file: /cvsroot/tolven/tolvenClient/src/org/tolven/client/TestLogin.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestLogin.java 7 Feb 2007 05:10:50 -0000 1.2 --- TestLogin.java 16 Feb 2007 05:54:30 -0000 1.3 *************** *** 18,21 **** --- 18,23 ---- t.login(uid, password, accountId); t.logout(); + t.login(uid, password, accountId); + t.logout(); } } Index: LoadTRIM.java =================================================================== RCS file: /cvsroot/tolven/tolvenClient/src/org/tolven/client/LoadTRIM.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LoadTRIM.java 7 Feb 2007 01:35:46 -0000 1.1 --- LoadTRIM.java 16 Feb 2007 05:54:30 -0000 1.2 *************** *** 16,20 **** } ! private static long accountId = 11800; private static String directory = "."; private static String EXTENSION = ".trim"; --- 16,20 ---- } ! private static long accountId = 21901; private static String directory = "."; private static String EXTENSION = ".trim"; *************** *** 28,34 **** } ! public void runit() throws IOException { File dir = new File( directory ); ! File files[] = dir.listFiles(new TrimFilter()); for (File file : files) { --- 28,34 ---- } ! public void runit() throws Exception { File dir = new File( directory ); ! beginTransaction(); File files[] = dir.listFiles(new TrimFilter()); for (File file : files) { *************** *** 43,46 **** --- 43,47 ---- System.out.println( "File: " + file.getName()); } + commitTransaction(); } Index: TolvenClient.java =================================================================== RCS file: /cvsroot/tolven/tolvenClient/src/org/tolven/client/TolvenClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TolvenClient.java 8 Feb 2007 04:42:59 -0000 1.3 --- TolvenClient.java 16 Feb 2007 05:54:30 -0000 1.4 *************** *** 15,18 **** --- 15,24 ---- import javax.security.auth.login.LoginException; import javax.security.jacc.PolicyContextException; + import javax.transaction.HeuristicMixedException; + import javax.transaction.HeuristicRollbackException; + import javax.transaction.NotSupportedException; + import javax.transaction.RollbackException; + import javax.transaction.SystemException; + import javax.transaction.UserTransaction; import org.tolven.app.CreatorRemote; *************** *** 42,48 **** private LoginContext lc; protected AccountUser accountUser; public TolvenClient() throws NamingException { ! InitialContext ctx = new InitialContext(); // Bind to the remote session bean interface in the running server via JNDI/RMI docBean = (DocumentRemote) ctx.lookup("tolven/DocumentBean/remote"); --- 48,56 ---- private LoginContext lc; protected AccountUser accountUser; + private InitialContext ctx; + UserTransaction ut; public TolvenClient() throws NamingException { ! ctx = new InitialContext(); // Bind to the remote session bean interface in the running server via JNDI/RMI docBean = (DocumentRemote) ctx.lookup("tolven/DocumentBean/remote"); *************** *** 55,58 **** --- 63,75 ---- } + protected void beginTransaction() throws NotSupportedException, SystemException, NamingException { + ut = (UserTransaction) ctx.lookup("UserTransaction"); + ut.begin(); + } + + protected void commitTransaction() throws NotSupportedException, SystemException, IllegalStateException, RollbackException, HeuristicMixedException, HeuristicRollbackException { + ut.commit(); + } + protected void setupPrivateKeyRing(String password, AccountUser accountUser, Subject subject, UserKeyRing userKeyRing) throws PolicyContextException, GeneralSecurityException, IOException { UserPrivateKey userPrivateKey = null; |
From: John C. <jc...@us...> - 2007-02-16 05:53:42
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7330/src/org/tolven/core/bean Modified Files: AccountDAOBean.java Log Message: Add support to update Account entity Index: AccountDAOBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean/AccountDAOBean.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AccountDAOBean.java 29 Jan 2007 01:55:40 -0000 1.25 --- AccountDAOBean.java 16 Feb 2007 05:53:37 -0000 1.26 *************** *** 79,83 **** } ! /** * Create a new account. No users are associated with this account. * @param accountType --- 79,91 ---- } ! /** ! * Stick the updated account back in the database. ! * @param account ! */ ! public void updateAccount( Account account ) { ! em.merge(account); ! } ! ! /** * Create a new account. No users are associated with this account. * @param accountType |
From: John C. <jc...@us...> - 2007-02-16 05:53:42
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7330/src/org/tolven/core Modified Files: AccountDAOLocal.java Log Message: Add support to update Account entity Index: AccountDAOLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/AccountDAOLocal.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AccountDAOLocal.java 29 Jan 2007 01:55:37 -0000 1.13 --- AccountDAOLocal.java 16 Feb 2007 05:53:37 -0000 1.14 *************** *** 46,49 **** --- 46,55 ---- /** + * Stick the updated account back in the database. + * @param account + */ + public void updateAccount( Account account ); + + /** * Create a new account. No users are associated with this account. * @param accountType |
From: John C. <jc...@us...> - 2007-02-16 05:52:56
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6927/src/org/tolven/web Modified Files: RegisterAction.java Log Message: New and improved Accountadmin pages Index: RegisterAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/RegisterAction.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** RegisterAction.java 12 Feb 2007 07:09:18 -0000 1.39 --- RegisterAction.java 16 Feb 2007 05:52:50 -0000 1.40 *************** *** 87,90 **** --- 87,91 ---- private String accountTitle; + private String accountTimeZone; private String newAccountTitle; *************** *** 196,200 **** */ public String updateAccount() { ! getAccount().setTitle(getAccountTitle()); // getTop().setAccountTitle(getAccountTitle()); // getTop().setAccountTimeZone(getAccount().getTimeZone()); --- 197,204 ---- */ public String updateAccount() { ! Account account = getAccountUser().getAccount(); ! account.setTitle(getAccountTitle()); ! account.setTimeZone(getAccountTimeZone()); ! accountBean.updateAccount(account); // getTop().setAccountTitle(getAccountTitle()); // getTop().setAccountTimeZone(getAccount().getTimeZone()); *************** *** 632,635 **** --- 636,648 ---- } + public void setAccountTimeZone(String accountTimeZone) { + this.accountTimeZone = accountTimeZone; + } + + public String getAccountTimeZone() { + if (accountTimeZone==null) accountTimeZone = getAccount().getTimeZone(); + return accountTimeZone; + } + public void setAccountTitle(String accountTitle) { this.accountTitle = accountTitle; |
From: John C. <jc...@us...> - 2007-02-16 05:52:27
|
Update of /cvsroot/tolven/tolvenWEB/web/WEB-INF In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6908/web/WEB-INF Modified Files: faces-config.xml Log Message: New and improved Accountadmin pages Index: faces-config.xml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/WEB-INF/faces-config.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** faces-config.xml 12 Feb 2007 07:12:15 -0000 1.34 --- faces-config.xml 16 Feb 2007 05:52:26 -0000 1.35 *************** *** 40,44 **** <navigation-case> <from-outcome>adminAccount</from-outcome> ! <to-view-id>/private/adminAccount.xhtml</to-view-id> </navigation-case> <navigation-case> --- 40,44 ---- <navigation-case> <from-outcome>adminAccount</from-outcome> ! <to-view-id>/manage/adminAccount.xhtml</to-view-id> </navigation-case> <navigation-case> *************** *** 150,154 **** --- 150,158 ---- </navigation-case> </navigation-rule> + <navigation-rule> + <description> + Return to Application Home Page + </description> <navigation-case> <from-outcome>echr</from-outcome> *************** *** 162,198 **** </navigation-case> </navigation-rule> <navigation-rule> <description> Account Administration </description> ! <from-view-id>/private/adminAccount.xhtml</from-view-id> <navigation-case> <from-action>#{reg.updateAccount}</from-action> <from-outcome>success</from-outcome> <to-view-id>/private/dispatch.xhtml</to-view-id> <redirect/> ! </navigation-case> <navigation-case> ! <from-action>#{reg.addSponsorship}</from-action> <from-outcome>success</from-outcome> ! <to-view-id>/private/adminAccount.xhtml</to-view-id> </navigation-case> <navigation-case> ! <from-action>#{reg.addDemoUser}</from-action> <from-outcome>success</from-outcome> ! <to-view-id>/private/adminAccount.xhtml</to-view-id> </navigation-case> <navigation-case> ! <from-outcome>cancel</from-outcome> <to-view-id>/private/dispatch.xhtml</to-view-id> ! </navigation-case> ! <navigation-case> ! <from-outcome>fail</from-outcome> ! <to-view-id>/private/adminAccount.xhtml</to-view-id> </navigation-case> <navigation-case> <from-action>#{gen.createCHRPatients}</from-action> <from-outcome>success</from-outcome> ! <to-view-id>/private/adminAccount.xhtml</to-view-id> </navigation-case> </navigation-rule> --- 166,256 ---- </navigation-case> </navigation-rule> + <navigation-rule> <description> Account Administration </description> ! <from-view-id>/manage/adminAccount.xhtml</from-view-id> ! <navigation-case> ! <from-outcome>edit</from-outcome> ! <to-view-id>/manage/editProfile.xhtml</to-view-id> ! <redirect/> ! </navigation-case> <navigation-case> + <from-outcome>control</from-outcome> + <to-view-id>/manage/controlAccess.xhtml</to-view-id> + <redirect/> + </navigation-case> + <navigation-case> + <from-outcome>sponsor</from-outcome> + <to-view-id>/manage/addSponsor.xhtml</to-view-id> + <redirect/> + </navigation-case> + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/private/dispatch.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>fail</from-outcome> + <to-view-id>/manage/adminAccount.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <description> + Edit Account Title or Timezone + </description> + <from-view-id>/manage/editProfile.xhtml</from-view-id> + <navigation-case> <from-action>#{reg.updateAccount}</from-action> <from-outcome>success</from-outcome> <to-view-id>/private/dispatch.xhtml</to-view-id> <redirect/> ! </navigation-case> ! </navigation-rule> ! ! <navigation-rule> ! <description> ! Control User Access to Accounts ! </description> ! <from-view-id>/manage/controlAccess.xhtml</from-view-id> ! <navigation-case> ! <from-action>#{reg.addDemoUser}</from-action> ! <from-outcome>success</from-outcome> ! <to-view-id>/manage/adminAccount.xhtml</to-view-id> ! </navigation-case> <navigation-case> ! <from-action>#{reg.updateAccount}</from-action> <from-outcome>success</from-outcome> ! <to-view-id>/private/dispatch.xhtml</to-view-id> ! <redirect/> </navigation-case> <navigation-case> ! <from-action>#{gen.createCHRPatients}</from-action> <from-outcome>success</from-outcome> ! <to-view-id>/manage/adminAccount.xhtml</to-view-id> </navigation-case> + </navigation-rule> + + <navigation-rule> + <description> + Add Sponsorships + </description> + <from-view-id>/manage/sponsorAdd.xhtml</from-view-id> + <navigation-case> + <from-action>#{reg.addSponsorship}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/manage/adminAccount.xhtml</to-view-id> + </navigation-case> <navigation-case> ! <from-action>#{reg.updateAccount}</from-action> ! <from-outcome>success</from-outcome> <to-view-id>/private/dispatch.xhtml</to-view-id> ! <redirect/> </navigation-case> <navigation-case> <from-action>#{gen.createCHRPatients}</from-action> <from-outcome>success</from-outcome> ! <to-view-id>/manage/adminAccount.xhtml</to-view-id> </navigation-case> </navigation-rule> *************** *** 205,209 **** <navigation-case> <from-outcome>close</from-outcome> ! <to-view-id>/private/adminAccount.xhtml</to-view-id> <redirect/> </navigation-case> --- 263,267 ---- <navigation-case> <from-outcome>close</from-outcome> ! <to-view-id>/manage/adminAccount.xhtml</to-view-id> <redirect/> </navigation-case> |
From: John C. <jc...@us...> - 2007-02-16 05:52:11
|
Update of /cvsroot/tolven/tolvenWEB/web/manage In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6682/web/manage Added Files: adminAccount.xhtml editProfile.xhtml controlAccess.xhtml addSponsor.xhtml Log Message: New and improved Accountadmin pages --- NEW FILE: addSponsor.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <head> <title>User Preferences</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <ui:composition template="../templates/portalTemplate.xhtml"> <ui:param name="skin" value="echr"/> <ui:define name="content"> <h3>Account sponsorships</h3> <h:form id="accountAdmin"> <p>Create a sponsorship and hand out the id to allow people to register for an account. People using this reference code will not be added to this account. However, we will keep track of all of the users that ultimately use this reference code.</p> <h:dataTable value="#{reg.sponsorships}" var="sp" styleClass="activity"> <h:column> <f:facet name="header"> <h:outputText value="Title"/> </f:facet> <h:outputText value="#{sp.title}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Reference Code"/> </f:facet> <h:outputText value="#{sp.referenceCode}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="URL"/> </f:facet> <h:outputText value="http://#{top.properties['tolven.invitation.host']}:#{top.properties['tolven.invitation.port']}#{top.properties['tolven.invitation.root']}/public/register.jsf?referenceCode=#{sp.referenceCode}" /> </h:column> </h:dataTable> <h:panelGrid columns="2" > <h:inputText id="sponsorTitle" value="#{reg.sponsorshipTitle}" size="50"/> <h:commandButton action="#{reg.addSponsorship}" value="Add Sponsorship"/> </h:panelGrid> <h:outputLink value="/Tolven/private/sponsoredUsers.jsf"> <h:outputText value="List of sponsored users"/> </h:outputLink> <h:outputText value=" | | " /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='echr'}" action="echr" /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='ephr'}" action="ephr" /> <h:messages for="acctAdmin:sponsorTitle" errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </h:form> </ui:define> </ui:composition> </body> </html> --- NEW FILE: adminAccount.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <head> <title>User Preferences</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <ui:composition template="../templates/portalTemplate.xhtml"> <ui:param name="skin" value="echr"/> <ui:define name="content"> <h3>Account #{reg.account.id} #{reg.account.title}</h3> <h:outputText value="This is a demo account" rendered="#{reg.user.demoUser}"/> <br/><br/> <h:form id="accountAdmin"> <h:panelGrid columns="3" cellpadding="5" > <h:outputLabel for="aTitle" value="Account Title" /> <h:outputText value=":" /> <h:outputText id="aTitle" value="#{reg.accountTitle}" /> <h:outputLabel for="aTZ" value="#{reg.user.ldapUID}'s Timezone" /> <h:outputText value=":" /> <h:outputText id="aTZ" value="#{top.timeZone}" /> </h:panelGrid> <h:commandLink value="Edit Title/Timezone" action="edit" /> <h:outputText value=" | | " /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='echr'}" action="echr" /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='ephr'}" action="ephr" /> <h3>List of users allowed to login to this account</h3> <h:dataTable value="#{reg.accountUsers}" var="au" styleClass="activity"> <!--h:column> <f:facet name="header"> <h:outputText value="Id"/> </f:facet> <h:outputText value="#{au.user.id}"/> </h:column--> <h:column> <f:facet name="header"> <h:outputText value="User Id"/> </f:facet> <h:outputText value="#{au.user.ldapUID}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Status"/> </f:facet> <h:panelGrid columns="2" cellpadding="3"> <h:outputText value="#{au.status}" /> <h:commandLink value="Edit Status" action="control" rendered="#{au.id!=top.accountUserId}" /> </h:panelGrid> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Effective"/> </f:facet> <h:outputText value="#{au.effectiveDate}"> <f:convertDateTime dateStyle="medium" timeZone="#{top.timeZone}"/> </h:outputText> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Expiration"/> </f:facet> <h:outputText value="#{au.expirationDate}"> <f:convertDateTime dateStyle="medium" timeZone="#{top.timeZone}"/> </h:outputText> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Authority"/> </f:facet> <h:outputText value="tbd"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Administrator?"/> </f:facet> <h:outputText value="me" rendered="#{au.id==top.accountUserId}"/> <h:commandLink value="Edit" action="control" rendered="#{au.id!=top.accountUserId}" /> </h:column> </h:dataTable> <h:commandLink value="Control User Access to Account" action="control" /> <h:outputText value=" | | " /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='echr'}" action="echr" /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='ephr'}" action="ephr" /> <h3>Account sponsorships</h3> <h:commandLink value="View/Add Sponsorships" action="sponsor" /> <h:outputText style="font-style:bold" value=" | | " /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='echr'}" action="echr" /> <h:commandLink value="Return to Application" rendered="#{reg.account.accountType.knownType=='ephr'}" action="ephr" /> </h:form> </ui:define> </ui:composition> </body> </html> --- NEW FILE: controlAccess.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <head> <title>User Preferences</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <ui:composition template="../templates/portalTemplate.xhtml"> <ui:param name="skin" value="echr"/> <ui:define name="content"> <h3>List of users allowed to login to this account</h3> <h:form id="accountAdmin"> <h:dataTable value="#{reg.accountUsers}" var="au" styleClass="activity"> <!--h:column> <f:facet name="header"> <h:outputText value="Id"/> </f:facet> <h:outputText value="#{au.user.id}"/> </h:column--> <h:column> <f:facet name="header"> <h:outputText value="User Id"/> </f:facet> <h:outputText value="#{au.user.ldapUID}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Status"/> </f:facet> <h:outputText value="#{au.status}" rendered="#{au.id==top.accountUserId}"/> <h:selectOneMenu value="#{au.status}" rendered="#{au.id!=top.accountUserId}"> <f:selectItem itemValue="active" itemLabel="active"/> <f:selectItem itemValue="inactive" itemLabel="inactive"/> </h:selectOneMenu> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Effective"/> </f:facet> <h:outputText value="#{au.effectiveDate}"> <f:convertDateTime dateStyle="medium" timeZone="#{top.timeZone}"/> </h:outputText> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Expiration"/> </f:facet> <h:outputText value="#{au.expirationDate}"> <f:convertDateTime dateStyle="medium" timeZone="#{top.timeZone}"/> </h:outputText> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Authority"/> </f:facet> <h:outputText value="tbd"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Administrator?"/> </f:facet> <h:outputText value="me" rendered="#{au.id==top.accountUserId}"/> <h:selectBooleanCheckbox value="#{au.accountPermission}" rendered="#{au.id!=top.accountUserId}"/> </h:column> </h:dataTable> <h:commandButton action="{reg.updateUser}" value="Update" /> <h:panelGrid columns="3" rendered="#{reg.user.demoUser}"> <h:outputText value="Add existing demo user to this account"/> <h:inputText id="uid" value="#{reg.newDemoUser}" size="20"/> <h:commandButton action="#{reg.addDemoUser}" value="Add"/> </h:panelGrid> <h:commandButton value="Return to Application" rendered="#{reg.account.accountType.knownType=='echr'}" action="echr" /> <h:commandButton value="Return to Application" rendered="#{reg.account.accountType.knownType=='ephr'}" action="ephr" /> <h:messages for="accountAdmin:uid" errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </h:form> <h:panelGroup rendered="#{reg.account.accountType.knownType=='echr'}"> <h3>Generate virtual patients into this account (#{reg.account.id}, #{reg.account.title})</h3> <p>Generate random patients and add them to this account. The generator runs in the background and will take several minutes to run. The generator creates a lot of data. But you'll notice that it doesn't create the exact number of patient specified: The generator automatically discards people that haven't been born yet and some but not all people that are deceased. Also, the fact that pregnancies result in zero, one or more live births makes the number hard to hit exactly. </p> <h:form id="patGen" > <h:panelGrid columns="2"> <h:outputText value="Number of Patients to generate (maximum=#{top.properties['tolven.gen.patient.max']})"/> <h:inputText id="count" value="#{gen.numberToGenerate}" size="4"> <f:validateLongRange minimum="1" maximum="#{top.properties['tolven.gen.patient.max']}"/> </h:inputText> <h:outputText value="Patients began arriving in which year"/> <h:inputText id="startYear" value="#{gen.generateHistoryFrom}" size="4"/> </h:panelGrid> <h:commandButton id="patGenAction" action="#{gen.createCHRPatients}" value="Generate Patients"/> </h:form> <h:messages errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </h:panelGroup> </ui:define> </ui:composition> </body> </html> --- NEW FILE: editProfile.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <head> <title>User Preferences</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <ui:composition template="../templates/portalTemplate.xhtml"> <ui:param name="skin" value="echr"/> <ui:define name="content"> <h3>Account #{reg.account.id} #{reg.account.title}</h3> <h:form id="adminAccount"> <h:panelGrid columns="2"> <h:outputText value="Account Title"/> <h:inputText value="#{reg.accountTitle}" size="50" /> <h:outputText value="Account Timezone"/> <h:selectOneMenu value="#{reg.accountTimeZone}" > <f:selectItems value="#{reg.timeZones}"/> </h:selectOneMenu> <h:outputText value="User #{reg.user.ldapUID}'s Timezone"/> <h:outputText value="#{reg.user.timeZone}" /> <h:outputText value="Current Timezone"/> <h:outputText value="#{top.timeZone}" /> </h:panelGrid> <h:commandButton action="#{reg.updateAccount}" value="Update"/> <h:commandButton value="Return to Application" rendered="#{reg.account.accountType.knownType=='echr'}" action="echr" /> <h:commandButton value="Return to Application" rendered="#{reg.account.accountType.knownType=='ephr'}" action="ephr" /> </h:form> </ui:define> </ui:composition> </body> </html> |
From: John C. <jc...@us...> - 2007-02-16 05:52:04
|
Update of /cvsroot/tolven/tolvenWEB/web/manage In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6516/web/manage Log Message: Directory /cvsroot/tolven/tolvenWEB/web/manage added to the repository |
From: Joseph I. <jos...@us...> - 2007-02-16 05:19:30
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25263/src/org/tolven/web Modified Files: TopAction.java Log Message: AccountUser should be a private variable Index: TopAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TopAction.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** TopAction.java 16 Feb 2007 05:06:41 -0000 1.40 --- TopAction.java 16 Feb 2007 05:18:33 -0000 1.41 *************** *** 65,69 **** private TolvenPerson tp; ! AccountUser accountUser; private long accountUserId; --- 65,69 ---- private TolvenPerson tp; ! private AccountUser accountUser; private long accountUserId; |
From: Joseph I. <jos...@us...> - 2007-02-16 05:06:51
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20242/src/org/tolven/web Modified Files: TopAction.java Log Message: SecurityFilters now pass the accountUserId to TopAction via a session attribute, rather than directly by setAccountUser, which can result in a detached error in Hibernate. Index: TopAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TopAction.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** TopAction.java 8 Feb 2007 08:14:20 -0000 1.39 --- TopAction.java 16 Feb 2007 05:06:41 -0000 1.40 *************** *** 43,46 **** --- 43,47 ---- import org.tolven.security.key.UserPrivateKey; import org.tolven.security.key.UserPublicKey; + import org.tolven.web.security.VestibuleSecurityFilter; /** *************** *** 399,404 **** public long getAccountUserId() { ! return accountUserId; ! } public void setAccountUserId(long accountUserId) { --- 400,421 ---- public long getAccountUserId() { ! if (accountUserId == 0) { ! ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext(); ! HttpSession session = ((HttpSession) ctx.getSession(true)); ! Object obj = session.getAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); ! // The AccountUser is for TopAction, so remove it and use it ! session.removeAttribute(VestibuleSecurityFilter.ACCOUNTUSER_ID); ! if (obj != null) { ! long sessionAccountUserId = ((Long) obj).longValue(); ! try { ! // setting the AccountUser will populate the accountUserId (backward compatibility) ! setAccountUser(activation.findAccountUser(sessionAccountUserId)); ! } catch (Exception ex) { ! // If the AccountUser has not been set yet, then accoutUserId will be returned ! } ! } ! } ! return accountUserId; ! } public void setAccountUserId(long accountUserId) { |
From: Joseph I. <jos...@us...> - 2007-02-16 05:06:43
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20242/src/org/tolven/web/security Modified Files: VestibuleSecurityFilter.java Log Message: SecurityFilters now pass the accountUserId to TopAction via a session attribute, rather than directly by setAccountUser, which can result in a detached error in Hibernate. Index: VestibuleSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/VestibuleSecurityFilter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VestibuleSecurityFilter.java 8 Feb 2007 08:14:21 -0000 1.4 --- VestibuleSecurityFilter.java 16 Feb 2007 05:06:41 -0000 1.5 *************** *** 60,64 **** private static String INVITATION_ID = "invitationId"; private static String TOLVEN_NOW = "tolvenNow"; ! private static String ACCOUNTUSER_ID = "accountUserId"; private ActivationLocal activation; --- 60,64 ---- private static String INVITATION_ID = "invitationId"; private static String TOLVEN_NOW = "tolvenNow"; ! public static String ACCOUNTUSER_ID = "accountUserId"; private ActivationLocal activation; *************** *** 188,200 **** // Give TolvenUser the AccountPrivateKey for the selected account privateKeyRing.setAccountPrivateKey(accountUser.getAccountPrivateKey()); - top.setAccountUser(accountUser); session.removeAttribute("pass"); ((HttpServletResponse) servletResponse).sendRedirect("../private/" + accountUser.getAccount().getAccountType().getHomePage()); return; } ! // If user has not been sent on there way by here, take away the user's AccountPrivateKey for the current account if one exists privateKeyRing.setAccountPrivateKey(null); top.setAccountUser(null); ! top.setAccountUserId(0); } catch (PolicyContextException ex) { ex.printStackTrace(); --- 188,200 ---- // Give TolvenUser the AccountPrivateKey for the selected account privateKeyRing.setAccountPrivateKey(accountUser.getAccountPrivateKey()); session.removeAttribute("pass"); + session.setAttribute(ACCOUNTUSER_ID, accountUser.getId()); ((HttpServletResponse) servletResponse).sendRedirect("../private/" + accountUser.getAccount().getAccountType().getHomePage()); return; } ! // If user has not been sent on there way by here, remove all account related information...they are in the vestibule privateKeyRing.setAccountPrivateKey(null); top.setAccountUser(null); ! session.removeAttribute(ACCOUNTUSER_ID); } catch (PolicyContextException ex) { ex.printStackTrace(); |
From: John C. <jc...@us...> - 2007-02-16 04:20:31
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv922/src/org/tolven/web Modified Files: MenuAction.java Log Message: Added support for data input "instantiate" Index: MenuAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/MenuAction.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** MenuAction.java 12 Feb 2007 07:09:38 -0000 1.33 --- MenuAction.java 16 Feb 2007 04:20:27 -0000 1.34 *************** *** 18,21 **** --- 18,22 ---- import java.net.URLEncoder; import java.text.SimpleDateFormat; + import java.util.ArrayList; import java.util.GregorianCalendar; import java.util.HashMap; *************** *** 74,77 **** --- 75,79 ---- private MenuData menuDataItem = null; private Long menuDataCount = null; + private List<String> childPaths; protected DocumentLocal documentLocal; *************** *** 233,236 **** --- 235,258 ---- /** + * From the current element, return a list of elements referencing each of the child + * nodes of the current MenuStructure item. Used to build summary pages from metaData. + * @return list of elements to include. + */ + public List<String> getChildPaths( ) { + if (childPaths==null ) { + childPaths = new ArrayList<String>( 10 ); + MenuStructure msParent = getThisMenu(); + for ( MenuStructure msChild : msParent.getSortedChildren()) { + if ("true".equals(msChild.getVisible())) { + MenuPath msPath = new MenuPath(msChild.getPath(), getTargetMenuPath() ); + childPaths.add( msPath.getPathString() ); + } + } + // System.out.println( getElement() + " children: " + childPaths); + } + return childPaths; + } + + /** * Get the menudata for the requested element */ *************** *** 282,285 **** --- 304,308 ---- return menuDataItem; } + /** * get the repeating item if specified in MenuStructure or *************** *** 526,565 **** context.put(patient.getMenuStructure().getPath(), patient.getPath()); System.out.println( "Context: " + patient.getMenuStructure().getPath() + " / " + patient.getPath()); ! DocXML doc = creatorBean.instantiate(getAccountId(), "echr:gcs", context); ! ass.setDocumentId(doc.getId()); ! menuLocal.persistMenuData(ass); ! ! // Note the elementId of this new item ! menuDataItem = ass; ! ! // Add the item to activity for this user/patient ! MenuData newActivity = new MenuData(); ! MenuStructure msNA = menuLocal.findMenuStructure(getAccountId(), getTop().getAccountType() + ":activity:all"); ! newActivity.setMenuStructure(msNA); ! newActivity.setAccount(msNA.getAccount()); ! newActivity.setParent01(patient); ! newActivity.setDate01(getNow()); ! newActivity.setString01(patient.getString01() + ", " + patient.getString02()); ! newActivity.setString02( "Glasgow Coma Scale in process"); ! newActivity.setDocumentId(doc.getId()); ! newActivity.setReference(ass); ! menuLocal.persistMenuData(newActivity); ! ! // That should be it for an assessment but since we don't have reflexive queries ! // done yet, we have to manually add this assessment to the list of assessments ! // but in fact, this should be in a list of pending assessments but we won't ! // go there yet. ! MenuData assAll = new MenuData(); ! // MenuStructure msaa = menuLocal.findDescendentMenuStructure(patientMS.getAccount().getId(), patientMS, "ass:all"); ! MenuStructure msaa = this.getThisMenu(); ! assAll.setMenuStructure(msaa); ! assAll.setAccount(msaa.getAccount()); ! assAll.setParent01(patient); ! assAll.setDate01(getNow()); ! assAll.setString01("GCS"); ! assAll.setString02( "new"); ! assAll.setDocumentId(doc.getId()); ! assAll.setReference(ass); ! menuLocal.persistMenuData(assAll); return "success"; } --- 549,588 ---- context.put(patient.getMenuStructure().getPath(), patient.getPath()); System.out.println( "Context: " + patient.getMenuStructure().getPath() + " / " + patient.getPath()); ! // DocXML doc = creatorBean.instantiate(getAccountId(), "echr:gcs", context); ! // ass.setDocumentId(doc.getId()); ! // menuLocal.persistMenuData(ass); ! // ! // // Note the elementId of this new item ! // menuDataItem = ass; ! // ! // // Add the item to activity for this user/patient ! // MenuData newActivity = new MenuData(); ! // MenuStructure msNA = menuLocal.findMenuStructure(getAccountId(), getTop().getAccountType() + ":activity:all"); ! // newActivity.setMenuStructure(msNA); ! // newActivity.setAccount(msNA.getAccount()); ! // newActivity.setParent01(patient); ! // newActivity.setDate01(getNow()); ! // newActivity.setString01(patient.getString01() + ", " + patient.getString02()); ! // newActivity.setString02( "Glasgow Coma Scale in process"); ! // newActivity.setDocumentId(doc.getId()); ! // newActivity.setReference(ass); ! // menuLocal.persistMenuData(newActivity); ! // ! // // That should be it for an assessment but since we don't have reflexive queries ! // // done yet, we have to manually add this assessment to the list of assessments ! // // but in fact, this should be in a list of pending assessments but we won't ! // // go there yet. ! // MenuData assAll = new MenuData(); ! //// MenuStructure msaa = menuLocal.findDescendentMenuStructure(patientMS.getAccount().getId(), patientMS, "ass:all"); ! // MenuStructure msaa = this.getThisMenu(); ! // assAll.setMenuStructure(msaa); ! // assAll.setAccount(msaa.getAccount()); ! // assAll.setParent01(patient); ! // assAll.setDate01(getNow()); ! // assAll.setString01("GCS"); ! // assAll.setString02( "new"); ! // assAll.setDocumentId(doc.getId()); ! // assAll.setReference(ass); ! // menuLocal.persistMenuData(assAll); return "success"; } |
From: John C. <jc...@us...> - 2007-02-16 04:20:02
|
Update of /cvsroot/tolven/tolvenWEB/web/WEB-INF In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv518/web/WEB-INF Modified Files: web.xml Log Message: Added instantiate servlet to support data entry Index: web.xml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/WEB-INF/web.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** web.xml 6 Feb 2007 06:30:31 -0000 1.17 --- web.xml 16 Feb 2007 04:20:00 -0000 1.18 *************** *** 67,71 **** <filter-class>org.tolven.web.XMLCacheFilter</filter-class> </filter> ! <filter> <filter-name>TransactionFilter</filter-name> --- 67,74 ---- <filter-class>org.tolven.web.XMLCacheFilter</filter-class> </filter> ! <filter-mapping> ! <filter-name>XMLCacheFilter</filter-name> ! <url-pattern>/ajax/*</url-pattern> ! </filter-mapping> <filter> <filter-name>TransactionFilter</filter-name> *************** *** 73,83 **** </filter> <filter-mapping> ! <filter-name>XMLCacheFilter</filter-name> ! <url-pattern>/ajax/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>TransactionFilter</filter-name> ! <url-pattern>*.jsf</url-pattern> </filter-mapping> <!-- listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> --- 76,88 ---- </filter> <filter-mapping> ! <filter-name>TransactionFilter</filter-name> ! <url-pattern>*.jsf</url-pattern> </filter-mapping> <filter-mapping> <filter-name>TransactionFilter</filter-name> ! <url-pattern>*.ajaxi</url-pattern> </filter-mapping> + + <!-- listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> *************** *** 121,124 **** --- 126,140 ---- </servlet-mapping> <servlet> + <servlet-name>Ajax Instantiation Servlet</servlet-name> + <servlet-class>org.tolven.ajax.InstantiateServlet</servlet-class> + <load-on-startup>3</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>Ajax Instantiation Servlet</servlet-name> + <url-pattern>*.ajaxi</url-pattern> + </servlet-mapping> + + <servlet> <servlet-name>Tolven Document Servlet</servlet-name> <servlet-class>org.tolven.ajax.DocServlet</servlet-class> |
From: John C. <jc...@us...> - 2007-02-16 04:19:34
|
Update of /cvsroot/tolven/tolvenWEB/web/wizard In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv506/web/wizard Added Files: observation.xhtml Log Message: New data types added to menus --- NEW FILE: observation.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <head> <title>New Patient Wizard</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <ui:composition template="wizTemplate.xhtml"> <ui:param name="skin" value="#{top.accountType}"/> <ui:param name="title" value="#{trim.trim.act.title.ST.value}"/> <ui:param name="author" value="Tolven"/> <ui:param name="subject" value="#{menu.menuDataItem.parent01.string02} #{menu.menuDataItem.parent01.string01}"/> <ui:define name="steps"> <div class="step" title="Getting Started" > <div class="pagesm"> <p>Observation test</p> <p>Click the next button when you're ready to begin.</p> <h:commandButton id="#{menu.elementLabel}submit" action="#{menu.submit}" value="Submit"/> </div> <div class="help" id="#{menu.elementLabel}submissionHelp" style="display:none"> <h1>Submission</h1> <p>The Submit button remains disabled until all entered data is validated and has been stored on the server in your private holding area. The time field represents the time when the data was most recently captured on the server (not the time of the observation). Clicking the submit button will mark this document as complete, actionable, and immutable.</p> </div> </div> </ui:define> </ui:composition> </body> </html> |
From: John C. <jc...@us...> - 2007-02-16 04:19:12
|
Update of /cvsroot/tolven/tolvenWEB/web/styles In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv432/web/styles Modified Files: ephr.css echr.css Log Message: Fix work in process display Index: echr.css =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/styles/echr.css,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** echr.css 29 Nov 2006 01:35:33 -0000 1.5 --- echr.css 16 Feb 2007 04:19:11 -0000 1.6 *************** *** 15,18 **** --- 15,26 ---- } + .summary { + padding:5px + } + + .summary table td { + vertical-align: top + } + .wholePage { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 0px; FONT: 1em/1.4em Geneva, Arial, Helvetica, sans-serif; WIDTH: auto; COLOR: #000000; PADDING-TOP: 10px Index: ephr.css =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/styles/ephr.css,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ephr.css 3 Dec 2006 08:39:50 -0000 1.6 --- ephr.css 16 Feb 2007 04:19:11 -0000 1.7 *************** *** 15,18 **** --- 15,26 ---- } + .summary { + padding:5px + } + + .summary table td { + vertical-align: top + } + .wholePage { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 0px; FONT: 1em/1.4em Geneva, Arial, Helvetica, sans-serif; WIDTH: auto; COLOR: #000000; PADDING-TOP: 10px *************** *** 312,315 **** --- 320,384 ---- } + .bar3:before { + content: "."; + display:block; + clear:both; + height: 0px; + visibility:hidden + } + + .bar3 { + COLOR: #333333; + BACKGROUND: #ffffff; + FONT-FAMILY: 'Lucide Grande', Verdana, Arial, sans-serif; + DISPLAY: block; + MARGIN: 0px 0px 0px 5px; + WIDTH: auto; + padding: 0px; + height: 33px; + } + .bar3 ul { + MARGIN: 0px; + PADDING: 0px; + } + + .bar3 li { + DISPLAY: block; + FLOAT: left; + padding: 0px; + } + + .bar3 li a { + PADDING-RIGHT: 0.75em; + DISPLAY: block; + PADDING-LEFT: 0.75em; + PADDING-BOTTOM: 8px; + MARGIN: 0px; + COLOR: #333333; + PADDING-TOP: 8px; + TEXT-DECORATION: none; + } + + .bar3 li a img { + border: 0px; + PADDING-RIGHT: 0px; + PADDING-LEFT: 0px; + PADDING-BOTTOM: 0px; + MARGIN: 0px; + PADDING-TOP: 0px; + width: 12px; + height: 12px; + } + + .bar3 li.active a:hover { + BACKGROUND: url(../images/bkgd_nav2_active.gif) no-repeat center bottom; COLOR: #191919 + } + .bar3 li a:hover { + PADDING-RIGHT: 0.75em; DISPLAY: block; PADDING-LEFT: 0.75em; BACKGROUND: #cccccc; PADDING-BOTTOM: 8px; MARGIN: 0px; COLOR: #4D4D4D; PADDING-TOP: 8px; TEXT-DECORATION: none + } + .bar3 li.active a { + BACKGROUND: url(../images/bkgd_nav2_active.gif) no-repeat center bottom; COLOR: #333333 + } + .wip { COLOR: #000000; |