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...> - 2006-12-08 07:21:54
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7901/src/org/tolven/core/entity Modified Files: AccountUser.java TolvenUser.java Account.java Log Message: Added more encryption key infrastructure. The columns will now appear in the DB, but will not be populated at this time. Index: AccountUser.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/AccountUser.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AccountUser.java 5 Dec 2006 09:36:09 -0000 1.6 --- AccountUser.java 8 Dec 2006 07:21:52 -0000 1.7 *************** *** 17,20 **** --- 17,21 ---- import java.util.Date; import javax.persistence.Column; + import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.FetchType; *************** *** 27,33 **** import javax.persistence.TemporalType; import org.tolven.doc.entity.DocBase; ! //TODO: Uncomment when encryption is released ! //import org.tolven.security.bean.AccountPrivateKey; ! //import javax.persistence.Embedded; /** --- 28,33 ---- import javax.persistence.TemporalType; import org.tolven.doc.entity.DocBase; ! ! import org.tolven.security.bean.AccountPrivateKey; /** *************** *** 73,81 **** private String status; - // TODO: Uncomment when encryption is released - /* @Embedded private AccountPrivateKey accountPrivateKey; ! */ /** --- 73,79 ---- private String status; @Embedded private AccountPrivateKey accountPrivateKey; ! /** *************** *** 194,200 **** this.status = status; } ! ! // TODO: Uncomment when encryption is released ! /* public AccountPrivateKey getAccountPrivateKey() { return accountPrivateKey; --- 192,196 ---- this.status = status; } ! public AccountPrivateKey getAccountPrivateKey() { return accountPrivateKey; *************** *** 208,211 **** return accountPrivateKey != null; } ! */ } --- 204,207 ---- return accountPrivateKey != null; } ! } Index: Account.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/Account.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Account.java 5 Dec 2006 09:36:09 -0000 1.10 --- Account.java 8 Dec 2006 07:21:52 -0000 1.11 *************** *** 16,21 **** --- 16,23 ---- import java.io.Serializable; import java.util.Set; + import java.security.PublicKey; import javax.persistence.CascadeType; import javax.persistence.Column; + import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.FetchType; *************** *** 27,35 **** import javax.persistence.Table; ! // TODO: Uncomment when encryption is released ! //import java.io.IOException; ! //import org.tolven.security.bean.TolvenPublicKey; ! //import java.security.PublicKey; ! //import javax.persistence.Embedded; /** --- 29,33 ---- import javax.persistence.Table; ! import org.tolven.security.bean.TolvenPublicKey; /** *************** *** 72,80 **** private Set<Sponsorship> sponsorships = null; - // TODO: Uncomment when encryption is released - /* @Embedded private TolvenPublicKey tolvenPublicKey; ! */ /** --- 70,76 ---- private Set<Sponsorship> sponsorships = null; @Embedded private TolvenPublicKey tolvenPublicKey; ! /** *************** *** 211,223 **** } - // TODO: Uncomment when encryption is released - /* public TolvenPublicKey getTolvenPublicKey() { return tolvenPublicKey; } ! public void setPublicKey(PublicKey aPublicKey) { ! tolvenPublicKey = TolvenPublicKey.getInstance(); ! tolvenPublicKey.init(aPublicKey); } --- 207,216 ---- } public TolvenPublicKey getTolvenPublicKey() { return tolvenPublicKey; } ! public void setPublicKey(TolvenPublicKey aTolvenPublicKey) { ! tolvenPublicKey = aTolvenPublicKey; } *************** *** 225,229 **** return tolvenPublicKey != null; } ! */ --- 218,222 ---- return tolvenPublicKey != null; } ! Index: TolvenUser.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/TolvenUser.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TolvenUser.java 5 Dec 2006 09:36:09 -0000 1.11 --- TolvenUser.java 8 Dec 2006 07:21:52 -0000 1.12 *************** *** 16,28 **** import java.io.Serializable; import java.util.Date; import javax.persistence.*; import org.tolven.doc.entity.DocBase; ! //TODO: Uncomment when encryption is released ! //import org.tolven.security.bean.TolvenPublicKey; ! //import org.tolven.security.bean.UserPrivateKey; ! //import java.security.GeneralSecurityException; ! //import java.security.PublicKey; /** --- 16,27 ---- import java.io.Serializable; import java.util.Date; + import java.security.GeneralSecurityException; + import java.security.PublicKey; import javax.persistence.*; import org.tolven.doc.entity.DocBase; ! import org.tolven.security.bean.TolvenPublicKey; ! import org.tolven.security.bean.UserPrivateKey; /** *************** *** 88,93 **** private DocBase likeness; - // TODO: Uncomment when encryption is released - /* @Embedded private UserPrivateKey userPrivateKey; --- 87,90 ---- *************** *** 95,99 **** @Embedded private TolvenPublicKey tolvenPublicKey; ! */ transient private Date oldLastLogin; --- 92,96 ---- @Embedded private TolvenPublicKey tolvenPublicKey; ! transient private Date oldLastLogin; *************** *** 216,222 **** this.sponsorship = sponsorship; } ! ! // TODO: Uncomment when encryption is released ! /* public UserPrivateKey getUserPrivateKey() { return userPrivateKey; --- 213,217 ---- this.sponsorship = sponsorship; } ! public UserPrivateKey getUserPrivateKey() { return userPrivateKey; *************** *** 239,243 **** tolvenPublicKey.init(aPublicKey); } ! */ --- 234,238 ---- tolvenPublicKey.init(aPublicKey); } ! |
From: Joseph I. <jos...@us...> - 2006-12-08 06:08:13
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11293/src/org/tolven/security/bean Modified Files: AccountPrivateKey.java Log Message: Both PublicKeys and PrivateKeys are now maintained in wrapper classes until ready for use. Index: AccountPrivateKey.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean/AccountPrivateKey.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AccountPrivateKey.java 6 Dec 2006 06:47:56 -0000 1.3 --- AccountPrivateKey.java 8 Dec 2006 06:08:08 -0000 1.4 *************** *** 72,76 **** * @throws IOException */ ! public PublicKey init(PublicKey anEncryptionKey) throws GeneralSecurityException, IOException { String privateKeyAlgorithm = System.getProperty(ACCOUNT_PRIVATE_KEY_ALGORITHM_PROP); return init(privateKeyAlgorithm, anEncryptionKey); --- 72,76 ---- * @throws IOException */ ! public TolvenPublicKey init(PublicKey anEncryptionKey) throws GeneralSecurityException, IOException { String privateKeyAlgorithm = System.getProperty(ACCOUNT_PRIVATE_KEY_ALGORITHM_PROP); return init(privateKeyAlgorithm, anEncryptionKey); *************** *** 87,91 **** * @throws GeneralSecurityException */ ! private PublicKey init(String aPrivateKeyAlgorithm, PublicKey anEncryptionKey) throws GeneralSecurityException, IOException { setKeySize(Integer.parseInt(System.getProperty(ACCOUNT_PRIVATE_KEY_LENGTH_PROP))); KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(aPrivateKeyAlgorithm); --- 87,91 ---- * @throws GeneralSecurityException */ ! private TolvenPublicKey init(String aPrivateKeyAlgorithm, PublicKey anEncryptionKey) throws GeneralSecurityException, IOException { setKeySize(Integer.parseInt(System.getProperty(ACCOUNT_PRIVATE_KEY_LENGTH_PROP))); KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(aPrivateKeyAlgorithm); *************** *** 99,103 **** EncryptedPrivateKeyInfo encryptedPrivateKeyInfo = new EncryptedPrivateKeyInfo(aPrivateKeyAlgorithm, encryptedPrivateKey); setEncodedEncryptedPrivateKeyInfo(encryptedPrivateKeyInfo.getEncoded()); ! return keyPair.getPublic(); } --- 99,105 ---- EncryptedPrivateKeyInfo encryptedPrivateKeyInfo = new EncryptedPrivateKeyInfo(aPrivateKeyAlgorithm, encryptedPrivateKey); setEncodedEncryptedPrivateKeyInfo(encryptedPrivateKeyInfo.getEncoded()); ! TolvenPublicKey tolvenPublicKey = TolvenPublicKey.getInstance(); ! tolvenPublicKey.init(keyPair.getPublic()); ! return tolvenPublicKey; } |
From: Joseph I. <jos...@us...> - 2006-12-08 06:08:12
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11293/src/test/org/tolven/security/bean Modified Files: AccountPrivateKeyTestCase.java AccountSecretKeyTestCase.java DocumentSecretKeyTestCase.java Log Message: Both PublicKeys and PrivateKeys are now maintained in wrapper classes until ready for use. Index: AccountSecretKeyTestCase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean/AccountSecretKeyTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AccountSecretKeyTestCase.java 4 Dec 2006 06:52:39 -0000 1.1 --- AccountSecretKeyTestCase.java 8 Dec 2006 06:08:08 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- import java.security.PublicKey; import java.security.PrivateKey; + import org.tolven.security.bean.TolvenPublicKey; import junit.framework.TestCase; *************** *** 25,32 **** PrivateKey theUserPrivateKey = userPrivateKey.getPrivateKey(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! PublicKey theAccountPublicKey = accountPrivateKey.init(theUserPublicKey); PrivateKey theAccountPrivateKey = accountPrivateKey.getPrivateKey(theUserPrivateKey); AccountSecretKey accountSecretKey = AccountSecretKey.getInstance(); ! SecretKey theOriginalSecretKey = accountSecretKey.init(theAccountPublicKey); SecretKey requestedSecretKey = accountSecretKey.getSecretKey(theAccountPrivateKey); assertTrue(requestedSecretKey.equals(theOriginalSecretKey)); --- 26,33 ---- PrivateKey theUserPrivateKey = userPrivateKey.getPrivateKey(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! TolvenPublicKey theAccountPublicKey = accountPrivateKey.init(theUserPublicKey); PrivateKey theAccountPrivateKey = accountPrivateKey.getPrivateKey(theUserPrivateKey); AccountSecretKey accountSecretKey = AccountSecretKey.getInstance(); ! SecretKey theOriginalSecretKey = accountSecretKey.init(theAccountPublicKey.getPublicKey()); SecretKey requestedSecretKey = accountSecretKey.getSecretKey(theAccountPrivateKey); assertTrue(requestedSecretKey.equals(theOriginalSecretKey)); *************** *** 50,56 **** PublicKey theUserPublicKey = userPrivateKey.init(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! PublicKey publicKey = accountPrivateKey.init(theUserPublicKey); AccountSecretKey accountSecretKey = AccountSecretKey.getInstance(); ! SecretKey secretKey = accountSecretKey.init(publicKey); assertTrue(secretKey.getAlgorithm().equals(System.getProperty(AccountSecretKey.ACCOUNT_USER_KBE_KEY_ALGORITHM_PROP))); } --- 51,57 ---- PublicKey theUserPublicKey = userPrivateKey.init(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! TolvenPublicKey accountPublicKey = accountPrivateKey.init(theUserPublicKey); AccountSecretKey accountSecretKey = AccountSecretKey.getInstance(); ! SecretKey secretKey = accountSecretKey.init(accountPublicKey.getPublicKey()); assertTrue(secretKey.getAlgorithm().equals(System.getProperty(AccountSecretKey.ACCOUNT_USER_KBE_KEY_ALGORITHM_PROP))); } Index: DocumentSecretKeyTestCase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean/DocumentSecretKeyTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DocumentSecretKeyTestCase.java 4 Dec 2006 06:52:39 -0000 1.1 --- DocumentSecretKeyTestCase.java 8 Dec 2006 06:08:08 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- import org.tolven.security.bean.AccountPrivateKey; import org.tolven.security.bean.UserPrivateKey; + import org.tolven.security.bean.TolvenPublicKey; public class DocumentSecretKeyTestCase extends TestCase { *************** *** 25,32 **** PrivateKey theUserPrivateKey = userPrivateKey.getPrivateKey(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! PublicKey theAccountPublicKey = accountPrivateKey.init(theUserPublicKey); PrivateKey theAccountPrivateKey = accountPrivateKey.getPrivateKey(theUserPrivateKey); DocumentSecretKey accountSecretKey = DocumentSecretKey.getInstance(); ! SecretKey theOriginalSecretKey = accountSecretKey.init(theAccountPublicKey); SecretKey requestedSecretKey = accountSecretKey.getSecretKey(theAccountPrivateKey); assertTrue(requestedSecretKey.equals(theOriginalSecretKey)); --- 26,33 ---- PrivateKey theUserPrivateKey = userPrivateKey.getPrivateKey(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! TolvenPublicKey theAccountPublicKey = accountPrivateKey.init(theUserPublicKey); PrivateKey theAccountPrivateKey = accountPrivateKey.getPrivateKey(theUserPrivateKey); DocumentSecretKey accountSecretKey = DocumentSecretKey.getInstance(); ! SecretKey theOriginalSecretKey = accountSecretKey.init(theAccountPublicKey.getPublicKey()); SecretKey requestedSecretKey = accountSecretKey.getSecretKey(theAccountPrivateKey); assertTrue(requestedSecretKey.equals(theOriginalSecretKey)); *************** *** 50,56 **** PublicKey theUserPublicKey = userPrivateKey.init(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! PublicKey publicKey = accountPrivateKey.init(theUserPublicKey); DocumentSecretKey accountSecretKey = DocumentSecretKey.getInstance(); ! SecretKey secretKey = accountSecretKey.init(publicKey); assertTrue(secretKey.getAlgorithm().equals(System.getProperty(DocumentSecretKey.DOC_KBE_KEY_ALGORITHM_PROP))); } --- 51,57 ---- PublicKey theUserPublicKey = userPrivateKey.init(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! TolvenPublicKey accountPublicKey = accountPrivateKey.init(theUserPublicKey); DocumentSecretKey accountSecretKey = DocumentSecretKey.getInstance(); ! SecretKey secretKey = accountSecretKey.init(accountPublicKey.getPublicKey()); assertTrue(secretKey.getAlgorithm().equals(System.getProperty(DocumentSecretKey.DOC_KBE_KEY_ALGORITHM_PROP))); } Index: AccountPrivateKeyTestCase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean/AccountPrivateKeyTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AccountPrivateKeyTestCase.java 4 Dec 2006 06:52:39 -0000 1.2 --- AccountPrivateKeyTestCase.java 8 Dec 2006 06:08:08 -0000 1.3 *************** *** 9,12 **** --- 9,13 ---- import org.tolven.security.bean.AccountPrivateKey; import org.tolven.security.bean.UserPrivateKey; + import org.tolven.security.bean.TolvenPublicKey; public class AccountPrivateKeyTestCase extends TestCase { *************** *** 30,35 **** PublicKey publicKey = userPrivateKey.init(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! PublicKey accountPublicKey = accountPrivateKey.init(publicKey); ! assertTrue(accountPublicKey.getAlgorithm().equals(System.getProperty(AccountPrivateKey.ACCOUNT_PRIVATE_KEY_ALGORITHM_PROP))); } --- 31,36 ---- PublicKey publicKey = userPrivateKey.init(password); AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! TolvenPublicKey accountPublicKey = accountPrivateKey.init(publicKey); ! assertTrue(accountPublicKey.getPublicKey().getAlgorithm().equals(System.getProperty(AccountPrivateKey.ACCOUNT_PRIVATE_KEY_ALGORITHM_PROP))); } |
From: Joseph I. <jos...@us...> - 2006-12-06 06:47:58
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv2752/src/org/tolven/security/bean Modified Files: AccountPrivateKey.java TolvenPublicKey.java UserPrivateKey.java Log Message: NOT_INITIALIZED string should be a static Index: UserPrivateKey.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean/UserPrivateKey.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UserPrivateKey.java 5 Dec 2006 08:45:48 -0000 1.4 --- UserPrivateKey.java 6 Dec 2006 06:47:56 -0000 1.5 *************** *** 46,50 **** public class UserPrivateKey extends TolvenEncryptedPrivateKey implements Serializable { ! private final String NOT_INITIALIZED = "UserPrivateKey not initialized"; public static final String USER_PRIVATE_KEY_ALGORITHM_PROP = "tolven.security.user.privateKeyAlgorithm"; --- 46,50 ---- public class UserPrivateKey extends TolvenEncryptedPrivateKey implements Serializable { ! private static final String NOT_INITIALIZED = "UserPrivateKey not initialized"; public static final String USER_PRIVATE_KEY_ALGORITHM_PROP = "tolven.security.user.privateKeyAlgorithm"; Index: AccountPrivateKey.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean/AccountPrivateKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AccountPrivateKey.java 4 Dec 2006 06:52:39 -0000 1.2 --- AccountPrivateKey.java 6 Dec 2006 06:47:56 -0000 1.3 *************** *** 41,45 **** public class AccountPrivateKey extends TolvenEncryptedPrivateKey implements Serializable { ! private final String NOT_INITIALIZED = "AccountPrivateKey not initialized"; public static final String ACCOUNT_PRIVATE_KEY_ALGORITHM_PROP = "tolven.security.account.privateKeyAlgorithm"; --- 41,45 ---- public class AccountPrivateKey extends TolvenEncryptedPrivateKey implements Serializable { ! private static final String NOT_INITIALIZED = "AccountPrivateKey not initialized"; public static final String ACCOUNT_PRIVATE_KEY_ALGORITHM_PROP = "tolven.security.account.privateKeyAlgorithm"; Index: TolvenPublicKey.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean/TolvenPublicKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TolvenPublicKey.java 5 Dec 2006 08:45:48 -0000 1.2 --- TolvenPublicKey.java 6 Dec 2006 06:47:56 -0000 1.3 *************** *** 30,34 **** public class TolvenPublicKey implements Serializable { ! private final String NOT_INITIALIZED = "TolvenPublicKey not initialized"; @Column(name = "x509_encoded__key_spec") --- 30,34 ---- public class TolvenPublicKey implements Serializable { ! private static final String NOT_INITIALIZED = "TolvenPublicKey not initialized"; @Column(name = "x509_encoded__key_spec") |
From: Joseph I. <jos...@us...> - 2006-12-05 09:36:15
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7537/src/org/tolven/core/bean Modified Files: InvitationBean.java ActivationBean.java Log Message: Preparation code for document encryption. All commented out at this time Index: InvitationBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean/InvitationBean.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** InvitationBean.java 3 Dec 2006 08:34:18 -0000 1.15 --- InvitationBean.java 5 Dec 2006 09:36:10 -0000 1.16 *************** *** 55,58 **** --- 55,59 ---- import org.tolven.core.TolvenPropertiesLocal; import org.tolven.core.entity.Account; + import org.tolven.core.entity.AccountUser; import org.tolven.core.entity.HealthRecord; import org.tolven.core.entity.Status; *************** *** 61,64 **** --- 62,68 ---- import org.tolven.doc.entity.DocBase; import org.tolven.doc.entity.Invitation; + // TODO: Uncomment when encryption is released + //import java.security.PublicKey; + //import org.tolven.security.bean.AccountPrivateKey; @Stateless *************** *** 308,312 **** System.out.println( "Created account: " + account.getId()); // Note, the user automatically gets account permission since they are the only user on that new account. ! accountBean.addAccountUser( account, accountBean.findUser( invitation.getTargetEmail()), now, true); } if (detail instanceof JoinAccountInvitation) --- 312,330 ---- System.out.println( "Created account: " + account.getId()); // Note, the user automatically gets account permission since they are the only user on that new account. ! TolvenUser tolvenUser = accountBean.findUser( invitation.getTargetEmail()); ! AccountUser accountUser = accountBean.addAccountUser( account, tolvenUser, now, true); ! // TODO: Uncomment when encryption is released ! /* ! try { ! AccountPrivateKey accountPrivateKey = AccountPrivateKey.getInstance(); ! PublicKey accountPublicKey = accountPrivateKey.init(tolvenUser.getPublicKey()); ! accountUser.setAccountPrivateKey(accountPrivateKey); ! account.setPublicKey(accountPublicKey); ! } catch (Exception ex) { ! // TODO: Do nothing but note the fact during development of ! // encryption keys ! System.out.println(getClass() + ": While creating AccountPrivateKey - " + ex.getMessage()); ! } ! */ } if (detail instanceof JoinAccountInvitation) *************** *** 315,319 **** Account account = accountBean.findAccount( ja.getAccountId() ); // Note, the user may or may not be given account permission depending on the wishes of the inviter. ! accountBean.addAccountUser( account, accountBean.findUser( invitation.getTargetEmail()), now, ja.isAccountPermission()); } } --- 333,338 ---- Account account = accountBean.findAccount( ja.getAccountId() ); // Note, the user may or may not be given account permission depending on the wishes of the inviter. ! TolvenUser invitedTolvenUser = accountBean.findUser( invitation.getTargetEmail()); ! AccountUser newAccountUser = accountBean.addAccountUser( account, invitedTolvenUser, now, ja.isAccountPermission()); } } Index: ActivationBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean/ActivationBean.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ActivationBean.java 3 Dec 2006 08:58:19 -0000 1.20 --- ActivationBean.java 5 Dec 2006 09:36:10 -0000 1.21 *************** *** 55,58 **** --- 55,61 ---- import org.tolven.security.TolvenPerson; import org.tolven.security.bean.LDAPLocal; + // TODO: Uncomment when encryption is released + //import java.security.PublicKey; + //import org.tolven.security.bean.UserPrivateKey; //import javax.jws.WebService; *************** *** 258,261 **** --- 261,279 ---- user.setOldLastLogin(user.getLastLogin()); user.setLastLogin( now ); // Now - current time. Update last login to now. + // TODO: Uncomment when encryption is released + /* + try { + if (!user.hasUserPrivateKey()) { + UserPrivateKey privateKey = UserPrivateKey.getInstance(); + PublicKey publicKey = privateKey.init(principal.toCharArray()); + user.setUserPrivateKey(privateKey); + user.setPublicKey(publicKey); + } + user.getUserPrivateKey().unlockPrivateKey(principal.toCharArray()); + } catch (Exception ex) { + // TODO: Do nothing but note the fact during development of encryption keys + System.out.println(getClass() + ": While setting UserPrivateKey - " + ex.getMessage()); + } + */ } return user; |
From: Joseph I. <jos...@us...> - 2006-12-05 09:36:15
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7537/src/org/tolven/core/entity Modified Files: AccountUser.java TolvenUser.java Account.java Log Message: Preparation code for document encryption. All commented out at this time Index: AccountUser.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/AccountUser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AccountUser.java 14 Oct 2006 20:13:35 -0000 1.5 --- AccountUser.java 5 Dec 2006 09:36:09 -0000 1.6 *************** *** 27,30 **** --- 27,33 ---- import javax.persistence.TemporalType; import org.tolven.doc.entity.DocBase; + //TODO: Uncomment when encryption is released + //import org.tolven.security.bean.AccountPrivateKey; + //import javax.persistence.Embedded; /** *************** *** 69,73 **** @Column( name="STATUS") private String status; ! /** --- 72,81 ---- @Column( name="STATUS") private String status; ! ! // TODO: Uncomment when encryption is released ! /* ! @Embedded ! private AccountPrivateKey accountPrivateKey; ! */ /** *************** *** 187,189 **** --- 195,211 ---- } + // TODO: Uncomment when encryption is released + /* + public AccountPrivateKey getAccountPrivateKey() { + return accountPrivateKey; + } + + public void setAccountPrivateKey(AccountPrivateKey privateKey) { + this.accountPrivateKey = privateKey; + } + + public boolean hasAccountPrivateKey() { + return accountPrivateKey != null; + } + */ } Index: Account.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/Account.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Account.java 6 Nov 2006 07:41:24 -0000 1.9 --- Account.java 5 Dec 2006 09:36:09 -0000 1.10 *************** *** 26,29 **** --- 26,36 ---- import javax.persistence.OneToMany; import javax.persistence.Table; + + // TODO: Uncomment when encryption is released + //import java.io.IOException; + //import org.tolven.security.bean.TolvenPublicKey; + //import java.security.PublicKey; + //import javax.persistence.Embedded; + /** * Maintains a collection of HealthRecords and related information. An account has one or more account administrators that generally *************** *** 65,68 **** --- 72,81 ---- private Set<Sponsorship> sponsorships = null; + // TODO: Uncomment when encryption is released + /* + @Embedded + private TolvenPublicKey tolvenPublicKey; + */ + /** * Construct an empty Account or Sub-account. A sub-account should have a non-null Parent Account. Account trees cannot have circular references. *************** *** 198,200 **** --- 211,230 ---- } + // TODO: Uncomment when encryption is released + /* + public TolvenPublicKey getTolvenPublicKey() { + return tolvenPublicKey; + } + + public void setPublicKey(PublicKey aPublicKey) { + tolvenPublicKey = TolvenPublicKey.getInstance(); + tolvenPublicKey.init(aPublicKey); + } + + public boolean hasTolvenPublicKey() { + return tolvenPublicKey != null; + } + */ + + } Index: TolvenUser.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/TolvenUser.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TolvenUser.java 4 Dec 2006 06:52:39 -0000 1.10 --- TolvenUser.java 5 Dec 2006 09:36:09 -0000 1.11 *************** *** 21,25 **** --- 21,28 ---- import org.tolven.doc.entity.DocBase; //TODO: Uncomment when encryption is released + //import org.tolven.security.bean.TolvenPublicKey; //import org.tolven.security.bean.UserPrivateKey; + //import java.security.GeneralSecurityException; + //import java.security.PublicKey; /** *************** *** 86,92 **** // TODO: Uncomment when encryption is released ! // @Embedded ! // private UserPrivateKey privateKey; ! transient private Date oldLastLogin; --- 89,99 ---- // TODO: Uncomment when encryption is released ! /* ! @Embedded ! private UserPrivateKey userPrivateKey; ! ! @Embedded ! private TolvenPublicKey tolvenPublicKey; ! */ transient private Date oldLastLogin; *************** *** 211,227 **** // TODO: Uncomment when encryption is released ! /* ! public UserPrivateKey getPrivateKey() { ! return privateKey; } ! public void setPrivateKey(UserPrivateKey privateKey) { ! this.privateKey = privateKey; } ! public boolean hasPrivateKey() { ! return privateKey != null; } ! */ --- 218,244 ---- // TODO: Uncomment when encryption is released ! /* ! public UserPrivateKey getUserPrivateKey() { ! return userPrivateKey; } ! public void setUserPrivateKey(UserPrivateKey privateKey) { ! this.userPrivateKey = privateKey; } ! public boolean hasUserPrivateKey() { ! return userPrivateKey != null; } ! ! public PublicKey getPublicKey() throws GeneralSecurityException { ! return tolvenPublicKey.getPublicKey(); ! } ! ! public void setPublicKey(PublicKey aPublicKey) { ! tolvenPublicKey = TolvenPublicKey.getInstance(); ! tolvenPublicKey.init(aPublicKey); ! } ! */ ! |
From: Joseph I. <jos...@us...> - 2006-12-05 08:45:50
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13842/src/org/tolven/security/bean Modified Files: TolvenPublicKey.java UserPrivateKey.java Log Message: UserPrivateKey no longer throws an exception if a locked PrivateKey is requested....it just returns null, which is good enough. Also added appropriate documentation. Index: UserPrivateKey.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean/UserPrivateKey.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UserPrivateKey.java 5 Dec 2006 08:34:22 -0000 1.3 --- UserPrivateKey.java 5 Dec 2006 08:45:48 -0000 1.4 *************** *** 48,53 **** private final String NOT_INITIALIZED = "UserPrivateKey not initialized"; - private final String PRIVATE_KEY_LOCKED = "UserPrivateKey locked"; - public static final String USER_PRIVATE_KEY_ALGORITHM_PROP = "tolven.security.user.privateKeyAlgorithm"; --- 48,51 ---- *************** *** 105,108 **** --- 103,110 ---- } + /** + * Return a randome salt byte[] + * @return + */ private byte[] getRandomSalt() { byte[] salt = new byte[Integer.parseInt(System.getProperty(USER_PASSWORD_SALT_LENGTH_PROP))]; *************** *** 156,159 **** --- 158,167 ---- } + /** + * Decrypt the encrypted Private and unlock it for future access using getPrivateKey() + * @param aPassword + * @throws GeneralSecurityException + * @throws IOException + */ public void unlockPrivateKey(char[] aPassword) throws GeneralSecurityException, IOException { if (getEncodedEncryptedPrivateKeyInfo() == null || pbeKeyAlgorithm == null || salt == null) *************** *** 164,174 **** privateKey = keyFactory.generatePrivate(privateKeySpec); } public PrivateKey getPrivateKey() { - if (privateKey == null) - throw new IllegalStateException(PRIVATE_KEY_LOCKED); return privateKey; } private PKCS8EncodedKeySpec getPrivateKeySpec(char[] aPassword) throws GeneralSecurityException, IOException { if (getEncodedEncryptedPrivateKeyInfo() == null || pbeKeyAlgorithm == null || salt == null) --- 172,199 ---- privateKey = keyFactory.generatePrivate(privateKeySpec); } + + /** + * Lock UserPrivateKey by removing the decrypted privateKey + * + */ + public void lockPrivateKey() { + privateKey = null; + } + /** + * Return the privateKey if it is not locked, otherwise return null + * @return + */ public PrivateKey getPrivateKey() { return privateKey; } + /** + * Return a PKCS8EncodedKeySpec which can be used to regenerate the PrivateKey + * @param aPassword + * @return + * @throws GeneralSecurityException + * @throws IOException + */ private PKCS8EncodedKeySpec getPrivateKeySpec(char[] aPassword) throws GeneralSecurityException, IOException { if (getEncodedEncryptedPrivateKeyInfo() == null || pbeKeyAlgorithm == null || salt == null) Index: TolvenPublicKey.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean/TolvenPublicKey.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TolvenPublicKey.java 5 Dec 2006 08:34:22 -0000 1.1 --- TolvenPublicKey.java 5 Dec 2006 08:45:48 -0000 1.2 *************** *** 50,53 **** --- 50,57 ---- } + /** + * Initialize TolvenPublicKey with aPublicKey + * @param aPublicKey + */ public void init(PublicKey aPublicKey) { X509EncodedKeySpec keySpec = new X509EncodedKeySpec(aPublicKey.getEncoded()); *************** *** 56,59 **** --- 60,68 ---- } + /** + * Decode and return the encapsulated PublicKey + * @return + * @throws GeneralSecurityException + */ public PublicKey getPublicKey() throws GeneralSecurityException { if (x509EncodedKeySpec == null || algorithm == null) |
From: Joseph I. <jos...@us...> - 2006-12-05 08:45:49
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13842/src/test/org/tolven/security/bean Modified Files: TolvenPublicKeyTestCase.java Log Message: UserPrivateKey no longer throws an exception if a locked PrivateKey is requested....it just returns null, which is good enough. Also added appropriate documentation. Index: TolvenPublicKeyTestCase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean/TolvenPublicKeyTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TolvenPublicKeyTestCase.java 5 Dec 2006 08:34:22 -0000 1.1 --- TolvenPublicKeyTestCase.java 5 Dec 2006 08:45:48 -0000 1.2 *************** *** 4,13 **** import java.security.GeneralSecurityException; import java.security.PublicKey; - import java.security.PrivateKey; - import junit.framework.TestCase; - import javax.crypto.SecretKey; import org.tolven.security.bean.TolvenPublicKey; - import org.tolven.security.bean.AccountPrivateKey; import org.tolven.security.bean.UserPrivateKey; --- 4,9 ---- *************** *** 35,40 **** /* ! * Test method for ! * 'org.tolven.security.bean.TolvenPublicKey.getPublicKey()' */ public void testGetPublicKey() throws GeneralSecurityException, IOException { --- 31,35 ---- /* ! * Test method for 'org.tolven.security.bean.TolvenPublicKey.getPublicKey()' */ public void testGetPublicKey() throws GeneralSecurityException, IOException { |
From: Joseph I. <jos...@us...> - 2006-12-05 08:34:26
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8715/src/test/org/tolven/security/bean Modified Files: UserPrivateKeyTestCase.java Added Files: TolvenPublicKeyTestCase.java Log Message: Created TolvenPublicKey and its test case. Also added the ability to unlock a UserPrivateKey with a password, so that the PrivateKey itself is available to the user throughout their login sesssion. Index: UserPrivateKeyTestCase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/test/org/tolven/security/bean/UserPrivateKeyTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UserPrivateKeyTestCase.java 4 Dec 2006 06:52:39 -0000 1.2 --- UserPrivateKeyTestCase.java 5 Dec 2006 08:34:22 -0000 1.3 *************** *** 64,66 **** --- 64,79 ---- } + /* + * Test method for 'org.tolven.security.bean.UserPrivateKey.unlockPrivateKey()' + */ + public void testUnlockPrivateKey() throws GeneralSecurityException, IOException { + initProperties(); + UserPrivateKey userPrivateKey = UserPrivateKey.getInstance(); + char[] password = "password".toCharArray(); + userPrivateKey.init(password); + userPrivateKey.unlockPrivateKey(password); + PrivateKey privateKey = userPrivateKey.getPrivateKey(); + assertNotNull(privateKey); + } + } --- NEW FILE: TolvenPublicKeyTestCase.java --- package test.org.tolven.security.bean; import java.io.IOException; import java.security.GeneralSecurityException; import java.security.PublicKey; import java.security.PrivateKey; import junit.framework.TestCase; import javax.crypto.SecretKey; import org.tolven.security.bean.TolvenPublicKey; import org.tolven.security.bean.AccountPrivateKey; import org.tolven.security.bean.UserPrivateKey; public class TolvenPublicKeyTestCase extends TestCase { /* * Test method for 'org.tolven.security.bean.TolvenPublicKey.getInstance()' */ public void testGetInstance() { TolvenPublicKey.getInstance(); } /* * Test method for * 'org.tolven.security.bean.TolvenPublicKey.init(PublicKey)' */ public void testInitPublicKey() throws GeneralSecurityException, IOException { UserPrivateKeyTestCase.initProperties(); UserPrivateKey userPrivateKey = UserPrivateKey.getInstance(); char[] password = "password".toCharArray(); PublicKey theUserPublicKey = userPrivateKey.init(password); TolvenPublicKey tolvenPublicKey = TolvenPublicKey.getInstance(); tolvenPublicKey.init(theUserPublicKey); } /* * Test method for * 'org.tolven.security.bean.TolvenPublicKey.getPublicKey()' */ public void testGetPublicKey() throws GeneralSecurityException, IOException { UserPrivateKeyTestCase.initProperties(); UserPrivateKey userPrivateKey = UserPrivateKey.getInstance(); char[] password = "password".toCharArray(); PublicKey theUserPublicKey = userPrivateKey.init(password); TolvenPublicKey tolvenPublicKey = TolvenPublicKey.getInstance(); tolvenPublicKey.init(theUserPublicKey); PublicKey publicKey = tolvenPublicKey.getPublicKey(); assertTrue(publicKey.equals(theUserPublicKey)); } } |
From: Joseph I. <jos...@us...> - 2006-12-05 08:34:26
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8715/src/org/tolven/security/bean Modified Files: UserPrivateKey.java Added Files: TolvenPublicKey.java Log Message: Created TolvenPublicKey and its test case. Also added the ability to unlock a UserPrivateKey with a password, so that the PrivateKey itself is available to the user throughout their login sesssion. Index: UserPrivateKey.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/bean/UserPrivateKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UserPrivateKey.java 4 Dec 2006 06:52:39 -0000 1.2 --- UserPrivateKey.java 5 Dec 2006 08:34:22 -0000 1.3 *************** *** 48,51 **** --- 48,53 ---- private final String NOT_INITIALIZED = "UserPrivateKey not initialized"; + private final String PRIVATE_KEY_LOCKED = "UserPrivateKey locked"; + public static final String USER_PRIVATE_KEY_ALGORITHM_PROP = "tolven.security.user.privateKeyAlgorithm"; *************** *** 69,72 **** --- 71,76 ---- private int iterationCount; + private transient PrivateKey privateKey; + protected UserPrivateKey() { } *************** *** 148,151 **** --- 152,178 ---- throw new IllegalStateException(NOT_INITIALIZED); EncryptedPrivateKeyInfo encryptedPrivateKeyInfo = new EncryptedPrivateKeyInfo(getEncodedEncryptedPrivateKeyInfo()); + PKCS8EncodedKeySpec privateKeySpec = getPrivateKeySpec(aPassword); + return KeyFactory.getInstance(encryptedPrivateKeyInfo.getAlgName()).generatePrivate(privateKeySpec); + } + + public void unlockPrivateKey(char[] aPassword) throws GeneralSecurityException, IOException { + if (getEncodedEncryptedPrivateKeyInfo() == null || pbeKeyAlgorithm == null || salt == null) + throw new IllegalStateException(NOT_INITIALIZED); + EncryptedPrivateKeyInfo encryptedPrivateKeyInfo = new EncryptedPrivateKeyInfo(getEncodedEncryptedPrivateKeyInfo()); + PKCS8EncodedKeySpec privateKeySpec = getPrivateKeySpec(aPassword); + KeyFactory keyFactory = KeyFactory.getInstance(encryptedPrivateKeyInfo.getAlgName()); + privateKey = keyFactory.generatePrivate(privateKeySpec); + } + + public PrivateKey getPrivateKey() { + if (privateKey == null) + throw new IllegalStateException(PRIVATE_KEY_LOCKED); + return privateKey; + } + + private PKCS8EncodedKeySpec getPrivateKeySpec(char[] aPassword) throws GeneralSecurityException, IOException { + if (getEncodedEncryptedPrivateKeyInfo() == null || pbeKeyAlgorithm == null || salt == null) + throw new IllegalStateException(NOT_INITIALIZED); + EncryptedPrivateKeyInfo encryptedPrivateKeyInfo = new EncryptedPrivateKeyInfo(getEncodedEncryptedPrivateKeyInfo()); PBEKeySpec pbeKeySpec = new PBEKeySpec(aPassword); SecretKey secretKey = SecretKeyFactory.getInstance(pbeKeyAlgorithm).generateSecret(pbeKeySpec); *************** *** 153,158 **** Cipher cipher = Cipher.getInstance(pbeKeyAlgorithm); cipher.init(Cipher.DECRYPT_MODE, secretKey, pbeParamSpec); ! PKCS8EncodedKeySpec privateKeySpec = encryptedPrivateKeyInfo.getKeySpec(cipher); ! return KeyFactory.getInstance(encryptedPrivateKeyInfo.getAlgName()).generatePrivate(privateKeySpec); } --- 180,184 ---- Cipher cipher = Cipher.getInstance(pbeKeyAlgorithm); cipher.init(Cipher.DECRYPT_MODE, secretKey, pbeParamSpec); ! return encryptedPrivateKeyInfo.getKeySpec(cipher); } --- NEW FILE: TolvenPublicKey.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.security.bean; import java.io.Serializable; import java.security.GeneralSecurityException; import java.security.KeyFactory; import java.security.PublicKey; import java.security.spec.X509EncodedKeySpec; import javax.persistence.*; /** * This class encapsulates an x509EncodedKeySpec for a Public Key * * @author Joseph Isaac * */ @Embeddable public class TolvenPublicKey implements Serializable { private final String NOT_INITIALIZED = "TolvenPublicKey not initialized"; @Column(name = "x509_encoded__key_spec") private byte[] x509EncodedKeySpec; @Column(name = "public_key_algorithm") private String algorithm; protected TolvenPublicKey() { } /** * Return an instance of TolvenPublicKey * * @return */ public static TolvenPublicKey getInstance() { return new TolvenPublicKey(); } public void init(PublicKey aPublicKey) { X509EncodedKeySpec keySpec = new X509EncodedKeySpec(aPublicKey.getEncoded()); x509EncodedKeySpec = keySpec.getEncoded(); algorithm = aPublicKey.getAlgorithm(); } public PublicKey getPublicKey() throws GeneralSecurityException { if (x509EncodedKeySpec == null || algorithm == null) throw new IllegalStateException(NOT_INITIALIZED); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(x509EncodedKeySpec); return KeyFactory.getInstance(algorithm).generatePublic(keySpec); } } |
From: John C. <jc...@us...> - 2006-12-05 07:45:16
|
Update of /cvsroot/tolven/tolven/template In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19709/template Modified Files: tolven.template Log Message: Add tolven.gen.patient.max (I also now see why there's two versions of this template) Index: tolven.template =================================================================== RCS file: /cvsroot/tolven/tolven/template/tolven.template,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tolven.template 4 Dec 2006 02:41:53 -0000 1.11 --- tolven.template 5 Dec 2006 07:45:13 -0000 1.12 *************** *** 21,24 **** --- 21,25 ---- tolven.ldap.genGroupDN=cn=gen,ou=groups,dc=tolven,dc=com tolven.ldap.rootDN=cn=Manager,dc=tolven,dc=com + tolven.gen.patient.max=1000 # The user's public key |
From: John C. <jc...@us...> - 2006-12-05 07:45:15
|
Update of /cvsroot/tolven/tolven/installer/template In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19709/installer/template Modified Files: tolven.template Log Message: Add tolven.gen.patient.max (I also now see why there's two versions of this template) Index: tolven.template =================================================================== RCS file: /cvsroot/tolven/tolven/installer/template/tolven.template,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tolven.template 4 Dec 2006 02:41:53 -0000 1.7 --- tolven.template 5 Dec 2006 07:45:13 -0000 1.8 *************** *** 21,24 **** --- 21,25 ---- tolven.ldap.genGroupDN=$LDAP_GENGROUPDN tolven.ldap.rootDN=$LDAP_ROOTDN + tolven.gen.patient.max=1000 # The user's public key |
From: John C. <jc...@us...> - 2006-12-05 07:42:08
|
Update of /cvsroot/tolven/tolvenWEB/web/private In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18384/web/private Modified Files: adminAccount.xhtml Log Message: Limit number of patients that can be generated (see tolven.properties tolven.gen.patient.max) Index: adminAccount.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/private/adminAccount.xhtml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** adminAccount.xhtml 4 Dec 2006 09:13:13 -0000 1.10 --- adminAccount.xhtml 5 Dec 2006 07:42:06 -0000 1.11 *************** *** 135,140 **** <h:form id="patGen" > <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"/> --- 135,142 ---- <h:form id="patGen" > <h:panelGrid columns="2"> ! <h:outputText value="Number of Patients to generate (maximum=#{top.properties['tolven.gen.patient.max']})"/> ! <h:inputText id="count" value="#{gen.numberToGenerate}" size="4"> ! <f:validateLongRange minimum="1" maximum="#{top.properties['tolven.gen.patient.max']}"/> ! </h:inputText> <h:outputText value="Patients began arriving in which year"/> <h:inputText id="startYear" value="#{gen.generateHistoryFrom}" size="4"/> |
From: John C. <jc...@us...> - 2006-12-05 07:40:39
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17611/src/org/tolven/gen/bean Modified Files: GenDriver.java Log Message: Limit data generation to two threads in order to preserve user performance Index: GenDriver.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean/GenDriver.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenDriver.java 4 Dec 2006 08:57:38 -0000 1.1 --- GenDriver.java 5 Dec 2006 07:40:31 -0000 1.2 *************** *** 15,18 **** --- 15,20 ---- import javax.annotation.EJB; + import javax.annotation.PostConstruct; + import javax.annotation.PreDestroy; import javax.annotation.Resource; import javax.ejb.ActivationConfigProperty; *************** *** 31,35 **** import org.tolven.app.entity.MenuData; - import org.tolven.core.ActivationLocal; import org.tolven.core.entity.Account; import org.tolven.core.entity.TolvenUser; --- 33,36 ---- *************** *** 38,49 **** import org.tolven.gen.entity.FamilyMember; import org.tolven.gen.entity.FamilyUnit; ! import org.tolven.gen.entity.VirtualPerson; ! @MessageDriven(activationConfig = { ! @ActivationConfigProperty(propertyName="destinationType", ! propertyValue="javax.jms.Queue"), ! @ActivationConfigProperty(propertyName="destination", ! propertyValue="queue/generator") }) public class GenDriver implements MessageListener { --- 39,56 ---- import org.tolven.gen.entity.FamilyMember; import org.tolven.gen.entity.FamilyUnit; ! /** ! * Control the Data Generator process. This process starts when a client queues a message to the ! * generator asking it to generate patients for an account. For each family created, the generator ! * then queues another message to generate data for that family. Thus, if 10 families are created, ! * then 10 separate activities are initiated. In any case, all processes return immediately and can ! * execute in parallel. ! * @author John Churin ! */ @MessageDriven(activationConfig = { ! // We essentially single-thread this queue so we don't clobber user performance. ! @ActivationConfigProperty(propertyName="maxPoolSize", propertyValue="2"), ! @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), ! @ActivationConfigProperty(propertyName="destination", propertyValue="queue/generator") }) public class GenDriver implements MessageListener { *************** *** 67,87 **** private MessageProducer messageProducer = null; ! public void initQueue() throws Exception { ! if (connection!=null) return; ! connection = connectionFactory.createConnection(); ! session = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); ! messageProducer = session.createProducer(queue); } public void queueMessage( GenControlFamily familyControl ) throws Exception { - initQueue(); ObjectMessage message = session.createObjectMessage(familyControl); messageProducer.send(message); - // messageProducer.close(); - // connection.close(); } public void onMessage(Message msg) { try { if (((ObjectMessage)msg).getObject() instanceof GenControlAccount ) { GenControlAccount control = (GenControlAccount) ((ObjectMessage)msg).getObject(); --- 74,107 ---- private MessageProducer messageProducer = null; ! ! @PostConstruct ! public void initQueue() { ! try { ! connection = connectionFactory.createConnection(); ! session = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); ! messageProducer = session.createProducer(queue); ! } catch (Exception e) { ! throw new RuntimeException( "Error creating connection to generator queue", e); ! } ! } ! ! @PreDestroy ! public void closeQueue() { ! try { ! messageProducer.close(); ! connection.close(); ! } catch (Exception e) { ! throw new RuntimeException( "Error closing connection to generator queue", e); ! } } public void queueMessage( GenControlFamily familyControl ) throws Exception { ObjectMessage message = session.createObjectMessage(familyControl); messageProducer.send(message); } public void onMessage(Message msg) { try { + // Generate families if (((ObjectMessage)msg).getObject() instanceof GenControlAccount ) { GenControlAccount control = (GenControlAccount) ((ObjectMessage)msg).getObject(); *************** *** 99,113 **** count = count + familyControl.getFamilyUnit().getMembers().size(); } } if (((ObjectMessage)msg).getObject() instanceof GenControlFamily ) { GenControlFamily control = (GenControlFamily) ((ObjectMessage)msg).getObject(); TolvenUser user = em.find(TolvenUser.class, control.getUserId()); Account chrAccount = em.find(Account.class, control.getChrAccountId()); for (FamilyMember member : control.getFamilyUnit().getMembers()) { - System.out.println("Gen: " + control); MenuData mdPrimary = gen.registerPatient( user, chrAccount, member.getPerson(), control.getFamilyUnit(), control.getNow(), control.getStartYear() ); if (mdPrimary==null) continue; gen.generateMedicalData( mdPrimary, null, control.getNow(), control.getStartYear(), member.getPerson().getDod()); } } } catch (JMSException e) { --- 119,137 ---- count = count + familyControl.getFamilyUnit().getMembers().size(); } + // session.commit(); + return; } + // Generate data for one family if (((ObjectMessage)msg).getObject() instanceof GenControlFamily ) { GenControlFamily control = (GenControlFamily) ((ObjectMessage)msg).getObject(); + System.out.println("start: " + control); TolvenUser user = em.find(TolvenUser.class, control.getUserId()); Account chrAccount = em.find(Account.class, control.getChrAccountId()); for (FamilyMember member : control.getFamilyUnit().getMembers()) { MenuData mdPrimary = gen.registerPatient( user, chrAccount, member.getPerson(), control.getFamilyUnit(), control.getNow(), control.getStartYear() ); if (mdPrimary==null) continue; gen.generateMedicalData( mdPrimary, null, control.getNow(), control.getStartYear(), member.getPerson().getDod()); } + System.out.println("stop: " + control); } } catch (JMSException e) { |
From: John C. <jc...@us...> - 2006-12-04 09:13:18
|
Update of /cvsroot/tolven/tolvenWEB/web/private In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11512/web/private Modified Files: adminAccount.xhtml Log Message: Async data generator Index: adminAccount.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/private/adminAccount.xhtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** adminAccount.xhtml 6 Nov 2006 07:41:30 -0000 1.9 --- adminAccount.xhtml 4 Dec 2006 09:13:13 -0000 1.10 *************** *** 127,144 **** <h:panelGroup rendered="#{reg.account.accountType.knownType=='echr'}"> <h3>Generate virtual patients into this account (#{reg.account.id}, #{reg.account.title})</h3> ! <p>Generate random patients and add them to this account. Keep the number of patients generated under 200. ! You can always add more patients in a second run (the existing patient will remain in the account). ! Be patient, this will take several minutes to run. The generator creates a lot of data. But you'll notice that it doesn't create the exact number of patient specified: The generator automatically discards people that haven't been born yet and some but not all people that are deceased. Also, the fact that pregnancies result in zero, one or more live births makes the number hard to hit exactly. </p> ! <p>As each patient is added to the patient list for the clinical account, each adult patient ! is given a user id consisting of the first and last name of the patient with a dot in between. eg ! Ficticious patient Nancy Cartwright would be given a username and password of nancy.cartwright ! (all lower case). Married couples will have their records in a combined family account. Some family ! accounts also have kids but the kids usually don't have a user id and therefore cannot login. ! Some people will just have one user and one medical record, their own, in an account.</p> ! <h:form id="patGen"> <h:panelGrid columns="2"> <h:outputText value="Number of Patients"/> --- 127,137 ---- <h:panelGroup rendered="#{reg.account.accountType.knownType=='echr'}"> <h3>Generate virtual patients into this account (#{reg.account.id}, #{reg.account.title})</h3> ! <p>Generate random patients and add them to this account. ! The generator runs in the background and will take several minutes to run. The generator creates a lot of data. But you'll notice that it doesn't create the exact number of patient specified: The generator automatically discards people that haven't been born yet and some but not all people that are deceased. Also, the fact that pregnancies result in zero, one or more live births makes the number hard to hit exactly. </p> ! <h:form id="patGen" > <h:panelGrid columns="2"> <h:outputText value="Number of Patients"/> *************** *** 149,152 **** --- 142,146 ---- <h:commandButton id="patGenAction" action="#{gen.createCHRPatients}" value="Generate Patients"/> </h:form> + <h:messages errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </h:panelGroup> </ui:define> |
From: John C. <jc...@us...> - 2006-12-04 09:01:15
|
Update of /cvsroot/tolven/tolvenWEB/web/WEB-INF In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6219/web/WEB-INF Modified Files: faces-config.xml Log Message: Async data generator Index: faces-config.xml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/WEB-INF/faces-config.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** faces-config.xml 28 Nov 2006 22:10:21 -0000 1.28 --- faces-config.xml 4 Dec 2006 09:01:10 -0000 1.29 *************** *** 75,78 **** --- 75,83 ---- </navigation-case> <navigation-case> + <from-action>#{gen.createCHRPatients}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/five/test/patientGen.xhtml</to-view-id> + </navigation-case> + <navigation-case> <from-outcome>/tab/phrToDo</from-outcome> <to-view-id>/tab/phrToDo.xhtml</to-view-id> *************** *** 476,480 **** </navigation-case> <navigation-case> ! <from-action>#{gen.createCHRAccount}</from-action> <from-outcome>success</from-outcome> <to-view-id>/five/test/patientGen.xhtml</to-view-id> --- 481,485 ---- </navigation-case> <navigation-case> ! <from-action>#{gen.createCHRPatients}</from-action> <from-outcome>success</from-outcome> <to-view-id>/five/test/patientGen.xhtml</to-view-id> |
From: John C. <jc...@us...> - 2006-12-04 09:00:54
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5842/src/org/tolven/web Modified Files: PersonGenAction.java Log Message: Async data generator Index: PersonGenAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/PersonGenAction.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PersonGenAction.java 3 Oct 2006 04:41:05 -0000 1.15 --- PersonGenAction.java 4 Dec 2006 09:00:53 -0000 1.16 *************** *** 33,36 **** --- 33,37 ---- import org.tolven.gen.CHRGenerator; import org.tolven.gen.PersonGenerator; + import org.tolven.gen.bean.GenControlAccount; import org.tolven.gen.entity.FamilyMember; import org.tolven.gen.entity.FamilyUnit; *************** *** 121,124 **** --- 122,126 ---- return "success"; } + public long getCurrentFamilyId( ) { Map<String,Object> reqMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap(); *************** *** 129,146 **** return id; } - - /** - * Create a whole account with the requested number of patients - * @throws Exception - */ - public String createCHRAccount( ) throws Exception { - chrGen.createAccount( getTop().getUser(), getNumberToGenerate(), getTop().getNow(), getTitle(), this.getGenerateHistoryFrom() ); - return "success"; - } public String createCHRPatients( ) throws Exception { ! Account account = accountBean.findAccount(getTop().getAccountId()); ! chrGen.createPatients( getTop().getUser(), account, getNumberToGenerate(), getTop().getNow(), this.getGenerateHistoryFrom() ); ! FacesContext.getCurrentInstance().addMessage( null, new FacesMessage( "" + getNumberToGenerate() + " Patients Created")); return "success"; } --- 131,145 ---- return id; } public String createCHRPatients( ) throws Exception { ! GenControlAccount control = new GenControlAccount(); ! control.setUserId( getTop().getUser().getId()); ! control.setChrAccountId(getTop().getAccountId()); ! control.setCount( getNumberToGenerate() ); ! control.setNow(getTop().getNow()); ! control.setStartYear(this.getGenerateHistoryFrom() ); ! chrGen.queueGeneration(control); ! FacesContext.getCurrentInstance().addMessage( null, new FacesMessage( "" + getNumberToGenerate() + " patients are being created")); ! // chrGen.createAccount( getTop().getUser(), getNumberToGenerate(), getTop().getNow(), getTitle(), this.getGenerateHistoryFrom() ); return "success"; } |
From: John C. <jc...@us...> - 2006-12-04 09:00:14
|
Update of /cvsroot/tolven/tolvenWEB/web/five/test In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5446/web/five/test Modified Files: patientGen.xhtml Log Message: Generate patients (not a whole account) Index: patientGen.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/test/patientGen.xhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** patientGen.xhtml 11 Aug 2006 00:10:26 -0000 1.2 --- patientGen.xhtml 4 Dec 2006 09:00:02 -0000 1.3 *************** *** 11,15 **** <ui:composition> <div id="patGenPane"> ! <p>Generate patients and add them to a new account. In order to view the new account and patients, you must log out and then log back in to select the new account.</p> <h:form id="patGen" onsubmit="return ajaxSubmit2(this);"> <h:panelGrid columns="2"> --- 11,16 ---- <ui:composition> <div id="patGenPane"> ! <h:panelGroup rendered="#{reg.account.accountType.knownType=='echr'}"> ! <p>Generate patients and add them to an this account. In order to view the new account and patients.</p> <h:form id="patGen" onsubmit="return ajaxSubmit2(this);"> <h:panelGrid columns="2"> *************** *** 21,27 **** <h:inputText id="title" value="#{gen.title}" size="80"/> </h:panelGrid> ! <h:commandButton id="patGenAction" action="#{gen.createCHRAccount}" value="Generate Account"/> </h:form> <h:messages errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </div> </ui:composition> --- 22,29 ---- <h:inputText id="title" value="#{gen.title}" size="80"/> </h:panelGrid> ! <h:commandButton id="patGenAction" action="#{gen.createCHRPatients}" value="Generate Account"/> </h:form> <h:messages errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> + </h:panelGroup> </div> </ui:composition> |
From: John C. <jc...@us...> - 2006-12-04 08:59:02
|
Update of /cvsroot/tolven/tolvenWEB/web/five In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4953/web/five Modified Files: obsSummary.xhtml resultSummary.xhtml procSummary.xhtml problemSummary.xhtml reminderSummary.xhtml dxSummary.xhtml medsummary.xhtml allergySummary.xhtml apptSummary.xhtml Log Message: Performance Index: apptSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/apptSummary.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** apptSummary.xhtml 29 Nov 2006 01:35:33 -0000 1.1 --- apptSummary.xhtml 4 Dec 2006 08:59:00 -0000 1.2 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="apptsum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="apptsum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> Index: problemSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/problemSummary.xhtml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** problemSummary.xhtml 2 Oct 2006 05:29:59 -0000 1.6 --- problemSummary.xhtml 4 Dec 2006 08:59:00 -0000 1.7 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="probsum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="probsum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> Index: obsSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/obsSummary.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** obsSummary.xhtml 29 Nov 2006 01:35:33 -0000 1.1 --- obsSummary.xhtml 4 Dec 2006 08:59:00 -0000 1.2 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="obssum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="obssum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> Index: procSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/procSummary.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** procSummary.xhtml 29 Nov 2006 01:35:33 -0000 1.1 --- procSummary.xhtml 4 Dec 2006 08:59:00 -0000 1.2 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="procsum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="procsum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> Index: dxSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/dxSummary.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dxSummary.xhtml 29 Nov 2006 01:35:33 -0000 1.1 --- dxSummary.xhtml 4 Dec 2006 08:59:00 -0000 1.2 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="dxsum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="dxsum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> Index: resultSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/resultSummary.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resultSummary.xhtml 29 Nov 2006 01:35:33 -0000 1.1 --- resultSummary.xhtml 4 Dec 2006 08:59:00 -0000 1.2 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="resultsum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="resultsum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> *************** *** 18,22 **** <h:column> <h:outputText value="#{md.date01}"> ! <f:convertDateTime type="date" pattern="MM/dd" timeZone="#{top.timeZone}"/> </h:outputText> </h:column> --- 18,22 ---- <h:column> <h:outputText value="#{md.date01}"> ! <f:convertDateTime type="date" pattern="MMM-yyyy" timeZone="#{top.timeZone}"/> </h:outputText> </h:column> *************** *** 28,35 **** </h:column> </h:dataTable> ! <h:outputLink rendered="#{menu.menuDataCount>6}" value="#" onclick="showPane('#{menu.drilldown}')"> ! <h:outputText value="More..." style="COLOR: #333333; TEXT-DECORATION: none; FONT-SIZE: 75%;TEXT-ALIGN: right;"/> ! </h:outputLink> ! <h:outputText rendered="#{menu.menuDataCount==0}" value="No new results" style="COLOR: #333333; FONT-SIZE: 75%;TEXT-ALIGN: center;"/> </ui:composition> </body> --- 28,35 ---- </h:column> </h:dataTable> ! <h:outputLink rendered="#{menu.menuDataCount>6}" value="#" onclick="showPane('#{menu.drilldown}')"> ! <h:outputText value="More..." style="COLOR: #333333; TEXT-DECORATION: none; FONT-SIZE: 75%;TEXT-ALIGN: right;"/> ! </h:outputLink> ! <h:outputText rendered="#{menu.menuDataCount==0}" value="No Lab Results" style="COLOR: #333333; FONT-SIZE: 75%;TEXT-ALIGN: center;"/> </ui:composition> </body> Index: reminderSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/reminderSummary.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reminderSummary.xhtml 29 Nov 2006 01:35:33 -0000 1.1 --- reminderSummary.xhtml 4 Dec 2006 08:59:00 -0000 1.2 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="remindersum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="remindersum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> Index: allergySummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/allergySummary.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** allergySummary.xhtml 29 Nov 2006 01:35:33 -0000 1.1 --- allergySummary.xhtml 4 Dec 2006 08:59:00 -0000 1.2 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="allergysum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="allergysum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> Index: medsummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/medsummary.xhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** medsummary.xhtml 29 Nov 2006 01:35:33 -0000 1.3 --- medsummary.xhtml 4 Dec 2006 08:59:00 -0000 1.4 *************** *** 10,14 **** <body> <ui:composition> ! <h:dataTable id="medsum" value="#{menu.menuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> --- 10,14 ---- <body> <ui:composition> ! <h:dataTable id="medsum" value="#{menu.summaryMenuData}" var="md" cellspacing="0" border="0" cellpadding="3" width="100%"> <f:facet name="header"> <h:outputLink value="#" onclick="showPane('#{menu.drilldown}')"> |
From: John C. <jc...@us...> - 2006-12-04 08:58:34
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4933/src/org/tolven/web Modified Files: MenuAction.java Log Message: Performance Index: MenuAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/MenuAction.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** MenuAction.java 29 Nov 2006 01:36:11 -0000 1.26 --- MenuAction.java 4 Dec 2006 08:58:30 -0000 1.27 *************** *** 60,65 **** private String elementLabel; private long accountId = 0; ! private MenuStructure ms; private MenuData menuDataItem = null; private List<MenuStructure> menus = null; --- 60,66 ---- private String elementLabel; private long accountId = 0; ! private MenuStructure ms = null; private MenuData menuDataItem = null; + private Long menuDataCount = null; private List<MenuStructure> menus = null; *************** *** 237,250 **** */ public long getMenuDataCount( ) { ! MenuQueryControl ctrl = new MenuQueryControl(); ! ctrl.setLimit( 0 ); ! ctrl.setMenuStructure( getThisMenu() ); ! ctrl.setNow( getNow()); ! ctrl.setOffset( 0 ); ! ctrl.setOriginalTargetPath( getTargetMenuPath() ); ! ctrl.setRequestedPath( getTargetMenuPath() ); ! ctrl.setSortDirection( "ASC"); ! ctrl.setSortOrder( "" ); ! return menuLocal.countMenuData( ctrl ); } --- 238,254 ---- */ public long getMenuDataCount( ) { ! if (menuDataCount==null) { ! MenuQueryControl ctrl = new MenuQueryControl(); ! ctrl.setLimit( 0 ); ! ctrl.setMenuStructure( getThisMenu() ); ! ctrl.setNow( getNow()); ! ctrl.setOffset( 0 ); ! ctrl.setOriginalTargetPath( getTargetMenuPath() ); ! ctrl.setRequestedPath( getTargetMenuPath() ); ! ctrl.setSortDirection( "ASC"); ! ctrl.setSortOrder( "" ); ! menuDataCount = new Long( menuLocal.countMenuData( ctrl ) ); ! } ! return menuDataCount; } *************** *** 287,292 **** public DocCCR getDocCCR( ) throws Exception { - // System.out.println( "[getDocCCR] MD.id=" + md.getId()); MenuData md = getDrilldownItem(); DocBase doc = md.getDocument(); if (doc==null) { --- 291,296 ---- public DocCCR getDocCCR( ) throws Exception { MenuData md = getDrilldownItem(); + // System.out.println( "[getDocCCR] MD.id=" + md.getId()); DocBase doc = md.getDocument(); if (doc==null) { *************** *** 294,297 **** --- 298,302 ---- return null; } + // Note: instanceof doesn't work in Hibernate lazy loading if (!(doc instanceof DocCCR)) { System.out.println( "Document is not CCR " + doc.getId() + " Class: " + doc.getClass().getName()); |
From: John C. <jc...@us...> - 2006-12-04 08:57:40
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4483/src/org/tolven/gen/bean Modified Files: GenMedical.java CHRGeneratorBean.java PersonGeneratorDAO.java Added Files: GenDriver.java GenControlFamily.java GenControlAccount.java GenControlBase.java Log Message: Async data generator --- NEW FILE: GenControlFamily.java --- package org.tolven.gen.bean; import java.io.Serializable; import org.tolven.gen.entity.FamilyUnit; /** * Generate data for a single family. * @author John Churin * */ public class GenControlFamily extends GenControlBase implements Serializable { private static final long serialVersionUID = 1L; private FamilyUnit familyUnit; public FamilyUnit getFamilyUnit() { return familyUnit; } public void setFamilyUnit(FamilyUnit familyUnit) { this.familyUnit = familyUnit; } public String toString() { StringBuffer sb = new StringBuffer( 200 ); sb.append( "GenControl Account: "); sb.append(getChrAccountId()); sb.append(" Family: "); sb.append( familyUnit.getFamilyName()); sb.append( " Now: "); sb.append(getNow()); return sb.toString(); } } --- NEW FILE: GenControlBase.java --- package org.tolven.gen.bean; import java.io.Serializable; import java.util.Date; public abstract class GenControlBase implements Serializable { private static final long serialVersionUID = 1L; private long userId; private long chrAccountId; private Date now; private int startYear; public long getChrAccountId() { return chrAccountId; } public void setChrAccountId(long chrAccountId) { this.chrAccountId = chrAccountId; } public Date getNow() { return now; } public void setNow(Date now) { this.now = now; } public int getStartYear() { return startYear; } public void setStartYear(int startYear) { this.startYear = startYear; } public long getUserId() { return userId; } public void setUserId(long userId) { this.userId = userId; } } Index: GenMedical.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean/GenMedical.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GenMedical.java 3 Dec 2006 08:36:39 -0000 1.16 --- GenMedical.java 4 Dec 2006 08:57:38 -0000 1.17 *************** *** 40,44 **** public class GenMedical { ! public static class PatientMD { MenuData patient = null; MenuStructure msProblem; --- 40,44 ---- public class GenMedical { ! public class PatientMD { MenuData patient = null; MenuStructure msProblem; --- NEW FILE: GenControlAccount.java --- /* * Copyright (C) 2007 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.gen.bean; import java.io.Serializable; /** * Command object directing an MDB to generate patients for an account. Create a number of families and add them to * the specified account. This does not cause the direct creation of the families but instead creates * the virtual family and then passes that to the data generator. * @author John Churin * */ public class GenControlAccount extends GenControlBase implements Serializable { private static final long serialVersionUID = 1L; private int count; public int getCount() { return count; } public void setCount(int count) { this.count = count; } public String toString() { StringBuffer sb = new StringBuffer( 200 ); sb.append( "GenControl Account: "); sb.append(getChrAccountId()); sb.append(" Count: "); sb.append(getCount()); sb.append( " Now: "); sb.append(getNow()); return sb.toString(); } } --- NEW FILE: GenDriver.java --- /* * Copyright (C) 2007 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.gen.bean; import javax.annotation.EJB; import javax.annotation.Resource; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.ejb.MessageDrivenContext; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.MessageProducer; import javax.jms.ObjectMessage; import javax.jms.Queue; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.tolven.app.entity.MenuData; import org.tolven.core.ActivationLocal; import org.tolven.core.entity.Account; import org.tolven.core.entity.TolvenUser; import org.tolven.gen.CHRGenerator; import org.tolven.gen.PersonGenerator; import org.tolven.gen.entity.FamilyMember; import org.tolven.gen.entity.FamilyUnit; import org.tolven.gen.entity.VirtualPerson; @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue="queue/generator") }) public class GenDriver implements MessageListener { @PersistenceContext private EntityManager em; @Resource(mappedName="ConnectionFactory") private ConnectionFactory connectionFactory; @Resource(mappedName="queue/generator") private Queue queue; @EJB private CHRGenerator gen; @EJB private PersonGenerator personGen; @Resource private MessageDrivenContext ctx; private Connection connection = null; private javax.jms.Session session = null; private MessageProducer messageProducer = null; public void initQueue() throws Exception { if (connection!=null) return; connection = connectionFactory.createConnection(); session = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); messageProducer = session.createProducer(queue); } public void queueMessage( GenControlFamily familyControl ) throws Exception { initQueue(); ObjectMessage message = session.createObjectMessage(familyControl); messageProducer.send(message); // messageProducer.close(); // connection.close(); } public void onMessage(Message msg) { try { if (((ObjectMessage)msg).getObject() instanceof GenControlAccount ) { GenControlAccount control = (GenControlAccount) ((ObjectMessage)msg).getObject(); System.out.println("MsgID: " + msg.getJMSMessageID() + " "+ control); int count = 0; while (count < control.getCount()) { FamilyUnit family = personGen.generateFamily(control.getNow()); GenControlFamily familyControl = new GenControlFamily(); familyControl.setFamilyUnit(family); familyControl.setChrAccountId(control.getChrAccountId()); familyControl.setNow(control.getNow()); familyControl.setUserId(control.getUserId()); familyControl.setStartYear(control.getStartYear()); queueMessage(familyControl); count = count + familyControl.getFamilyUnit().getMembers().size(); } } if (((ObjectMessage)msg).getObject() instanceof GenControlFamily ) { GenControlFamily control = (GenControlFamily) ((ObjectMessage)msg).getObject(); TolvenUser user = em.find(TolvenUser.class, control.getUserId()); Account chrAccount = em.find(Account.class, control.getChrAccountId()); for (FamilyMember member : control.getFamilyUnit().getMembers()) { System.out.println("Gen: " + control); MenuData mdPrimary = gen.registerPatient( user, chrAccount, member.getPerson(), control.getFamilyUnit(), control.getNow(), control.getStartYear() ); if (mdPrimary==null) continue; gen.generateMedicalData( mdPrimary, null, control.getNow(), control.getStartYear(), member.getPerson().getDod()); } } } catch (JMSException e) { e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Index: PersonGeneratorDAO.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean/PersonGeneratorDAO.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PersonGeneratorDAO.java 28 Sep 2006 19:13:28 -0000 1.8 --- PersonGeneratorDAO.java 4 Dec 2006 08:57:38 -0000 1.9 *************** *** 14,17 **** --- 14,18 ---- package org.tolven.gen.bean; + import java.io.IOException; import java.util.ArrayList; import java.util.Date; *************** *** 32,35 **** --- 33,38 ---- import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; + import org.tolven.core.entity.Account; + import org.tolven.core.entity.TolvenUser; import org.tolven.gen.PersonGenerator; import org.tolven.gen.PersonGeneratorRemote; *************** *** 37,40 **** --- 40,44 ---- import org.tolven.gen.entity.FamilyUnit; import org.tolven.gen.entity.VirtualPerson; + import org.tolven.gen.entity.FamilyMember.FamilyMemberRole; import org.tolven.gen.util.GenerateCauseOfDeath; import org.tolven.gen.util.GeneratePlace; *************** *** 104,107 **** --- 108,122 ---- return null; } + + /** + * Add address information to a family + * @param family + * @throws IOException + */ + public void generateAddress( FamilyUnit family) throws IOException { + placeGenerator.generateZipCode(family); + placeGenerator.generateAddress(family); + } + /** * Generate people and persist them. No mention of which people are generated is returned. *************** *** 183,186 **** --- 198,246 ---- return rslt; } + public FamilyUnit generateFamily( Date now ) throws Exception { + // Start a family + FamilyUnit family = new FamilyUnit(); + placeGenerator.generateZipCode(family); + placeGenerator.generateAddress(family); + String primaryGender = null; + int primaryAge = 0; + // Start with a primary person (we should find a suitable mom or dad in 100 tries) + for (int c = 0; c < 100; c++) { + VirtualPerson person = generatePerson(); + primaryAge = person.getAgeInYears(now); + if ( primaryAge < 18 ) continue; + family.setFamilyName(person.getLast()); + primaryGender = person.getGender(); + FamilyMemberRole role; + if ("F".equals(person.getGender())) { + role = FamilyMember.FamilyMemberRole.MOTHER; + } else { + role = FamilyMember.FamilyMemberRole.FATHER; + } + family.addMember( person, role ); + break; + } + // Look for a second person (we may not find one) + for (int c = 0; c < 10; c++) { + VirtualPerson person = generatePerson(); + int age = person.getAgeInYears( now ); + if ( age < 18 ) continue; + if (primaryGender.equals(person.getGender())) continue; + int ageDifference = person.getAgeInYears( now )-primaryAge; + // If too far apart in age, forget it + if (Math.abs( ageDifference) > 10 ) continue; + // Same last name, add to family + person.setLast(family.getFamilyName()); + FamilyMemberRole role; + if ("F".equals(person.getGender())) { + role = FamilyMember.FamilyMemberRole.MOTHER; + } else { + role = FamilyMember.FamilyMemberRole.FATHER; + } + family.addMember( person, role ); + break; + } + return family; + } /** Index: CHRGeneratorBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean/CHRGeneratorBean.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CHRGeneratorBean.java 3 Dec 2006 08:36:39 -0000 1.14 --- CHRGeneratorBean.java 4 Dec 2006 08:57:38 -0000 1.15 *************** *** 22,32 **** import java.util.LinkedList; import java.util.List; - import java.util.Queue; import java.util.Random; import java.util.Stack; import javax.annotation.EJB; import javax.ejb.Local; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; --- 22,38 ---- import java.util.LinkedList; import java.util.List; import java.util.Random; import java.util.Stack; import javax.annotation.EJB; + import javax.annotation.Resource; import javax.ejb.Local; import javax.ejb.Stateless; + import javax.jms.Connection; + import javax.jms.ConnectionFactory; + import javax.jms.JMSException; + import javax.jms.MessageProducer; + import javax.jms.ObjectMessage; + import javax.jms.Queue; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; *************** *** 52,55 **** --- 58,62 ---- import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocCCR; + import org.tolven.doc.entity.Invitation; import org.tolven.gen.CHRGenerator; import org.tolven.gen.PersonGenerator; *************** *** 71,75 **** private EntityManager em; ! @EJB private AccountDAOLocal accountBean; --- 78,88 ---- private EntityManager em; ! @Resource(mappedName="ConnectionFactory") ! private ConnectionFactory connectionFactory; ! ! @Resource(mappedName="queue/generator") ! private Queue queue; ! ! @EJB private AccountDAOLocal accountBean; *************** *** 118,121 **** --- 131,149 ---- /** + * Queue the generation of one or more clinical data events + * @param invitation + * @throws JMSException + */ + public void queueGeneration(GenControlBase control) throws JMSException { + Connection connection = connectionFactory.createConnection(); + javax.jms.Session session = connection.createSession(false, + javax.jms.Session.AUTO_ACKNOWLEDGE); + MessageProducer messageProducer = session.createProducer(queue); + ObjectMessage message = session.createObjectMessage(control); + messageProducer.send(message); + messageProducer.close(); + connection.close(); + } + /** * We'll start by creating a completely new account and then add patients to the account. * @param user *************** *** 291,295 **** */ public void generateMedicalData( MenuData mdCHR, MenuData mdPHR, Date now, int startYear, Date dateOfDeath ) throws JAXBException, CCRException, ParseException { ! // OK, nice start but let's give this person some medical data. GenMedical genMed = new GenMedical( menu, mdCHR, mdPHR, now, startYear, this ); genMed.setDateOfDeath(dateOfDeath); --- 319,324 ---- */ public void generateMedicalData( MenuData mdCHR, MenuData mdPHR, Date now, int startYear, Date dateOfDeath ) throws JAXBException, CCRException, ParseException { ! initCriteria(); ! // OK, nice start but let's give this person some medical data. GenMedical genMed = new GenMedical( menu, mdCHR, mdPHR, now, startYear, this ); genMed.setDateOfDeath(dateOfDeath); *************** *** 311,321 **** start.setTime( dob ); System.out.print( "*****Registering baby: " + mother.getFamilyName() + " " + person.getDob()); ! TolvenUser userCHR = mother.mdCHR.patient.getDocument().getAuthor(); ! TolvenUser userPHR = mother.mdPHR.patient.getDocument().getAuthor(); ! MenuData mdCHRBaby = registerPatient( userCHR, mother.getCHRAccount(), person, null, mother.getNow(), start.get(GregorianCalendar.YEAR) ); ! MenuData mdPHRBaby = registerPatient( userPHR, mother.getPHRAccount(), person, null, mother.getNow(), start.get(GregorianCalendar.YEAR) ); ! if (mdCHRBaby!=null && mdPHRBaby!=null) { ! generateMedicalData( mdCHRBaby, mdPHRBaby, mother.getNow(), mother.getStartYear(), person.getDod()); ! } } catch (Exception e) { // forget it if there's a problem --- 340,355 ---- start.setTime( dob ); System.out.print( "*****Registering baby: " + mother.getFamilyName() + " " + person.getDob()); ! MenuData mdCHRBaby = null; ! MenuData mdPHRBaby = null; ! if (mother.mdCHR!=null) { ! TolvenUser userCHR = mother.mdCHR.patient.getDocument().getAuthor(); ! mdCHRBaby = registerPatient( userCHR, mother.getCHRAccount(), person, null, mother.getNow(), start.get(GregorianCalendar.YEAR) ); ! ! } ! if (mother.mdPHR!=null) { ! TolvenUser userPHR = mother.mdPHR.patient.getDocument().getAuthor(); ! mdPHRBaby = registerPatient( userPHR, mother.getPHRAccount(), person, null, mother.getNow(), start.get(GregorianCalendar.YEAR) ); ! } ! generateMedicalData( mdCHRBaby, mdPHRBaby, mother.getNow(), mother.getStartYear(), person.getDod()); } catch (Exception e) { // forget it if there's a problem |
From: John C. <jc...@us...> - 2006-12-04 08:57:40
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4483/src/org/tolven/gen/util Modified Files: LifeSpan.java Log Message: Async data generator Index: LifeSpan.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/util/LifeSpan.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LifeSpan.java 21 Aug 2006 00:26:30 -0000 1.3 --- LifeSpan.java 4 Dec 2006 08:57:38 -0000 1.4 *************** *** 21,25 **** public class LifeSpan extends GeneratorBase { private int totalPopulation = 0; ! private static Logger log = Logger.getLogger( "org.tolven.gen"); // US Population distribution based on 2002 census estimates --- 21,25 ---- public class LifeSpan extends GeneratorBase { private int totalPopulation = 0; ! private Logger log = Logger.getLogger( "org.tolven.gen"); // US Population distribution based on 2002 census estimates |
From: John C. <jc...@us...> - 2006-12-04 08:57:40
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4483/src/org/tolven/gen Modified Files: PersonGenerator.java CHRGenerator.java Log Message: Async data generator Index: PersonGenerator.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/PersonGenerator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PersonGenerator.java 21 Aug 2006 00:26:30 -0000 1.4 --- PersonGenerator.java 4 Dec 2006 08:57:38 -0000 1.5 *************** *** 14,17 **** --- 14,18 ---- package org.tolven.gen; + import java.io.IOException; import java.util.Date; import java.util.List; *************** *** 42,45 **** --- 43,60 ---- /** + * Add address information to a family + * @param family + * @throws IOException + */ + public void generateAddress( FamilyUnit family) throws IOException; + /** + * Generate a family + * @param now + * @return + * @throws Exception + */ + public FamilyUnit generateFamily( Date now ) throws Exception; + + /** * Add members of a family to our account, but only those that have been born. * TODO: Add unborn people to the scheduler to be added on the day of the blessed event! Index: CHRGenerator.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/CHRGenerator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CHRGenerator.java 15 Nov 2006 07:00:11 -0000 1.5 --- CHRGenerator.java 4 Dec 2006 08:57:38 -0000 1.6 *************** *** 14,21 **** --- 14,32 ---- package org.tolven.gen; + import java.io.IOException; + import java.text.ParseException; import java.util.Date; + import javax.jms.JMSException; + import javax.xml.bind.JAXBException; + + import org.tolven.app.entity.MenuData; import org.tolven.core.entity.Account; import org.tolven.core.entity.TolvenUser; + import org.tolven.doc.entity.CCRException; + import org.tolven.gen.bean.GenControlAccount; + import org.tolven.gen.bean.GenControlBase; + import org.tolven.gen.entity.FamilyUnit; + import org.tolven.gen.entity.VirtualPerson; public interface CHRGenerator { *************** *** 45,47 **** --- 56,83 ---- public void createFamily( TolvenUser user, Account account, Date now, int startYear) throws Exception; + /** + * Queue the generation of one or more clinical data events + * @param invitation + * @throws JMSException + */ + public void queueGeneration(GenControlBase control) throws JMSException; + /** + * This is where we add the generated patient to the full patient list of the account. + * @param account + * @param vp + * @throws CCRException + * @throws IOException + * @throws JAXBException + * @throws ParseException + */ + public MenuData registerPatient( TolvenUser user, Account account, VirtualPerson vp, FamilyUnit family, Date now, int startYear ) throws IOException, CCRException, JAXBException, ParseException; + + /** + * Generate Medical data for a patient + * @throws CCRException + * @throws JAXBException + * @throws ParseException + */ + public void generateMedicalData( MenuData mdCHR, MenuData mdPHR, Date now, int startYear, Date dateOfDeath ) throws JAXBException, CCRException, ParseException; + } |
From: John C. <jc...@us...> - 2006-12-04 08:57:40
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4483/src/org/tolven/gen/entity Modified Files: FamilyMember.java FamilyUnit.java VirtualPerson.java Log Message: Async data generator Index: VirtualPerson.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/entity/VirtualPerson.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VirtualPerson.java 28 Aug 2006 19:37:36 -0000 1.4 --- VirtualPerson.java 4 Dec 2006 08:57:38 -0000 1.5 *************** *** 112,116 **** transient static String hl7Format = "yyyyMMddhhmmss"; ! transient static SimpleDateFormat hl7sdf = new SimpleDateFormat( hl7Format ); public String getHL7Dob() { --- 112,116 ---- transient static String hl7Format = "yyyyMMddhhmmss"; ! transient SimpleDateFormat hl7sdf = new SimpleDateFormat( hl7Format ); public String getHL7Dob() { *************** *** 119,123 **** transient static String birthdayFormat = "MMdd"; ! transient static SimpleDateFormat birthdaysdf = new SimpleDateFormat( birthdayFormat ); public String getBirthday() { --- 119,123 ---- transient static String birthdayFormat = "MMdd"; ! transient SimpleDateFormat birthdaysdf = new SimpleDateFormat( birthdayFormat ); public String getBirthday() { *************** *** 223,227 **** transient static String dobFormat = "yyyy-MM-dd"; ! transient static SimpleDateFormat sdf = new SimpleDateFormat( dobFormat ); public String toString() --- 223,227 ---- transient static String dobFormat = "yyyy-MM-dd"; ! transient SimpleDateFormat sdf = new SimpleDateFormat( dobFormat ); public String toString() Index: FamilyMember.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/entity/FamilyMember.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FamilyMember.java 21 Aug 2006 00:26:29 -0000 1.2 --- FamilyMember.java 4 Dec 2006 08:57:38 -0000 1.3 *************** *** 14,17 **** --- 14,19 ---- package org.tolven.gen.entity; + import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; *************** *** 29,34 **** @Entity @Table(name = "FAMILY_MEMBER", schema="gen") ! public class FamilyMember { public enum FamilyMemberRole { MOTHER, FATHER, CHILD, GRANDMOTHER, GRANDFATHER } --- 31,38 ---- @Entity @Table(name = "FAMILY_MEMBER", schema="gen") ! public class FamilyMember implements Serializable { + private static final long serialVersionUID = 1L; + public enum FamilyMemberRole { MOTHER, FATHER, CHILD, GRANDMOTHER, GRANDFATHER } Index: FamilyUnit.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/entity/FamilyUnit.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FamilyUnit.java 21 Aug 2006 00:26:29 -0000 1.3 --- FamilyUnit.java 4 Dec 2006 08:57:38 -0000 1.4 *************** *** 14,17 **** --- 14,18 ---- package org.tolven.gen.entity; + import java.io.Serializable; import java.util.HashSet; import java.util.Set; *************** *** 37,43 **** @Entity @Table(name = "FAMILY_UNIT", schema="gen") ! public class FamilyUnit { ! @Id @GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_SEQ_GEN") private long id; --- 38,46 ---- @Entity @Table(name = "FAMILY_UNIT", schema="gen") ! public class FamilyUnit implements Serializable { ! private static final long serialVersionUID = 1L; ! ! @Id @GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_SEQ_GEN") private long id; |
From: John C. <jc...@us...> - 2006-12-04 08:57:05
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4066/src/org/tolven/app/bean Modified Files: MenuBean.java Log Message: Performance Index: MenuBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuBean.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** MenuBean.java 29 Nov 2006 01:31:21 -0000 1.38 --- MenuBean.java 4 Dec 2006 08:57:01 -0000 1.39 *************** *** 94,102 **** query.setParameter( "id", id ); query.setParameter( "accountId", ctrl.getMenuStructure().getAccount().getId() ); ! // System.out.println( "[MenuBean] Looking for menuDataItem with key: " + id + " for account: " + id ); query.setMaxResults(2); List<MenuData> items = query.getResultList(); if ( items.size()!=1) return null; MenuData rslt = items.get(0); return rslt; } --- 94,107 ---- query.setParameter( "id", id ); query.setParameter( "accountId", ctrl.getMenuStructure().getAccount().getId() ); ! System.out.println( "[MenuBean] Looking for menuDataItem with key: " + id + " for account: " + id ); query.setMaxResults(2); List<MenuData> items = query.getResultList(); if ( items.size()!=1) return null; MenuData rslt = items.get(0); + // DocBase doc = rslt.getDocument(); // Eager fetch in this case + // if (doc != null ) { + // doc.getAccount(); + // System.out.println( "findMenuDataItem: " + doc.getId() + " class=" + doc.getClass().getName()); + // } return rslt; } |