You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(141) |
Sep
(184) |
Oct
(159) |
Nov
(77) |
Dec
(114) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(212) |
Feb
(302) |
Mar
(323) |
Apr
(360) |
May
(302) |
Jun
(392) |
Jul
(299) |
Aug
(858) |
Sep
(499) |
Oct
(489) |
Nov
(324) |
Dec
(438) |
2008 |
Jan
(449) |
Feb
(388) |
Mar
(811) |
Apr
(583) |
May
(949) |
Jun
(1431) |
Jul
(943) |
Aug
(527) |
Sep
(576) |
Oct
(440) |
Nov
(1046) |
Dec
(658) |
2009 |
Jan
(259) |
Feb
(192) |
Mar
(495) |
Apr
(2322) |
May
(2023) |
Jun
(1387) |
Jul
(722) |
Aug
(771) |
Sep
(167) |
Oct
(142) |
Nov
(384) |
Dec
(884) |
2010 |
Jan
(344) |
Feb
(82) |
Mar
(248) |
Apr
(341) |
May
(389) |
Jun
(289) |
Jul
(19) |
Aug
(478) |
Sep
(274) |
Oct
(431) |
Nov
(322) |
Dec
(207) |
2011 |
Jan
(125) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John C. <jc...@us...> - 2007-02-04 16:40:29
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/doc Modified Files: DocumentLocal.java XMLLocal.java DocumentRemote.java Log Message: Add Trim classes, creator and rule evaluator Index: DocumentLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/DocumentLocal.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DocumentLocal.java 20 Jan 2007 19:23:17 -0000 1.10 --- DocumentLocal.java 4 Feb 2007 16:39:57 -0000 1.11 *************** *** 76,80 **** public DocCCR createCCRDocument( long userId, long accountId ) throws CCRException; ! /** * Not a very practical method but we'll use it for testing. --- 76,81 ---- public DocCCR createCCRDocument( long userId, long accountId ) throws CCRException; ! public DocXML createXMLDocument( String xmlNS, long userId, long accountId ); ! /** * Not a very practical method but we'll use it for testing. *************** *** 138,144 **** * @param doc * @param accountId of the author * @return the id assigned to the new document. */ ! public long createImage( DocImage doc, long userId, long accountId ); /** --- 139,146 ---- * @param doc * @param accountId of the author + * @param content the actual image to store * @return the id assigned to the new document. */ ! public long createImage( DocImage doc, long userId, long accountId, byte[] content ); /** Index: DocumentRemote.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/DocumentRemote.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DocumentRemote.java 28 Jan 2007 06:03:55 -0000 1.2 --- DocumentRemote.java 4 Feb 2007 16:39:57 -0000 1.3 *************** *** 14,16 **** --- 14,21 ---- // public DocBase findDocument( long docId, long AccountId ); + + public void queueMessage( byte[] payload, String xmlns, long accountId, long userId) throws Exception; + + public void ruleTest() throws Exception; + } Index: XMLLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/XMLLocal.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XMLLocal.java 21 Jan 2007 00:00:42 -0000 1.2 --- XMLLocal.java 4 Feb 2007 16:39:57 -0000 1.3 *************** *** 9,12 **** --- 9,14 ---- import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocXML; + import org.tolven.trim.Trim; + import org.tolven.trim.util.TRIMException; public interface XMLLocal { *************** *** 23,26 **** --- 25,30 ---- public void marshalCCR( ContinuityOfCareRecord ccr, OutputStream output ) throws JAXBException, CCRException; + + public void marshalTRIM( Trim trim, OutputStream output ) throws JAXBException, TRIMException; } |
From: John C. <jc...@us...> - 2007-02-04 16:40:25
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/trim/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21538/src/org/tolven/trim/util Log Message: Directory /cvsroot/tolven/tolvenEJB/src/org/tolven/trim/util added to the repository |
From: John C. <jc...@us...> - 2007-02-04 16:40:24
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/doc/bean Modified Files: Evaluator.java DocumentBean.java XMLBean.java Added Files: RulesBaseFactory.java Removed Files: IdHash.java Log Message: Add Trim classes, creator and rule evaluator Index: XMLBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/XMLBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XMLBean.java 21 Jan 2007 00:00:42 -0000 1.2 --- XMLBean.java 4 Feb 2007 16:39:51 -0000 1.3 *************** *** 1,5 **** package org.tolven.doc.bean; - import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.OutputStream; --- 1,4 ---- *************** *** 17,25 **** import javax.xml.transform.stream.StreamSource; - import org.jboss.annotation.security.SecurityDomain; import org.tolven.ccr.ContinuityOfCareRecord; import org.tolven.doc.XMLLocal; import org.tolven.doc.entity.CCRException; ! import org.tolven.doc.entity.DocXML; @Stateless() --- 16,24 ---- import javax.xml.transform.stream.StreamSource; import org.tolven.ccr.ContinuityOfCareRecord; import org.tolven.doc.XMLLocal; import org.tolven.doc.entity.CCRException; ! import org.tolven.trim.Trim; ! import org.tolven.trim.util.TRIMException; @Stateless() *************** *** 27,30 **** --- 26,30 ---- public class XMLBean implements XMLLocal { static final String CCR_NS = "urn:astm-org:CCR"; + static final String TRIM_NS = "urn:astm-org:trim:4.0"; private Map<String, JAXBContext> jaxbContexts; *************** *** 54,57 **** --- 54,58 ---- public String decodeBindingContext( String ns) { if (CCR_NS.equals(ns)) return "org.tolven.ccr"; + if (TRIM_NS.equals(ns)) return "org.tolven.trim"; return null; } *************** *** 72,75 **** --- 73,85 ---- } + public void marshalTRIM( Trim trim, OutputStream output ) throws JAXBException, TRIMException { + JAXBContext jc = setupJAXBContext( decodeBindingContext(TRIM_NS)); + Marshaller m = jc.createMarshaller(); + m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE ); + m.marshal( trim, output ); + // StringWriter result = new StringWriter( 10000 ); + // return result.toString(); + } + /** * <p>This method will unmarshal the XML into an object graph and return the head of that graph. </p> *************** *** 83,88 **** } - - - } --- 93,95 ---- --- IdHash.java DELETED --- Index: DocumentBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/DocumentBean.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DocumentBean.java 28 Jan 2007 06:52:29 -0000 1.20 --- DocumentBean.java 4 Feb 2007 16:39:51 -0000 1.21 *************** *** 14,17 **** --- 14,18 ---- package org.tolven.doc.bean; + import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.StringReader; *************** *** 26,29 **** --- 27,32 ---- import javax.ejb.Remote; import javax.ejb.Stateless; + import javax.jms.ConnectionFactory; + import javax.jms.Queue; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; *************** *** 43,46 **** --- 46,50 ---- import org.tolven.core.entity.Status; import org.tolven.core.entity.TolvenUser; + import org.tolven.core.util.Queuer; import org.tolven.doc.DocumentLocal; import org.tolven.doc.DocumentRemote; *************** *** 50,53 **** --- 54,59 ---- import org.tolven.doc.entity.DocImage; import org.tolven.doc.entity.DocXML; + import org.tolven.gen.entity.FamilyMember; + import org.tolven.trim.Trim; /** *************** *** 68,76 **** private EntityManager em; - @EJB private TolvenPropertiesLocal propertyBean; - private JAXBContext jc = null; ! /** * Get a document by its internal ID * @param docId the id of the document --- 74,87 ---- private EntityManager em; private JAXBContext jc = null; ! // @Resource(mappedName="ConnectionFactory") ! @Resource(mappedName="java:/JmsXA") ! private ConnectionFactory connectionFactory; ! ! @Resource(mappedName="queue/rule") ! private Queue ruleQueue; ! ! /** * Get a document by its internal ID * @param docId the id of the document *************** *** 81,85 **** return doc; } ! /** * The document is immediately persisted (with no XML in it). This gives us the ID we'll need --- 92,99 ---- return doc; } ! public void ruleTest() throws Exception { ! RulesBaseFactory factory = new RulesBaseFactory(); ! factory.open("echr.drl"); ! } /** * The document is immediately persisted (with no XML in it). This gives us the ID we'll need *************** *** 110,113 **** --- 124,135 ---- } + public DocXML createXMLDocument( String xmlNS, long userId, long accountId ) { + DocXML doc = new DocXML(); + String oid = System.getProperty("tolven.repository.oid"); + doc.setMediaType("text/xml"); + doc.setXmlNS(xmlNS); + createDocument( doc, userId, accountId ); + return doc; + } /** *************** *** 179,183 **** */ public List<DocXML> findAllXMLDocuments(long userId, int pageSize, int offset, String sortAttribute, String sortDir ) { ! Query query = em.createQuery( "SELECT d FROM DocCCR d, AccountUser au WHERE au.user.id = :user AND d.account.id = au.account.id ORDER BY d." + sortAttribute + " " + sortDir ); query.setMaxResults(pageSize); query.setFirstResult(offset); --- 201,205 ---- */ public List<DocXML> findAllXMLDocuments(long userId, int pageSize, int offset, String sortAttribute, String sortDir ) { ! Query query = em.createQuery( "SELECT d FROM DocXML d, AccountUser au WHERE au.user.id = :user AND d.account.id = au.account.id ORDER BY d." + sortAttribute + " " + sortDir ); query.setMaxResults(pageSize); query.setFirstResult(offset); *************** *** 186,194 **** return items; } ! /** * Count of all XML documents owned by any account the specified user is a member of (for demo use only). This is otherwise a security violation. */ public long countXMLDocuments( long userId ) { ! Query query = em.createQuery( "SELECT COUNT(d) FROM DocCCR d, AccountUser au WHERE au.user.id = :userId AND d.account.id = au.account.id"); query.setParameter("userId", userId); Long rslt = (Long) query.getSingleResult(); --- 208,217 ---- return items; } ! ! /** * Count of all XML documents owned by any account the specified user is a member of (for demo use only). This is otherwise a security violation. */ public long countXMLDocuments( long userId ) { ! Query query = em.createQuery( "SELECT COUNT(d) FROM DocXML d, AccountUser au WHERE au.user.id = :userId AND d.account.id = au.account.id"); query.setParameter("userId", userId); Long rslt = (Long) query.getSingleResult(); *************** *** 256,262 **** * @param accountId of the author */ ! public long createImage( DocImage doc, long userId, long accountId ) { ! doc.setAccount(em.getReference( Account.class, accountId )); ! return createDocument( doc, userId, accountId ); } --- 279,286 ---- * @param accountId of the author */ ! public long createImage( DocImage doc, long userId, long accountId, byte[] content ) { ! long id = createDocument( doc, userId, accountId ); ! doc.setContent(content); ! return id; } *************** *** 317,320 **** } ! } --- 341,356 ---- } ! public void queueMessage( byte[] payload, String xmlns, long accountId, long userId) throws Exception { ! Queuer q = new Queuer(); ! q.init(connectionFactory, ruleQueue); ! TolvenMessage tm = new TolvenMessage(); ! tm.setAccountId(accountId); ! tm.setAuthorId(userId); ! // tm.setXmlName("trim"); ! tm.setXmlNS( xmlns); ! tm.setPayload(payload); ! q.send( tm ); ! q.close(); ! System.out.println("Message queued" ); ! } } Index: Evaluator.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/Evaluator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Evaluator.java 26 Jan 2007 06:45:34 -0000 1.4 --- Evaluator.java 4 Feb 2007 16:39:51 -0000 1.5 *************** *** 20,24 **** import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; - import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; --- 20,23 ---- *************** *** 26,30 **** --- 25,32 ---- import javax.xml.bind.JAXBException; + import org.drools.RuleBase; + import org.drools.WorkingMemory; import org.tolven.app.MenuLocal; + import org.tolven.app.bean.AppEvalAdaptor; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; *************** *** 41,44 **** --- 43,52 ---- import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocCCR; + import org.tolven.doc.entity.DocXML; + import org.tolven.trim.Act; + import org.tolven.trim.ActInternal; + import org.tolven.trim.ActNull; + import org.tolven.trim.ActSlot; + import org.tolven.trim.Trim; /** * Evaluate new documents that have arrived. We do this after a document is safely stored and in the *************** *** 59,63 **** @EJB private MenuLocal menuLocal; @EJB private XMLLocal xmlBean; ! public void onMessage(Message msg) { String msgId = "<tbd>"; --- 67,75 ---- @EJB private MenuLocal menuLocal; @EJB private XMLLocal xmlBean; ! private static final String CCRns = "urn:astm-org:CCR"; ! private static final String TRIMns = "urn:astm-org:trim:4.0"; ! ! RulesBaseFactory ruleBaseFactory = new RulesBaseFactory(); ! public void onMessage(Message msg) { String msgId = "<tbd>"; *************** *** 66,92 **** TolvenMessage tm = (TolvenMessage) ((ObjectMessage)msg).getObject(); // System.out.println( tm.getPayload()); ! processCCR(tm); // System.out.println( docCCR.getPatientActor().getPerson().getName().getCurrentName().getFamilyString()); ! } catch (JMSException e) { ! System.out.println( "Msg Failed: " + msgId); ! e.printStackTrace(); ! } catch (JAXBException e) { ! System.out.println( "Msg Failed: " + msgId); ! // TODO Auto-generated catch block ! e.printStackTrace(); ! } catch (CCRException e) { ! System.out.println( "Msg Failed: " + msgId); ! // TODO Auto-generated catch block ! e.printStackTrace(); ! } catch (ParseException e) { ! System.out.println( "Msg Failed: " + msgId); ! // TODO Auto-generated catch block ! e.printStackTrace(); ! } catch (IOException e) { ! // TODO Auto-generated catch block ! e.printStackTrace(); } } /** * Process a single CCR message. Verify the account and user --- 78,124 ---- TolvenMessage tm = (TolvenMessage) ((ObjectMessage)msg).getObject(); // System.out.println( tm.getPayload()); ! if (CCRns.equals(tm.getXmlNS())) processCCR(tm); ! else if ( TRIMns.equals(tm.getXmlNS())) processTRIM( tm ); // System.out.println( docCCR.getPatientActor().getPerson().getName().getCurrentName().getFamilyString()); ! } catch (Exception e) { ! System.out.println( "Msg Failed: " + msgId + " Error: " + e.getMessage()); ! // e.printStackTrace(); } } + public void processTRIM( TolvenMessage tm ) throws Exception { + System.out.println( "Processing TRIM document for account: " + tm.getAccountId()); + DocXML docXML = documentLocal.createXMLDocument( tm.getXmlNS(), tm.getAuthorId(), tm.getAccountId() ); + System.out.println( "Document created, id: " + docXML.getId()); + docXML.setContent(tm.getPayload()); + // System.out.println( "Document set payload, id: " + docXML.getId()); + documentLocal.finalizeDocument(docXML); + // System.out.println( "Finalized Document, id: " + docXML.getId()); + // Get type of account + String accountType = docXML.getAccount().getAccountType().getKnownType(); + Trim trim = (Trim) xmlBean.unmarshal(tm.getXmlNS(), tm.getPayloadInputStream()); + RuleBase ruleBase = ruleBaseFactory.open( accountType + ".drl"); + //load up the rulebase + WorkingMemory workingMemory = ruleBase.newWorkingMemory(); + AppEvalAdaptor app = new AppEvalAdaptor( docXML.getAccount()); + app.init(menuLocal, workingMemory); + // Assert a trim object and see what the rules do with it + workingMemory.assertObject(trim); + workingMemory.fireAllRules(); + workingMemory.dispose(); + + for (ActSlot act : trim.getActs()) { + if (act instanceof Act ) { + System.out.println( "TRIM Act: " + ((Act)act).getClassCode() + "-" + ((Act)act).getMoodCode()); + } + if (act instanceof ActInternal ) { + System.out.println( "TRIM Act Internal: " + ((ActInternal)act).getInternalId()); + } + if (act instanceof ActNull ) { + System.out.println( "TRIM Act null, flavor: " + ((ActNull)act).getFlavor()); + } + } + } + /** * Process a single CCR message. Verify the account and user --- NEW FILE: RulesBaseFactory.java --- package org.tolven.doc.bean; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.HashMap; import java.util.Map; import org.drools.RuleBase; import org.drools.RuleBaseConfiguration; import org.drools.RuleBaseFactory; import org.drools.compiler.PackageBuilder; import org.drools.compiler.PackageBuilderConfiguration; import org.drools.rule.Package; /** * One of these per session bean instance. Non-reentrant. * @author John Churin * */ public class RulesBaseFactory { private Map<String, RuleBase> ruleBases; public RulesBaseFactory() { ruleBases = new HashMap<String, RuleBase>( ); } public RuleBase open( String ruleFile) throws Exception { RuleBase ruleBase = ruleBases.get(ruleFile); if (ruleBase==null) { //read in the source ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); InputStream inputStream = classLoader.getResourceAsStream( ruleFile ); Reader source = new InputStreamReader( inputStream ); //optionally read in the DSL (if you are using it). //Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) ); //Use package builder to build up a rule package. //An alternative lower level class called "DrlParser" can also be used... PackageBuilderConfiguration conf = new PackageBuilderConfiguration(); conf.setJavaLanguageLevel( "1.5" ); PackageBuilder builder = new PackageBuilder(conf); //this wil parse and compile in one step //NOTE: There are 2 methods here, the one argument one is for normal DRL. builder.addPackageFromDrl( source ); //Use the following instead of above if you are using a DSL: //builder.addPackageFromDrl( source, dsl ); //get the compiled package (which is serializable) Package pkg = builder.getPackage(); //add the package to a rulebase (deploy the rule package). ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); // In any case, be sure we use equality, not identity for facts. System.setProperty(RuleBaseConfiguration.PROPERTY_ASSERT_BEHAVIOR, RuleBaseConfiguration.WM_BEHAVIOR_EQUALITY ); } return ruleBase; } } |
From: John C. <jc...@us...> - 2007-02-04 16:40:05
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/rim/xml In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/test/org/tolven/rim/xml Modified Files: XMLTestBase.java Log Message: Add Trim classes, creator and rule evaluator Index: XMLTestBase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/test/org/tolven/rim/xml/XMLTestBase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XMLTestBase.java 16 Jan 2007 06:13:35 -0000 1.1 --- XMLTestBase.java 4 Feb 2007 16:39:59 -0000 1.2 *************** *** 30,34 **** Marshaller m = jc.createMarshaller(); m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE ); ! m.setProperty( Marshaller.JAXB_FRAGMENT, Boolean.TRUE ); // m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://xxx" ); StringWriter result = new StringWriter( 1000 ); --- 30,34 ---- Marshaller m = jc.createMarshaller(); m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE ); ! // m.setProperty( Marshaller.JAXB_FRAGMENT, Boolean.TRUE ); // m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://xxx" ); StringWriter result = new StringWriter( 1000 ); |
From: John C. <jc...@us...> - 2007-02-04 16:40:05
|
Update of /cvsroot/tolven/tolvenEJB/src/test/rules In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/test/rules Added Files: unitTest3.drl unitTest2.drl unitTest1.drl RuleBaseTests.java Log Message: Add Trim classes, creator and rule evaluator --- NEW FILE: RuleBaseTests.java --- package test.rules; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.Date; import junit.framework.TestCase; import org.drools.RuleBase; import org.drools.RuleBaseConfiguration; import org.drools.RuleBaseFactory; import org.drools.WorkingMemory; import org.drools.compiler.PackageBuilder; import org.drools.compiler.PackageBuilderConfiguration; import org.drools.rule.Package; import org.tolven.trim.Act; import org.tolven.trim.ActClass; import org.tolven.trim.ActMood; import org.tolven.trim.Trim; import org.tolven.trim.util.TrimFactory; public class RuleBaseTests extends TestCase { private static TrimFactory factory = new TrimFactory(); public void testRuleBase1( ) throws Exception { System.out.println( "testRuleBase1 - display Hello from rule"); RuleBase ruleBase = openRuleBase("test/rules/unitTest1.drl"); System.setProperty(RuleBaseConfiguration.PROPERTY_ASSERT_BEHAVIOR, RuleBaseConfiguration.WM_BEHAVIOR_EQUALITY ); //load up the rulebase WorkingMemory workingMemory = ruleBase.newWorkingMemory(); workingMemory.assertObject("Hello"); workingMemory.fireAllRules(); workingMemory.dispose(); } public void testRuleBase2a( ) throws Exception { System.out.println( "testRuleBase2a - assert XXX twice with identity: two XXX display"); System.setProperty(RuleBaseConfiguration.PROPERTY_ASSERT_BEHAVIOR, RuleBaseConfiguration.WM_BEHAVIOR_IDENTITY ); RuleBase ruleBase = openRuleBase("test/rules/unitTest2.drl"); //load up the rulebase WorkingMemory workingMemory = ruleBase.newWorkingMemory(); // With identity, this is two separate facts, with equality, only one workingMemory.assertObject(new String("XXX")); workingMemory.assertObject(new String("XXX")); workingMemory.fireAllRules(); workingMemory.dispose(); } public Act createAct1( ) { Act act = factory.createAct(ActClass.OBS, ActMood.EVN); // act.setInternalId("92994566"); factory.setCodeAsCD( act, "CBC", "MyRADSystem"); factory.addId( act, "4.5.6.7", "id12345"); factory.addId( act, "4.5.6.8", "xxxx9998-123"); factory.addEffectiveTimeAsTS(act, new Date()); return act; } public Trim createTrim1( ) { Trim trim = factory.createTrim(); trim.getActs().add(createAct1()); return trim; } public void testRuleBase2b( ) throws Exception { System.out.println( "testRuleBase2b - assert XXX twice with equality: one XXX display"); System.setProperty(RuleBaseConfiguration.PROPERTY_ASSERT_BEHAVIOR, RuleBaseConfiguration.WM_BEHAVIOR_EQUALITY ); RuleBase ruleBase = openRuleBase("test/rules/unitTest2.drl"); //load up the rulebase WorkingMemory workingMemory = ruleBase.newWorkingMemory(); // With identity, this is two separate facts, with equality, only one workingMemory.assertObject(new String("XXX")); workingMemory.assertObject(new String("XXX")); workingMemory.fireAllRules(); workingMemory.dispose(); } public static class Counter { int count = 0; public void bump() { count++; } } public void testRuleBase3( ) throws Exception { System.out.println( "testRuleBase3 - assert a TRIM object"); System.setProperty(RuleBaseConfiguration.PROPERTY_ASSERT_BEHAVIOR, RuleBaseConfiguration.WM_BEHAVIOR_EQUALITY ); RuleBase ruleBase = openRuleBase("test/rules/unitTest3.drl"); //load up the rulebase WorkingMemory workingMemory = ruleBase.newWorkingMemory(); // Assert a trim object and see what the rules do with it Counter counter = new Counter(); workingMemory.setGlobal("counter", counter); workingMemory.assertObject(createTrim1()); workingMemory.fireAllRules(); workingMemory.dispose(); System.out.println( "Had: " + counter.count + " rule firings"); assertTrue( counter.count==9); } public RuleBase openRuleBase( String ruleFile) throws Exception { //read in the source ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); assertFalse(classLoader==null ); InputStream inputStream = classLoader.getResourceAsStream( ruleFile ); assertFalse(inputStream==null ); Reader source = new InputStreamReader( inputStream ); //optionally read in the DSL (if you are using it). //Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) ); //Use package builder to build up a rule package. //An alternative lower level class called "DrlParser" can also be used... PackageBuilderConfiguration conf = new PackageBuilderConfiguration(); conf.setJavaLanguageLevel( "1.5" ); PackageBuilder builder = new PackageBuilder(conf); //this wil parse and compile in one step //NOTE: There are 2 methods here, the one argument one is for normal DRL. builder.addPackageFromDrl( source ); //Use the following instead of above if you are using a DSL: //builder.addPackageFromDrl( source, dsl ); //get the compiled package (which is serializable) Package pkg = builder.getPackage(); //add the package to a rulebase (deploy the rule package). RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); return ruleBase; } } --- NEW FILE: unitTest3.drl --- package test.rules import java.util.*; import org.tolven.trim.*; import java.lang.Integer; import test.rules.RuleBaseTests.Counter; global RuleBaseTests.Counter counter; /** * See what we can do with a TRIM object */ rule "trim" when $trim: Trim() then for (ActSlot act : $trim.getActs()) assert( act ); counter.bump(); end rule "act is event rule" when $act: Act( moodCode == ActMood.EVN ) then System.out.println( "Act: " + $act.getClassCode() + "-" + $act.getMoodCode() + " is in event mood" ); counter.bump(); end rule "act rule" when $act: Act( $id : id, $effectiveTime : effectiveTime ) then assert( $id ); assert( $effectiveTime ); System.out.println( "Act: " + $act.getClassCode() + "-" + $act.getMoodCode() ); counter.bump(); end rule "act is obs rule" when $act: Act( classCode == ActClass.OBS ) then System.out.println( "Act: " + $act.getClassCode() + "-" + $act.getMoodCode() + " is an Observation" ); counter.bump(); end rule "act is event observation rule" when $act: Act( moodCode == ActMood.EVN, classCode == ActClass.OBS ) then System.out.println( "Act: " + $act.getClassCode() + "-" + $act.getMoodCode() + " is an observation event" ); counter.bump(); end rule "Display ID slot" when $slot: SETIISlot() then for (II ii : $slot.getIIS( )) assert( ii ); counter.bump(); end rule "display II" when $ii: II(); then System.out.println( "ID: " + $ii.getRoot() + "/" + $ii.getExtension() ); counter.bump(); end rule "Display GTS slot" when $slot: GTSSlot() then System.out.println( "TS:" + $slot.getTS( )); counter.bump(); end --- NEW FILE: unitTest2.drl --- package test.rules import java.util.*; /** * Simple rules used for unit tests */ rule "Simple test to make sure rules are working" when $string: String() then System.out.println( $string ); end --- NEW FILE: unitTest1.drl --- package test.rules import java.util.*; /** * Simple rules used for unit tests */ rule "Simple test to make sure rules are working" when $string: String() then System.out.println( $string ); end |
From: John C. <jc...@us...> - 2007-02-04 16:40:05
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/trim In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/test/org/tolven/trim Added Files: ActTests.java Log Message: Add Trim classes, creator and rule evaluator --- NEW FILE: ActTests.java --- package test.org.tolven.trim; import org.tolven.trim.Act; import org.tolven.trim.ActClass; import org.tolven.trim.ActMood; import org.tolven.trim.ObjectFactory; import test.org.tolven.trim.xml.XMLTestBase; public class ActTests extends XMLTestBase { public void testAct1() { ObjectFactory factory = new ObjectFactory(); Act act = factory.createAct(); act.setClassCode(ActClass.OBS); act.setMoodCode(ActMood.EVN); } } |
From: John C. <jc...@us...> - 2007-02-04 16:40:05
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/app Modified Files: MenuLocal.java Added Files: CreatorRemote.java MenuRemote.java CreatorLocal.java Log Message: Add Trim classes, creator and rule evaluator --- NEW FILE: CreatorLocal.java --- package org.tolven.app; import java.util.Map; import javax.xml.bind.JAXBException; import org.tolven.app.entity.MenuStructure; import org.tolven.doc.entity.DocXML; import org.tolven.trim.util.TRIMException; public interface CreatorLocal { /** * Instantiate a new document based on the supplied MenuStructure item which must be role=trim. * the optional "parent" MenuData provides context. For example, a * typical parent would be a specific patient. * This should also be where we do blending. * @param ms The menustructure item, which must have a role of "trim" * @param parent Parent menu data item, if applicable, otherwise, null * @return A new document containing this instantiated template. The document may actually contain a number of * nested templates. But we don't care at this point. */ public DocXML instantiate( MenuStructure ms, Map<String, String> context ) throws JAXBException, TRIMException; public DocXML instantiate( long accountId, String path, Map<String, String> context ) throws JAXBException, TRIMException; } --- NEW FILE: CreatorRemote.java --- package org.tolven.app; import java.util.Map; import javax.xml.bind.JAXBException; import org.tolven.doc.entity.DocXML; import org.tolven.trim.util.TRIMException; public interface CreatorRemote { /** * Instantiate a new document based on the supplied MenuStructure item which must be role=trim. * the optional "parent" MenuData provides context. For example, a * typical parent would be a specific patient. * This should also be where we do blending. * @param ms The menustructure item, which must have a role of "trim" * @param parent Parent menu data item, if applicable, otherwise, null * @return A new document containing this instantiated template. The document may actually contain a number of * nested templates. But we don't care at this point. */ public DocXML instantiate( long accountId, String path, Map<String, String> context ) throws JAXBException, TRIMException; } --- NEW FILE: MenuRemote.java --- package org.tolven.app; import java.util.List; import org.tolven.app.bean.MenuQueryControl; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; public interface MenuRemote { /** * Given a Tolven accountId and the path to a menu item, return the corresponding menustructure object. * @param userId tolven user id * @param path The path is colon-separated, without identifiers. For example, "echr:activity" * @return The MenuStructure object (its parents will also be accessible from this object) */ public MenuStructure findMenuStructure( long accountId, String path ); /** * Given a Tolven accountId, a menustructure and a partial path to a menu item within that menu structure, * return the corresponsing menustructure object. * @param userId tolven user id * @param path The path is colon-separated, without identifiers. For example, if the path of the supplied menu structure is "echr:patient" then this paramater * might contain "results:lab" * @return The MenuStructure object (its parents will also be accessible from this object) */ public MenuStructure findDescendentMenuStructure( long accountId, MenuStructure parent, String path); /** * <p>Given a specific menuStructure and corresponding keys, return the data for that structure. * Some MenuData results are specified by metadata to be single results. However, this method * does nothing different except that the caller can expect a List result with one value in it * in that case. * This query could be fairly complex if filters and such are used so we may use some helper methods to * modularize the query.</p> * <ul> * <li>Find only MenuData matching the specified MenuStructure instance. This significantly and * sometimes completely narrows the result set. The MenuStructure is a surrogate for the account * and/or user and the specific path in the menu hierarchy. this criteria also implicitly enforces * security by preventing access to any account data other than that of the user's account.</li> * <li>The metadata tells us how to sort by default but the user may modify the sort requirements.</li> * <li>Menu data can have an expiration timestamp. The <i>now</i> parameter in query control tells us the * definitive timestamp against which the query can compare. Note: Expired menuData rows can and will be * removed by a background task. Don't depend on expired menuData being present after it has expired.</li> * <li>QueryControl tells us how many rows to return and which row to start with. This allows paging.</li> * <li>Sort criteria may be specified.</li> * <li></li> * </ul> * @param A query control structure carrying the parameters needed for this query including the Metadata * corresponding to the data we want to query, an array of long values corresponding to the path of this * menuStructure NodeKeys corresponding to static menuStructure nodes are zero (but they are not skipped). * Thus, the number of items in this array exactly matches the path specified in the * MenuStructure (which is different from how MenuData stores keyValues. * @return A list of MenuData values matching the criteria */ public List<MenuData> findMenuData( MenuQueryControl ctrl ); /** * Return a count of the number of menuData items specified in the criteria. Offset and limit are ignored. */ public long countMenuData(MenuQueryControl ctrl ); /** * <p>Find a menu data item - this is an exact-match although we just return null if not found (EJB spec says to thrown an error for a singleResult query). * For security purposes, we include * accountId in case someone tries to phish for a menudata item they don't own.</p> */ public MenuData findMenuDataItem( MenuQueryControl ctrl ); /** * <p>We're asked to add a menu item to one of the active menus for this user. * This is a persistence operation because we always know which menu items the user has available on the * browser (although we don't know or care if the user has actually selected that item or not. * For example, is a list of new activity for a user may contain a link saying a patient's lab results are * available to view. The path might be: "echr:pat-123:results:lab". The pane containing that data * is fetched via findMenuData, not this method. Thus, the actual results will be available to the user shortly.</p> * <p>But that result would look silly on the browser all by itself. One would expect that the menu structure * also reflect that patient so that the user can: * <ul> * <li>tell what they are looking at, </li> * <li>return to that patient later,</li> * <li>go to different parts of that patient's record. </li> * </ul> * So, in addition to the target pane, the browser will also request "echr:pat-123:results", * "echr:pat-123" and even "echr" if they are not already present in the browser. The problem is that * in this example, the browser finds "echr" locally and thus doesn't want to ask for it again. * But it does an additioanl <i>navigation validation</i> check by looking for a selector (menuItem) * corresponding to each new container pane as it is received: it wants to be sure there's a way for the user * to get to each pane it has. Thus, in this case "echr" is present but "echr:pat-123:sel" is not * and therefore "echr" must be refreshed. This same logic occurs at all levels: * <table cellspacing="0" border=1"> * <th><td>When this is received by the browser</td><td>And this pane is present </td><td>Request that pane again if this item is missing</td></tr> * <tr><td>echr:pat-123:results:lab</td><td>echr:pat-123:results</td><td>echr:pat-123:results:lab:sel </td></tr> * <tr><td>echr:pat-123:results</td><td>echr:pat-123</td><td>echr:pat-123:results:sel </td></tr> * <tr><td>echr:pat-123</td><td>echr</td><td>echr:pat-123:sel </td></tr> * </table> * Since the browser and the server are processing this asynchronously, we don't know the order this happens. * so, in fact, upon each new pane's arrival, the browser walks up the path checking everything each time. * Eventually, it all shows up. Remember that before this user action occured, we said echr did not contain * a menu item for pat-123. While requesting echr as if pat-123 was indeed part of it, we can't count on knowing that * because of the asynchronous and possibly parallel nature of the interaction. We just get a happy request for * echr assuming pat-123 is there. * </p> * <p> And that's where we come in. When a new pane is requested that doesn't exist on the browser, we need to * immediately tell the server about it so that subsequent requests will get updated menu data. We could tie up the * browser with a synchronous call but that may impact the user experience. Instead, we actually include the * original path (echr:pat-123:results:lab) in each call to the browser. Prior to processing the the request, * we do a which check to make sure the menus are properly updated and if not update it/them. So whichever request * gets to the server/database first insures the update is performed. We do that check and update the menu data * when needed. </p> * <p>Note: It doesn't matter if the menu items we're talking about are actually visible or not as long as they * are present on the browser is all we care about. Visibility is between the browser, the page designer, and the user.</p> * @param ctrl includes the account and parsed path item we want to add. */ public void addMenuItem( MenuQueryControl ctrl ); /** * Create an initial, debugging menu structure for the user * @param account * @return The root node of the MenuStructure */ public MenuStructure createDefaultMenuStructure( Account account ); /** * Return the full menu structure for a user. */ public List<MenuStructure> findFullMenuStructure( long accountId); /** * Given a list of menus, update them in the database * @param menus */ public void updateMenus( List<MenuStructure> menus); /** * Simple method to persist a single menu data object * */ public void persistMenuData( MenuData md ); /** * Look for a set of placeholders associated with this node and if found, load them up. * Don't complain if none are found. * @param root */ public void loadTRIM( long accountId, String name, byte[] trimXML ); /** * Instantiate a new menuDataItem based on the supplied MenuStructure item must be (TRIM) * and optionally use the supplied "parent" MenuData item to qualify the new item. For example, a * typical parent would be patient. * This should also be where we do blending, but we can do that later when we actually have the * template in object form. * @param ms The menustructure item, which must have a role of "trim" * @param parent Parent menu data item, if applicable, otherwise, null * @return the new MenuData item, which has already been persisted */ public MenuData instantiate( MenuStructure ms, MenuData parent ); } Index: MenuLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/MenuLocal.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MenuLocal.java 16 Jan 2007 06:12:48 -0000 1.14 --- MenuLocal.java 4 Feb 2007 16:39:58 -0000 1.15 *************** *** 21,30 **** import java.util.List; - import org.tolven.app.bean.MenuDataWrapper; import org.tolven.app.bean.MenuQueryControl; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; - import org.tolven.doc.entity.DocBase; /** * EJB Session interface for manipulating menu and index structures. --- 21,28 ---- *************** *** 163,166 **** --- 161,181 ---- public void persistMenuData( MenuData md ); + /** + * Instantiate a new menuDataItem based on the supplied MenuStructure item must be (TRIM) + * and optionally use the supplied "parent" MenuData item to qualify the new item. For example, a + * typical parent would be patient. + * This should also be where we do blending, but we can do that later when we actually have the + * template in object form. + * @param ms The menustructure item, which must have a role of "trim" + * @param parent Parent menu data item, if applicable, otherwise, null + * @return the new MenuData item, which has already been persisted + */ + public MenuData instantiate( MenuStructure ms, MenuData parent ); + /** + * Look for a set of placeholders associated with this node and if found, load them up. + * Don't complain if none are found. + * @param root + */ + public void loadTRIM( long accountId, String name, byte[] trimXML ); } |
From: John C. <jc...@us...> - 2007-02-04 16:40:05
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/app/bean Modified Files: MenuBean.java Added Files: AppEvalAdaptor.java CreatorBean.java Log Message: Add Trim classes, creator and rule evaluator Index: MenuBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuBean.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** MenuBean.java 26 Jan 2007 06:45:34 -0000 1.43 --- MenuBean.java 4 Feb 2007 16:39:58 -0000 1.44 *************** *** 14,17 **** --- 14,20 ---- package org.tolven.app.bean; + import java.io.ByteArrayInputStream; + import java.io.IOException; + import java.io.InputStream; import java.util.ArrayList; import java.util.List; *************** *** 19,22 **** --- 22,26 ---- import javax.annotation.EJB; import javax.ejb.Local; + import javax.ejb.Remote; import javax.ejb.Stateless; import javax.persistence.EntityManager; *************** *** 25,28 **** --- 29,33 ---- import org.tolven.app.MenuLocal; + import org.tolven.app.MenuRemote; import org.tolven.app.entity.MSColumn; import org.tolven.app.entity.MenuData; *************** *** 30,34 **** --- 35,41 ---- import org.tolven.core.entity.Account; import org.tolven.doc.DocumentLocal; + import org.tolven.doc.XMLLocal; import org.tolven.doc.entity.DocBase; + import org.tolven.trim.Trim; /** *************** *** 51,59 **** */ @Local(MenuLocal.class) ! public @Stateless class MenuBean implements MenuLocal { @PersistenceContext private EntityManager em; - - /** * @see MenuLocal --- 58,65 ---- */ @Local(MenuLocal.class) ! @Remote(MenuRemote.class) ! public @Stateless class MenuBean implements MenuLocal, MenuRemote { @PersistenceContext private EntityManager em; /** * @see MenuLocal *************** *** 821,824 **** --- 827,883 ---- } + + /** + * Load a TRIM XML to metadata for this account. + * @param accountId + * @param name Name of the node, which must include the full path, for example, echr:patient: + */ + public void loadTRIM( long accountId, String name, byte[] trimXML ) { + MenuStructure root = getRootMenuStructure( em.getReference(Account.class, accountId)); + MenuStructure trim; + try { + trim = this.findDescendentMenuStructure(accountId, root, name); + } catch( Exception e) { + trim = new MenuStructure( + root.getAccount(), root, "trimView.xhtml", null, 0, name, null, "true", null, "trim" ); + } + trim.setTrim(trimXML); + em.merge( trim ); + System.out.println("Trim " + trim.getPath() + " loaded to account " + accountId); + } + + /** + * This is a shortcut, not appropriate for production. See the other instantiate method in Creator. + * Instantiate a new menuDataItem based on the supplied MenuStructure item must be (TRIM) + * and optionally use the supplied "parent" MenuData item to qualify the new item. For example, a + * typical parent would be patient. + * This should also be where we do blending, but we can do that later when we actually have the + * template in object form. + * @param ms The menustructure item, which must have a role of "trim" + * @param parent Parent menu data item, if applicable, otherwise, null + * @return the new MenuData item, which has already been persisted + */ + public MenuData instantiate( MenuStructure ms, MenuData parent ) { + if (!"trim".equals(ms.getRole())) throw new IllegalArgumentException( "Only TRIM metadata can be instantiated"); + MenuData menuData = new MenuData(); + menuData.setMenuStructure(ms); + if (null==parent) { + menuData.setParent01(parent.getParent01()); + menuData.setParent02(parent.getParent02()); + menuData.setParent03(parent.getParent03()); + // Need parent hierarchy, not just immediate parent + if (null==parent.getParent01()) { + menuData.setParent01(parent); + } else if (null==parent.getParent02()) { + menuData.setParent02(parent); + } else if (null==parent.getParent03()) { + menuData.setParent03(parent); + } else if (null==parent.getParent04()) { + menuData.setParent04(parent); + } else throw new IllegalStateException( "Cannot instantiate a 5th level descendent menu data item"); + } + em.persist(menuData); + return menuData; + } public MenuStructure createDefaultMenuStructure( Account account ) { --- NEW FILE: CreatorBean.java --- package org.tolven.app.bean; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.Map; import javax.annotation.EJB; import javax.annotation.Resource; import javax.ejb.EJBContext; import javax.ejb.Local; import javax.ejb.Remote; import javax.ejb.Stateless; import javax.xml.bind.JAXBException; import org.tolven.app.CreatorLocal; import org.tolven.app.CreatorRemote; import org.tolven.app.MenuLocal; import org.tolven.app.entity.MenuStructure; import org.tolven.core.ActivationLocal; import org.tolven.core.entity.TolvenUser; import org.tolven.doc.DocumentLocal; import org.tolven.doc.XMLLocal; import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocXML; import org.tolven.trim.Act; import org.tolven.trim.ActBind; import org.tolven.trim.ActInternal; import org.tolven.trim.ActParticipation; import org.tolven.trim.ActSlot; import org.tolven.trim.InboundActRelationship; import org.tolven.trim.OutboundActRelationship; import org.tolven.trim.Role; import org.tolven.trim.RoleBind; import org.tolven.trim.RoleInternal; import org.tolven.trim.RoleParticipation; import org.tolven.trim.RoleSlot; import org.tolven.trim.Trim; import org.tolven.trim.util.TRIMException; import org.tolven.trim.util.TrimFactory; @Stateless() @Local(CreatorLocal.class) @Remote(CreatorRemote.class) public class CreatorBean implements CreatorLocal, CreatorRemote { // @EJB AccountDAOLocal AccountDAOBean; @EJB ActivationLocal activationBean; @EJB MenuLocal menuBean; @EJB DocumentLocal documentBean; @EJB XMLLocal xmlBean; @Resource EJBContext ejbContext; static final String TRIM_NS = "urn:astm-org:trim:4.0"; TrimFactory factory; public CreatorBean( ) { factory = new TrimFactory( ); } /** * Run throught the TRIM structure and replace bind requests with an internal ID where possible. */ public void scanTrim( Trim trim, Map<String, String> context ) { for (ActSlot actSlot : trim.getActs()) { if (actSlot instanceof Act ) { scanAct( (Act) actSlot, context ); } } } public void scanAct( Act act, Map<String, String> context ) { for (ActParticipation part : act.getParticipations()) { if (part.getRole() instanceof Role) { scanRole( (Role)part.getRole(), context ); } else if (part.getRole() instanceof RoleBind) { part.setRole(bindRole( (RoleBind)part.getRole(), context )); } } for (InboundActRelationship arInbound : act.getInboundActRelationships()) { if ( arInbound.getTarget() instanceof Act) { scanAct( (Act) arInbound.getTarget(), context ); } else if ( arInbound.getTarget() instanceof ActBind) { arInbound.setTarget(bindAct( (ActBind)arInbound.getTarget(), context )); } } for (OutboundActRelationship arOutbound : act.getOutboundActRelationships()) { if ( arOutbound.getSource() instanceof Act) { scanAct( (Act) arOutbound.getSource(), context ); } else if ( arOutbound.getSource() instanceof ActBind) { arOutbound.setSource(bindAct( (ActBind)arOutbound.getSource(), context )); } } } public void scanRole( Role role, Map<String, String> context ) { for ( RoleParticipation part : role.getParticipations()) { if (part.getAct() instanceof Act) { scanAct( (Act)part.getAct(), context ); } else if (part.getAct() instanceof ActBind) { part.setAct(bindAct( (ActBind)part.getAct(), context )); } } } /** * We're only interested in bind requests for an act. Try to find a match in the context. * @param roleBind * @param context - pairs of MS path and MD path * @return */ public ActSlot bindAct( ActBind actBind, Map<String, String> context ) { if (null==context) return actBind; String mdPath = context.get(actBind.getTemplateId()); if (null==mdPath) return actBind; ActInternal actInternal = factory.createActInternal(actBind.getClassCode(), actBind.getMoodCode(), mdPath); return actInternal; } /** * We're only interested in bind requests for a Role. Try to find a match in parent. * @param roleBind * @param context - pairs of MS path and MD path * @return */ public RoleSlot bindRole( RoleBind roleBind, Map<String, String> context ) { if (null==context) return roleBind; String mdPath = context.get(roleBind.getTemplateId()); if (null==mdPath) return roleBind; RoleInternal roleInternal = factory.createRoleInternal(roleBind.getClassCode(), mdPath); return roleInternal; } /** * Instantiate a new document based on the supplied MenuStructure item which must be role=trim. * the optional "parent" MenuData provides context. For example, a * typical parent would be a specific patient. * This should also be where we do blending. * @param ms The menustructure item, which must have a role of "trim" * @param parent Parent menu data item, if applicable, otherwise, null * @return A new document containing this instantiated template. The document may actually contain a number of * nested templates. But we don't care at this point. * @throws CCRException * @throws JAXBException * @throws TRIMException */ public DocXML instantiate( MenuStructure ms, Map<String, String> context ) throws JAXBException, TRIMException { if (!"trim".equals(ms.getRole())) throw new IllegalArgumentException( "Only TRIM metadata can be instantiated"); TolvenUser user = activationBean.findUser(ejbContext.getCallerPrincipal().getName()); DocXML docXML = documentBean.createXMLDocument( TRIM_NS, user.getId(), ms.getAccount().getId() ); System.out.println( "Document created, id: " + docXML.getId()); ByteArrayInputStream bs = new ByteArrayInputStream(ms.getTrim() ); Trim trim = (Trim) xmlBean.unmarshal(TRIM_NS, bs); scanTrim( trim, context); // OK, now put the finished TRIM back into XML and store in the document. ByteArrayOutputStream trimXML = new ByteArrayOutputStream() ; xmlBean.marshalTRIM(trim, trimXML); docXML.setContent(trimXML.toByteArray()); // Document remains in new status, but is saved (persist/merge) documentBean.saveDocument(docXML); return docXML; } /** * Appropriate for remote invocation, no objects have to move around * @param accountId * @param ms * @param parent * @return * @throws JAXBException * @throws TRIMException */ public DocXML instantiate( long accountId, String path, Map<String, String> context ) throws JAXBException, TRIMException { MenuStructure ms = menuBean.findMenuStructure(accountId, path); return instantiate( ms, context); } } --- NEW FILE: AppEvalAdaptor.java --- package org.tolven.app.bean; import java.util.List; import org.drools.WorkingMemory; import org.tolven.app.MenuLocal; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; /** * When processing a transaction, this class provides a connection between the Rule engine and the application (menu data and menuStructure). * It is account-specific and there should never be more than one per account. It can be reused for multiple * transactions. * This object needs to be tied to a session bean instance in order to work, it is not a session bean on its own. * * @author John Churin * */ public class AppEvalAdaptor { private Account account; private MenuLocal menuBean; public MenuLocal getMenuBean() { return menuBean; } public void setMenuBean(MenuBean menuBean) { this.menuBean = menuBean; } /** * Associate this object with working memory as a global and thus allowing callbacks. Also, associate it * with a MenuBean that helps it do its work. * @param menuBean a Menu bean * @param wm rule working memory */ public void init( MenuLocal menuBean, WorkingMemory wm ) { if (account==null) throw new IllegalStateException("Missing Account"); this.menuBean = menuBean; wm.setGlobal("app",this); assertAll( wm ); } /** * Constructor requires an account * @param account */ public AppEvalAdaptor( Account account) { this.account = account; } /** * When this adaptor is initialized, it should assert anything appropriate into working memory. * This will allow the rule engine to see facts from application metadata. * In this case, we can just assert all menuStructure objects for this account into WM. We'll let * metadata and new data meet up in the rule engine. */ protected void assertAll( WorkingMemory wm ) { if (account==null) throw new IllegalStateException("Missing Account"); if (menuBean==null) throw new IllegalStateException("Missing MenuBean"); if (wm==null) throw new IllegalArgumentException("Missing working memory argument"); List<MenuStructure> menus = menuBean.findFullMenuStructure( getAccount().getId()); for (MenuStructure ms : menus) { wm.assertObject(ms); } } public MenuData findMenuData( MenuStructure ms, String path ) { MenuQueryControl ctrl = new MenuQueryControl(); ctrl.setMenuStructure(ms); ctrl.setRequestedPath(new MenuPath(path)); return menuBean.findMenuDataItem(ctrl); } public Account getAccount() { return account; } public void setAccount(Account account) { this.account = account; } /** * Equality is the same as Account equality */ @Override public boolean equals(Object obj) { if (!(obj instanceof AppEvalAdaptor)) return false; return getAccount().equals(((AppEvalAdaptor)obj).getAccount()); } /** * Hash is the same as Account hash */ @Override public int hashCode() { return getAccount().hashCode(); } @Override public String toString() { return this.getClass().getName() + " for account " + getAccount().getId(); } } |
From: John C. <jc...@us...> - 2007-02-04 16:40:04
|
Update of /cvsroot/tolven/tolvenEJB/resources/xsd In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/resources/xsd Added Files: trim4.xsd Log Message: Add Trim classes, creator and rule evaluator --- NEW FILE: trim4.xsd --- <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns="urn:tolven-org:trim:4.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:trim="urn:tolven-org:trim:4.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" targetNamespace="urn:tolven-org:trim:4.0" elementFormDefault="qualified" attributeFormDefault="unqualified" jaxb:version="2.1" jaxb:extensionBindingPrefixes="xjc"> <xs:annotation> <xs:appinfo> <jaxb:globalBindings> <xjc:simple/> </jaxb:globalBindings> </xs:appinfo> </xs:annotation> <xs:element name="trim" type="Trim"/> <xs:complexType name="Trim"> <xs:sequence> <xs:element name="act" type="ActSlot" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!--xs:complexType name="InfrastructureRoot" abstract="true"> <xs:sequence> <xs:element name="templateId" type="url" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="realmCode" type="RealmCode" minOccurs="0" maxOccurs="unbounded"/> [...1206 lines suppressed...] <xs:enumeration value="RECENT"/> <xs:enumeration value="PREVSUM"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="RealmCode"> <xs:restriction base="cs"> <xs:enumeration value="US"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="RelationshipConjunction"> <xs:annotation> <xs:documentation>vocSet: T10365 (C-0-T10365-cpt)</xs:documentation> </xs:annotation> <xs:restriction base="cs"> <xs:enumeration value="AND"/> <xs:enumeration value="XOR"/> <xs:enumeration value="OR"/> </xs:restriction> </xs:simpleType> </xs:schema> |
From: John C. <jc...@us...> - 2007-02-04 16:40:04
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/doc/entity Modified Files: DocXML.java Log Message: Add Trim classes, creator and rule evaluator Index: DocXML.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity/DocXML.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DocXML.java 28 Jan 2007 06:52:29 -0000 1.5 --- DocXML.java 4 Feb 2007 16:39:58 -0000 1.6 *************** *** 14,35 **** package org.tolven.doc.entity; - import java.io.IOException; import java.io.Serializable; - import java.io.StringReader; - import java.io.StringWriter; - import java.util.HashMap; - import java.util.Map; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; - import javax.persistence.Transient; - import javax.xml.bind.JAXBContext; - import javax.xml.bind.JAXBElement; - import javax.xml.bind.JAXBException; - import javax.xml.bind.Marshaller; - import javax.xml.bind.Unmarshaller; - import javax.xml.namespace.QName; - import javax.xml.transform.stream.StreamSource; @Entity --- 14,22 ---- *************** *** 42,48 **** private static final long serialVersionUID = 2L; - // @Transient - // private Object binding; - @Column(name="XML_NS") private String xmlNS; --- 29,32 ---- *************** *** 68,73 **** /** * When non-null, specifies the XML to Java binding context. For example, "org.tolven.ccr" ! * or "org.tolven.rim". ! * The XmlNamespace attribute mut already be available. * @return */ --- 52,57 ---- /** * When non-null, specifies the XML to Java binding context. For example, "org.tolven.ccr" ! * or "org.tolven.trim". ! * The XmlNamespace attribute must already be available. * @return */ *************** *** 76,88 **** if (ns==null) throw new IllegalArgumentException( "Namespace required to determine binding context" ); if ("urn:astm-org:CCR".equals(ns)) return "org.tolven.ccr"; return null; } - - // /** - // * Used for unit testing only - // */ - // public void resetBinding( ) { - // binding = null; - // } public String getXmlName() { --- 60,66 ---- if (ns==null) throw new IllegalArgumentException( "Namespace required to determine binding context" ); if ("urn:astm-org:CCR".equals(ns)) return "org.tolven.ccr"; + if ("urn:astm-org:trim:4.0".equals(ns)) return "org.tolven.trim"; return null; } public String getXmlName() { |
From: John C. <jc...@us...> - 2007-02-04 16:40:04
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/core/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/test/org/tolven/core/bean Removed Files: TolvenPropertiesTest.java Log Message: Add Trim classes, creator and rule evaluator --- TolvenPropertiesTest.java DELETED --- |
From: John C. <jc...@us...> - 2007-02-04 16:40:03
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/trim/xml In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/test/org/tolven/trim/xml Added Files: ActXMLTests.java XMLTestBase.java Log Message: Add Trim classes, creator and rule evaluator --- NEW FILE: XMLTestBase.java --- package test.org.tolven.trim.xml; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import javax.xml.transform.stream.StreamSource; import junit.framework.TestCase; import org.tolven.trim.Trim; public abstract class XMLTestBase extends TestCase{ private JAXBContext jc = null; public static final String BINDING = "org.tolven.trim"; public JAXBContext setupJAXBContext() throws JAXBException { if (jc==null) { System.out.println( "loading JAXB binding context: " + BINDING ); jc = JAXBContext.newInstance( BINDING ); } return jc; } public String marshal( Trim top) throws JAXBException, IOException { JAXBContext jc = setupJAXBContext(); Marshaller m = jc.createMarshaller(); m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE ); // m.setProperty( Marshaller.JAXB_FRAGMENT, Boolean.TRUE ); m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://www.tolven.org/schema/trim4.xsd" ); StringWriter result = new StringWriter( 1000 ); m.marshal( top, result ); result.close(); return result.toString(); } public Trim unmarshal( String xml ) throws JAXBException, IOException { JAXBContext jc = setupJAXBContext(); Unmarshaller u = jc.createUnmarshaller(); Object o = u.unmarshal( new StreamSource( new StringReader( xml ) ) ); return (Trim) o; } } --- NEW FILE: ActXMLTests.java --- package test.org.tolven.trim.xml; import java.io.IOException; import javax.xml.bind.JAXBException; import org.tolven.trim.Act; import org.tolven.trim.ActClass; import org.tolven.trim.ActInternal; import org.tolven.trim.ActMood; import org.tolven.trim.ActNull; import org.tolven.trim.ActSlot; import org.tolven.trim.Trim; import org.tolven.trim.util.TrimFactory; public class ActXMLTests extends XMLTestBase { TrimFactory factory=null; @Override protected void setUp() throws Exception { factory = new TrimFactory(); super.setUp(); } public Act createAct1( ) { Act act = factory.createAct(ActClass.OBS, ActMood.EVN); // act.setInternalId("92994566"); factory.setCodeAsCD( act, "CBC", "MyRADSystem"); factory.addId( act, "4.5.6.7", "id12345"); factory.addId( act, "4.5.6.8", "xxxx9998-123"); return act; } public void testAct1() throws JAXBException, IOException { this.setupJAXBContext(); // Create an object graph Trim trim = factory.createTrim(); trim.getActs().add(createAct1()); // Marshal to XML. String xml = marshal(trim ); System.out.println( xml ); // Now unmarshal back to objects Trim trim2 = unmarshal(xml); for (ActSlot act : trim2.getActs()) { if (act instanceof Act ) { System.out.println( "TRIM Act: " + ((Act)act).getClassCode() + "-" + ((Act)act).getMoodCode()); } if (act instanceof ActInternal ) { System.out.println( "TRIM Act Internal: " + ((ActInternal)act).getInternalId()); } if (act instanceof ActNull ) { System.out.println( "TRIM Act null, flavor: " + ((ActNull)act).getFlavor()); } } } } |
From: John C. <jc...@us...> - 2007-02-04 16:40:03
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/trim/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/trim/util Added Files: TrimFactory.java TRIMException.java Log Message: Add Trim classes, creator and rule evaluator --- NEW FILE: TRIMException.java --- package org.tolven.trim.util; public class TRIMException extends Exception { public TRIMException( String error ) { super( error); } } --- NEW FILE: TrimFactory.java --- package org.tolven.trim.util; import java.text.SimpleDateFormat; import java.util.Date; import org.tolven.trim.Act; import org.tolven.trim.ActClass; import org.tolven.trim.ActInternal; import org.tolven.trim.ActMood; import org.tolven.trim.ActNull; import org.tolven.trim.ActParticipation; import org.tolven.trim.ActSlot; import org.tolven.trim.CD; import org.tolven.trim.CE; import org.tolven.trim.II; import org.tolven.trim.InboundActRelationship; import org.tolven.trim.NullFlavor; import org.tolven.trim.ObjectFactory; import org.tolven.trim.OutboundActRelationship; import org.tolven.trim.Participation; import org.tolven.trim.ParticipationType; import org.tolven.trim.Role; import org.tolven.trim.RoleClass; import org.tolven.trim.RoleInternal; import org.tolven.trim.RoleReference; import org.tolven.trim.RoleSlot; public class TrimFactory extends ObjectFactory { private SimpleDateFormat HL7TSformat = new SimpleDateFormat("yyyyMMddHHmmssZZ"); public Act createAct( ActClass classCode, ActMood moodCode) { Act act = createAct(); act.setClassCode(classCode); act.setMoodCode(moodCode); return act; } public ActNull createActNull( NullFlavor flavor ) { ActNull act = createActNull(); act.setFlavor(flavor); return act; } public ActInternal createActInternal( ActClass classCode, ActMood moodCode, String internalId ) { ActInternal act = createActInternal(); act.setClassCode(classCode); act.setMoodCode(moodCode); act.setInternalId(internalId); return act; } public void addId( Act act, String root, String extension) { II ii = createII(); ii.setExtension(extension); ii.setRoot(root); if (null==act.getId()) act.setId(createSETIISlot()); act.getId().getIIS().add(ii); act.getId().setNull(null); } public void setIdAsNull( Act act, NullFlavor nullFlavor) { if (null==act.getId()) act.setId(createSETIISlot()); act.getId().getIIS().clear(); act.getId().setNull(nullFlavor); } public void setCodeAsCD( Act act, String code, String codeSystem) { CD cd = createCD(); cd.setCode(code); cd.setCodeSystem(codeSystem); if (null==act.getCode()) act.setCode(createCDSlot()); act.getCode().setCE(null); act.getCode().setFlavor(null); act.getCode().setCD(cd); } public void setCodeAsCE( Act act, String code, String codeSystem) { CE ce = createCE(); ce.setCode(code); ce.setCodeSystem(codeSystem); if (null==act.getCode()) act.setCode(createCDSlot()); act.getCode().setCD(null); act.getCode().setFlavor(null); act.getCode().setCE(ce); } public void setCodeAsNull( Act act, NullFlavor nullFlavor) { if (null==act.getCode()) act.setCode(createCDSlot()); act.getCode().setCD(null); act.getCode().setFlavor(nullFlavor); act.getCode().setCE(null); } public void addEffectiveTimeAsTS( Act act, Date time) { if (null==act.getEffectiveTime()) act.setEffectiveTime(createGTSSlot()); String ts = HL7TSformat.format(time); // act.getEffectiveTime().getIVLTS().clear(); act.getEffectiveTime().getTS().add(ts); act.getEffectiveTime().setNull(null); } public void setEffectiveTimeAsNull( Act act, NullFlavor nullFlavor) { if (null==act.getEffectiveTime()) act.setEffectiveTime(createGTSSlot()); act.getEffectiveTime().getIVLTS().clear(); act.getEffectiveTime().getTS().clear(); act.getEffectiveTime().setNull(nullFlavor); } public Role createRole( RoleClass roleClass ) { Role role = createRole(); role.setClassCode(roleClass); return role; } public RoleInternal createRoleInternal( RoleClass roleClass, String id ) { RoleInternal role = createRoleInternal(); role.setClassCode( roleClass); role.setInternalId(id); return role; } public II createII(String root, String extension ) { II ii = createII(); ii.setRoot(root); ii.setExtension(extension); return ii; } public RoleReference createRoleReference( RoleClass roleClass, String root, String extension ) { RoleReference role = createRoleReference(); role.setClassCode(roleClass); createII( root, extension); role.getId().getIIS().add(createII( root, extension)); return role; } public ActParticipation createActParticipation( ParticipationType type, RoleSlot role ) { ActParticipation participation = createActParticipation(); participation.setTypeCode(type); participation.setRole(role); return participation; } public void addParticipation( Act act, ActParticipation participation ) { act.getParticipations().add(participation); } public void addInboundActRelationship( Act act, InboundActRelationship ar ) { act.getInboundActRelationships().add(ar); } public void addOutboundActRelationship( Act act, OutboundActRelationship ar ) { act.getOutboundActRelationships().add(ar); } } |
From: John C. <jc...@us...> - 2007-02-04 16:39:59
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/doc/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/test/org/tolven/doc/entity Removed Files: InvitationTest.java Log Message: Add Trim classes, creator and rule evaluator --- InvitationTest.java DELETED --- |
From: John C. <jc...@us...> - 2007-02-04 16:39:58
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/app/entity Modified Files: MenuStructure.java MenuData.java Log Message: Add Trim classes, creator and rule evaluator Index: MenuStructure.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity/MenuStructure.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MenuStructure.java 16 Jan 2007 06:12:47 -0000 1.10 --- MenuStructure.java 4 Feb 2007 16:39:57 -0000 1.11 *************** *** 23,26 **** --- 23,27 ---- import java.util.Stack; + import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; *************** *** 30,33 **** --- 31,35 ---- import javax.persistence.GenerationType; import javax.persistence.Id; + import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; *************** *** 152,155 **** --- 154,162 ---- private String repeating; + @Lob + @Basic(fetch=FetchType.LAZY) + @Column(name="TRIM") + private byte[] trim; + /** * The path string is computed, not set. This is where we do it by climbing up the path to the root. *************** *** 382,384 **** --- 389,399 ---- } + public byte[] getTrim() { + return trim; + } + + public void setTrim(byte[] trim) { + this.trim = trim; + } + } Index: MenuData.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity/MenuData.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MenuData.java 16 Jan 2007 06:12:47 -0000 1.13 --- MenuData.java 4 Feb 2007 16:39:57 -0000 1.14 *************** *** 16,19 **** --- 16,20 ---- import java.io.Serializable; import java.util.Date; + import java.util.Map; import java.util.Stack; *************** *** 293,297 **** --- 294,318 ---- calculatePath(); } + /** + * Use the current path to populate a context map. This consists of the path without ids for the name + * and the path with ids for the value. Context comes form each of the non-null parents. + */ + public void populateContext( Map<String, String> context ) { + if (null!=getParent01()) { + context.put(getParent01().getPath(), getParent01().getMenuStructure().getPath()); + } + if (null!=getParent02()) { + context.put(getParent02().getPath(), getParent02().getMenuStructure().getPath()); + } + if (null!=getParent03()) { + context.put(getParent03().getPath(), getParent03().getMenuStructure().getPath()); + } + if (null!=getParent04()) { + context.put(getParent03().getPath(), getParent04().getMenuStructure().getPath()); + } + } + + /** * Account is denormalized from MenuStructure into MenuData. We need it here for performance and security. * For performance, we avoid a join with MenuStructure and for security, we can verify that the user |
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/trim In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21577/src/org/tolven/trim Added Files: TelecommunicationAddressUse.java ActRelationshipSplit.java ActClass.java ContextControl.java ActMood.java RoleLinkType.java EntityDeterminer.java ObjectFactory.java ActStatusSlot.java Observation.java ActBind.java Trim.java EntityNamePartType.java CV.java package-info.java RoleClass.java IVLINT.java EntityClass.java CDSlot.java RealmCode.java RoleParticipations.java OutboundActRelationship.java RoleReference.java CESlot.java EntityNameUse.java Slot.java II.java TsBoundary.java IntegrityCheckAlgorithm.java RoleBind.java GTSSlot.java ActRelationshipJoin.java TELFieldType.java ParticipationType.java ParticipationSubset.java AddressPartType.java GTS.java ActReference.java URL.java ObservationValueSlot.java ST.java IVLINTSlot.java CR.java ActStatus.java RoleParticipation.java InboundActRelationship.java RoleStatus.java SETCESlot.java ActParticipations.java RoleSlot.java EntityStatus.java ParticipationSignature.java IVLTS.java CD.java PQ.java ActParticipation.java NullFlavor.java ActRelationshipType.java TSSlot.java BL.java ActRelationshipCheckpoint.java AddressUse.java ActNull.java ActRelationshipSubset.java IntegrityCheckType.java RoleInternal.java PostalAddressUse.java ED.java Participation.java BLSlot.java DataType.java STSlot.java RoleNull.java ActSlot.java EntityNamePartQualifier.java UpdateCode.java BinaryDataEncoding.java IntegrityCheck.java RelationshipConjunction.java CompressionAlgorithm.java ActRelationship.java ActInternal.java SETIISlot.java SetOperator.java TimingEvent.java Act.java Role.java EDSlot.java CE.java Log Message: Add Trim classes, creator and rule evaluator --- NEW FILE: EntityStatus.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for EntityStatus. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="EntityStatus"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="nullified"/> * <enumeration value="normal"/> * <enumeration value="active"/> * <enumeration value="terminated"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "EntityStatus") @XmlEnum public enum EntityStatus { @XmlEnumValue("nullified") NULLIFIED("nullified"), @XmlEnumValue("normal") NORMAL("normal"), @XmlEnumValue("active") ACTIVE("active"), @XmlEnumValue("terminated") TERMINATED("terminated"); private final String value; EntityStatus(String v) { value = v; } public String value() { return value; } public static EntityStatus fromValue(String v) { for (EntityStatus c: EntityStatus.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } } --- NEW FILE: BLSlot.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for BLSlot complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="BLSlot"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}Slot"> * <choice> * <element name="null" type="{urn:tolven-org:trim:4.0}NullFlavor" minOccurs="0"/> * <element name="BL" type="{urn:tolven-org:trim:4.0}BL" minOccurs="0"/> * </choice> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "BLSlot", propOrder = { "bl", "_null" }) public class BLSlot extends Slot { @XmlElement(name = "BL") protected BL bl; @XmlElement(name = "null") protected NullFlavor _null; /** * Gets the value of the bl property. * * @return * possible object is * {@link BL } * */ public BL getBL() { return bl; } /** * Sets the value of the bl property. * * @param value * allowed object is * {@link BL } * */ public void setBL(BL value) { this.bl = value; } /** * Gets the value of the null property. * * @return * possible object is * {@link NullFlavor } * */ public NullFlavor getNull() { return _null; } /** * Sets the value of the null property. * * @param value * allowed object is * {@link NullFlavor } * */ public void setNull(NullFlavor value) { this._null = value; } } --- NEW FILE: ActMood.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActMood. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="ActMood"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="APT"/> * <enumeration value="ARQ"/> * <enumeration value="DEF"/> * <enumeration value="EVN"/> * <enumeration value="EVN.CRT"/> * <enumeration value="EXPEC"/> * <enumeration value="GOL"/> * <enumeration value="INT"/> * <enumeration value="OPT"/> * <enumeration value="PERM"/> * <enumeration value="PERMRQ"/> * <enumeration value="PRMS"/> * <enumeration value="PRP"/> * <enumeration value="RMD"/> * <enumeration value="RQO"/> * <enumeration value="RSK"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "ActMood") @XmlEnum public enum ActMood { APT("APT"), ARQ("ARQ"), DEF("DEF"), EVN("EVN"), @XmlEnumValue("EVN.CRT") EVN_CRT("EVN.CRT"), EXPEC("EXPEC"), GOL("GOL"), INT("INT"), OPT("OPT"), PERM("PERM"), PERMRQ("PERMRQ"), PRMS("PRMS"), PRP("PRP"), RMD("RMD"), RQO("RQO"), RSK("RSK"); private final String value; ActMood(String v) { value = v; } public String value() { return value; } public static ActMood fromValue(String v) { for (ActMood c: ActMood.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } } --- NEW FILE: SetOperator.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for SetOperator. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="SetOperator"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="H"/> * <enumeration value="E"/> * <enumeration value="I"/> * <enumeration value="A"/> * <enumeration value="P"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "SetOperator") @XmlEnum public enum SetOperator { H, E, I, A, P; public String value() { return name(); } public static SetOperator fromValue(String v) { return valueOf(v); } } --- NEW FILE: EDSlot.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for EDSlot complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="EDSlot"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}Slot"> * <choice> * <element name="null" type="{urn:tolven-org:trim:4.0}NullFlavor" minOccurs="0"/> * <element name="ST" type="{urn:tolven-org:trim:4.0}ST" minOccurs="0"/> * <element name="ED" type="{urn:tolven-org:trim:4.0}ED" minOccurs="0"/> * <element name="reference" type="{urn:tolven-org:trim:4.0}TELFieldType" maxOccurs="unbounded" minOccurs="0"/> * </choice> * <attribute name="language" type="{urn:tolven-org:trim:4.0}cs" /> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EDSlot", propOrder = { "references", "ed", "st", "_null" }) public class EDSlot extends Slot { @XmlElement(name = "reference") protected List<TELFieldType> references; @XmlElement(name = "ED") protected ED ed; @XmlElement(name = "ST") protected ST st; @XmlElement(name = "null") protected NullFlavor _null; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String language; /** * Gets the value of the references property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the references property. * * <p> * For example, to add a new item, do as follows: * <pre> * getReferences().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TELFieldType } * * */ public List<TELFieldType> getReferences() { if (references == null) { references = new ArrayList<TELFieldType>(); } return this.references; } /** * Gets the value of the ed property. * * @return * possible object is * {@link ED } * */ public ED getED() { return ed; } /** * Sets the value of the ed property. * * @param value * allowed object is * {@link ED } * */ public void setED(ED value) { this.ed = value; } /** * Gets the value of the st property. * * @return * possible object is * {@link ST } * */ public ST getST() { return st; } /** * Sets the value of the st property. * * @param value * allowed object is * {@link ST } * */ public void setST(ST value) { this.st = value; } /** * Gets the value of the null property. * * @return * possible object is * {@link NullFlavor } * */ public NullFlavor getNull() { return _null; } /** * Sets the value of the null property. * * @param value * allowed object is * {@link NullFlavor } * */ public void setNull(NullFlavor value) { this._null = value; } /** * Gets the value of the language property. * * @return * possible object is * {@link String } * */ public String getLanguage() { return language; } /** * Sets the value of the language property. * * @param value * allowed object is * {@link String } * */ public void setLanguage(String value) { this.language = value; } } --- NEW FILE: InboundActRelationship.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for InboundActRelationship complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="InboundActRelationship"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}ActRelationship"> * <sequence> * <element name="target" type="{urn:tolven-org:trim:4.0}ActSlot"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InboundActRelationship", propOrder = { "target" }) public class InboundActRelationship extends ActRelationship { @XmlElement(required = true) protected ActSlot target; /** * Gets the value of the target property. * * @return * possible object is * {@link ActSlot } * */ public ActSlot getTarget() { return target; } /** * Sets the value of the target property. * * @param value * allowed object is * {@link ActSlot } * */ public void setTarget(ActSlot value) { this.target = value; } } --- NEW FILE: RelationshipConjunction.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for RelationshipConjunction. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="RelationshipConjunction"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="AND"/> * <enumeration value="XOR"/> * <enumeration value="OR"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "RelationshipConjunction") @XmlEnum public enum RelationshipConjunction { AND, XOR, OR; public String value() { return name(); } public static RelationshipConjunction fromValue(String v) { return valueOf(v); } } --- NEW FILE: OutboundActRelationship.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for OutboundActRelationship complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="OutboundActRelationship"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}ActRelationship"> * <sequence> * <element name="source" type="{urn:tolven-org:trim:4.0}ActSlot"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OutboundActRelationship", propOrder = { "source" }) public class OutboundActRelationship extends ActRelationship { @XmlElement(required = true) protected ActSlot source; /** * Gets the value of the source property. * * @return * possible object is * {@link ActSlot } * */ public ActSlot getSource() { return source; } /** * Sets the value of the source property. * * @param value * allowed object is * {@link ActSlot } * */ public void setSource(ActSlot value) { this.source = value; } } --- NEW FILE: ActBind.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActBind complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="ActBind"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}ActSlot"> * <sequence> * <element name="classCode" type="{urn:tolven-org:trim:4.0}ActClass" minOccurs="0"/> * <element name="moodCode" type="{urn:tolven-org:trim:4.0}ActMood" minOccurs="0"/> * <element name="templateId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ActBind", propOrder = { "classCode", "moodCode", "templateId" }) public class ActBind extends ActSlot { protected ActClass classCode; protected ActMood moodCode; protected String templateId; /** * Gets the value of the classCode property. * * @return * possible object is * {@link ActClass } * */ public ActClass getClassCode() { return classCode; } /** * Sets the value of the classCode property. * * @param value * allowed object is * {@link ActClass } * */ public void setClassCode(ActClass value) { this.classCode = value; } /** * Gets the value of the moodCode property. * * @return * possible object is * {@link ActMood } * */ public ActMood getMoodCode() { return moodCode; } /** * Sets the value of the moodCode property. * * @param value * allowed object is * {@link ActMood } * */ public void setMoodCode(ActMood value) { this.moodCode = value; } /** * Gets the value of the templateId property. * * @return * possible object is * {@link String } * */ public String getTemplateId() { return templateId; } /** * Sets the value of the templateId property. * * @param value * allowed object is * {@link String } * */ public void setTemplateId(String value) { this.templateId = value; } } --- NEW FILE: EntityDeterminer.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for EntityDeterminer. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="EntityDeterminer"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="INSTANCE"/> * <enumeration value="KIND"/> * <enumeration value="QUANTIFIED_KIND"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "EntityDeterminer") @XmlEnum public enum EntityDeterminer { INSTANCE, KIND, QUANTIFIED_KIND; public String value() { return name(); } public static EntityDeterminer fromValue(String v) { return valueOf(v); } } --- NEW FILE: IVLINT.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for IVL_INT complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="IVL_INT"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="low" type="{urn:tolven-org:trim:4.0}int" minOccurs="0"/> * <element name="high" type="{urn:tolven-org:trim:4.0}int" minOccurs="0"/> * <element name="center" type="{urn:tolven-org:trim:4.0}int" minOccurs="0"/> * <element name="width" type="{urn:tolven-org:trim:4.0}int" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "IVL_INT", propOrder = { "low", "high", "center", "width" }) public class IVLINT { protected Integer low; protected Integer high; protected Integer center; protected Integer width; /** * Gets the value of the low property. * * @return * possible object is * {@link Integer } * */ public Integer getLow() { return low; } /** * Sets the value of the low property. * * @param value * allowed object is * {@link Integer } * */ public void setLow(Integer value) { this.low = value; } /** * Gets the value of the high property. * * @return * possible object is * {@link Integer } * */ public Integer getHigh() { return high; } /** * Sets the value of the high property. * * @param value * allowed object is * {@link Integer } * */ public void setHigh(Integer value) { this.high = value; } /** * Gets the value of the center property. * * @return * possible object is * {@link Integer } * */ public Integer getCenter() { return center; } /** * Sets the value of the center property. * * @param value * allowed object is * {@link Integer } * */ public void setCenter(Integer value) { this.center = value; } /** * Gets the value of the width property. * * @return * possible object is * {@link Integer } * */ public Integer getWidth() { return width; } /** * Sets the value of the width property. * * @param value * allowed object is * {@link Integer } * */ public void setWidth(Integer value) { this.width = value; } } --- NEW FILE: RoleParticipation.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for RoleParticipation complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="RoleParticipation"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}Participation"> * <sequence> * <element name="act" type="{urn:tolven-org:trim:4.0}ActSlot"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RoleParticipation", propOrder = { "act" }) public class RoleParticipation extends Participation { @XmlElement(required = true, nillable = true) protected ActSlot act; /** * Gets the value of the act property. * * @return * possible object is * {@link ActSlot } * */ public ActSlot getAct() { return act; } /** * Sets the value of the act property. * * @param value * allowed object is * {@link ActSlot } * */ public void setAct(ActSlot value) { this.act = value; } } --- NEW FILE: DataType.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for DataType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="DataType"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DataType") @XmlSeeAlso({ CV.class }) public class DataType { } --- NEW FILE: EntityNamePartQualifier.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for EntityNamePartQualifier. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="EntityNamePartQualifier"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="LS"/> * <enumeration value="IN"/> * <enumeration value="TITLE"/> * <enumeration value="AC"/> * <enumeration value="NB"/> * <enumeration value="PR"/> * <enumeration value="VV"/> * <enumeration value="AD"/> * <enumeration value="BR"/> * <enumeration value="SP"/> * <enumeration value="CL"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "EntityNamePartQualifier") @XmlEnum public enum EntityNamePartQualifier { LS, IN, TITLE, AC, NB, PR, VV, AD, BR, SP, CL; public String value() { return name(); } public static EntityNamePartQualifier fromValue(String v) { return valueOf(v); } } --- NEW FILE: GTSSlot.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for GTSSlot complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="GTSSlot"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}Slot"> * <choice> * <element name="null" type="{urn:tolven-org:trim:4.0}NullFlavor" minOccurs="0"/> * <element name="TS" type="{urn:tolven-org:trim:4.0}TS" maxOccurs="unbounded" minOccurs="0"/> * <element name="IVL_TS" type="{urn:tolven-org:trim:4.0}IVL_TS" maxOccurs="unbounded" minOccurs="0"/> * </choice> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GTSSlot", propOrder = { "ivlts", "ts", "_null" }) public class GTSSlot extends Slot { @XmlElement(name = "IVL_TS") protected List<IVLTS> ivlts; @XmlElement(name = "TS") protected List<String> ts; @XmlElement(name = "null") protected NullFlavor _null; /** * Gets the value of the ivlts property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the ivlts property. * * <p> * For example, to add a new item, do as follows: * <pre> * getIVLTS().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link IVLTS } * * */ public List<IVLTS> getIVLTS() { if (ivlts == null) { ivlts = new ArrayList<IVLTS>(); } return this.ivlts; } /** * Gets the value of the ts property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the ts property. * * <p> * For example, to add a new item, do as follows: * <pre> * getTS().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getTS() { if (ts == null) { ts = new ArrayList<String>(); } return this.ts; } /** * Gets the value of the null property. * * @return * possible object is * {@link NullFlavor } * */ public NullFlavor getNull() { return _null; } /** * Sets the value of the null property. * * @param value * allowed object is * {@link NullFlavor } * */ public void setNull(NullFlavor value) { this._null = value; } } --- NEW FILE: BinaryDataEncoding.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for BinaryDataEncoding. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="BinaryDataEncoding"> * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN"> * <enumeration value="B64"/> * <enumeration value="TXT"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "BinaryDataEncoding") @XmlEnum public enum BinaryDataEncoding { @XmlEnumValue("B64") B_64("B64"), TXT("TXT"); private final String value; BinaryDataEncoding(String v) { value = v; } public String value() { return value; } public static BinaryDataEncoding fromValue(String v) { for (BinaryDataEncoding c: BinaryDataEncoding.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } } --- NEW FILE: AddressPartType.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for AddressPartType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="AddressPartType"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="CAR"/> * <enumeration value="CEN"/> * <enumeration value="CNT"/> * <enumeration value="CPA"/> * <enumeration value="DEL"/> * <enumeration value="CTY"/> * <enumeration value="POB"/> * <enumeration value="ZIP"/> * <enumeration value="PRE"/> * <enumeration value="STA"/> * <enumeration value="ADL"/> * <enumeration value="UNIT"/> * <enumeration value="UNID"/> * <enumeration value="DAL"/> * <enumeration value="DINSTA"/> * <enumeration value="DINSTQ"/> * <enumeration value="DINST"/> * <enumeration value="DMOD"/> * <enumeration value="DMODID"/> * <enumeration value="SAL"/> * <enumeration value="DIR"/> * <enumeration value="BNR"/> * <enumeration value="BNN"/> * <enumeration value="BNS"/> * <enumeration value="STR"/> * <enumeration value="STB"/> * <enumeration value="STTYP"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "AddressPartType") @XmlEnum public enum AddressPartType { CAR, CEN, CNT, CPA, DEL, CTY, POB, ZIP, PRE, STA, ADL, UNIT, UNID, DAL, DINSTA, DINSTQ, DINST, DMOD, DMODID, SAL, DIR, BNR, BNN, BNS, STR, STB, STTYP; public String value() { return name(); } public static AddressPartType fromValue(String v) { return valueOf(v); } } --- NEW FILE: ActClass.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActClass. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="ActClass"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="ACCM"/> * <enumeration value="ACCT"/> * <enumeration value="ACSN"/> * <enumeration value="ACT"/> * <enumeration value="ACTN"/> * <enumeration value="ADJUD"/> * <enumeration value="ALRT"/> * <enumeration value="BATTERY"/> * <enumeration value="CACT"/> * <enumeration value="CASE"/> * <enumeration value="CATEGORY"/> * <enumeration value="CDALVLONE"/> * <enumeration value="CLNTRL"/> * <enumeration value="CLUSTER"/> * <enumeration value="CNOD"/> * <enumeration value="CNTRCT"/> * <enumeration value="COMPOSITION"/> * <enumeration value="COND"/> * <enumeration value="CONS"/> * <enumeration value="CONTREG"/> * <enumeration value="COV"/> * <enumeration value="CTTEVENT"/> * <enumeration value="DGIMG"/> * <enumeration value="DIET"/> * <enumeration value="DISPACT"/> * <enumeration value="DOC"/> * <enumeration value="DOCBODY"/> * <enumeration value="DOCCLIN"/> * <enumeration value="DOCSECT"/> * <enumeration value="EHR"/> * <enumeration value="ENC"/> * <enumeration value="ENTRY"/> * <enumeration value="EXTRACT"/> * <enumeration value="FCNTRCT"/> * <enumeration value="FOLDER"/> * <enumeration value="INC"/> * <enumeration value="INFO"/> * <enumeration value="INFRM"/> * <enumeration value="INVE"/> * <enumeration value="INVSTG"/> * <enumeration value="LIST"/> * <enumeration value="MPROT"/> * <enumeration value="OBS"/> * <enumeration value="OBSCOR"/> * <enumeration value="OBSSER"/> * <enumeration value="ORGANIZER"/> * <enumeration value="OUTB"/> * <enumeration value="PCPR"/> * <enumeration value="PROC"/> * <enumeration value="REG"/> * <enumeration value="REV"/> * <enumeration value="ROIBND"/> * <enumeration value="ROIOVL"/> * <enumeration value="SBADM"/> * <enumeration value="SPCOBS"/> * <enumeration value="SPCTRT"/> * <enumeration value="SPECCOLLECT"/> * <enumeration value="SPLY"/> * <enumeration value="STC"/> * <enumeration value="STORE"/> * <enumeration value="SUBST"/> * <enumeration value="TOPIC"/> * <enumeration value="TRNS"/> * <enumeration value="VERIF"/> * <enumeration value="XACT"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "ActClass") @XmlEnum public enum ActClass { ACCM, ACCT, ACSN, ACT, ACTN, ADJUD, ALRT, BATTERY, CACT, CASE, CATEGORY, CDALVLONE, CLNTRL, CLUSTER, CNOD, CNTRCT, COMPOSITION, COND, CONS, CONTREG, COV, CTTEVENT, DGIMG, DIET, DISPACT, DOC, DOCBODY, DOCCLIN, DOCSECT, EHR, ENC, ENTRY, EXTRACT, FCNTRCT, FOLDER, INC, INFO, INFRM, INVE, INVSTG, LIST, MPROT, OBS, OBSCOR, OBSSER, ORGANIZER, OUTB, PCPR, PROC, REG, REV, ROIBND, ROIOVL, SBADM, SPCOBS, SPCTRT, SPECCOLLECT, SPLY, STC, STORE, SUBST, TOPIC, TRNS, VERIF, XACT; public String value() { return name(); } public static ActClass fromValue(String v) { return valueOf(v); } } --- NEW FILE: ActRelationshipJoin.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActRelationshipJoin. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="ActRelationshipJoin"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="D"/> * <enumeration value="X"/> * <enumeration value="K"/> * <enumeration value="W"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "ActRelationshipJoin") @XmlEnum public enum ActRelationshipJoin { D, X, K, W; public String value() { return name(); } public static ActRelationshipJoin fromValue(String v) { return valueOf(v); } } --- NEW FILE: STSlot.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for STSlot complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="STSlot"> * <complexContent> * <extension base="{urn:tolven-org:trim:4.0}Slot"> * <choice> * <element name="null" type="{urn:tolven-org:trim:4.0}NullFlavor" minOccurs="0"/> * <element name="ST" type="{urn:tolven-org:trim:4.0}ST" minOccurs="0"/> * </choice> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "STSlot", propOrder = { "st", "_null" }) public class STSlot extends Slot { @XmlElement(name = "ST") protected ST st; @XmlElement(name = "null") protected NullFlavor _null; /** * Gets the value of the st property. * * @return * possible object is * {@link ST } * */ public ST getST() { return st; } /** * Sets the value of the st property. * * @param value * allowed object is * {@link ST } * */ public void setST(ST value) { this.st = value; } /** * Gets the value of the null property. * * @return * possible object is * {@link NullFlavor } * */ public NullFlavor getNull() { return _null; } /** * Sets the value of the null property. * * @param value * allowed object is * {@link NullFlavor } * */ public void setNull(NullFlavor value) { this._null = value; } } --- NEW FILE: ActRelationshipSubset.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActRelationshipSubset. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="ActRelationshipSubset"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="MAX"/> * <enumeration value="MIN"/> * <enumeration value="SUM"/> * <enumeration value="FUTURE"/> * <enumeration value="LAST"/> * <enumeration value="NEXT"/> * <enumeration value="FUTSUM"/> * <enumeration value="PAST"/> * <enumeration value="FIRST"/> * <enumeration value="RECENT"/> * <enumeration value="PREVSUM"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "ActRelationshipSubset") @XmlEnum public enum ActRelationshipSubset { MAX, MIN, SUM, FUTURE, LAST, NEXT, FUTSUM, PAST, FIRST, RECENT, PREVSUM; public String value() { return name(); } public static ActRelationshipSubset fromValue(String v) { return valueOf(v); } } --- NEW FILE: ActSlot.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActSlot complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="ActSlot"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ActSlot") @XmlSeeAlso({ ActReference.class, ActNull.class, ActBind.class, Act.class, ActInternal.class }) public abstract class ActSlot { } --- NEW FILE: ActStatus.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActStatus. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="ActStatus"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="nullified"/> * <enumeration value="obsolete"/> * <enumeration value="normal"/> * <enumeration value="aborted"/> * <enumeration value="active"/> * <enumeration value="cancelled"/> * <enumeration value="completed"/> * <enumeration value="held"/> * <enumeration value="new"/> * <enumeration value="suspended"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "ActStatus") @XmlEnum public enum ActStatus { @XmlEnumValue("nullified") NULLIFIED("nullified"), @XmlEnumValue("obsolete") OBSOLETE("obsolete"), @XmlEnumValue("normal") NORMAL("normal"), @XmlEnumValue("aborted") ABORTED("aborted"), @XmlEnumValue("active") ACTIVE("active"), @XmlEnumValue("cancelled") CANCELLED("cancelled"), @XmlEnumValue("completed") COMPLETED("completed"), @XmlEnumValue("held") HELD("held"), @XmlEnumValue("new") NEW("new"), @XmlEnumValue("suspended") SUSPENDED("suspended"); private final String value; ActStatus(String v) { value = v; } public String value() { return value; } public static ActStatus fromValue(String v) { for (ActStatus c: ActStatus.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } } --- NEW FILE: PostalAddressUse.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for PostalAddressUse. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="PostalAddressUse"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="ABC"/> * <enumeration value="IDE"/> * <enumeration value="SYL"/> * <enumeration value="BAD"/> * <enumeration value="TMP"/> * <enumeration value="PHYS"/> * <enumeration value="PST"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "PostalAddressUse") @XmlEnum public enum PostalAddressUse { ABC, IDE, SYL, BAD, TMP, PHYS, PST; public String value() { return name(); } public static PostalAddressUse fromValue(String v) { return valueOf(v); } } --- NEW FILE: ActRelationshipType.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ActRelationshipType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="ActRelationshipType"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="APND"/> * <enumeration value="ARR"/> * <enumeration value="AUTH"/> * <enumeration value="CAUS"/> * <enumeration value="CHRG"/> * <enumeration value="CIND"/> * <enumeration value="COMP"/> * <enumeration value="COST"/> * <enumeration value="COVBY"/> * <enumeration value="CREDIT"/> * <enumeration value="CTRLV"/> * <enumeration value="DEBIT"/> * <enumeration value="DEP"/> * <enumeration value="DOC"/> * <enumeration value="DRIV"/> * <enumeration value="ELNK"/> * <enumeration value="EVID"/> * <enumeration value="EXPL"/> * <enumeration value="FLFS"/> * <enumeration value="GEN"/> * <enumeration value="GEVL"/> * <enumeration value="GOAL"/> * <enumeration value="INST"/> * <enumeration value="ITEMSLOC"/> * <enumeration value="LIMIT"/> * <enumeration value="MFST"/> * <enumeration value="MITGT"/> * <enumeration value="MTCH"/> * <enumeration value="NAME"/> * <enumeration value="OBJC"/> * <enumeration value="OBJF"/> * <enumeration value="OCCR"/> * <enumeration value="OPTN"/> * <enumeration value="OREF"/> * <enumeration value="OUTC"/> * <enumeration value="PERT"/> * <enumeration value="PRCN"/> * <enumeration value="PREV"/> * <enumeration value="REFR"/> * <enumeration value="REFV"/> * <enumeration value="REV"/> * <enumeration value="RISK"/> * <enumeration value="RPLC"/> * <enumeration value="RSON"/> * <enumeration value="SAS"/> * <enumeration value="SCH"/> * <enumeration value="SEQL"/> * <enumeration value="SPRT"/> * <enumeration value="SPRTBND"/> * <enumeration value="SUBJ"/> * <enumeration value="SUCC"/> * <enumeration value="SUMM"/> * <enumeration value="TRIG"/> * <enumeration value="UPDT"/> * <enumeration value="VRXCRPT"/> * <enumeration value="XCRPT"/> * <enumeration value="XFRM"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "ActRelationshipType") @XmlEnum public enum ActRelationshipType { APND, ARR, AUTH, CAUS, CHRG, CIND, COMP, COST, COVBY, CREDIT, CTRLV, DEBIT, DEP, DOC, DRIV, ELNK, EVID, EXPL, FLFS, GEN, GEVL, GOAL, INST, ITEMSLOC, LIMIT, MFST, MITGT, MTCH, NAME, OBJC, OBJF, OCCR, OPTN, OREF, OUTC, PERT, PRCN, PREV, REFR, REFV, REV, RISK, RPLC, RSON, SAS, SCH, SEQL, SPRT, SPRTBND, SUBJ, SUCC, SUMM, TRIG, UPDT, VRXCRPT, XCRPT, XFRM; public String value() { return name(); } public static ActRelationshipType fromValue(String v) { return valueOf(v); } } --- NEW FILE: NullFlavor.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for NullFlavor. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="NullFlavor"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="OTH"/> * <enumeration value="NINF"/> * <enumeration value="PINF"/> * <enumeration value="ASKU"/> * <enumeration value="NAV"/> * <enumeration value="UNK"/> * <enumeration value="QS"/> * <enumeration value="NASK"/> * <enumeration value="TRC"/> * <enumeration value="NI"/> * <enumeration value="MSK"/> * <enumeration value="NA"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "NullFlavor") @XmlEnum public enum NullFlavor { OTH, NINF, PINF, ASKU, NAV, UNK, QS, NASK, TRC, NI, MSK, NA; public String value() { return name(); } public static NullFlavor fromValue(String v) { return valueOf(v); } } --- NEW FILE: TelecommunicationAddressUse.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for TelecommunicationAddressUse. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * <simpleType name="TelecommunicationAddressUse"> * <restriction base="{urn:tolven-org:trim:4.0}cs"> * <enumeration value="AS"/> * <enumeration value="EC"/> * <enumeration value="MC"/> * <enumeration value="PG"/> * </restriction> * </simpleType> * </pre> * */ @XmlType(name = "TelecommunicationAddressUse") @XmlEnum public enum TelecommunicationAddressUse { AS, EC, MC, PG; public String value() { return name(); } public static TelecommunicationAddressUse fromValue(String v) { return valueOf(v); } } --- NEW FILE: RoleSlot.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2007.02.03 at 07:59:42 PM PST // package org.tolven.trim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for RoleSlot complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="RoleSlot"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RoleSlot") @XmlSeeAlso({ RoleNull.class, RoleBind.class, RoleReference.class, Role.class, RoleInternal.class }) public abstract class RoleSlot { } --- NEW FILE: ParticipationType.java --- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Impl... [truncated message content] |
From: John C. <jc...@us...> - 2007-02-04 16:39:43
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/trim In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21538/src/org/tolven/trim Log Message: Directory /cvsroot/tolven/tolvenEJB/src/org/tolven/trim added to the repository |
From: John C. <jc...@us...> - 2007-02-04 16:39:37
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/trim In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21538/src/test/org/tolven/trim Log Message: Directory /cvsroot/tolven/tolvenEJB/src/test/org/tolven/trim added to the repository |
From: John C. <jc...@us...> - 2007-02-04 16:39:37
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/trim/xml In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21538/src/test/org/tolven/trim/xml Log Message: Directory /cvsroot/tolven/tolvenEJB/src/test/org/tolven/trim/xml added to the repository |
From: John C. <jc...@us...> - 2007-02-04 16:39:37
|
Update of /cvsroot/tolven/tolvenEJB/src/test/rules In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21538/src/test/rules Log Message: Directory /cvsroot/tolven/tolvenEJB/src/test/rules added to the repository |
From: Joseph I. <jos...@us...> - 2007-02-04 08:39:10
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25760/src/org/tolven/web/security Modified Files: SecurityFilter.java Log Message: Added static strings for references to session attributes names. Index: SecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/SecurityFilter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SecurityFilter.java 4 Feb 2007 08:37:05 -0000 1.4 --- SecurityFilter.java 4 Feb 2007 08:39:08 -0000 1.5 *************** *** 61,64 **** --- 61,65 ---- private static String INVITATION_ID = "invitationId"; private static String TOLVEN_NOW = "tolvenNow"; + private static String ACCOUNTUSER_ID = "accountUserId"; private ActivationLocal activation; *************** *** 153,157 **** } PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! String accountUserIdString = request.getParameter("accountUserId"); if (accountUserIdString != null && accountUserIdString.trim().length() > 0) { // User has selected an account home page --- 154,158 ---- } PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! String accountUserIdString = request.getParameter(ACCOUNTUSER_ID); if (accountUserIdString != null && accountUserIdString.trim().length() > 0) { // User has selected an account home page |
From: Joseph I. <jos...@us...> - 2007-02-04 08:37:09
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24748/src/org/tolven/web/security Modified Files: SecurityFilter.java Log Message: Added static strings for references to session attributes names. Index: SecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/SecurityFilter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SecurityFilter.java 4 Feb 2007 08:32:36 -0000 1.3 --- SecurityFilter.java 4 Feb 2007 08:37:05 -0000 1.4 *************** *** 59,62 **** --- 59,64 ---- private static String TOP = "top"; + private static String INVITATION_ID = "invitationId"; + private static String TOLVEN_NOW = "tolvenNow"; private ActivationLocal activation; *************** *** 112,122 **** boolean justLoggedIn = user == null; if (justLoggedIn) { ! user = activation.loginUser(principalName, (Date) request.getAttribute("tolvenNow")); top.setUser(user); } ! if ((user == null || Status.NEW_LOGIN.value().equalsIgnoreCase(user.getStatus())) && request.getParameter("invitationId") != null) { // Since we have no user yet, we'll try executing an activation invitation (if it works) ! long invitationId = Long.parseLong(request.getParameter("invitationId")); ! Date now = (Date) request.getAttribute("tolvenNow"); if (!loginBean.activate(principalName, invitationId, now)) { System.out.println(getClass() + ": COULD NOT ACTIVATE INVITATION REDIRECT TO NOWHERE"); --- 114,124 ---- boolean justLoggedIn = user == null; if (justLoggedIn) { ! user = activation.loginUser(principalName, (Date) request.getAttribute(TOLVEN_NOW)); top.setUser(user); } ! if ((user == null || Status.NEW_LOGIN.value().equalsIgnoreCase(user.getStatus())) && request.getParameter(INVITATION_ID) != null) { // Since we have no user yet, we'll try executing an activation invitation (if it works) ! long invitationId = Long.parseLong(request.getParameter(INVITATION_ID)); ! Date now = (Date) request.getAttribute(TOLVEN_NOW); if (!loginBean.activate(principalName, invitationId, now)) { System.out.println(getClass() + ": COULD NOT ACTIVATE INVITATION REDIRECT TO NOWHERE"); |
From: Joseph I. <jos...@us...> - 2007-02-04 08:32:37
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22954/src/org/tolven/web/security Modified Files: SecurityFilter.java Log Message: If top does not exist in session, add it rather than refuse the right to create or select an account. Index: SecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/SecurityFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SecurityFilter.java 4 Feb 2007 07:35:50 -0000 1.2 --- SecurityFilter.java 4 Feb 2007 08:32:36 -0000 1.3 *************** *** 58,61 **** --- 58,63 ---- public class SecurityFilter implements Filter { + private static String TOP = "top"; + private ActivationLocal activation; private LoginLocal loginBean; *************** *** 103,113 **** String principalName = principal.getName(); // PHASE ONE: User Authentication ! HttpSession session = request.getSession(false); ! TopAction top = (TopAction) session.getAttribute("top"); ! if (top == null) { ! System.out.println(getClass() + ": NO TOP REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } TolvenUser user = top.getUser(); boolean justLoggedIn = user == null; --- 105,112 ---- String principalName = principal.getName(); // PHASE ONE: User Authentication ! HttpSession session = request.getSession(); ! TopAction top = (TopAction) session.getAttribute(TOP); ! if (top == null) ! session.setAttribute(TOP, new TopAction()); TolvenUser user = top.getUser(); boolean justLoggedIn = user == null; |
From: Joseph I. <jos...@us...> - 2007-02-04 07:35:52
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31756/src/org/tolven/web/security Modified Files: SecurityFilter.java Log Message: Added SecurityFilter for review. It has not been activated, but will take on all the responsiblity for post login processing of users, as well has access to both the createAccount and selectAccout pages. Index: SecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/SecurityFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SecurityFilter.java 4 Feb 2007 07:26:23 -0000 1.1 --- SecurityFilter.java 4 Feb 2007 07:35:50 -0000 1.2 *************** *** 49,52 **** --- 49,53 ---- import org.tolven.web.TolvenContext; import org.tolven.web.TopAction; + /** * The original post-login code, which was located in the class TopAction (author John Churin), has been copied to this *************** *** 80,197 **** public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { ! try { ! HttpServletRequest request = (HttpServletRequest) servletRequest; ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); ! if (subject != null) { ! System.out.println(getClass() + ": Subject=" + subject); ! Principal principal = null; ! Object obj = null; ! for (java.util.Iterator iter = subject.getPrincipals().iterator(); iter.hasNext();) { ! obj = iter.next(); ! if (obj instanceof Principal && !(obj instanceof Group)) { ! principal = (Principal) obj; ! break; } ! } ! if (principal == null) { ! System.out.println(getClass() + ": NO FILTER REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } ! String principalName = principal.getName(); ! // PHASE ONE: User Authentication ! HttpSession session = request.getSession(false); ! TopAction top = (TopAction) session.getAttribute("top"); ! if (top == null) { ! System.out.println(getClass() + ": NO TOP REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } ! TolvenUser user = top.getUser(); ! boolean justLoggedIn = user == null; ! if (justLoggedIn) { ! user = activation.loginUser(principalName, (Date) request.getAttribute("tolvenNow")); ! top.setUser(user); ! } ! if ((user == null || Status.NEW_LOGIN.value().equalsIgnoreCase(user.getStatus())) && request.getParameter("invitationId") != null) { ! // Since we have no user yet, we'll try executing an activation invitation (if it works) ! long invitationId = Long.parseLong(request.getParameter("invitationId")); ! Date now = (Date) request.getAttribute("tolvenNow"); ! if (!loginBean.activate(principalName, invitationId, now)) { ! System.out.println(getClass() + ": COULD NOT ACTIVATE INVITATION REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; } ! // try TolvenUser again ! user = activation.loginUser(principalName, now); ! if (user == null) { ! System.out.println(getClass() + ": COULD NOT COMPLETE ACTIVATION REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; ! } else { top.setUser(user); } ! invitationBean.executeInvitation(invitationId, now); ! } ! if (user == null) { ! System.out.println(getClass() + ": USER IS NULL REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } ! if (!user.hasUserPrivateKey()) { ! addKeysToUser(user, subject); ! } ! // PHASE TWO: Account Authentication ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); ! if (privateCredentials.isEmpty()) { ! System.out.println(getClass() + ": NO PRIVATE KEY RING REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } ! PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! String accountUserIdString = request.getParameter("accountUserId"); ! if (accountUserIdString != null && accountUserIdString.trim().length() > 0) { ! // User has selected an account home page ! AccountUser accountUser = activation.findAccountUser(Long.parseLong(accountUserIdString.trim())); ! if (accountUser == null) { ! System.out.println(getClass() + ": NO ACCOUNTUSER REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; } ! // SAFETY CHECK HERE - Don't trust the accountUserId alone, it must match user. ! if (accountUser.getUser().getId() != user.getId()) { ! System.out.println(getClass() + ": ACCOUNTUSER DOES NOT BELONG TO USER REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; } ! // Give TolvenUser the AccountPrivateKey for the selected account ! privateKeyRing.setAccountPrivateKey(accountUser.getAccountPrivateKey()); ! top.setAccountUser(accountUser); ! ((HttpServletResponse) servletResponse).sendRedirect(accountUser.getAccount().getAccountType().getHomePage()); ! return; ! } ! // Take away the user's AccountPrivateKey for the current account if one exists ! privateKeyRing.setAccountPrivateKey(null); ! if(justLoggedIn) { ! // Allow through...No password is required ! } else { ! // sendRedirect to password page } } - } catch (PolicyContextException ex) { - ex.printStackTrace(); - throw new ServletException(ex); - } catch (NamingException ex) { - ex.printStackTrace(); - throw new ServletException(ex); - } catch (InvitationException ex) { - ex.printStackTrace(); - throw new ServletException(ex); - } catch (JAXBException ex) { - ex.printStackTrace(); - throw new ServletException(ex); - } catch (GeneralSecurityException ex) { - ex.printStackTrace(); - throw new ServletException(ex); } chain.doFilter(servletRequest, servletResponse); --- 81,200 ---- public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { ! if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! try { ! HttpServletRequest request = (HttpServletRequest) servletRequest; ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); ! if (subject != null) { ! System.out.println(getClass() + ": Subject=" + subject); ! Principal principal = null; ! Object obj = null; ! for (java.util.Iterator iter = subject.getPrincipals().iterator(); iter.hasNext();) { ! obj = iter.next(); ! if (obj instanceof Principal && !(obj instanceof Group)) { ! principal = (Principal) obj; ! break; ! } } ! if (principal == null) { ! System.out.println(getClass() + ": NO FILTER REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; } ! String principalName = principal.getName(); ! // PHASE ONE: User Authentication ! HttpSession session = request.getSession(false); ! TopAction top = (TopAction) session.getAttribute("top"); ! if (top == null) { ! System.out.println(getClass() + ": NO TOP REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; ! } ! TolvenUser user = top.getUser(); ! boolean justLoggedIn = user == null; ! if (justLoggedIn) { ! user = activation.loginUser(principalName, (Date) request.getAttribute("tolvenNow")); top.setUser(user); } ! if ((user == null || Status.NEW_LOGIN.value().equalsIgnoreCase(user.getStatus())) && request.getParameter("invitationId") != null) { ! // Since we have no user yet, we'll try executing an activation invitation (if it works) ! long invitationId = Long.parseLong(request.getParameter("invitationId")); ! Date now = (Date) request.getAttribute("tolvenNow"); ! if (!loginBean.activate(principalName, invitationId, now)) { ! System.out.println(getClass() + ": COULD NOT ACTIVATE INVITATION REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } ! // try TolvenUser again ! user = activation.loginUser(principalName, now); ! if (user == null) { ! System.out.println(getClass() + ": COULD NOT COMPLETE ACTIVATION REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } else { ! top.setUser(user); ! } ! invitationBean.executeInvitation(invitationId, now); ! } ! if (user == null) { ! System.out.println(getClass() + ": USER IS NULL REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; } ! if (!user.hasUserPrivateKey()) { ! addKeysToUser(user, subject); ! } ! // PHASE TWO: Account Authentication ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); ! if (privateCredentials.isEmpty()) { ! System.out.println(getClass() + ": NO PRIVATE KEY RING REDIRECT TO NOWHERE"); ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); return; } ! PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! String accountUserIdString = request.getParameter("accountUserId"); ! if (accountUserIdString != null && accountUserIdString.trim().length() > 0) { ! // User has selected an account home page ! AccountUser accountUser = activation.findAccountUser(Long.parseLong(accountUserIdString.trim())); ! if (accountUser == null) { ! System.out.println(getClass() + ": NO ACCOUNTUSER REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } ! // SAFETY CHECK HERE - Don't trust the accountUserId alone, it must match user. ! if (accountUser.getUser().getId() != user.getId()) { ! System.out.println(getClass() + ": ACCOUNTUSER DOES NOT BELONG TO USER REDIRECT TO NOWHERE"); ! ((HttpServletResponse) servletResponse).sendRedirect("nowhere.jsf"); ! return; ! } ! // Give TolvenUser the AccountPrivateKey for the selected account ! privateKeyRing.setAccountPrivateKey(accountUser.getAccountPrivateKey()); ! top.setAccountUser(accountUser); ! ((HttpServletResponse) servletResponse).sendRedirect(accountUser.getAccount().getAccountType().getHomePage()); ! return; ! } ! // Take away the user's AccountPrivateKey for the current account if one exists ! privateKeyRing.setAccountPrivateKey(null); ! if (justLoggedIn) { ! // Allow through...No password is required ! } else { ! // sendRedirect to password page ! } } + } catch (PolicyContextException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (NamingException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (InvitationException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (JAXBException ex) { + ex.printStackTrace(); + throw new ServletException(ex); + } catch (GeneralSecurityException ex) { + ex.printStackTrace(); + throw new ServletException(ex); } } chain.doFilter(servletRequest, servletResponse); |
From: Joseph I. <jos...@us...> - 2007-02-04 07:34:52
|
Update of /cvsroot/tolven/tolvenWEB/web/WEB-INF In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31332/web/WEB-INF Modified Files: web.xml Log Message: Added SecurityFilter for review. It has not been activated, but will take on all the responsiblity for post login processing of users, as well has access to both the createAccount and selectAccout pages. Index: web.xml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/WEB-INF/web.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** web.xml 23 Jan 2007 03:13:41 -0000 1.15 --- web.xml 4 Feb 2007 07:34:48 -0000 1.16 *************** *** 83,86 **** --- 83,98 ---- <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener--> + <filter> + <filter-name>SecurityFilter</filter-name> + <filter-class>org.tolven.web.security.SecurityFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>SecurityFilter</filter-name> + <url-pattern>/private/createAccount.jsf</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>SecurityFilter</filter-name> + <url-pattern>/private/selectAccount.jsf</url-pattern> + </filter-mapping> <servlet> <servlet-name>Faces Servlet</servlet-name> |