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: Joseph I. <jos...@us...> - 2007-01-19 08:21:44
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/auth In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9942/src/org/tolven/web/security/auth Added Files: KeyLoginModule.java Log Message: This LoginModule does not verify username/password directly and MUST be proceeded by a LoginModule which does. * However, it is responsible for adding credentials to a Subject, and while adding a UserPrivateKey, it will attempt * unlock the UserPrivateKey with the provided password. If the password is not correct, then the login will fail. * The UserPrivateKey is placed in a PrivateKeyRing, and it is the PrivateKeyRing which is added to the privateCredentials * of the Subject. --- NEW FILE: KeyLoginModule.java --- /* * Copyright (C) 2006 Tolven Inc * * This library is free software; you can redistribute it and/or modify it under the terms of * the GNU Lesser General Public License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Contact: in...@to... */ package org.tolven.web.security.auth; import java.io.IOException; import java.security.Principal; import java.security.acl.Group; import java.util.Arrays; import java.util.Enumeration; import java.util.Iterator; import java.util.Map; import javax.naming.InitialContext; import javax.security.auth.Subject; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.PasswordCallback; import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.auth.login.LoginException; import javax.security.auth.spi.LoginModule; import javax.security.jacc.PolicyContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.tolven.core.entity.TolvenUser; import org.tolven.security.LoginLocal; import org.tolven.security.TolvenPrincipal; import org.tolven.security.acl.TolvenGroup; import org.tolven.security.key.PrivateKeyRing; import org.tolven.security.key.UserPrivateKey; import org.tolven.security.key.UserPublicKey; import org.tolven.web.TopAction; /** * This LoginModule does not verify username/password directly and MUST be proceeded by a LoginModule which does. * However, it is responsible for adding credentials to a Subject, and while adding a UserPrivateKey, it will attempt * unlock the UserPrivateKey with the provided password. If the password is not correct, then the login will fail. * The UserPrivateKey is placed in a PrivateKeyRing, and it is the PrivateKeyRing which is added to the privateCredentials * of the Subject. * * @author Joseph Isaac * */ public class KeyLoginModule implements LoginModule { private Subject subject = null; private CallbackHandler callbackHandler = null; private String username; private char[] password; public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> arg2, Map<String, ?> arg3) { System.out.println(getClass() + "initialize()"); this.subject = subject; this.callbackHandler = callbackHandler; } public boolean login() throws LoginException { System.out.println(getClass() + " begin login"); if (callbackHandler == null) throw new LoginException("No CallbackHandler"); NameCallback nc = new NameCallback("User name: "); PasswordCallback pc = new PasswordCallback("Password: ", false); Callback[] callbacks = { nc, pc }; try { callbackHandler.handle(callbacks); username = nc.getName(); if (username == null) throw new LoginException("null username not permitted"); char[] tmpPassword = pc.getPassword(); if (tmpPassword == null) throw new LoginException("null password not permitted"); password = new char[tmpPassword.length]; System.arraycopy(tmpPassword, 0, password, 0, tmpPassword.length); pc.clearPassword(); } catch (IOException e) { LoginException le = new LoginException("Failed to get username/password"); le.initCause(e); throw le; } catch (UnsupportedCallbackException e) { LoginException le = new LoginException("CallbackHandler does not support: " + e.getCallback()); le.initCause(e); throw le; } return true; } public boolean commit() throws LoginException { System.out.println(getClass() + ": begin commit"); try { if (System.getProperty("tolven.security.keys.activate") != null) { // Use the session to initialize TolvenUser HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest"); if (request == null) throw new LoginException(getClass() + ": could not obtain an HttpServletRequest"); HttpSession session = request.getSession(); if (session == null) throw new LoginException(getClass() + ": could not obtain an HttpSession"); TopAction top = (TopAction) session.getAttribute("top"); if (top == null) throw new LoginException(getClass() + ": could not obtain a TopAction"); //TODO: Phase One obtain an initialized TolvenUser is valid TolvenUser user = top.intializeUser(username); if (user == null) throw new LoginException(getClass() + ": No User found, access denied"); boolean userModified = false; if (!user.hasUserPrivateKey()) { System.out.println(getClass() + ": initialize keys "); user.initUserPrivateKey(password); userModified = true; } UserPrivateKey userPrivateKey = user.getUserPrivateKey(); System.out.println(getClass() + ": Adding UserPrivateKey to Subject " + username); userPrivateKey.unlockPrivateKey(password); // Populate the Subject // Ensure there is only one Group called Roles Group group = null;; for (Iterator iter = subject.getPrincipals(Group.class).iterator(); iter.hasNext();) { group = (Group) iter.next(); if ("Roles".equalsIgnoreCase(group.getName())) break; group = null; } if(group == null) { } else { } if (group == null) group = new TolvenGroup("Roles"); // TODO: Currently we do not distinguish by role. When roles are supported in LDAP this code can be removed boolean allRolesExists = false; Principal principal = null; for (Enumeration e = group.members(); e.hasMoreElements();) { principal = (Principal) e.nextElement(); if ("*".equalsIgnoreCase(principal.getName())) { allRolesExists = true; break; } } if (!allRolesExists) group.addMember(new TolvenPrincipal("*")); // 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.remove(); } subject.getPrivateCredentials().add(new PrivateKeyRing(userPrivateKey)); System.out.println(getClass() + ": Adding getUserPublicKey to Subject " + username); // 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.remove(); } subject.getPublicCredentials().add(user.getUserPublicKey()); if (userModified) { InitialContext ictx = new InitialContext(); LoginLocal loginLocal = (LoginLocal) ictx.lookup("tolven/LoginBean/local"); if (loginLocal == null) throw new LoginException(getClass() + ": Could not locate the LoginBean"); loginLocal.update(user); System.out.println(getClass() + ": persisted new keys user " + username); } } System.out.println(getClass() + ": completing login for " + username); } catch (Exception ex) { ex.printStackTrace(); throw new LoginException(ex.getMessage()); } return true; } public boolean abort() throws LoginException { removeAllCredentials(); return true; } public boolean logout() throws LoginException { removeAllCredentials(); return true; } private void removeAllCredentials() throws LoginException { callbackHandler = null; username = null; Arrays.fill(password, '0'); password = null; try { // Remove PrivateKeyRing if (subject != null) { for (Iterator iter = subject.getPrivateCredentials(PrivateKeyRing.class).iterator(); iter.hasNext();) { iter.next(); iter.remove(); } // Remove all UserPublicKey for (Iterator iter = subject.getPrivateCredentials(UserPublicKey.class).iterator(); iter.hasNext();) { iter.next(); iter.remove(); } } } catch (Exception ex) { ex.printStackTrace(); throw new LoginException(ex.getMessage()); } finally { subject = null; } } } |
From: Joseph I. <jos...@us...> - 2007-01-18 08:35:34
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19568/src/org/tolven/doc/entity Modified Files: DocBase.java Log Message: Throw exceptions if a document is not associated with an Account or DocumentSecretKey when content is added to or retrieved from it. It also now prints a stack trace when decryption is not possible. Index: DocBase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity/DocBase.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DocBase.java 17 Jan 2007 07:54:55 -0000 1.17 --- DocBase.java 18 Jan 2007 08:35:30 -0000 1.18 *************** *** 176,182 **** */ private byte[] getDecryptedContent(byte[] encryptedContent) { ! if (encryptedContent == null || documentSecretKey == null) return encryptedContent; try { Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); if (subject == null) --- 176,186 ---- */ private byte[] getDecryptedContent(byte[] encryptedContent) { ! if (encryptedContent == null) return encryptedContent; try { + if (account == null) + throw new RuntimeException("Content cannot be retrieved from a document which is not associated with an account"); + if (documentSecretKey == null) + throw new RuntimeException("Content cannot be decrypted without a documentSecretKey"); Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); if (subject == null) *************** *** 210,213 **** --- 214,218 ---- return cipher.doFinal(encryptedContent); } catch (Exception ex) { + ex.printStackTrace(); return "THIS DOCUMENT CANNOT BE DECRYPTED".getBytes(); } *************** *** 218,227 **** return new String(getContent()); } public void setContent(byte[] content) { if (System.getProperty("tolven.security.keys.activate") != null) { this.content = getEncryptedContent(content); } else { ! this.content = content; ! } } --- 223,233 ---- return new String(getContent()); } + public void setContent(byte[] content) { if (System.getProperty("tolven.security.keys.activate") != null) { this.content = getEncryptedContent(content); } else { ! this.content = content; ! } } *************** *** 248,252 **** } } ! public void setContentString(String content) { setContent(content.getBytes()); --- 254,258 ---- } } ! public void setContentString(String content) { setContent(content.getBytes()); |
From: John C. <jc...@us...> - 2007-01-18 03:45:47
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/index In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26973/src/org/tolven/index Modified Files: Browse.java Log Message: Fix commit problem - hopefuilly - refresh in browser seems to help also. Index: Browse.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/index/Browse.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Browse.java 18 Jan 2007 02:11:18 -0000 1.2 --- Browse.java 18 Jan 2007 03:45:44 -0000 1.3 *************** *** 23,26 **** --- 23,27 ---- import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import javax.transaction.Status; import javax.transaction.UserTransaction; *************** *** 152,160 **** 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); } String uri = request.getRequestURI(); --- 153,163 ---- UserTransaction ut = null; try { ! ctx = new InitialContext(); ! ut = (UserTransaction) ctx.lookup("UserTransaction"); ! if(ut.getStatus()!=Status.STATUS_ACTIVE) { ! ut.begin(); ! } } catch (Exception e) { ! throw new ServletException("[BrowseServlet] Error setting up UserTransaction or starting a transaction", e); } String uri = request.getRequestURI(); *************** *** 165,184 **** throw new ServletException( "Login failed"); } response.sendRedirect("view.browse"); - // This module is all about read-only so rollback in all cases try { ut.rollback(); } catch (Exception e) { ! throw new ServletException( "[AjaxServlet] Rollback Exception", e ); } return; } ! // See if we have an account user. Can't go on without it. if (null==request.getSession(true).getAttribute("accountUser")) { - // This module is all about read-only so rollback in all cases try { ut.rollback(); } catch (Exception e) { ! throw new ServletException( "[AjaxServlet] Rollback Exception", e ); } throw new ServletException( "Not logged in or invalid account selected"); --- 168,186 ---- throw new ServletException( "Login failed"); } + // Now that the user is logged in, redirect them to the view page response.sendRedirect("view.browse"); try { ut.rollback(); } catch (Exception e) { ! throw new ServletException( "[BrowseServlet] Rollback Exception", e ); } return; } ! // See if we have an account user id. Can't go on without it. if (null==request.getSession(true).getAttribute("accountUser")) { try { ut.rollback(); } catch (Exception e) { ! throw new ServletException( "[BrowseServlet] Rollback Exception", e ); } throw new ServletException( "Not logged in or invalid account selected"); *************** *** 200,208 **** writer.write( "</head>\n"); writer.write( "<body>\n"); - if( uri.endsWith("logout.browse")) { - request.getSession(false).invalidate(); - writer.write( "<p>Logged out</p>\n"); - writer.write( "<p><a href='login.browse'>Login</a></p>\n"); - } if( uri.endsWith("view.browse")) { --- 202,205 ---- *************** *** 210,219 **** String element = request.getParameter( "element"); - // Show everything about the item we've been asked to display - // if (id!=0) { - // showDetail( id ); - // } - // Show lists we have available - // System.out.println( "Showing lists"); showLists( accountUser, writer, element); // Display the requested memu data, if any --- 207,210 ---- *************** *** 221,228 **** // System.out.println( "Showing: " + element); MenuQueryControl ctrl = setupControl( request, accountUser ); ! showMenuData( accountUser, writer, ctrl); } writer.write( "<p><a href='logout.browse'>Logout</a></p>\n"); } writer.write( "</body>\n"); writer.write( "</html>\n"); --- 212,231 ---- // System.out.println( "Showing: " + element); MenuQueryControl ctrl = setupControl( request, accountUser ); ! if ("placeholder".equals(ctrl.getMenuStructure().getRole())) { ! // System.out.println( "Showing detail"); ! showMenuDataDetail( accountUser, writer, ctrl ); ! } ! if ("list".equals(ctrl.getMenuStructure().getRole())) { ! // System.out.println( "Showing lists"); ! showMenuDataList( accountUser, writer, ctrl); ! } } writer.write( "<p><a href='logout.browse'>Logout</a></p>\n"); } + else if( uri.endsWith("logout.browse")) { + request.getSession(false).invalidate(); + writer.write( "<p>Logged out</p>\n"); + writer.write( "<p><a href='login.browse'>Login</a></p>\n"); + } writer.write( "</body>\n"); writer.write( "</html>\n"); *************** *** 232,236 **** ut.rollback(); } catch (Exception e) { ! throw new ServletException( "[AjaxServlet] Rollback Exception", e ); } } --- 235,239 ---- ut.rollback(); } catch (Exception e) { ! throw new ServletException( "[BrowseServlet] Rollback Exception", e ); } } *************** *** 262,265 **** --- 265,269 ---- List<MenuStructure> placeholders = getPlaceholders( ms ); // System.out.println( "found placeholders for: " + ms.getPath()); + // We filter the list of lists to only those that could yield a result. if (placeholders.size() > 0 ) { writer.write( "<tr>" ); *************** *** 329,333 **** * @throws IOException */ ! void showMenuData( AccountUser au, Writer writer, MenuQueryControl ctrl ) throws IOException { List<MenuData> rows = menuLocal.findMenuData( ctrl ); showQueryInfo(writer, ctrl); --- 333,337 ---- * @throws IOException */ ! void showMenuDataList( AccountUser au, Writer writer, MenuQueryControl ctrl ) throws IOException { List<MenuData> rows = menuLocal.findMenuData( ctrl ); showQueryInfo(writer, ctrl); *************** *** 363,366 **** --- 367,414 ---- } + + /** + * Display the detail for a single menu data item + * @param top + * @param writer + * @param ctrl + * @throws IOException + */ + void showMenuDataDetail( AccountUser au, Writer writer, MenuQueryControl ctrl ) throws IOException { + MenuData md = menuLocal.findMenuDataItem( ctrl ); + showQueryInfo(writer, ctrl); + // Output results in an HTML table + writer.write( "<p>Menu data (detail) for " + ctrl.getRequestedPath()+ "</p>\n"); + writer.write( "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n"); + writer.write( "<tr>" ); + writer.write( "<th><em>FieldName</em></th>"); + writer.write( "<th><em>Value</em></th>"); + writer.write( "</tr>\n"); + + if (null!=md.getString01()) writer.write( "<tr><td>String01</td><td>" + md.getString01() + "</td></tr>\n"); + if (null!=md.getString02()) writer.write( "<tr><td>String02</td><td>" + md.getString02() + "</td></tr>\n"); + if (null!=md.getString03()) writer.write( "<tr><td>String03</td><td>" + md.getString03() + "</td></tr>\n"); + if (null!=md.getString04()) writer.write( "<tr><td>String04</td><td>" + md.getString04() + "</td></tr>\n"); + if (null!=md.getDate01()) writer.write( "<tr><td>Date01</td><td>" + md.getDate01() + "</td></tr>\n"); + if (null!=md.getDate02()) writer.write( "<tr><td>Date02</td><td>" + md.getDate02() + "</td></tr>\n"); + if (null!=md.getDate03()) writer.write( "<tr><td>Date03</td><td>" + md.getDate03() + "</td></tr>\n"); + if (null!=md.getDate04()) writer.write( "<tr><td>Date04</td><td>" + md.getDate04() + "</td></tr>\n"); + if (0!=md.getLong01()) writer.write( "<tr><td>Long01</td><td>" + md.getLong01() + "</td></tr>\n"); + if (0!=md.getLong02()) writer.write( "<tr><td>Long02</td><td>" + md.getLong02() + "</td></tr>\n"); + if (0!=md.getLong03()) writer.write( "<tr><td>Long03</td><td>" + md.getLong03() + "</td></tr>\n"); + if (0!=md.getLong04()) writer.write( "<tr><td>Long04</td><td>" + md.getLong04() + "</td></tr>\n"); + if (null!=md.getPqStringVal01()) writer.write( "<tr><td>PQ01</td><td>" + md.getPqStringVal01() + " " + md.getPqUnits01() + "</td></tr>\n"); + if (null!=md.getPqStringVal02()) writer.write( "<tr><td>PQ02</td><td>" + md.getPqStringVal02() + " " + md.getPqUnits02() + "</td></tr>\n"); + if (null!=md.getPqStringVal03()) writer.write( "<tr><td>PQ03</td><td>" + md.getPqStringVal03() + " " + md.getPqUnits03() + "</td></tr>\n"); + if (null!=md.getPqStringVal04()) writer.write( "<tr><td>PQ04</td><td>" + md.getPqStringVal04() + " " + md.getPqUnits04() + "</td></tr>\n"); + if (null!=md.getParentPath01()) writer.write( "<tr><td>Parent01</td><td>" + md.getParentPath01() + "</td></tr>\n"); + if (null!=md.getParentPath02()) writer.write( "<tr><td>Parent02</td><td>" + md.getParentPath03() + "</td></tr>\n"); + if (null!=md.getParentPath03()) writer.write( "<tr><td>Parent03</td><td>" + md.getParentPath03() + "</td></tr>\n"); + if (null!=md.getParentPath04()) writer.write( "<tr><td>Parent04</td><td>" + md.getParentPath04() + "</td></tr>\n"); + if (0!=md.getDocumentId()) writer.write( "<tr><td>DocumentId</td><td>" + md.getDocumentId() + "</td></tr>\n"); + if (null!=md.getReference()) writer.write( "<tr><td>Reference</td><td>" + md.getReference().getPath() + "</td></tr>\n"); + writer.write( "</table>\n"); + } + void showQueryInfo(Writer writer, MenuQueryControl ctrl ) throws IOException { writer.write( "<p>Query Criteria</p>" ); |
From: John C. <jc...@us...> - 2007-01-18 02:11:20
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/index In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18984/src/org/tolven/index Modified Files: Browse.java Log Message: Add direct login to the demo menudata browser. Index: Browse.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/index/Browse.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Browse.java 17 Jan 2007 18:43:01 -0000 1.1 --- Browse.java 18 Jan 2007 02:11:18 -0000 1.2 *************** *** 10,13 **** --- 10,20 ---- import javax.naming.InitialContext; import javax.naming.NamingException; + import javax.security.auth.callback.Callback; + import javax.security.auth.callback.CallbackHandler; + import javax.security.auth.callback.NameCallback; + import javax.security.auth.callback.PasswordCallback; + import javax.security.auth.callback.UnsupportedCallbackException; + import javax.security.auth.login.LoginContext; + import javax.security.auth.login.LoginException; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; *************** *** 23,32 **** import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.doc.DocumentLocal; ! import org.tolven.web.TopAction; /** ! * This servlet provides an all-in-one-place way to browse through all MenuData for an account. ! * It is generally only useful for development. * The output has several sections: * <ol> --- 30,46 ---- 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.core.entity.TolvenUser; import org.tolven.doc.DocumentLocal; ! import org.tolven.security.TolvenPerson; /** ! * <p>This servlet provides an all-in-one-place way to browse through all MenuData for an account. ! * Only useful for development, primarily for testing and viewing metadata and as a way to understand how ! * the application works without the burden of AJAX, Faces, Facelets, context management, etc.</p> ! * <p>This module also handles its own login and logout in order to make those processes explicit. It still uses ! * JAAS-based LDAP authentication but not the usual FormAuthenticator (j_security_check). ! * * The output has several sections: * <ol> *************** *** 36,40 **** * <li>The current item, if any, is displayed in full.</li> * </ol> ! * The main query itself, given a query string can be found in showMenuData. * * @author John Churin --- 50,54 ---- * <li>The current item, if any, is displayed in full.</li> * </ol> ! * <p>The main query itself can be found in showMenuData. findMenuData.</p> * * @author John Churin *************** *** 47,50 **** --- 61,65 ---- private ServletContext context = null; private MenuLocal menuLocal; + private ActivationLocal activateLocal; @Override *************** *** 56,59 **** --- 71,75 ---- documentLocal = (DocumentLocal) ctx.lookup("tolven/DocumentBean/local"); menuLocal = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); + activateLocal = (ActivationLocal) ctx.lookup("tolven/ActivationBean/local"); } catch (NamingException e) *************** *** 63,66 **** --- 79,149 ---- super.init(config); } + class UsernamePasswordHandler implements CallbackHandler { + TolvenPerson tp; + + public UsernamePasswordHandler(TolvenPerson tp) { + this.tp = tp; + } + + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + int len = callbacks.length; + Callback cb; + for(int i=0; i<len; i++) { + cb = callbacks[i]; + if(cb instanceof NameCallback) { + NameCallback ncb = (NameCallback)cb; + ncb.setName(tp.getUid()); + } + else if (cb instanceof PasswordCallback) { + PasswordCallback pcb = (PasswordCallback)cb; + pcb.setPassword(tp.getUserPassword().toCharArray()); + } else { + throw new UnsupportedCallbackException(cb, "Unknown callback request"); + } + } + } + }; + + /** + * Log the user in using username and password supplied by the client. + * @param request + * @return + * @throws LoginException + * @throws ServletException + */ + void login( HttpServletRequest request ) throws LoginException, ServletException { + if (null==request.getParameter("username") || + null==request.getParameter("password") || + null==request.getParameter("account")) { + throw new ServletException( "Missing account, username, and/or password"); + } + TolvenPerson tp = new TolvenPerson(); + tp.setUid(request.getParameter("username")); + tp.setUserPassword(request.getParameter("password")); + System.out.println( "Logging in user: " + tp.getUid()); + UsernamePasswordHandler handler = new UsernamePasswordHandler(tp); + LoginContext lc = new LoginContext("tolvenApplicationLDAP", handler); + // System.out.println( "Created login context"); + lc.login(); + System.out.println( "Password verified"); + TolvenUser user = activateLocal.loginUser( tp.getUid(), new Date() ); + // This simulates the SelectAccount page + List<AccountUser> accountUsers = activateLocal.findUserAccounts(user); + long accountId = Long.parseLong(request.getParameter("account")); + long accountUserId = 0; + // Select the most recent AccountUser and use that account + for ( AccountUser au : accountUsers ) { + if (8300==au.getAccount().getId() ) { + accountUserId = au.getId(); + accountId = au.getAccount().getId(); + } + } + if (accountUserId==0) { + throw new ServletException( "Invalid account specified"); + } + System.out.println( "Selected account: " + Long.toString(accountId)); + request.getSession().setAttribute("accountUser", new Long(accountUserId)); + // lc.logout(); + } @Override *************** *** 75,87 **** throw new ServletException("[AjaxServlet] Error setting up UserTransaction or starting a transaction", e); } ! // Get information about the current session ! TopAction top = null; ! Object topObj = request.getSession(false).getAttribute("top"); ! if (topObj==null) { ! throw new IllegalStateException( "[Demo Servlet] Top Obj is null - how can that be"); ! } ! if (topObj instanceof TopAction) { ! top = (org.tolven.web.TopAction)topObj; ! } // Prepare response back to client response.setContentType("text/html"); --- 158,194 ---- throw new ServletException("[AjaxServlet] Error setting up UserTransaction or starting a transaction", e); } ! String uri = request.getRequestURI(); ! if( uri.endsWith("login.browse")) { ! try { ! login( request ); ! } catch (LoginException e ) { ! throw new ServletException( "Login failed"); ! } ! response.sendRedirect("view.browse"); ! // This module is all about read-only so rollback in all cases ! try { ! ut.rollback(); ! } catch (Exception e) { ! throw new ServletException( "[AjaxServlet] Rollback Exception", e ); ! } ! return; ! } ! // See if we have an account user. Can't go on without it. ! if (null==request.getSession(true).getAttribute("accountUser")) { ! // This module is all about read-only so rollback in all cases ! try { ! ut.rollback(); ! } catch (Exception e) { ! throw new ServletException( "[AjaxServlet] Rollback Exception", e ); ! } ! throw new ServletException( "Not logged in or invalid account selected"); ! } ! ! // Get AccountUser from the current session ! // String accountUserString = (String) request.getSession(true).getAttribute("accountUser"); ! long accountUserId = (Long) request.getSession(false).getAttribute("accountUser"); ! AccountUser accountUser = activateLocal.findAccountUser(accountUserId); ! System.out.println( "Using account: " + Long.toString(accountUser.getAccount().getId())); ! // Prepare response back to client response.setContentType("text/html"); *************** *** 89,112 **** Writer writer=response.getWriter(); writer.write( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" >"); - writer.write( "<html>\n" ); writer.write( "<head>\n"); writer.write( "</head>\n"); writer.write( "<body>\n"); ! // Get key parameters from the request ! String element = request.getParameter( "element"); ! ! // Show everything about the item we've been asked to display ! // if (id!=0) { ! // showDetail( id ); ! // } ! // Show lists we have available ! showLists( top, writer, element); ! // Display the requested memu data, if any ! if (element!=null) { ! MenuQueryControl ctrl = setupControl( request, top ); ! showMenuData( top, writer, ctrl); ! } writer.write( "</body>\n"); writer.write( "</html>\n"); --- 196,228 ---- Writer writer=response.getWriter(); writer.write( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" >"); writer.write( "<html>\n" ); writer.write( "<head>\n"); writer.write( "</head>\n"); writer.write( "<body>\n"); + if( uri.endsWith("logout.browse")) { + request.getSession(false).invalidate(); + writer.write( "<p>Logged out</p>\n"); + writer.write( "<p><a href='login.browse'>Login</a></p>\n"); + } ! if( uri.endsWith("view.browse")) { ! // Get key parameters from the request ! String element = request.getParameter( "element"); ! ! // Show everything about the item we've been asked to display ! // if (id!=0) { ! // showDetail( id ); ! // } ! // Show lists we have available ! // System.out.println( "Showing lists"); ! showLists( accountUser, writer, element); ! // Display the requested memu data, if any ! if (element!=null) { ! // System.out.println( "Showing: " + element); ! MenuQueryControl ctrl = setupControl( request, accountUser ); ! showMenuData( accountUser, writer, ctrl); ! } ! writer.write( "<p><a href='logout.browse'>Logout</a></p>\n"); ! } writer.write( "</body>\n"); writer.write( "</html>\n"); *************** *** 127,131 **** * @throws IOException */ ! void showLists( TopAction top, Writer writer, String element ) throws IOException { // Output results in an HTML table writer.write( "<p>Available Lists</p>\n"); --- 243,247 ---- * @throws IOException */ ! void showLists( AccountUser au, Writer writer, String element ) throws IOException { // Output results in an HTML table writer.write( "<p>Available Lists</p>\n"); *************** *** 140,147 **** MenuPath elementPath = new MenuPath( element ); // Get all metadata (for this account) ! List<MenuStructure> menus = menuLocal.findFullMenuStructure( top.getAccountId()); for (MenuStructure ms : menus) { if ("list".equals(ms.getRole()) ) { List<MenuStructure> placeholders = getPlaceholders( ms ); if (placeholders.size() > 0 ) { writer.write( "<tr>" ); --- 256,265 ---- MenuPath elementPath = new MenuPath( element ); // Get all metadata (for this account) ! List<MenuStructure> menus = menuLocal.findFullMenuStructure( au.getAccount().getId()); ! // System.out.println( "found menus for account: " + au.getAccount().getId()); for (MenuStructure ms : menus) { if ("list".equals(ms.getRole()) ) { List<MenuStructure> placeholders = getPlaceholders( ms ); + // System.out.println( "found placeholders for: " + ms.getPath()); if (placeholders.size() > 0 ) { writer.write( "<tr>" ); *************** *** 164,173 **** * @return */ ! MenuQueryControl setupControl( HttpServletRequest request, TopAction top) { MenuQueryControl ctrl = new MenuQueryControl(); String element = request.getParameter( "element"); MenuPath path = new MenuPath( element ); // Based on the path we get in the element parameter, get the corresponding menuStructure (metadata) ! MenuStructure ms = menuLocal.findMenuStructure( top.getAccountId(), path.getPath() ); String repeatingBase = ms.getRepeating(); ctrl.setMenuStructure( ms ); --- 282,291 ---- * @return */ ! MenuQueryControl setupControl( HttpServletRequest request, AccountUser au) { MenuQueryControl ctrl = new MenuQueryControl(); String element = request.getParameter( "element"); MenuPath path = new MenuPath( element ); // Based on the path we get in the element parameter, get the corresponding menuStructure (metadata) ! MenuStructure ms = menuLocal.findMenuStructure( au.getAccount().getId(), path.getPath() ); String repeatingBase = ms.getRepeating(); ctrl.setMenuStructure( ms ); *************** *** 211,215 **** * @throws IOException */ ! void showMenuData( TopAction top, Writer writer, MenuQueryControl ctrl ) throws IOException { List<MenuData> rows = menuLocal.findMenuData( ctrl ); showQueryInfo(writer, ctrl); --- 329,333 ---- * @throws IOException */ ! void showMenuData( AccountUser au, Writer writer, MenuQueryControl ctrl ) throws IOException { List<MenuData> rows = menuLocal.findMenuData( ctrl ); showQueryInfo(writer, ctrl); *************** *** 319,322 **** --- 437,441 ---- return p; } + // System.out.println( "Find placeholder for: " + ms.getPath()); MenuStructure msPlaceholder = menuLocal.findMenuStructure( ms.getAccount().getId(), placeholderPath); while ( null!=msPlaceholder ) { |
From: John C. <jc...@us...> - 2007-01-17 18:43:17
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27439/src/org/tolven/app/bean Modified Files: MenuPath.java MenuBean.java Log Message: Add MenuData browser Index: MenuBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuBean.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** MenuBean.java 16 Jan 2007 06:12:47 -0000 1.40 --- MenuBean.java 17 Jan 2007 18:43:06 -0000 1.41 *************** *** 294,298 **** MenuStructure allpatients = new MenuStructure( ! root.getAccount(), patients, "patients.xhtml", null, 1, "all", "My Patients", "true", "echr:patient", "tab" ); em.persist( allpatients ); em.persist( new MSColumn( allpatients, 1, "Name", "reference", "%s, %s", "string01,string02") ); --- 294,298 ---- MenuStructure allpatients = new MenuStructure( ! root.getAccount(), patients, "patients.xhtml", null, 1, "all", "My Patients", "true", "echr:patient", "list" ); em.persist( allpatients ); em.persist( new MSColumn( allpatients, 1, "Name", "reference", "%s, %s", "string01,string02") ); *************** *** 302,306 **** MenuStructure dispats = new MenuStructure( ! root.getAccount(), patients, "dispats.xhtml", null, 2, "disease", "Patients By Disease", "true", "echr:patient", "tab" ); em.persist( dispats ); em.persist( new MSColumn( dispats, 1, "Name", "reference", "%s, %s", "string01,string02") ); --- 302,306 ---- MenuStructure dispats = new MenuStructure( ! root.getAccount(), patients, "dispats.xhtml", null, 2, "disease", "Patients By Disease", "true", "echr:patient", "list" ); em.persist( dispats ); em.persist( new MSColumn( dispats, 1, "Name", "reference", "%s, %s", "string01,string02") ); *************** *** 311,315 **** MenuStructure dmpats = new MenuStructure( ! root.getAccount(), patients, "dmpats.xhtml", null, 3, "dm", "Diabetes Registry", "true", "echr:patient", "tab" ); em.persist( dmpats ); em.persist( new MSColumn( dmpats, 1, "Last", "reference", "string01") ); --- 311,315 ---- MenuStructure dmpats = new MenuStructure( ! root.getAccount(), patients, "dmpats.xhtml", null, 3, "dm", "Diabetes Registry", "true", "echr:patient", "list" ); em.persist( dmpats ); em.persist( new MSColumn( dmpats, 1, "Last", "reference", "string01") ); *************** *** 331,335 **** // Family Members MenuStructure allpatients = new MenuStructure( ! root.getAccount(), myFamily, "patients.xhtml", null, 1, "members", "Family Members", "true", "ephr:patient", "tab" ); em.persist( allpatients ); em.persist( new MSColumn( allpatients, 1, "Name", "reference", "%s, %s", "string01,string02") ); --- 331,335 ---- // Family Members MenuStructure allpatients = new MenuStructure( ! root.getAccount(), myFamily, "patients.xhtml", null, 1, "members", "Family Members", "true", "ephr:patient", "list" ); em.persist( allpatients ); em.persist( new MSColumn( allpatients, 1, "Name", "reference", "%s, %s", "string01,string02") ); *************** *** 339,346 **** MenuStructure agents = new MenuStructure( ! root.getAccount(), myFamily, "agents.xhtml", null, 2, "agents", "Agents", "true", "ephr:agent", "tab" ); em.persist( agents ); MenuStructure providers = new MenuStructure( ! root.getAccount(), myFamily, "agents.xhtml", null, 3, "providers", "Provider Preference", "true", "ephr:provider", "tab" ); em.persist( providers ); --- 339,346 ---- MenuStructure agents = new MenuStructure( ! root.getAccount(), myFamily, "agents.xhtml", null, 2, "agents", "Agents", "true", "ephr:agent", "list" ); em.persist( agents ); MenuStructure providers = new MenuStructure( ! root.getAccount(), myFamily, "agents.xhtml", null, 3, "providers", "Provider Preference", "true", "ephr:provider", "list" ); em.persist( providers ); *************** *** 370,374 **** // All activity MenuStructure all = new MenuStructure( ! root.getAccount(), activity, "activity.xhtml", null, 2, "all", "All Activity", "true", null, "tab" ); em.persist( all ); em.persist( new MSColumn( all, 1, "Date", "date01", "d MMM yyyy") ); --- 370,374 ---- // All activity MenuStructure all = new MenuStructure( ! root.getAccount(), activity, "activity.xhtml", null, 2, "all", "All Activity", "true", null, "list" ); em.persist( all ); em.persist( new MSColumn( all, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 383,387 **** em.persist( results ); MenuStructure allResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 1, "all", "All Results", "true", null, "tab" ); em.persist( allResults ); em.persist( new MSColumn( allResults, 1, "Date", "date01", "d MMM yyyy") ); --- 383,387 ---- em.persist( results ); MenuStructure allResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 1, "all", "All Results", "true", null, "list" ); em.persist( allResults ); em.persist( new MSColumn( allResults, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 392,396 **** em.persist( new MSColumn( allResults, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure labResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 2, "lab", "Lab Results", "true", null, "tab" ); em.persist( labResults ); em.persist( new MSColumn( labResults, 1, "Date", "date01", "d MMM yyyy") ); --- 392,396 ---- em.persist( new MSColumn( allResults, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure labResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 2, "lab", "Lab Results", "true", null, "list" ); em.persist( labResults ); em.persist( new MSColumn( labResults, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 401,405 **** em.persist( new MSColumn( labResults, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure radResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 3, "rad", "Radiology Results", "true", null, "tab" ); em.persist( radResults ); em.persist( new MSColumn( radResults, 1, "Date", "date01", "d MMM yyyy") ); --- 401,405 ---- em.persist( new MSColumn( labResults, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure radResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 3, "rad", "Radiology Results", "true", null, "list" ); em.persist( radResults ); em.persist( new MSColumn( radResults, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 410,414 **** em.persist( new MSColumn( radResults, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure othResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 4, "oth", "Other Results", "true", null, "tab" ); em.persist( othResults ); em.persist( new MSColumn( othResults, 1, "Date", "date01", "d MMM yyyy") ); --- 410,414 ---- em.persist( new MSColumn( radResults, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure othResults = new MenuStructure( ! root.getAccount(), results, "activity.xhtml", null, 4, "oth", "Other Results", "true", null, "list" ); em.persist( othResults ); em.persist( new MSColumn( othResults, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 423,427 **** // Results MenuStructure rx = new MenuStructure( ! root.getAccount(), activity, "activity.xhtml", null, 3, "rx", "Prescriptions", "true", null, "tab" ); em.persist( new MSColumn( rx, 1, "Date", "date01", "d MMM yyyy") ); em.persist( new MSColumn( rx, 2, "For", "parent01", "string01") ); --- 423,427 ---- // Results MenuStructure rx = new MenuStructure( ! root.getAccount(), activity, "activity.xhtml", null, 3, "rx", "Prescriptions", "true", null, "list" ); em.persist( new MSColumn( rx, 1, "Date", "date01", "d MMM yyyy") ); em.persist( new MSColumn( rx, 2, "For", "parent01", "string01") ); *************** *** 435,439 **** em.persist( req ); MenuStructure chrData = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 1, "chr", "CHR Data", "true", null, "tab" ); em.persist( chrData ); em.persist( new MSColumn( chrData, 1, "Date", "date01", "d MMM yyyy") ); --- 435,439 ---- em.persist( req ); MenuStructure chrData = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 1, "chr", "CHR Data", "true", null, "list" ); em.persist( chrData ); em.persist( new MSColumn( chrData, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 444,448 **** em.persist( new MSColumn( chrData, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure provider = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 2, "prov", "Provider Requests", "true", null, "tab" ); em.persist( provider ); em.persist( new MSColumn( provider, 1, "Date", "date01", "d MMM yyyy") ); --- 444,448 ---- em.persist( new MSColumn( chrData, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure provider = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 2, "prov", "Provider Requests", "true", null, "list" ); em.persist( provider ); em.persist( new MSColumn( provider, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 453,457 **** em.persist( new MSColumn( provider, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure quest = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 3, "quest", "Questionnaires", "true", null, "tab" ); em.persist( quest ); em.persist( new MSColumn( quest, 1, "Date", "date01", "d MMM yyyy") ); --- 453,457 ---- em.persist( new MSColumn( provider, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure quest = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 3, "quest", "Questionnaires", "true", null, "list" ); em.persist( quest ); em.persist( new MSColumn( quest, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 462,466 **** em.persist( new MSColumn( quest, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure ass = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 2, "ass", "Assessments", "true", null, "tab" ); em.persist( ass ); em.persist( new MSColumn( ass, 1, "Date", "date01", "d MMM yyyy") ); --- 462,466 ---- em.persist( new MSColumn( quest, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure ass = new MenuStructure( ! root.getAccount(), req, "activity.xhtml", null, 2, "ass", "Assessments", "true", null, "list" ); em.persist( ass ); em.persist( new MSColumn( ass, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 474,478 **** em.persist( cons ); MenuStructure apptcons = new MenuStructure( ! root.getAccount(), cons, "activity.xhtml", null, 1, "ass", "Appointment Requests", "true", null, "tab" ); em.persist( apptcons ); em.persist( new MSColumn( apptcons, 1, "Date", "date01", "d MMM yyyy") ); --- 474,478 ---- em.persist( cons ); MenuStructure apptcons = new MenuStructure( ! root.getAccount(), cons, "activity.xhtml", null, 1, "ass", "Appointment Requests", "true", null, "list" ); em.persist( apptcons ); em.persist( new MSColumn( apptcons, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 483,487 **** em.persist( new MSColumn( apptcons, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure econs = new MenuStructure( ! root.getAccount(), cons, "activity.xhtml", null, 1, "econs", "eConsultation", "true", null, "tab" ); em.persist( econs ); em.persist( new MSColumn( econs, 1, "Date", "date01", "d MMM yyyy") ); --- 483,487 ---- em.persist( new MSColumn( apptcons, 6, "Due", "date02", "d MMM yyyy") ); MenuStructure econs = new MenuStructure( ! root.getAccount(), cons, "activity.xhtml", null, 1, "econs", "eConsultation", "true", null, "list" ); em.persist( econs ); em.persist( new MSColumn( econs, 1, "Date", "date01", "d MMM yyyy") ); *************** *** 514,517 **** --- 514,520 ---- account, result, "test.xhtml", "testLink.xhtml", -1, "test", "Test", "false", "test", "placeholder" ); em.persist( test ); + MenuStructure order = new MenuStructure( + account, patient, "order.xhtml", "orderLink.xhtml", -1, "order", "Order", "false", "order", "placeholder" ); + em.persist( order ); MenuStructure summary = new MenuStructure( *************** *** 564,568 **** MenuStructure newResults = new MenuStructure( ! account, patResults, "newResults.xhtml", null, 20, "new", "New results", "true", null, "tab" ); em.persist( newResults ); em.persist( new MSColumn( newResults, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); --- 567,571 ---- MenuStructure newResults = new MenuStructure( ! account, patResults, "newResults.xhtml", null, 20, "new", "New results", "true", root.getPath() +":patient:result", "list" ); em.persist( newResults ); em.persist( new MSColumn( newResults, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); *************** *** 572,580 **** MenuStructure pendingOrders = new MenuStructure( ! account, patResults, "pendingOrders.xhtml", null, 30, "orders", "Pending Orders", "true", null, "tab" ); em.persist( pendingOrders ); MenuStructure labAll = new MenuStructure( ! account, patResults, "lab.xhtml", null, 40, "lab", "Lab", "true", null, "tab" ); em.persist( labAll ); em.persist( new MSColumn( labAll, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); --- 575,583 ---- MenuStructure pendingOrders = new MenuStructure( ! account, patResults, "pendingOrders.xhtml", null, 30, "orders", "Pending Orders", "true", null, "list" ); em.persist( pendingOrders ); MenuStructure labAll = new MenuStructure( ! account, patResults, "lab.xhtml", null, 40, "lab", "Lab", "true", root.getPath() +":patient:result:test", "list" ); em.persist( labAll ); em.persist( new MSColumn( labAll, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); *************** *** 587,603 **** MenuStructure lipids = new MenuStructure( ! account, patResults, "graphLipids.xhtml", null, 999, "lipids", "Lipids", "true", null, "tab" ); em.persist( lipids ); MenuStructure pathology = new MenuStructure( ! account, patResults, "pathology.xhtml", null, 50, "pathology", "Pathology", "true", null, "tab" ); em.persist( pathology ); MenuStructure selfMon = new MenuStructure( ! account, patResults, "selfMon.xhtml", null, 60, "self", "Self Monitoring", "true", null, "tab" ); em.persist( selfMon ); MenuStructure rad = new MenuStructure( ! account, patResults, "rad.xhtml", null, 70, "rad", "Radiology", "true", null, "tab" ); em.persist( rad ); em.persist( new MSColumn( rad, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); --- 590,606 ---- MenuStructure lipids = new MenuStructure( ! account, patResults, "graphLipids.xhtml", null, 999, "lipids", "Lipids", "true", root.getPath() +":patient:result:test", "list" ); em.persist( lipids ); MenuStructure pathology = new MenuStructure( ! account, patResults, "pathology.xhtml", null, 50, "pathology", "Pathology", "true", root.getPath() +":patient:result:test", "list" ); em.persist( pathology ); MenuStructure selfMon = new MenuStructure( ! account, patResults, "selfMon.xhtml", null, 60, "self", "Self Monitoring", "true", root.getPath() +":patient:result:test", "list" ); em.persist( selfMon ); MenuStructure rad = new MenuStructure( ! account, patResults, "rad.xhtml", null, 70, "rad", "Radiology", "true", root.getPath() +":patient:result:test", "list" ); em.persist( rad ); em.persist( new MSColumn( rad, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); *************** *** 608,616 **** MenuStructure physio = new MenuStructure( ! account, patResults, "physio.xhtml", null, 80, "physio", "Physio", "true", null, "tab" ); em.persist( physio ); MenuStructure images = new MenuStructure( ! account, patResults, "images.xhtml", null, 90, "images", "Images", "true", null, "tab" ); em.persist( images ); --- 611,619 ---- MenuStructure physio = new MenuStructure( ! account, patResults, "physio.xhtml", null, 80, "physio", "Physio", "true", root.getPath() +":patient:result:test", "list" ); em.persist( physio ); MenuStructure images = new MenuStructure( ! account, patResults, "images.xhtml", null, 90, "images", "Images", "true", root.getPath() +":patient:result:test", "list" ); em.persist( images ); *************** *** 620,628 **** em.persist( doc ); MenuStructure ques = new MenuStructure( ! account, doc, "questionaires.xhtml", null, 2, "ques", "Questionnaires", "true", null, "tab" ); em.persist( ques ); MenuStructure assAll = new MenuStructure( ! account, doc, "assAll.xhtml", null, 3, "ass", "Clinical Assessments", "true", null, "tab" ); em.persist( assAll ); em.persist( new MSColumn( assAll, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); --- 623,631 ---- em.persist( doc ); MenuStructure ques = new MenuStructure( ! account, doc, "questionaires.xhtml", null, 2, "ques", "Questionnaires", "true", root.getPath() +":patient:assessment", "list" ); em.persist( ques ); MenuStructure assAll = new MenuStructure( ! account, doc, "assAll.xhtml", null, 3, "ass", "Clinical Assessments", "true", root.getPath() +":patient:assessment", "list" ); em.persist( assAll ); em.persist( new MSColumn( assAll, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); *************** *** 644,664 **** MenuStructure obs = new MenuStructure( ! account, doc, "obs.xhtml", null, 4, "obs", "Observations", "true", null, "tab" ); em.persist( obs ); MenuStructure allergies = new MenuStructure( ! account, doc, "allergies.xhtml", null, 5, "allergies", "Allergies", "true", null, "tab" ); em.persist( allergies ); MenuStructure protocols = new MenuStructure( ! account, doc, "protocols.xhtml", null, 6, "protocols", "Protocols", "true", null, "tab" ); em.persist( protocols ); MenuStructure goals = new MenuStructure( ! account, doc, "goals.xhtml", null, 7, "goals", "Goals", "true", null, "tab" ); em.persist( goals ); MenuStructure dx = new MenuStructure( ! account, doc, "dx.xhtml", null, 8, "dx", "Working Diagnoses", "true", null, "tab" ); em.persist( dx ); --- 647,667 ---- MenuStructure obs = new MenuStructure( ! account, doc, "obs.xhtml", null, 4, "obs", "Observations", "true", root.getPath() +":patient:assessment", "list" ); em.persist( obs ); MenuStructure allergies = new MenuStructure( ! account, doc, "allergies.xhtml", null, 5, "allergies", "Allergies", "true", root.getPath() +":patient:assessment", "list" ); em.persist( allergies ); MenuStructure protocols = new MenuStructure( ! account, doc, "protocols.xhtml", null, 6, "protocols", "Protocols", "true", root.getPath() +":patient:assessment", "list" ); em.persist( protocols ); MenuStructure goals = new MenuStructure( ! account, doc, "goals.xhtml", null, 7, "goals", "Goals", "true", null, "list" ); em.persist( goals ); MenuStructure dx = new MenuStructure( ! account, doc, "dx.xhtml", null, 8, "dx", "Working Diagnoses", "true", null, "list" ); em.persist( dx ); *************** *** 669,685 **** em.persist( hx ); MenuStructure famhx = new MenuStructure( ! account, hx, "famhx.xhtml", null, 2, "famhx", "Family", "true", null, "tab" ); em.persist( famhx ); MenuStructure medhx = new MenuStructure( ! account, hx, "medhx.xhtml", null, 3, "medhx", "Medical", "true", null, "tab" ); em.persist( medhx ); MenuStructure dxhx = new MenuStructure( ! account, hx, "dxhx.xhtml", null, 4, "dxhx", "Diagnoses", "true", null, "tab" ); em.persist( dxhx ); MenuStructure problems = new MenuStructure( ! account, hx, "problems.xhtml", null, 5, "problems", "Problems", "true", null, "tab" ); em.persist( problems ); em.persist( new MSColumn( problems, 1, "Problem", "string01", null) ); --- 672,688 ---- em.persist( hx ); MenuStructure famhx = new MenuStructure( ! account, hx, "famhx.xhtml", null, 2, "famhx", "Family", "true", null, "list" ); em.persist( famhx ); MenuStructure medhx = new MenuStructure( ! account, hx, "medhx.xhtml", null, 3, "medhx", "Medical", "true", null, "list" ); em.persist( medhx ); MenuStructure dxhx = new MenuStructure( ! account, hx, "dxhx.xhtml", null, 4, "dxhx", "Diagnoses", "true", null, "list" ); em.persist( dxhx ); MenuStructure problems = new MenuStructure( ! account, hx, "problems.xhtml", null, 5, "problems", "Problems", "true", root.getPath() +":patient:problem", "list" ); em.persist( problems ); em.persist( new MSColumn( problems, 1, "Problem", "string01", null) ); *************** *** 687,694 **** em.persist( new MSColumn( problems, 3, "Status", "string02", null) ); MenuStructure pxhx = new MenuStructure( ! account, hx, "pxhx.xhtml", null, 6, "pxhx", "Procedures", "true", null, "tab" ); em.persist( pxhx ); MenuStructure psyhx = new MenuStructure( ! account, hx, "psyhx.xhtml", null, 7, "psyhx", "Psychiatry", "true", null, "tab" ); em.persist( psyhx ); --- 690,697 ---- em.persist( new MSColumn( problems, 3, "Status", "string02", null) ); MenuStructure pxhx = new MenuStructure( ! account, hx, "pxhx.xhtml", null, 6, "pxhx", "Procedures", "true", null, "list" ); em.persist( pxhx ); MenuStructure psyhx = new MenuStructure( ! account, hx, "psyhx.xhtml", null, 7, "psyhx", "Psychiatry", "true", null, "list" ); em.persist( psyhx ); *************** *** 699,715 **** MenuStructure medications = new MenuStructure( ! account, med, "medications.xhtml", null, 2, "meds", "Medications", "true", null, "tab" ); em.persist( medications ); MenuStructure rx = new MenuStructure( ! account, med, "rx.xhtml", null, 3, "rx", "Prescriptions", "true", null, "tab" ); em.persist( rx ); MenuStructure otcm = new MenuStructure( ! account, med, "otcm.xhtml", null, 4, "otcm", "OTCM", "true", null, "tab" ); em.persist( otcm ); MenuStructure imm = new MenuStructure( ! account, med, "imm.xhtml", null, 4, "imm", "Immunizations", "true", null, "tab" ); em.persist( imm ); --- 702,718 ---- MenuStructure medications = new MenuStructure( ! account, med, "medications.xhtml", null, 2, "meds", "Medications", "true", null, "list" ); em.persist( medications ); MenuStructure rx = new MenuStructure( ! account, med, "rx.xhtml", null, 3, "rx", "Prescriptions", "true", null, "list" ); em.persist( rx ); MenuStructure otcm = new MenuStructure( ! account, med, "otcm.xhtml", null, 4, "otcm", "OTCM", "true", null, "list" ); em.persist( otcm ); MenuStructure imm = new MenuStructure( ! account, med, "imm.xhtml", null, 4, "imm", "Immunizations", "true", null, "list" ); em.persist( imm ); *************** *** 724,756 **** MenuStructure providers = new MenuStructure( ! account, pers, "providers.xhtml", null, 3, "providers", "Providers", "true", null, "tab" ); em.persist( providers ); MenuStructure ins = new MenuStructure( ! account, pers, "ins.xhtml", null, 4, "ins", "Insurance", "true", null, "tab" ); em.persist( ins ); MenuStructure access = new MenuStructure( ! account, pers, "access.xhtml", null, 5, "access", "Access", "true", null, "tab" ); em.persist( access ); MenuStructure nok = new MenuStructure( ! account, pers, "nok.xhtml", null, 6, "nok", "Next of Kin", "true", null, "tab" ); em.persist( nok ); MenuStructure fun = new MenuStructure( ! account, pers, "fun.xhtml", null, 7, "fun", "Functional Status", "true", null, "tab" ); em.persist( fun ); MenuStructure appointments = new MenuStructure( ! account, pers, "appointments.xhtml", null, 9, "appts", "Appointments", "true", null, "tab" ); em.persist( appointments ); MenuStructure reminders = new MenuStructure( ! account, pers, "reminders.xhtml", null, 10, "reminders", "Reminders", "true", null, "tab" ); em.persist( reminders ); MenuStructure hmaint = new MenuStructure( ! account, pers, "hmaint.xhtml", null, 11, "hmaint", "Health Maint", "true", null, "tab" ); em.persist( hmaint ); --- 727,759 ---- MenuStructure providers = new MenuStructure( ! account, pers, "providers.xhtml", null, 3, "providers", "Providers", "true", null, "list" ); em.persist( providers ); MenuStructure ins = new MenuStructure( ! account, pers, "ins.xhtml", null, 4, "ins", "Insurance", "true", null, "list" ); em.persist( ins ); MenuStructure access = new MenuStructure( ! account, pers, "access.xhtml", null, 5, "access", "Access", "true", null, "list" ); em.persist( access ); MenuStructure nok = new MenuStructure( ! account, pers, "nok.xhtml", null, 6, "nok", "Next of Kin", "true", null, "list" ); em.persist( nok ); MenuStructure fun = new MenuStructure( ! account, pers, "fun.xhtml", null, 7, "fun", "Functional Status", "true", null, "list" ); em.persist( fun ); MenuStructure appointments = new MenuStructure( ! account, pers, "appointments.xhtml", null, 9, "appts", "Appointments", "true", null, "list" ); em.persist( appointments ); MenuStructure reminders = new MenuStructure( ! account, pers, "reminders.xhtml", null, 10, "reminders", "Reminders", "true", null, "list" ); em.persist( reminders ); MenuStructure hmaint = new MenuStructure( ! account, pers, "hmaint.xhtml", null, 11, "hmaint", "Health Maint", "true", null, "list" ); em.persist( hmaint ); Index: MenuPath.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuPath.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MenuPath.java 15 Nov 2006 07:00:11 -0000 1.5 --- MenuPath.java 17 Jan 2007 18:43:06 -0000 1.6 *************** *** 41,57 **** */ public MenuPath(String path, MenuPath srcPath) { ! Map<String, Long> nodeValues = srcPath.getNodeValues(); ! String nodes[] = path.split("\\:"); ! StringBuffer newPath = new StringBuffer( 100 ); ! for (int x = 0;x < nodes.length; x++) { ! if (newPath.length()>0) newPath.append(":"); ! newPath.append(nodes[x]); ! // A match and the value needs to be non-zero, then we copy it ! if (nodeValues.containsKey(nodes[x]) && nodeValues.get(nodes[x]).longValue()!=0) { ! newPath.append("-"); ! newPath.append(nodeValues.get(nodes[x]).longValue()); } } - this.pathString = newPath.toString(); } --- 41,61 ---- */ public MenuPath(String path, MenuPath srcPath) { ! if (srcPath.getPathString()!=null) { ! Map<String, Long> nodeValues = srcPath.getNodeValues(); ! String nodes[] = path.split("\\:"); ! StringBuffer newPath = new StringBuffer( 100 ); ! for (int x = 0;x < nodes.length; x++) { ! if (newPath.length()>0) newPath.append(":"); ! newPath.append(nodes[x]); ! // A match and the value needs to be non-zero, then we copy it ! if (nodeValues.containsKey(nodes[x]) && nodeValues.get(nodes[x]).longValue()!=0) { ! newPath.append("-"); ! newPath.append(nodeValues.get(nodes[x]).longValue()); ! } } + this.pathString = newPath.toString(); + } else { + this.pathString = path; } } |
From: John C. <jc...@us...> - 2007-01-17 18:43:14
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/index In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27400/src/org/tolven/index Added Files: Browse.java Log Message: Add MenuData browser --- NEW FILE: Browse.java --- package org.tolven.index; import java.io.IOException; import java.io.Writer; import java.util.Date; import java.util.Enumeration; import java.util.LinkedList; import java.util.List; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.transaction.UserTransaction; import org.tolven.app.MenuLocal; import org.tolven.app.bean.MenuPath; import org.tolven.app.bean.MenuQueryControl; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.doc.DocumentLocal; import org.tolven.web.TopAction; /** * This servlet provides an all-in-one-place way to browse through all MenuData for an account. * It is generally only useful for development. * The output has several sections: * <ol> * <li>The query elements of the current query, including defaults supplied in this module.</li> * <li>A list of all MenuStructure data pplicable to the currently selected item</li> * <li>If the current item is a list, then the actual data in that list is displayed.</li> * <li>The current item, if any, is displayed in full.</li> * </ol> * The main query itself, given a query string can be found in showMenuData. * * @author John Churin * */ public class Browse extends HttpServlet { private static final long serialVersionUID = 1L; private DocumentLocal documentLocal; private ServletContext context = null; private MenuLocal menuLocal; @Override public void init(ServletConfig config) throws ServletException { context = config.getServletContext(); try { InitialContext ctx = new InitialContext(); documentLocal = (DocumentLocal) ctx.lookup("tolven/DocumentBean/local"); menuLocal = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); } catch (NamingException e) { throw new RuntimeException(e); } super.init(config); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) 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); } // Get information about the current session TopAction top = null; Object topObj = request.getSession(false).getAttribute("top"); if (topObj==null) { throw new IllegalStateException( "[Demo Servlet] Top Obj is null - how can that be"); } if (topObj instanceof TopAction) { top = (org.tolven.web.TopAction)topObj; } // Prepare response back to client response.setContentType("text/html"); response.setHeader("Cache-Control", "no-cache"); Writer writer=response.getWriter(); writer.write( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" >"); writer.write( "<html>\n" ); writer.write( "<head>\n"); writer.write( "</head>\n"); writer.write( "<body>\n"); // Get key parameters from the request String element = request.getParameter( "element"); // Show everything about the item we've been asked to display // if (id!=0) { // showDetail( id ); // } // Show lists we have available showLists( top, writer, element); // Display the requested memu data, if any if (element!=null) { MenuQueryControl ctrl = setupControl( request, top ); showMenuData( top, writer, ctrl); } writer.write( "</body>\n"); writer.write( "</html>\n"); writer.close(); // This module is all about read-only so rollback in all cases try { ut.rollback(); } catch (Exception e) { throw new ServletException( "[AjaxServlet] Rollback Exception", e ); } } /** * Look for any lists that could be queried based on the element we have. * @param top * @param writer * @param id When non-zero, the id of the menudata item we can use to narrow the list of choices * @throws IOException */ void showLists( TopAction top, Writer writer, String element ) throws IOException { // Output results in an HTML table writer.write( "<p>Available Lists</p>\n"); writer.write( "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n"); writer.write( "<tr>" ); writer.write( "<th><em>Id</em></th>"); writer.write( "<th><em>Path</em></th>"); writer.write( "<th><em>Type</em></th>"); writer.write( "<th><em>Title</em></th>"); writer.write( "<th><em>Entity</em></th>"); writer.write( "</tr>\n"); MenuPath elementPath = new MenuPath( element ); // Get all metadata (for this account) List<MenuStructure> menus = menuLocal.findFullMenuStructure( top.getAccountId()); for (MenuStructure ms : menus) { if ("list".equals(ms.getRole()) ) { List<MenuStructure> placeholders = getPlaceholders( ms ); if (placeholders.size() > 0 ) { writer.write( "<tr>" ); writer.write( "<td>" + getMSRef(ms, elementPath ) + "</td>"); writer.write( "<td>" + ms.getPath() + "</td>"); writer.write( "<td>" + ms.getRole() + "</td>"); writer.write( "<td>" + ms.getText() + "</td>"); writer.write( "<td>"); showPlaceholders( placeholders, writer); writer.write( "</td>" ); writer.write( "</tr>\n"); } } } writer.write( "</table>\n"); } /** * Collect several parameters and setup the MenuData Query. * @param request The HTTP request * @param top Provide access to the logged in context * @return */ MenuQueryControl setupControl( HttpServletRequest request, TopAction top) { MenuQueryControl ctrl = new MenuQueryControl(); String element = request.getParameter( "element"); MenuPath path = new MenuPath( element ); // Based on the path we get in the element parameter, get the corresponding menuStructure (metadata) MenuStructure ms = menuLocal.findMenuStructure( top.getAccountId(), path.getPath() ); String repeatingBase = ms.getRepeating(); ctrl.setMenuStructure( ms ); ctrl.setNow( new Date() ); if (request.getParameter( "offset")!=null) { ctrl.setOffset( Integer.parseInt( request.getParameter( "offset")) ); } else { ctrl.setOffset( 0 ); } if (request.getParameter( "page_size" )!=null) { ctrl.setLimit( Integer.parseInt( request.getParameter( "page_size" )) ); } else { ctrl.setLimit( 100 ); } ctrl.setOriginalTargetPath( path ); ctrl.setRequestedPath( path ); if (request.getParameter( "sort_dir")!=null) { ctrl.setSortDirection( request.getParameter( "sort_dir") ); } else { ctrl.setSortDirection( "asc"); } ctrl.setSortOrder( request.getParameter( "sort_col") ); // Any attribute name that ends with "Filter" (exactly) is taken as a filter parameter (but we don't store the 'filter suffix') Enumeration<String> params = request.getParameterNames(); while (params.hasMoreElements() ) { String param = params.nextElement(); if (param.endsWith("Filter")) { ctrl.getFilters().put(param.substring(0, param.length()-6), request.getParameter(param)); } } return ctrl; } /** * Display the contents of the list specified in the query criterie * @param top * @param writer * @param ctrl * @throws IOException */ void showMenuData( TopAction top, Writer writer, MenuQueryControl ctrl ) throws IOException { List<MenuData> rows = menuLocal.findMenuData( ctrl ); showQueryInfo(writer, ctrl); // Output results in an HTML table writer.write( "<p>Menu data (instance data) for " + ctrl.getRequestedPath()+ "</p>\n"); writer.write( "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n"); writer.write( "<tr>" ); writer.write( "<th><em>Id</em></th>"); writer.write( "<th><em>String01</em></th>"); writer.write( "<th><em>String02</em></th>"); writer.write( "<th><em>String03</em></th>"); writer.write( "<th><em>String04</em></th>"); writer.write( "<th><em>Date01</em></th>"); writer.write( "<th><em>Date02</em></th>"); writer.write( "<th><em>Date03</em></th>"); writer.write( "<th><em>Date04</em></th>"); writer.write( "</tr>\n"); for (MenuData md : rows) { writer.write( "<tr>" ); writer.write( "<td>" + getMDRef( md) + "</td>"); writer.write( "<td>" + md.getString01() + "</td>"); writer.write( "<td>" + md.getString02() + "</td>"); writer.write( "<td>" + md.getString03() + "</td>"); writer.write( "<td>" + md.getString04() + "</td>"); writer.write( "<td>" + md.getDate01() + "</td>"); writer.write( "<td>" + md.getDate02() + "</td>"); writer.write( "<td>" + md.getDate03() + "</td>"); writer.write( "<td>" + md.getDate04() + "</td>"); writer.write( "</tr>\n"); } writer.write( "</table>\n"); } void showQueryInfo(Writer writer, MenuQueryControl ctrl ) throws IOException { writer.write( "<p>Query Criteria</p>" ); writer.write( "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n"); writer.write( "<tr>" ); writer.write( "<th><em>Account</em></th>"); writer.write( "<th><em>Path</em></th>"); writer.write( "<th><em>element</em></th>"); writer.write( "<th><em>offset</em></th>"); writer.write( "<th><em>page_size</em></th>"); writer.write( "</tr>\n"); writer.write( "<tr>" ); writer.write( "<td>" + ctrl.getMenuStructure().getAccount().getId() + "</td>"); writer.write( "<td>" + ctrl.getMenuStructure().getPath() + "</td>"); writer.write( "<td>" + ctrl.requestedPath.getPathString() + "</td>"); writer.write( "<td>" + ctrl.getOffset() + "</td>"); writer.write( "<td>" + ctrl.getLimit() + "</td>"); writer.write( "</tr>\n"); writer.write( "</table>\n"); } /** * Create a URL to the menu data for this MenuStructure item. In other words, a drilldown. * @param md * @return */ String getMSRef( MenuStructure ms, MenuPath element) { StringBuffer sb = new StringBuffer(); // Must be a list if (!"list".equals(ms.getRole())) return Long.toString(ms.getId()); // Attempt to construct a path MenuPath path = new MenuPath( ms.getPath(), element ); sb.append("<a href='"); sb.append("?element=" ); sb.append(path.getPathString()); sb.append( "'>"); sb.append(ms.getId()); sb.append("</a>"); return sb.toString(); } /** * Selecting a menu data item sends that item back so that we can display other lists * available from that item. * @param md * @return */ String getMDRef( MenuData md) { StringBuffer sb = new StringBuffer(); MenuData reference = md.getReference(); if (null==reference) return Long.toString(md.getId()); // Let the user drill down on this item sb.append("<a href='"); sb.append("?element=" ); sb.append(reference.getPath()); sb.append( "'>"); sb.append(md.getId()); sb.append("</a>"); return sb.toString(); } /** * Find out where this item is in the hierarchy of entities (placeholders) * @param ms * @return */ List<MenuStructure> getPlaceholders( MenuStructure ms ) { LinkedList<MenuStructure> p = new LinkedList<MenuStructure>(); try { // Metadata tells us the kind of repeating data in this list String placeholderPath = ms.getRepeating(); if (placeholderPath==null) { return p; } MenuStructure msPlaceholder = menuLocal.findMenuStructure( ms.getAccount().getId(), placeholderPath); while ( null!=msPlaceholder ) { if (!"placeholder".equals(msPlaceholder.getRole())) return p; p.addFirst( msPlaceholder); msPlaceholder = msPlaceholder.getParent(); } return p; } catch (RuntimeException e) { return p; } } /** * For a given list, display the placeholders (entities) involved in that list * @param top * @param writer * @param msList * @throws IOException */ void showPlaceholders( List<MenuStructure> msList, Writer writer ) throws IOException { boolean firstTime = true; for ( MenuStructure ms : msList ) { if (firstTime) firstTime = false; else writer.write( ", "); writer.write( ms.getNode()); } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub super.doPost(request, response); } @Override public void destroy() { // TODO Auto-generated method stub super.destroy(); } } |
From: John C. <jc...@us...> - 2007-01-17 18:43:12
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/index In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27389/src/org/tolven/index Log Message: Directory /cvsroot/tolven/tolvenWEB/src/org/tolven/index added to the repository |
From: John C. <jc...@us...> - 2007-01-17 18:43:12
|
Update of /cvsroot/tolven/tolvenWEB/web/five In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27400/web/five Modified Files: tabs.xhtml level1.xhtml customize.xhtml patient.xhtml bar2.xhtml bar1.xhtml Log Message: Add MenuData browser Index: bar1.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/bar1.xhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bar1.xhtml 29 Nov 2006 01:35:33 -0000 1.4 --- bar1.xhtml 17 Jan 2007 18:43:01 -0000 1.5 *************** *** 13,17 **** <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{item.role=='tab' and item.visible=='true' and item.sequence gt 0}"> <li id="#{param.element}:#{item.node}:sel"> <a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text}</a> --- 13,17 ---- <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{(item.role=='tab' or item.role=='list') and item.visible=='true' and item.sequence gt 0}"> <li id="#{param.element}:#{item.node}:sel"> <a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text}</a> Index: customize.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/customize.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** customize.xhtml 22 Jun 2006 00:23:15 -0000 1.1 --- customize.xhtml 17 Jan 2007 18:43:01 -0000 1.2 *************** *** 18,22 **** <tr> <td > ! <c:if test="#{item.role=='tab'}"> <input name="#{param.element}:choice" type="checkbox" checked="#{item.visible=='true'?'checked':''}" value="#{item.path}:sel" onclick="showMenu(this);"/> Tab is visible </c:if> --- 18,22 ---- <tr> <td > ! <c:if test="#{(item.role=='tab' or item.role=='list')}"> <input name="#{param.element}:choice" type="checkbox" checked="#{item.visible=='true'?'checked':''}" value="#{item.path}:sel" onclick="showMenu(this);"/> Tab is visible </c:if> Index: level1.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/level1.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** level1.xhtml 22 Jun 2006 00:23:15 -0000 1.1 --- level1.xhtml 17 Jan 2007 18:43:01 -0000 1.2 *************** *** 13,17 **** <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{item.role=='tab'}"> <li id="#{param.element}:#{item.node}:sel" class="menuItem"><a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text} </a></li> </c:if> --- 13,17 ---- <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{(item.role=='tab' or item.role=='list')}"> <li id="#{param.element}:#{item.node}:sel" class="menuItem"><a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text} </a></li> </c:if> Index: tabs.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/tabs.xhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tabs.xhtml 2 Aug 2006 01:28:58 -0000 1.3 --- tabs.xhtml 17 Jan 2007 18:43:01 -0000 1.4 *************** *** 13,17 **** <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{item.role=='tab'}"> <li id="#{param.element}:#{item.node}:sel" style="display:#{item.visible=='true'?'inline':'none'}"> <a href="javascript:showPane('#{param.element}:#{item.node}');">#{item.text}</a> --- 13,17 ---- <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{(item.role=='tab' or item.role=='list')}"> <li id="#{param.element}:#{item.node}:sel" style="display:#{item.visible=='true'?'inline':'none'}"> <a href="javascript:showPane('#{param.element}:#{item.node}');">#{item.text}</a> Index: patient.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/patient.xhtml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** patient.xhtml 29 Nov 2006 01:35:33 -0000 1.6 --- patient.xhtml 17 Jan 2007 18:43:01 -0000 1.7 *************** *** 18,22 **** <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{item.role=='tab' and item.visible=='true' and item.sequence lt 0}"> <li id="#{param.element}:#{item.node}:sel"> <a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text}</a> --- 18,22 ---- <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{(item.role=='tab' or item.role=='list') and item.visible=='true' and item.sequence lt 0}"> <li id="#{param.element}:#{item.node}:sel"> <a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text}</a> Index: bar2.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/bar2.xhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bar2.xhtml 19 Nov 2006 20:04:02 -0000 1.3 --- bar2.xhtml 17 Jan 2007 18:43:01 -0000 1.4 *************** *** 13,17 **** <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{item.role=='tab' and item.visible=='true'}"> <li id="#{param.element}:#{item.node}:sel"> <a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text}</a> --- 13,17 ---- <ul> <c:forEach var="item" items="#{menu.thisMenu.sortedChildren}"> ! <c:if test="#{(item.role=='tab' or item.role=='list') and item.visible=='true'}"> <li id="#{param.element}:#{item.node}:sel"> <a href="javascript:showPane('#{param.element}:#{item.node}');"> #{item.text}</a> |
From: John C. <jc...@us...> - 2007-01-17 18:43:12
|
Update of /cvsroot/tolven/tolvenWEB/web/templates In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27400/web/templates Modified Files: portalTemplate.xhtml Log Message: Add MenuData browser Index: portalTemplate.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/templates/portalTemplate.xhtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** portalTemplate.xhtml 5 Jan 2007 07:53:49 -0000 1.15 --- portalTemplate.xhtml 17 Jan 2007 18:43:01 -0000 1.16 *************** *** 73,76 **** --- 73,77 ---- <h:panelGroup rendered="#{top.accountUserId!=0}"> <li><a href="javascript:getRemoteContent(visiblePage);" >[Refresh]</a></li> + <li><a href="top.browse" >[Technical]</a></li> </h:panelGroup> </ul> |
From: John C. <jc...@us...> - 2007-01-17 18:43:12
|
Update of /cvsroot/tolven/tolvenWEB/web/WEB-INF In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27400/web/WEB-INF Modified Files: web.xml Log Message: Add MenuData browser Index: web.xml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/WEB-INF/web.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** web.xml 8 Jan 2007 07:26:38 -0000 1.13 --- web.xml 17 Jan 2007 18:43:01 -0000 1.14 *************** *** 129,132 **** --- 129,141 ---- <url-pattern>*.graph</url-pattern> </servlet-mapping> + <servlet> + <servlet-name>Browse Index Servlet</servlet-name> + <servlet-class>org.tolven.index.Browse</servlet-class> + <load-on-startup>8</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>Browse Index Servlet</servlet-name> + <url-pattern>*.browse</url-pattern> + </servlet-mapping> <session-config><session-timeout> |
From: Joseph I. <jos...@us...> - 2007-01-17 07:57:07
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12210/src/org/tolven/doc/bean Modified Files: DocumentBean.java Log Message: Document content cannot be set unless the document is associated with an account first. This will have no effect, unless key encryption is activated. Index: DocumentBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/DocumentBean.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DocumentBean.java 16 Jan 2007 06:19:23 -0000 1.16 --- DocumentBean.java 17 Jan 2007 07:56:20 -0000 1.17 *************** *** 118,124 **** public DocCCR persistMessage( TolvenMessage tm ) { DocCCR docCCR = new DocCCR(); - docCCR.setContentString(tm.getPayload()); docCCR.setAccount(em.getReference(Account.class, tm.getAccountId())); docCCR.setAuthor(em.getReference(TolvenUser.class, tm.getAuthorId())); docCCR.setStatus("active"); docCCR.setMediaType("text/xml"); --- 118,124 ---- public DocCCR persistMessage( TolvenMessage tm ) { DocCCR docCCR = new DocCCR(); docCCR.setAccount(em.getReference(Account.class, tm.getAccountId())); docCCR.setAuthor(em.getReference(TolvenUser.class, tm.getAuthorId())); + docCCR.setContentString(tm.getPayload()); docCCR.setStatus("active"); docCCR.setMediaType("text/xml"); |
From: Joseph I. <jos...@us...> - 2007-01-17 07:54:57
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11401/src/org/tolven/doc/entity Modified Files: DocBase.java Log Message: Document content cannot be set unless the document is associated with an account first. This will have no effect, unless key encryption is activated. Index: DocBase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity/DocBase.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DocBase.java 16 Jan 2007 06:17:09 -0000 1.16 --- DocBase.java 17 Jan 2007 07:54:55 -0000 1.17 *************** *** 227,234 **** private byte[] getEncryptedContent(byte[] content) { ! if (content == null || account == null) //TODO: Then presumably the content could not have been encrypted return content; try { PublicKey accountPublicKey = account.getPublicKey(); if (accountPublicKey == null) { --- 227,236 ---- private byte[] getEncryptedContent(byte[] content) { ! if (content == null) //TODO: Then presumably the content could not have been encrypted return content; try { + if (account == null) + throw new RuntimeException("Content cannot be added to a document which is not associated with an account"); PublicKey accountPublicKey = account.getPublicKey(); if (accountPublicKey == null) { |
From: Joseph I. <jos...@us...> - 2007-01-16 08:27:26
|
Update of /cvsroot/tolven/tolven/installer/template In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4931/installer/template Modified Files: ant-build.template Log Message: Added new property jboss-rules.location=${tolven.location}/lib/jboss-rules for IzPack compilation. Index: ant-build.template =================================================================== RCS file: /cvsroot/tolven/tolven/installer/template/ant-build.template,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ant-build.template 8 Nov 2006 07:27:42 -0000 1.3 --- ant-build.template 16 Jan 2007 08:27:25 -0000 1.4 *************** *** 77,80 **** --- 77,81 ---- tolvenWEB.location=${tolven.home}/tolvenWEB + jboss-rules.location=${tolven.location}/lib/jboss-rules openSSL.location=${tolven.location}/lib/openSSL openLDAP.location=${tolven.location}/lib/openLDAP |
From: John C. <jc...@us...> - 2007-01-16 06:48:50
|
Update of /cvsroot/tolven/tolvenWEB/web/wizard In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27916/web/wizard Modified Files: gcs.xhtml Log Message: Allow entered time to be adjusted by 1 and 10 minute increments (instead of the previous 5 minute increment). Index: gcs.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/wizard/gcs.xhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gcs.xhtml 29 Nov 2006 01:35:32 -0000 1.2 --- gcs.xhtml 16 Jan 2007 06:48:49 -0000 1.3 *************** *** 54,60 **** <input id="#{menu.element}-gcsT" name="#{menu.element}-gcsT" readonly="true" type="text" value="" size="30"/><br /> <a href="javascript:addHours('#{menu.element}-gcsT',-1);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">-1h</a> ! <a href="javascript:addMinutes('#{menu.element}-gcsT',-5);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">-5m</a> <a href="javascript:setNow('#{menu.element}-gcsT');#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">now</a> ! <a href="javascript:addMinutes('#{menu.element}-gcsT', 5);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">+5m</a> <a href="javascript:addHours('#{menu.element}-gcsT', 1);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">+1h</a> <br/> --- 54,62 ---- <input id="#{menu.element}-gcsT" name="#{menu.element}-gcsT" readonly="true" type="text" value="" size="30"/><br /> <a href="javascript:addHours('#{menu.element}-gcsT',-1);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">-1h</a> ! <a href="javascript:addMinutes('#{menu.element}-gcsT',-10);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">-10m</a> ! <a href="javascript:addMinutes('#{menu.element}-gcsT',-1);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">-1m</a> <a href="javascript:setNow('#{menu.element}-gcsT');#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">now</a> ! <a href="javascript:addMinutes('#{menu.element}-gcsT', 1);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">+1m</a> ! <a href="javascript:addMinutes('#{menu.element}-gcsT', 10);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">+10m</a> <a href="javascript:addHours('#{menu.element}-gcsT', 1);#{menu.elementLabel}computeGCS($('#{menu.element}-gcsT'));">+1h</a> <br/> |
From: John C. <jc...@us...> - 2007-01-16 06:48:20
|
Update of /cvsroot/tolven/tolvenWEB/web/WEB-INF In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27882/web/WEB-INF Modified Files: faces-config.xml Log Message: Fix small validation errors which may have causes some navigation problems. Index: faces-config.xml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/WEB-INF/faces-config.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** faces-config.xml 3 Jan 2007 16:50:32 -0000 1.30 --- faces-config.xml 16 Jan 2007 06:48:19 -0000 1.31 *************** *** 204,208 **** <from-view-id>/private/sponsoredUsers.xhtml</from-view-id> <navigation-case> ! <from-action>close</from-action> <to-view-id>/private/adminAccount.xhtml</to-view-id> <redirect/> --- 204,208 ---- <from-view-id>/private/sponsoredUsers.xhtml</from-view-id> <navigation-case> ! <from-outcome>close</from-outcome> <to-view-id>/private/adminAccount.xhtml</to-view-id> <redirect/> *************** *** 248,252 **** <from-view-id>/private/prefPhotos.xhtml</from-view-id> <navigation-case> ! <from-action>${reg.selectAsLikeness}</from-action> <from-outcome>success</from-outcome> <to-view-id>/private/userDemog.xhtml</to-view-id> --- 248,252 ---- <from-view-id>/private/prefPhotos.xhtml</from-view-id> <navigation-case> ! <from-action>#{reg.selectAsLikeness}</from-action> <from-outcome>success</from-outcome> <to-view-id>/private/userDemog.xhtml</to-view-id> *************** *** 254,258 **** </navigation-case> <navigation-case> ! <from-action>${reg.upload}</from-action> <from-outcome>success</from-outcome> <to-view-id>/private/prefPhotos.xhtml</to-view-id> --- 254,258 ---- </navigation-case> <navigation-case> ! <from-action>#{reg.upload}</from-action> <from-outcome>success</from-outcome> <to-view-id>/private/prefPhotos.xhtml</to-view-id> |
From: John C. <jc...@us...> - 2007-01-16 06:47:28
|
Update of /cvsroot/tolven/tolvenWEB/web/templates In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27484/web/templates Modified Files: baseTemplate.xhtml Log Message: Remove junk from the now obsolete page. (the page should be removed) Index: baseTemplate.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/templates/baseTemplate.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** baseTemplate.xhtml 22 Jun 2006 00:23:16 -0000 1.1 --- baseTemplate.xhtml 16 Jan 2007 06:47:22 -0000 1.2 *************** *** 30,36 **** <div id="bannerad" style="display:block"> <div id="TopBanner"> - <iframe width="728" height="102" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="No" src='http://adv.webmd.com/html.ng/transactionID=929191915&apg=home&site=webmd&dom=www.webmd.com&brand=mywebmd&uri=%2f&pos=left&adsize=728x90&network=consumer'> - <script language='JavaScript1.1' src='http://adv.webmd.com/js.ng/Params.richmedia=yes&transactionID=929191915&apg=home&site=webmd&dom=www.webmd.com&brand=mywebmd&uri=%2f&pos=left&adsize=728x90&network=consumer' type="text/javascript" charset='ISO-8859-1'></script> - </iframe> </div> </div> --- 30,33 ---- |
From: John C. <jc...@us...> - 2007-01-16 06:46:37
|
Update of /cvsroot/tolven/tolvenWEB/web/scripts In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27087/web/scripts Modified Files: tolven6.js Log Message: When the last wizard is closed, allow a completely different tab to be selected as current - don't just float into limbo. Index: tolven6.js =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/scripts/tolven6.js,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tolven6.js 29 Nov 2006 01:35:33 -0000 1.10 --- tolven6.js 16 Jan 2007 06:46:35 -0000 1.11 *************** *** 192,195 **** --- 192,198 ---- function fixVisibleSubPage( id ) { var content = $(id); + if (content==null) { + return addRemoteContent( id, id ); + } var vsp = content.getAttribute("visibleSubPage"); if (vsp == null) return content; *************** *** 205,209 **** } } ! return null; } --- 208,212 ---- } } ! return content; } |
From: John C. <jc...@us...> - 2007-01-16 06:45:13
|
Update of /cvsroot/tolven/tolvenWEB/web/scripts In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26610/web/scripts Modified Files: tolvenwiz.js Log Message: Allow entered time to be adjusted by 1 and 10 minute increments (instead of the previous 5 minute increment). Index: tolvenwiz.js =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/scripts/tolvenwiz.js,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tolvenwiz.js 29 Nov 2006 01:35:33 -0000 1.4 --- tolvenwiz.js 16 Jan 2007 06:45:12 -0000 1.5 *************** *** 4664,4672 **** } } ! function setNow( field ) { var now = new Date(); ! var m = now.getMinutes() - (now.getMinutes() % 5 ); ! now.setMinutes( m ); now.setSeconds( 0 ); $(field).setAttribute( 'now', now.toString() ); --- 4664,4672 ---- } } ! // TBD - now should be server now. function setNow( field ) { var now = new Date(); ! // var m = now.getMinutes() - (now.getMinutes() % 5 ); ! // now.setMinutes( m ); now.setSeconds( 0 ); $(field).setAttribute( 'now', now.toString() ); |
From: John C. <jc...@us...> - 2007-01-16 06:44:13
|
Update of /cvsroot/tolven/tolvenWEB/web/private In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26200/web/private Modified Files: userDemog.xhtml Log Message: Correct "Send test eMail" button (should only be for demo users) Index: userDemog.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/private/userDemog.xhtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** userDemog.xhtml 5 Jan 2007 07:53:48 -0000 1.9 --- userDemog.xhtml 16 Jan 2007 06:44:09 -0000 1.10 *************** *** 23,27 **** <h:message for="uid" errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </h:panelGroup> ! <h:commandButton action="#{reg.sendTestMessage}" value="Send Test eMail" rendered="#{!reg.user.demoUser}"/> </h:panelGroup> <h:outputText value="First Name"/> --- 23,27 ---- <h:message for="uid" errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </h:panelGroup> ! <h:commandButton action="#{reg.sendTestMessage}" value="Send Test eMail" rendered="#{reg.user.demoUser}"/> </h:panelGroup> <h:outputText value="First Name"/> |
From: John C. <jc...@us...> - 2007-01-16 06:42:53
|
Update of /cvsroot/tolven/tolvenWEB/web/five In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25445/web/five Modified Files: xml.xhtml Log Message: Account for the fact that documents cannot be accessed directly from menudata (a query must be performed). Index: xml.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/xml.xhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xml.xhtml 17 Nov 2006 03:17:39 -0000 1.2 --- xml.xhtml 16 Jan 2007 06:42:48 -0000 1.3 *************** *** 6,16 **** xmlns:c="http://java.sun.com/jstl/core"> <head> ! <title>List of a patients problems</title> </head> <body> <ui:composition> ! Document: #{menu.drilldownItem.document.id} <pre> ! #{menu.drilldownItem.document.contentString} </pre> --- 6,16 ---- xmlns:c="http://java.sun.com/jstl/core"> <head> ! <title>Peek at the document behind the patient</title> </head> <body> <ui:composition> ! Document: #{menu.drilldownItem.documentId} <pre> ! #{menu.drilldownItemDoc.contentString} </pre> |
From: John C. <jc...@us...> - 2007-01-16 06:41:55
|
Update of /cvsroot/tolven/tolvenWEB/web/five In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25034/web/five Modified Files: login.xhtml Log Message: Cosmetic Index: login.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/login.xhtml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** login.xhtml 29 Nov 2006 01:35:33 -0000 1.8 --- login.xhtml 16 Jan 2007 06:41:54 -0000 1.9 *************** *** 38,55 **** </div> <div style="padding:10px;margin:5px;width:600px;clear:both"> ! <h3>November 28, 2006</h3> ! <p>Significant changes require that you create a new account which you can do right after you login by selecting the link at the bottom of the Select Account page. ! Previous accounts may work with some errors. </p> <h3>Important Privacy Notice</h3> <p>You are logging into a demo database. While Tolven makes every effort to protect data, this installation has not been certified as secure. Do not enter real patient medical data or any secrets. </p> - <h3>New Users</h3> - <p>After creating your login, you may want to generate some artificial patient data. - To do so, click the checkbox on the Create Account page which you can access after logging in.</p> <hr/> <p>This application is still under development. You should expect changes ! frequently and without warning. Some pages don't work at all, yet. Please feel free to drop us a line at <a href="mailto:in...@to...">in...@to...</a> with your thoughts.</p> --- 38,57 ---- </div> <div style="padding:10px;margin:5px;width:600px;clear:both"> ! <h3>January 15, 2007</h3> ! <p>Returning users: Changes in the demo data generator require that you create a new account which you can do right after you login by selecting the link at the bottom of the Select Account page. ! Previous accounts may work with some errors. The generator now runs in the background so requests ! to generate data will return immediately.</p> ! <p>We are testing the document encryption mechanism on this site. Please report errors relating to private keys or encryption.</p> ! <h3>New Users</h3> ! <p>After creating your login, you may want to generate some artificial patient data. ! To do so, click the checkbox on the Create Account page which you can access after logging in.</p> <h3>Important Privacy Notice</h3> <p>You are logging into a demo database. While Tolven makes every effort to protect data, this installation has not been certified as secure. Do not enter real patient medical data or any secrets. </p> <hr/> <p>This application is still under development. You should expect changes ! frequently and without warning. Some pages don't work at all. Please feel free to drop us a line at <a href="mailto:in...@to...">in...@to...</a> with your thoughts.</p> |
From: John C. <jc...@us...> - 2007-01-16 06:41:40
|
Update of /cvsroot/tolven/tolvenWEB/web/five In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25020/web/five Modified Files: dmpats.xhtml Log Message: Activate this display Index: dmpats.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/dmpats.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dmpats.xhtml 12 Aug 2006 07:19:01 -0000 1.1 --- dmpats.xhtml 16 Jan 2007 06:41:38 -0000 1.2 *************** *** 51,59 **** Filter (last,first): <input name="dmpatsFilter" type="text" id="dmpatsFilter" /> </form> ! <div id="dmpatsDG" style="border: 1px solid #E1E1E1;width:590px"> <table id="dmpatsGrid_header" > <thead> <tr> - <th align="right" width="50px" >Link</th> <th align="left" width="100px">Last</th> <th align="left" width="150px">First</th> --- 51,58 ---- Filter (last,first): <input name="dmpatsFilter" type="text" id="dmpatsFilter" /> </form> ! <div id="dmpatsDG" style="width:590px"> <table id="dmpatsGrid_header" > <thead> <tr> <th align="left" width="100px">Last</th> <th align="left" width="150px">First</th> *************** *** 66,85 **** <table id="dmpatsGrid" > <tbody> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td align="right" width="50px">-</td><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> </tbody> </table> --- 65,84 ---- <table id="dmpatsGrid" > <tbody> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> ! <tr><td width="100px">-</td><td width="150px">-</td><td width="100px">-</td><td width="90px">-</td><td align="center" width="60px">-</td></tr> </tbody> </table> |
From: John C. <jc...@us...> - 2007-01-16 06:41:09
|
Update of /cvsroot/tolven/tolvenWEB/web/five/test In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24857/web/five/test Modified Files: familyDetail.xhtml patientGen.xhtml Log Message: This module should be completely obsolete now. Index: familyDetail.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/test/familyDetail.xhtml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** familyDetail.xhtml 2 Aug 2006 22:54:44 -0000 1.5 --- familyDetail.xhtml 16 Jan 2007 06:41:07 -0000 1.6 *************** *** 12,19 **** <div id="fdpane"> <hr/> - <h:form id="createFam" onsubmit="return ajaxSubmit2(this);"> - <h:outputText value="Adopt this family by adding each member to this account's list of patients"/> - <h:commandButton id="gf1" action="#{gen.adoptFamily}" value="Create"/> - </h:form> <h:panelGrid columns="4"> <h:outputText value="Id"/> --- 12,15 ---- Index: patientGen.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/test/patientGen.xhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** patientGen.xhtml 4 Dec 2006 09:00:02 -0000 1.3 --- patientGen.xhtml 16 Jan 2007 06:41:07 -0000 1.4 *************** *** 16,20 **** <h:panelGrid columns="2"> <h:outputText value="Number of Patients"/> ! <h:inputText id="count" value="#{gen.numberToGenerate}" size="4"/> <h:outputText value="Patients began arriving in which year"/> <h:inputText id="startYear" value="#{gen.generateHistoryFrom}" size="4"/> --- 16,22 ---- <h:panelGrid columns="2"> <h:outputText value="Number of Patients"/> ! <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"/> |
From: John C. <jc...@us...> - 2007-01-16 06:40:39
|
Update of /cvsroot/tolven/tolvenWEB/web/five/test In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24596/web/five/test Modified Files: docList.xhtml Log Message: Use correct document count method for findallXMLdocuments Index: docList.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/test/docList.xhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** docList.xhtml 14 Jan 2007 06:26:29 -0000 1.4 --- docList.xhtml 16 Jan 2007 06:40:38 -0000 1.5 *************** *** 12,16 **** <script language="JavaScript" type="text/javascript"> // <![CDATA[ ! #{menu.elementLabel}DG = new Rico.LiveGrid( '#{menu.element}LG', 10, 100, 'xmlDocList.ajax', {prefetchBuffer: true, --- 12,16 ---- <script language="JavaScript" type="text/javascript"> // <![CDATA[ ! #{menu.elementLabel}DG = new Rico.LiveGrid( '#{menu.element}LG', 10, #{doc.XMLDocumentCount}, 'xmlDocList.ajax', {prefetchBuffer: true, *************** *** 20,24 **** // ]]> </script> ! <p> Documents owned by the logged in user</p> <div style="border: 1px solid #E1E1E1;width:590px"> <table id="#{menu.element}LG_header"> --- 20,33 ---- // ]]> </script> ! <p> A list of documents owned by any account of which the the logged in user is a member. ! <strong>This is a forced security violation</strong> for demo purposes only. ! Normally, a user is not allowed to see documents (or anything) in accounts other than ! the one they are logged into. This query shows that if that restriction were breached, ! documents in an account other than the account the user is currently logged into, even ! if that user is a member of the other account, will not be viewable or computable ! because the document is encryped. (Note: the encryption feature is not retroactive ! so you may still find plaintext documents in older accounts).</p> ! <p>To see encrypted documents, you must have more than one account in the Select Account page presented when you logged in.</p> ! <div style="border: 1px solid #E1E1E1;width:590px"> <table id="#{menu.element}LG_header"> |
From: John C. <jc...@us...> - 2007-01-16 06:38:56
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23693/src/org/tolven/web Modified Files: PersonGenAction.java Log Message: This module should be completely obsolete now. Index: PersonGenAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/PersonGenAction.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PersonGenAction.java 4 Dec 2006 09:00:53 -0000 1.16 --- PersonGenAction.java 16 Jan 2007 06:38:55 -0000 1.17 *************** *** 31,35 **** import org.tolven.core.entity.AccountUser; import org.tolven.core.entity.TolvenUser; ! import org.tolven.gen.CHRGenerator; import org.tolven.gen.PersonGenerator; import org.tolven.gen.bean.GenControlAccount; --- 31,35 ---- import org.tolven.core.entity.AccountUser; import org.tolven.core.entity.TolvenUser; ! import org.tolven.gen.Generator; import org.tolven.gen.PersonGenerator; import org.tolven.gen.bean.GenControlAccount; *************** *** 48,52 **** private PersonGenerator personGen; // @EJB ! private CHRGenerator chrGen; // @EJB private ActivationLocal activation; --- 48,52 ---- private PersonGenerator personGen; // @EJB ! private Generator chrGen; // @EJB private ActivationLocal activation; *************** *** 89,93 **** accountBean = (AccountDAOLocal) ctx.lookup("tolven/AccountDAOBean/local"); personGen = (PersonGenerator) ctx.lookup("tolven/PersonGeneratorDAO/local"); ! chrGen = (CHRGenerator) ctx.lookup("tolven/CHRGeneratorBean/local"); menu = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); } --- 89,93 ---- accountBean = (AccountDAOLocal) ctx.lookup("tolven/AccountDAOBean/local"); personGen = (PersonGenerator) ctx.lookup("tolven/PersonGeneratorDAO/local"); ! chrGen = (Generator) ctx.lookup("tolven/GeneratorBean/local"); menu = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); } *************** *** 131,135 **** return id; } ! public String createCHRPatients( ) throws Exception { GenControlAccount control = new GenControlAccount(); --- 131,139 ---- return id; } ! /** ! * Generate new demo patients in this account ! * @return ! * @throws Exception ! */ public String createCHRPatients( ) throws Exception { GenControlAccount control = new GenControlAccount(); *************** *** 146,188 **** /** - * Add members of a virtual family to our account. - * @return "success" - */ - public String adoptFamily( ) throws Exception { - personGen.adoptFamily(getCurrentFamilyId(), getTop().getAccountId(), "echr:patients", getTop().getNow() ); - return "success"; - } - - /** - * Create an account, users and health records for the family specified by familyId param - * @throws Exception - */ - public String createPHR( ) throws Exception { - long id = getCurrentFamilyId(); - FamilyUnit family = personGen.findFamily( id ); - // First, create an account - Account account = accountBean.createAccount( "ephr"); - // Create health records and possibly users for each one in the family. - for (FamilyMember m : family.getMembers()) { - int age = m.getPerson().getAgeInYears(getNow()); - TolvenPerson tp = new TolvenPerson( m.getPerson()); - activation.createHealthRecord( account, tp.getGivenName() + " " + tp.getSn()); - if (age > 18 ) { - TolvenUser user = activation.registerAndActivate( tp, getNow() ); - AccountUser au = accountBean.addAccountUser(account, user, getNow(), true ); - MenuStructure msroot = menu.createDefaultMenuStructure( account ); - // Find the patients node - MenuStructure mspat = msroot.findDescendent( "patients"); - // create menu data - REAL SIMPLE TO START WITH - MenuData md = new MenuData( ); - md.setMenuStructure( mspat ); - md.setString01( tp.getGivenName() + " " + tp.getSn()); - menu.persistMenuData( md ); - } - } - return "success"; - } - - /** * Return the specified family member */ --- 150,153 ---- |