Changeset 1300

Show
Ignore:
Timestamp:
04/08/09 23:48:07 (3 years ago)
Author:
daan
Message:

Removed PlanningService?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • his/trunk/README.txt

    r1224 r1300  
    83833. Installing LDAP 
    8484 
    85    Patients are also stored in an LDAP directory, to allow integration with the Calendar Server. 
    8685   So to fully test the system, you will have to setup an LDAP directory 
    8786   and configure his.properties file accordingly to match your setup. 
     
    9796        ldap.password=password 
    9897 
    99 4. Installing Calendar Server 
    100  
    101    We currently use Apple Calendar Service (http://www.apple.com/server/macosx/features/ical.html) 
    102    in the production environment. This is an open source calendar service that can be installed without using 
    103    Mac OS X Leopard Server. You need to have Python installed, as it is written in Python. 
    104    For more information, see: http://trac.calendarserver.org/ 
    105    - Install the Calendar Service by following the instructions found at 
    106      http://trac.calendarserver.org/wiki/QuickStart 
    107    - Normally, Calendar Server uses Open Directory for authentication. For testing locally, you can create 
    108      an accounts-test.xml with usernames and passwords. See http://trac.calendarserver.org/wiki/XMLDirectoryService 
    109      for more information. Create an admin user in the file accounts-test.xml: 
    110      <accounts realm="Test Realm"> 
    111         <user> 
    112             <uid>admin</uid> 
    113             <guid>admin</guid> 
    114             <password>admin</password> 
    115             <name>Super User</name> 
    116         </user> 
    117      </accounts> 
    118  
    119    - Change 'data/src/test/resources/test.properties' 
    120             'configuration/default/tomcat/conf/his.properties' 
    121             'configuration/production/tomcat/conf/his.properties' 
    122      to contain the right Calendar Server connection parameters. 
    123         caldav.host=localhost 
    124         caldav.port=8010 
    125         caldav.root=/calendars/ 
    126         caldav.username=admin 
    127         caldav.password=admin 
    128  
    129 5. Installing the certificate for the communication with the Vecozo webservice. 
     984. Installing the certificate for the communication with the Vecozo webservice. 
    13099 
    131100    We use one of the Vecozo webservices to verify and support the creation of new patients in the system. 
  • his/trunk/configuration/default/tomcat/conf/his.properties

    r1092 r1300  
    116116frontpage.order.sample1=1 
    117117frontpage.order.sample2=2 
    118  
    119  
    120 ###################################### 
    121 #    CalDav plugin configuration     # 
    122 ###################################### 
    123 caldav.host=10.0.114.196 
    124 caldav.port=8008 
    125 caldav.root=/calendars/ 
    126  
    127 caldav.username=planning 
    128 caldav.password=planning 
    129 ###################################### 
    130 # End of CalDav plugin configuration # 
    131 ###################################### 
  • his/trunk/configuration/production/tomcat/conf/his.properties

    r1092 r1300  
    111111# 
    112112osgi.show.prompt=false 
    113  
    114  
    115 ###################################### 
    116 #    CalDav plugin configuration     # 
    117 ###################################### 
    118 caldav.host=10.0.114.196 
    119 caldav.port=8008 
    120 caldav.root=/calendars/ 
    121  
    122 caldav.username=planning 
    123 caldav.password=planning 
    124 ###################################### 
    125 # End of CalDav plugin configuration # 
    126 ###################################### 
  • his/trunk/data/etc/create_db.sql

    r1292 r1300  
    191191)type=InnoDB DEFAULT CHARSET=utf8; 
    192192 
    193 -- 
    194 -- OLD APPOINTMENT STUFF. Can be removed in the second phase of the conversion away from CalDAV 
    195 -- - Daan 
    196 -- 
    197 DROP TABLE IF EXISTS occurred_appointment; 
    198 CREATE TABLE occurred_appointment ( 
    199     id                                  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, 
    200     version                     BIGINT(20) NOT NULL default 0, 
    201     identifier                          VARCHAR(255) NOT NULL UNIQUE, 
    202     description                         VARCHAR(255) NOT NULL, 
    203     location_dn                         VARCHAR(255), 
    204     location_name                       VARCHAR(255), 
    205     location_uid                        VARCHAR(255), 
    206     start_date                          DATETIME NOT NULL, 
    207     end_date                            DATETIME NOT NULL, 
    208  
    209     PRIMARY KEY (id) 
    210  
    211 )type=InnoDB DEFAULT CHARSET=utf8; 
    212  
    213  
    214 DROP TABLE IF EXISTS occurred_appointment_attendee; 
    215 CREATE TABLE occurred_appointment_attendee ( 
    216     id                                  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, 
    217     version                     BIGINT(20) NOT NULL default 0, 
    218     appointment_id                      BIGINT(20) UNSIGNED NOT NULL, 
    219     attendee_uid                VARCHAR(255), 
    220         PRIMARY KEY (id), 
    221  
    222     CONSTRAINT fk_occurred_appointmentattendee_appointment FOREIGN KEY (appointment_id) 
    223         REFERENCES occurred_appointment (id) 
    224         ON DELETE RESTRICT ON UPDATE RESTRICT 
    225  
    226  )type=InnoDB DEFAULT CHARSET=utf8; 
    227  
    228  
    229 DROP TABLE IF EXISTS appointment_attendee_cancelled; 
    230 CREATE TABLE appointment_attendee_cancelled ( 
    231     id                                  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, 
    232     version                     BIGINT(20) NOT NULL default 0, 
    233     appointment_identifier      VARCHAR(255) NOT NULL, 
    234     attendee_identifier         VARCHAR(255) NOT NULL, 
    235  
    236         PRIMARY KEY (id) 
    237  
    238  )type=InnoDB DEFAULT CHARSET=utf8; 
    239  
    240 -- 
    241 -- END OF OLD APPOINTMENT STUFF. Can be removed in the second phase of the conversion away from CalDAV 
    242 -- 
    243  
    244 -- 
    245 -- NEW APPOINTMENT STUFF. This comment can be removed when the OLD STUFF above is removed. 
    246 --  - Daan 
    247 -- 
    248  
    249193DROP TABLE IF EXISTS appointment; 
    250194CREATE TABLE appointment ( 
     
    282226 
    283227)type=InnoDB DEFAULT CHARSET=utf8; 
    284  
    285 -- 
    286 -- END OF NEW APPOINTMENT STUFF. This comment can be removed when the OLD STUFF above is removed. 
    287 -- 
    288228 
    289229DROP TABLE IF EXISTS contact_person_external_identifier; 
  • his/trunk/data/etc/upgrade_1.7-to-1.8.sql

    r1286 r1300  
    2525ALTER TABLE patient 
    2626    ADD COLUMN created timestamp NULL default CURRENT_TIMESTAMP; 
     27 
     28DROP TABLE IF EXISTS occurred_appointment; 
     29 
     30DROP TABLE IF EXISTS occurred_appointment_attendee; 
     31 
     32DROP TABLE IF EXISTS appointment_attendee_cancelled; 
     33 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/dao/LdapDao.java

    r1208 r1300  
    2424    public List<LdapLocation> findLocationsByName(String searchInput); 
    2525 
    26     LdapEmployee getEmployeeByCaldavIdentifier(String identifier); 
     26    LdapEmployee getEmployeeByIdentifier(String identifier); 
    2727} 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/dao/PatientGroupDao.java

    r1267 r1300  
    22 
    33import org.joiningtracks.his.data.model.Appointment; 
    4 import org.joiningtracks.his.data.model.CaldavAppointment; 
    54import org.joiningtracks.his.data.model.PathwayParticipation; 
    65import org.joiningtracks.his.data.model.Patient; 
     
    2322    Collection<PatientGroup> getPatientGroupsForAppointment(Appointment appointment); 
    2423 
    25     @Deprecated 
    26     Collection<String> getPatientGroupTypesForAppointment(CaldavAppointment appointment); 
    27  
    2824    List<PatientGroup> findAllPatientGroupsByGroupType(String groupType); 
    2925 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/dao/jpa/JpaPatientGroupDao.java

    r1267 r1300  
    33import org.joiningtracks.his.data.dao.PatientGroupDao; 
    44import org.joiningtracks.his.data.model.Appointment; 
    5 import org.joiningtracks.his.data.model.CaldavAppointment; 
    65import org.joiningtracks.his.data.model.PathwayParticipation; 
    76import org.joiningtracks.his.data.model.Patient; 
     
    236235        if(resultList.size()==0) { 
    237236            return new ArrayList<PatientGroup>(); 
    238         } else { 
    239             return resultList; 
    240         } 
    241     } 
    242  
    243     @Deprecated 
    244     public Collection<String> getPatientGroupTypesForAppointment(CaldavAppointment appointment) { 
    245         if(appointment == null){ 
    246             return new ArrayList<String>(); 
    247         } 
    248  
    249         Map<String, Object> parameters = new HashMap<String, Object>(); 
    250         parameters.put("identifier", appointment.getIdentifier()); 
    251  
    252         StringBuilder jql = new StringBuilder(); 
    253         jql.append("select p.group_type from patientgroup p left join patientgroup_appointment pa on (pa.patientgroup_id = p.id) where pa.appointment_identifier = :identifier "); 
    254  
    255  
    256         Query query = entityManager.createNativeQuery(jql.toString()); 
    257         for (Map.Entry<String, Object> entry : parameters.entrySet()) { 
    258             query.setParameter(entry.getKey(), entry.getValue()); 
    259         } 
    260  
    261         List<String> resultList = query.getResultList(); 
    262         if(resultList.size()==0) { 
    263             return new ArrayList<String>(); 
    264237        } else { 
    265238            return resultList; 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/dao/ldap/LdapDaoImpl.java

    r1208 r1300  
    6363 
    6464    //@Cacheable(modelId = "employeesCacheModel") 
    65     public LdapEmployee getEmployeeByCaldavIdentifier(String caldavIdentifier) { 
     65    public LdapEmployee getEmployeeByIdentifier(String identifier) { 
    6666        //(&(objectClass=apple-user)(gidNumber=1026)) 
    6767        AndFilter filter = new AndFilter(); 
    6868 
    6969        EqualsFilter appleUserFilter = new EqualsFilter("objectClass", "apple-user"); 
    70         EqualsFilter gidNumberFilter = new EqualsFilter("apple-generateduid", caldavIdentifier); 
     70        EqualsFilter gidNumberFilter = new EqualsFilter("apple-generateduid", identifier); 
    7171 
    7272        filter.and(appleUserFilter); 
     
    216216    } 
    217217 
    218      
     218 
    219219} 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/dao/ldap/VerySimpleJdbcMockLdapDao.java

    r1243 r1300  
    22 
    33import org.joiningtracks.his.data.dao.LdapDao; 
     4import org.joiningtracks.his.data.model.LdapDepartment; 
    45import org.joiningtracks.his.data.model.LdapEmployee; 
    5 import org.joiningtracks.his.data.model.LdapDepartment; 
    66import org.joiningtracks.his.data.model.LdapLocation; 
     7import org.springframework.beans.factory.annotation.Required; 
    78import org.springframework.jdbc.core.JdbcTemplate; 
    89import org.springframework.jdbc.core.RowMapper; 
    9 import org.springframework.beans.factory.annotation.Required; 
    1010 
    11 import java.util.List; 
    1211import java.sql.ResultSet; 
    1312import java.sql.SQLException; 
     13import java.util.List; 
    1414 
    1515/** 
     
    3737    } 
    3838 
    39     public LdapEmployee getEmployeeByCaldavIdentifier(String identifier) { 
     39    public LdapEmployee getEmployeeByIdentifier(String identifier) { 
    4040        return findEmployeeByIdentifier(identifier); 
    4141    } 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/model/AttendeeEntityListener.java

    r1266 r1300  
    4747        switch (attendeeReference.getAttendeeType()) { 
    4848            case employee: 
    49                 attendeeReference.setAttendee(ldapDao.getEmployeeByCaldavIdentifier(attendeeId)); 
     49                attendeeReference.setAttendee(ldapDao.getEmployeeByIdentifier(attendeeId)); 
    5050                break; 
    5151            case location: 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/model/ExternalIdentifier.java

    r1092 r1300  
    3232 
    3333    public static final String EXTERNAL_PAPER_FILE = "PaperFile"; 
    34     public static final String CALDAV_ATTENDEE_UID = "ldap"; 
    3534 
    3635    /** 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/model/LdapEmployee.java

    r1208 r1300  
    1818import java.io.Serializable; 
    1919 
    20 public class LdapEmployee implements Serializable, CaldavAttendee, IAttendee { 
     20public class LdapEmployee implements Serializable, IAttendee { 
    2121 
    2222    private String dn; 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/model/LdapLocation.java

    r1208 r1300  
    2121 
    2222@Embeddable 
    23 public class LdapLocation implements CaldavAttendee, IAttendee, Serializable { 
     23public class LdapLocation implements IAttendee, Serializable { 
    2424 
    2525    @Column(name = "location_dn") 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/model/Patient.java

    r1274 r1300  
    4444 
    4545@Table(name = "patient") 
    46 public class Patient extends Person implements CaldavAttendee, IAttendee { 
     46public class Patient extends Person implements IAttendee { 
    4747 
    4848    @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDate") 
     
    512512    } 
    513513 
    514     public String getIdentifier() { 
    515         return this.getIdentifierValue(ExternalIdentifier.CALDAV_ATTENDEE_UID); 
    516     } 
    517  
    518514    public String getAttendeeId() { 
    519515        return String.valueOf(getId()); 
  • his/trunk/data/src/main/java/org/joiningtracks/his/data/model/TeamMemberEntityListener.java

    r1270 r1300  
    2424    private void loadTeamMember(LdapDao ldapDao, TeamMember teamMember) { 
    2525        if(teamMember.getLdapId() != null){ 
    26             LdapEmployee ldapEmployee = ldapDao.getEmployeeByCaldavIdentifier(teamMember.getLdapId()); 
     26            LdapEmployee ldapEmployee = ldapDao.getEmployeeByIdentifier(teamMember.getLdapId()); 
    2727            teamMember.setEmployee(ldapEmployee); 
    2828        } 
  • his/trunk/data/src/main/resources/context/sql.xml

    r1292 r1300  
    5757    <bean id="pathwayParticipationPaymentDao" class="org.joiningtracks.his.data.dao.jpa.JpaPathwayParticipationPaymentDao"/> 
    5858 
    59     <bean id="occurredAppointmentDao" class="org.joiningtracks.his.data.dao.jpa.JpaOccurredAppointmentDao"/> 
    60  
    6159    <bean id="appointmentDao" class="org.joiningtracks.his.data.dao.jpa.JpaAppointmentDao"/> 
    6260 
    6361    <bean id="teamDao" class="org.joiningtracks.his.data.dao.jpa.JpaTeamDao"/> 
    64  
    65     <bean id="cancelledAttendeeDao" class="org.joiningtracks.his.data.dao.jpa.JpaCancelledAttendeeDao"/> 
    6662 
    6763    <bean id="pathwayRegistryDao" class="org.joiningtracks.his.data.dao.jpa.JpaPathwayProviderRegistryDao"/> 
  • his/trunk/data/src/test/java/org/joiningtracks/his/data/dao/Database.java

    r1295 r1300  
    652652    } 
    653653 
    654     //============================================== Occurred_appointment table ======================================== 
    655  
    656     /** 
    657      * Inserts an occurred_appointment into the database 
    658      * 
    659      * @param id          The occurred_appointment ID 
    660      * @param identifier         The CalDav UID 
    661      * @param description Description of the occurred_appointment 
    662      * @param startDate   Start date and time of the occurred_appointment 
    663      * @param endDate     End date and time of the occurred_appointment 
    664      */ 
    665  
    666     public void insertOccurredAppointment( 
    667             long id, 
    668             String identifier, 
    669             String description, 
    670             DateTime startDate, 
    671             DateTime endDate) { 
    672  
    673         PersistentDateTime pstartDate = new PersistentDateTime(); 
    674         pstartDate.disassemble(startDate); 
    675  
    676         JdbcInsertStatement stmt = new JdbcInsertStatementBuilder("occurred_appointment") 
    677                 .addParameter("id", id) 
    678                 .addParameter("identifier", identifier) 
    679                 .addParameter("description", description) 
    680                 .addParameter("start_date", new java.sql.Timestamp(startDate.toDateTime().getMillis())) 
    681                 .addParameter("end_date", new java.sql.Timestamp(endDate.toDateTime().getMillis())) 
    682                 .addParameter("version", 0) 
    683                 .build(); 
    684  
    685         jdbcTemplate.update(stmt.getSql(), stmt.getParameters()); 
    686     } 
    687  
    688     /** 
    689      * Verifies an occurred_appointment with the data in the database 
    690      * 
    691      * @param id          The occurred_appointments ID 
    692      * @param identifier         The CalDav UID 
    693      * @param description Description of the occurred_appointment 
    694      * @param startDate   Start date and time of the occurred_appointment 
    695      * @param endDate     End date and time of the occurred_appointment 
    696      * @param version     The version of this row 
    697      */ 
    698     public void verifyOccurredAppointment( 
    699             final long id, 
    700             final String identifier, 
    701             final String description, 
    702             final DateTime startDate, 
    703             final DateTime endDate, 
    704             final int version) { 
    705  
    706         String sql = "select * from occurred_appointment where id = ?"; 
    707         jdbcTemplate.getJdbcOperations().query(sql, new Object[]{id}, new VerifyingResultSetExtractor() { 
    708             public void doVerifyData(ResultSet rs) throws SQLException, DataAccessException { 
    709                 assertTrue(rs.next()); 
    710                 assertEquals(identifier, rs.getString("identifier")); 
    711                 assertEquals(description, rs.getString("description")); 
    712  
    713                 assertEquals(new Timestamp(startDate.toDateTime().getMillis()), rs.getTimestamp("start_date")); 
    714                 assertEquals(new Timestamp(endDate.toDateTime().getMillis()), rs.getTimestamp("end_date")); 
    715                 assertEquals(version, rs.getInt("version")); 
    716                 assertFalse(rs.next()); 
    717             } 
    718         }); 
    719     } 
    720  
    721654    /** 
    722655     * Inserts an appointment into the database 
  • his/trunk/data/src/test/java/org/joiningtracks/his/data/dao/jpa/JpaPatientDaoTest.java

    r1248 r1300  
    1919import org.joda.time.LocalDate; 
    2020import org.joiningtracks.his.data.dao.PatientDao; 
    21 import org.joiningtracks.his.data.model.*; 
     21import org.joiningtracks.his.data.model.Address; 
     22import org.joiningtracks.his.data.model.Country; 
     23import org.joiningtracks.his.data.model.Gender; 
     24import org.joiningtracks.his.data.model.GeneralPractitioner; 
     25import org.joiningtracks.his.data.model.InsuranceCompany; 
     26import org.joiningtracks.his.data.model.Patient; 
     27import org.joiningtracks.his.data.model.PatientExternalIdentifier; 
     28import org.joiningtracks.his.data.model.PatientInsurancePolicy; 
    2229import org.springframework.core.io.ClassPathResource; 
    2330 
     
    12431250 
    12441251        Patient patient = dao.getById(1L); 
    1245         patient.setIdentifier("caldav", "caldav uid 01"); 
     1252        patient.setIdentifier("example", "example uid 01"); 
    12461253        dao.update(patient); 
    12471254 
    12481255        patient = dao.getById(2L); 
    1249         patient.setIdentifier("caldav", "caldav uid 02"); 
     1256        patient.setIdentifier("example", "example uid 02"); 
    12501257        dao.update(patient); 
    12511258 
    12521259 
    1253         patient = dao.findByExternalIdentifier("caldav", "caldav uid 01"); 
     1260        patient = dao.findByExternalIdentifier("example", "example uid 01"); 
    12541261        assertEquals("Patient1", patient.getFirstName()); 
    12551262 
    1256         patient = dao.findByExternalIdentifier("caldav", "caldav uid 02"); 
     1263        patient = dao.findByExternalIdentifier("example", "example uid 02"); 
    12571264        assertEquals("Patient2", patient.getFirstName()); 
    12581265    } 
  • his/trunk/data/src/test/java/org/joiningtracks/his/data/dao/ldap/LdapDaoTest.java

    r1209 r1300  
    117117    } 
    118118 
    119     public void testGetEmployeeByCaldavIdentifier(){ 
     119    public void testGetEmployeeByIdentifier(){ 
    120120        expect(ldapTemplate.search((DistinguishedName) anyObject(), (String) anyObject(), (AttributesMapper) anyObject())).andReturn(employeeResult); 
    121121 
    122122        replay(ldapTemplate, employeeAttributesMapper); 
    123         ldapDao.getEmployeeByCaldavIdentifier("identifier"); 
     123        ldapDao.getEmployeeByIdentifier("identifier"); 
    124124        verify(ldapTemplate, employeeAttributesMapper); 
    125125    } 
  • his/trunk/frontend/common/src/main/java/org/joiningtracks/his/frontend/common/wicket/model/LdapEmployeeDetachableModel.java

    r1231 r1300  
    9797    @Override 
    9898    protected Object load() { 
    99         return ldapEmployeeService.getEmployeeByCaldavIdentifier(identifier); 
     99        return ldapEmployeeService.getEmployeeByIdentifier(identifier); 
    100100    } 
    101101} 
  • his/trunk/plugin/bridge/pom.xml

    r1285 r1300  
    5858        </dependency> 
    5959 
     60        <dependency> 
     61            <groupId>javax.servlet</groupId> 
     62            <artifactId>servlet-api</artifactId> 
     63            <version>2.4</version> 
     64            <scope>provided</scope> 
     65        </dependency> 
    6066    </dependencies> 
    6167 
  • his/trunk/plugin/bridge/src/main/resources/context/osgiContainerContext.xml

    r1295 r1300  
    3434            <value> 
    3535                patientService, 
    36                 planningService, 
    3736                appointmentService, 
    3837                clinicalPathwayService, 
  • his/trunk/service/pom.xml

    r1285 r1300  
    101101        </dependency> 
    102102 
    103         <dependency> 
    104             <groupId>org.osaf</groupId> 
    105             <artifactId>caldav4j</artifactId> 
    106             <version>0.4-SNAPSHOT</version> 
    107             <exclusions> 
    108                 <exclusion> 
    109                     <groupId>net.fortuna</groupId> 
    110                     <artifactId>ical4j</artifactId> 
    111                 </exclusion> 
    112                 <exclusion> 
    113                     <groupId>ehcache</groupId> 
    114                     <artifactId>ehcache</artifactId> 
    115                 </exclusion> 
    116                 <exclusion> 
    117                     <groupId>xerces</groupId> 
    118                     <artifactId>xerces</artifactId> 
    119                 </exclusion> 
    120             </exclusions> 
    121         </dependency> 
    122  
    123103    </dependencies> 
    124104 
  • his/trunk/service/src/main/java/org/joiningtracks/his/service/ldap/LdapEmployeeService.java

    r1092 r1300  
    4545    public List<LdapLocation> findLocationsByName(String searchInput); 
    4646 
    47     LdapEmployee getEmployeeByCaldavIdentifier(String identifier); 
     47    LdapEmployee getEmployeeByIdentifier(String identifier); 
    4848} 
  • his/trunk/service/src/main/java/org/joiningtracks/his/service/ldap/impl/LdapEmployeeServiceImpl.java

    r1208 r1300  
    7474    } 
    7575 
    76     public LdapEmployee getEmployeeByCaldavIdentifier(String identifier) { 
    77         return ldapDao.getEmployeeByCaldavIdentifier(identifier); 
     76    public LdapEmployee getEmployeeByIdentifier(String identifier) { 
     77        return ldapDao.getEmployeeByIdentifier(identifier); 
    7878    } 
    7979} 
  • his/trunk/service/src/main/resources/context/cache.xml

    r1110 r1300  
    2828    </bean> 
    2929 
    30     <bean id="ccisEmpByCaldavIdMethodCachingAdvice" class="org.joiningtracks.his.support.util.aop.MethodCachingInterceptor"> 
    31         <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    32         <property name="cacheName" value="CCIS_EMP"/> 
    33     </bean> 
    34  
    35     <!-- cache for the caldav identifiers, a none changing external identifier of a patient --> 
    36     <bean id="ccisPatientByExternalIdentifierCachingAdvice" class="org.joiningtracks.his.support.util.aop.MethodCachingInterceptor"> 
    37         <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    38         <property name="cacheName" value="CCIS_PATIENT"/> 
    39     </bean> 
    40      
    41     <bean id="ccisCaldavEventMethodCachingAdvice" class="org.joiningtracks.his.support.util.aop.MethodCachingInterceptor"> 
    42         <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    43         <property name="cacheName" value="CCIS_CALDAV_EVENT"/> 
    44     </bean> 
    45  
    46     <bean id="ccisCaldavEventMethodCacheInvalidationAdvice" class="org.joiningtracks.his.support.util.aop.MethodCacheInvalidatorAdvice"> 
    47         <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    48         <property name="cacheName" value="CCIS_CALDAV_EVENT"/> 
    49     </bean> 
    50  
    51     <bean id="ccisCaldavEventsListMethodCachingAdvice" class="org.joiningtracks.his.support.util.aop.MethodCachingInterceptor"> 
    52         <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    53         <property name="cacheName" value="CCIS_CALDAV_EVENT_LIST"/> 
    54     </bean> 
    55  
    56     <bean id="ccisCaldavEventsListMethodCacheInvalidationAdvice" class="org.joiningtracks.his.support.util.aop.MethodCacheInvalidatorAdvice"> 
    57         <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    58         <property name="cacheName" value="CCIS_CALDAV_EVENT_LIST"/> 
    59     </bean> 
    60  
    6130    <bean id="methodTimingAdvice" class="org.joiningtracks.his.support.util.aop.MethodTimingInterceptor"/> 
    6231 
    6332    <aop:config> 
    64         <aop:pointcut id="getEmployeeByCaldavIdentifierPointcut" expression="execution(org.joiningtracks..LdapEmployee org.joiningtracks..LdapEmployeeService.getEmployeeByCaldavIdentifier(..))"/> 
    6533        <aop:pointcut id="getAllEmployeesPointcut" expression="execution(* org.joiningtracks..LdapEmployeeService.getAllEmployees())"/> 
    66         <aop:pointcut id="getEventPointcut" expression="execution(* org.joiningtracks..CaldavTemplate.getEvent(..))"/> 
    67         <aop:pointcut id="getAllEventsForDateRangePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.getAllEventsForDateRange(..))"/> 
    68         <aop:pointcut id="caldavUpdatePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.update(..))"/> 
    69         <aop:pointcut id="caldavCreatePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.create(..))"/> 
    70         <aop:pointcut id="caldavRemovePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.remove(..))"/> 
    71         <!-- aop:pointcut id="getPlannedAppointmentsForPointcut" expression="execution(* org.joiningtracks..PlanningService.getPlannedAppointmentFor(..))"/ --> 
    72          
    73         <!-- TODO only cache the CALDAV external identifier --> 
    74         <aop:pointcut id="patientServiceGetExternalIdentifierPointcut" expression="execution(* org.joiningtracks..PatientService.findByExternalIdentifier(..))"/> 
    7534 
    76         <!-- aop:advisor id="getAllEmployeesMethodTimingAdvisor" advice-ref="methodTimingAdvice" pointcut-ref="getAllEmployeesPointcut"/--> 
    7735        <aop:advisor id="getAllEmployeesMethodCachingAdvice" advice-ref="ccisEmpListMethodCachingAdvice" pointcut-ref="getAllEmployeesPointcut"/> 
    78         <!-- aop:advisor id="getEmployeeByCaldavIdentifierMethodTimingAdvisor" advice-ref="methodTimingAdvice" pointcut-ref="getEmployeeByCaldavIdentifierPointcut"/ --> 
    79         <aop:advisor id="getEmployeeByCaldavIdentifierMethodCachingAdvisor" advice-ref="ccisEmpByCaldavIdMethodCachingAdvice" pointcut-ref="getEmployeeByCaldavIdentifierPointcut"/> 
    80         <!-- aop:advisor id="getEventMethodTimingAdvisor" advice-ref="methodTimingAdvice" pointcut-ref="getEventPointcut"/ --> 
    81         <aop:advisor id="getEventMethodCachingAdvisor" advice-ref="ccisCaldavEventMethodCachingAdvice" pointcut-ref="getEventPointcut"/> 
    82         <!-- aop:advisor id="getAllEventsForDateRangeMethodTimingAdvisor" advice-ref="methodTimingAdvice" pointcut-ref="getAllEventsForDateRangePointcut"/ --> 
    83         <aop:advisor id="getAllEventsForDateRangeMethodCachingAdvisor" advice-ref="ccisCaldavEventsListMethodCachingAdvice" pointcut-ref="getAllEventsForDateRangePointcut"/> 
    84         <aop:advisor id="caldavCreateListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavCreatePointcut"/> 
    85         <aop:advisor id="caldavUpdateListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavUpdatePointcut"/> 
    86         <aop:advisor id="caldavUpdateInvalidationAdvice" advice-ref="ccisCaldavEventMethodCacheInvalidationAdvice" pointcut-ref="caldavUpdatePointcut"/> 
    87         <aop:advisor id="caldavRemoveListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavRemovePointcut"/> 
    88         <aop:advisor id="caldavRemoveInvalidationAdvice" advice-ref="ccisCaldavEventMethodCacheInvalidationAdvice" pointcut-ref="caldavRemovePointcut"/> 
    89         <aop:advisor id="getEmployeeByCaldavIdentifierAdvice" advice-ref="ccisPatientByExternalIdentifierCachingAdvice" pointcut-ref="patientServiceGetExternalIdentifierPointcut"/> 
    90         <!-- aop:advisor id="planningServiceMethodsTimingAdvisor" advice-ref="methodTimingAdvice" pointcut-ref="getPlannedAppointmentsForPointcut"/--> 
    9136    </aop:config> 
    9237    
  • his/trunk/service/src/main/resources/context/services-ehcache.xml

    r1110 r1300  
    44 <defaultCache maxElementsInMemory="10" eternal="false" 
    55        timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" /> 
    6   <!-- LdapEmployeeServiceImpl --> 
    7   <!-- 
    8     <cache name="getEmployeeByCaldavIdentifier" maxElementsInMemory="50" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" /> 
    9     <cache name="getAllEmployees" maxElementsInMemory="50" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" /> 
    10   --> 
     6 
    117    <cache name="CCIS_EMP_LIST" maxElementsInMemory="50" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" /> 
    128    <cache name="CCIS_EMP" maxElementsInMemory="50" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" /> 
     
    1410    <cache name="CCIS_PATIENT" maxElementsInMemory="100" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" /> 
    1511 
    16   <!-- CaldavTemplate --> 
    17   <!-- 
    18     <cache name="getEvent" maxElementsInMemory="300" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400"/> 
    19     <cache name="getAllEventsForDateRange" maxElementsInMemory="20" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" /> 
    20   --> 
    21     <cache name="CCIS_CALDAV_EVENT" maxElementsInMemory="300" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400"/> 
    22     <cache name="CCIS_CALDAV_EVENT_LIST" maxElementsInMemory="20" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" /> 
    2312</ehcache> 
    2413 
  • his/trunk/service/src/main/resources/context/services.xml

    r1292 r1300  
    3939    <bean id="employeeRoleService" class="org.joiningtracks.his.service.team.impl.DefaultEmployeeRoleService"> 
    4040        <property name="employeeRoleDao" ref="employeeRoleDao"/> 
    41     </bean> 
    42  
    43     <bean id="caldavConfiguration" class="org.joiningtracks.his.service.planning.CaldavConfiguration"> 
    44         <property name="caldavServer" value="${caldav.host}"/> 
    45         <property name="caldavServerPort" value="${caldav.port}"/> 
    46         <property name="caldavRoot" value="${caldav.root}"/> 
    47         <property name="caldavUser" value="${caldav.username}"/> 
    48         <property name="caldavPassword" value="${caldav.password}"/> 
    49     </bean> 
    50  
    51     <bean id="caldavTemplate" class="org.joiningtracks.his.service.planning.CaldavTemplate"> 
    52         <!-- constructor-arg ref="caldavConfiguration"/ --> 
    53         <property name="caldavConfiguration" ref="caldavConfiguration"/> 
    54     </bean> 
    55  
    56     <bean id="planningService" class="org.joiningtracks.his.service.planning.impl.DefaultPlanningService"> 
    57         <property name="occurredAppointmentDao" ref="occurredAppointmentDao"/> 
    58         <property name="cancelledAttendeeDao" ref="cancelledAttendeeDao"/> 
    59         <property name="caldavTemplate" ref="caldavTemplate"/> 
    60         <property name="patientService" ref="patientService"/> 
    61         <property name="employeeService" ref="ldapEmployeeService"/> 
    6241    </bean> 
    6342 
  • his/trunk/service/src/test/java/org/joiningtracks/his/service/appointment/impl/DefaultAppointmentServiceTest.java

    r1228 r1300  
    1111import org.joiningtracks.his.data.dao.jpa.JpaAppointmentDao; 
    1212import org.joiningtracks.his.data.model.Appointment; 
    13 import org.joiningtracks.his.data.model.CaldavAttendee; 
    1413import org.joiningtracks.his.data.model.Patient; 
    1514import org.joiningtracks.his.service.appointment.AppointmentService; 
    16 import org.joiningtracks.his.service.planning.converter.AppointmentConverter; 
    1715import org.joiningtracks.his.support.util.event.EventListener; 
    1816import org.joiningtracks.his.support.util.event.EventListenerRegistry; 
     
    5250 
    5351    public void testCreate() throws Exception { 
    54         AppointmentConverter appointmentConverter = new AppointmentConverter(); 
    55  
    5652        DateTime startDate = new DateTime(2008, 1, 1, 10, 0, 0, 0); 
    5753        DateTime endDate = new DateTime(2008, 1, 1, 12, 0, 0, 0); 
     
    9389        DateTime startDate = new DateTime(2008, 1, 1, 10, 0, 0, 0); 
    9490        DateTime endDate = new DateTime(2008, 1, 1, 12, 0, 0, 0); 
    95         ArrayList<CaldavAttendee> attendees = new ArrayList<CaldavAttendee>(); 
    96         attendees.add(new Patient()); 
    97         attendees.add(new Patient()); 
    98  
    9991 
    10092        Appointment appointment = new Appointment("Description", startDate, endDate); 
  • his/trunk/service/src/test/java/org/joiningtracks/his/service/ldap/impl/LdapEmployeeServiceImplTest.java

    r1209 r1300  
    111111    } 
    112112 
    113     public void testGetEmployeeByCaldavIdentifier(){ 
    114         expect(ldapDao.getEmployeeByCaldavIdentifier("identifier")).andReturn(new LdapEmployee()); 
     113    public void testGetEmployeeByIdentifier(){ 
     114        expect(ldapDao.getEmployeeByIdentifier("identifier")).andReturn(new LdapEmployee()); 
    115115 
    116116        replay(ldapDao); 
    117         ldapEmployeeService.getEmployeeByCaldavIdentifier("identifier"); 
     117        ldapEmployeeService.getEmployeeByIdentifier("identifier"); 
    118118        verify(ldapDao); 
    119119    } 
  • his/trunk/support/testutil/src/main/resources/test.properties

    r1092 r1300  
    110110# 
    111111osgi.show.prompt=false 
    112  
    113  
    114  
    115 ###################################### 
    116 #    CalDav plugin configuration     # 
    117 ###################################### 
    118 caldav.host=10.0.114.196 
    119 caldav.port=8008 
    120 caldav.root=/calendars/ 
    121  
    122 caldav.username=planning 
    123 caldav.password=planning 
    124 ###################################### 
    125 # End of CalDav plugin configuration # 
    126 ###################################### 
  • his/trunk/support/util/src/main/java/org/joiningtracks/his/support/util/aop/MethodCacheInvalidatorAdvice.java

    r1092 r1300  
    1616package org.joiningtracks.his.support.util.aop; 
    1717 
     18import net.sf.ehcache.Cache; 
     19import net.sf.ehcache.CacheManager; 
     20import org.apache.commons.logging.Log; 
     21import org.apache.commons.logging.LogFactory; 
    1822import org.springframework.aop.AfterReturningAdvice; 
    1923import org.springframework.beans.factory.annotation.Required; 
    20 import org.apache.commons.logging.Log; 
    21 import org.apache.commons.logging.LogFactory; 
    2224 
    2325import java.lang.reflect.Method; 
    2426 
    25 import net.sf.ehcache.CacheManager; 
    26 import net.sf.ehcache.Cache; 
    27  
    28 /** 
    29  * Invalidate the method cache as use by the MethodCachingInterceptor 
    30  * Sample configuration using Spring AOP: 
    31  * <code> 
    32  *   <bean id="ccisCaldavEventsListMethodCacheInvalidationAdvice" class="org.joiningtracks.his.support.util.aop.MethodCacheInvalidatorAdvice"> 
    33  *       <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    34  *       <property name="cacheName" value="CCIS_CALDAV_EVENT_LIST"/> 
    35  *   </bean> 
    36  * 
    37  *   <aop:config> 
    38  *       <aop:pointcut id="caldavUpdatePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.update(..))"/> 
    39  *       <aop:pointcut id="caldavCreatePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.create(..))"/> 
    40  *       <aop:pointcut id="caldavRemovePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.remove(..))"/> 
    41  * 
    42  *       <aop:advisor id="caldavCreateListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavCreatePointcut"/> 
    43  *       <aop:advisor id="caldavUpdateListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavUpdatePointcut"/> 
    44  *       <aop:advisor id="caldavUpdateInvalidationAdvice" advice-ref="ccisCaldavEventMethodCacheInvalidationAdvice" pointcut-ref="caldavUpdatePointcut"/> 
    45  *       <aop:advisor id="caldavRemoveListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavRemovePointcut"/> 
    46  *       <aop:advisor id="caldavRemoveInvalidationAdvice" advice-ref="ccisCaldavEventMethodCacheInvalidationAdvice" pointcut-ref="caldavRemovePointcut"/> 
    47  * 
    48  *   </aop:config> 
    49  * </code> 
    50  *  
    51  * @see MethodCachingInterceptor 
    52  * @since 10 januari 2009 
    53  * @author Olger Warnier 
    54  */ 
     27 /** 
     28  * Invalidate the method cache as use by the MethodCachingInterceptor 
     29  * @see MethodCachingInterceptor 
     30  * @since 10 januari 2009 
     31  * @author Olger Warnier 
     32  **/ 
    5533public class MethodCacheInvalidatorAdvice implements AfterReturningAdvice { 
    5634    private final Log log = LogFactory.getLog(getClass()); 
     
    7250                log.debug("Invalidated cache " + cacheName); 
    7351            } 
    74             /* 
    75             StringBuffer cacheKey = new StringBuffer(method.getName()); 
    76             Object arg; 
    77             for(int i = 0; i < args.length ; i++) { 
    78                 arg = args[i]; 
    79                 cacheKey.append(arg.toString().hashCode()); 
    80             } 
    81  
    82             if (log.isDebugEnabled()) { 
    83                 log.debug("Lookup cachedElement in cache " + cacheName + " for key " + cacheKey.toString()); 
    84             } 
    85             if (cache.isKeyInCache(cacheKey)) { 
    86                 cache.removeAll(); 
    87                 if (log.isDebugEnabled()) { 
    88                     log.debug("Remove cachedElement in cache " + cacheName + " for key " + cacheKey.toString()); 
    89                 } 
    90             } 
    91             */ 
    9252        } 
    9353    } 
    94      
    9554 
    9655    @Required 
    97     public void setCacheName(String cacheName) { 
     56    public final void setCacheName(String cacheName) { 
    9857        this.cacheName = cacheName; 
    9958    } 
    10059 
    10160    @Required 
    102     public void setCacheManager(CacheManager cacheManager) { 
     61    public final void setCacheManager(CacheManager cacheManager) { 
    10362        this.cacheManager = cacheManager; 
    10463    } 
  • his/trunk/support/util/src/main/java/org/joiningtracks/his/support/util/aop/MethodCachingInterceptor.java

    r1180 r1300  
    3232 * When the cache is not available, it will be created based on the default settings. 
    3333 * 
    34  * The cache uses as key the method name and the hash value of each argument and is used 
    35  * in conjunction with the MethodCacheInvalidatorAdvice in order to invalidate the given cache name 
    36  * 
    37  * Spring AOP Sample configuration: 
    38  * <code> 
    39  *   <bean id="ccisServiceCacheManager" class="net.sf.ehcache.CacheManager"> 
    40  *       <constructor-arg index="0" type="java.net.URL" value="classpath:context/services-ehcache.xml"/> 
    41  *   </bean> 
    42  * 
    43  * 
    44  *   <bean id="ccisCaldavEventsListMethodCachingAdvice" class="org.joiningtracks.his.support.util.aop.MethodCachingInterceptor"> 
    45  *       <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    46  *       <property name="cacheName" value="CCIS_CALDAV_EVENT_LIST"/> 
    47  *   </bean> 
    48  * 
    49  *   <bean id="ccisCaldavEventsListMethodCacheInvalidationAdvice" class="org.joiningtracks.his.support.util.aop.MethodCacheInvalidatorAdvice"> 
    50  *       <property name="cacheManager" ref="ccisServiceCacheManager"/> 
    51  *       <property name="cacheName" value="CCIS_CALDAV_EVENT_LIST"/> 
    52  *   </bean> 
    53  * 
    54  *   <aop:config> 
    55  *        <aop:pointcut id="getEventPointcut" expression="execution(* org.joiningtracks..CaldavTempate.getEvent(..))"/> 
    56  *        <aop:pointcut id="getAllEventsForDateRangePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.getAllEventsForDateRange(..))"/> 
    57  *        <aop:pointcut id="caldavUpdatePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.update(..))"/> 
    58  *        <aop:pointcut id="caldavCreatePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.create(..))"/> 
    59  *        <aop:pointcut id="caldavRemovePointcut" expression="execution(* org.joiningtracks..CaldavTemplate.remove(..))"/> 
    60  * 
    61  *        <aop:advisor id="getEventMethodCachingAdvisor" advice-ref="ccisCaldavEventMethodCachingAdvice" pointcut-ref="getEventPointcut"/> 
    62  *        <aop:advisor id="getAllEventsForDateRangeMethodCachingAdvisor" advice-ref="ccisCaldavEventsListMethodCachingAdvice" pointcut-ref="getAllEventsForDateRangePointcut"/> 
    63  *        <aop:advisor id="caldavCreateListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavCreatePointcut"/> 
    64  *        <aop:advisor id="caldavUpdateListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavUpdatePointcut"/> 
    65  *        <aop:advisor id="caldavUpdateInvalidationAdvice" advice-ref="ccisCaldavEventMethodCacheInvalidationAdvice" pointcut-ref="caldavUpdatePointcut"/> 
    66  *        <aop:advisor id="caldavRemoveListInvalidationAdvice" advice-ref="ccisCaldavEventsListMethodCacheInvalidationAdvice" pointcut-ref="caldavRemovePointcut"/> 
    67  *        <aop:advisor id="caldavRemoveInvalidationAdvice" advice-ref="ccisCaldavEventMethodCacheInvalidationAdvice" pointcut-ref="caldavRemovePointcut"/> 
    68  * 
    69  *   </aop:config> 
    70  * </code> 
    71  *  
    7234 * @see MethodCacheInvalidatorAdvice 
    7335 * @since 10 januari 2009 
  • his/trunk/support/util/src/main/java/org/joiningtracks/his/support/util/aop/MethodTimingInterceptor.java

    r1092 r1300  
    1616package org.joiningtracks.his.support.util.aop; 
    1717 
    18 import java.math.BigDecimal; 
    19  
    2018import org.aopalliance.intercept.MethodInterceptor; 
    2119import org.aopalliance.intercept.MethodInvocation; 
     
    2523import org.apache.commons.logging.LogFactory; 
    2624 
     25import java.math.BigDecimal; 
     26 
    2727/** 
    2828 * MethodTimingInterceptor calculates the total time used for a specific method. 
    2929 * 
    30  * Sample configuration with Spring AOP: 
    31  *<code> 
    32  *   <bean id="methodTimingAdvice" class="org.joiningtracks.his.support.util.aop.MethodTimingInterceptor"/> 
    33  *   <aop:config> 
    34  *       <aop:pointcut id="planningServiceMethodsPointcut" expression="execution(* org.joiningtracks..PlanningService.*(..))"/> 
    35  * 
    36  *       <aop:advisor id="planningServiceMethodsTimingAdvisor" advice-ref="methodTimingAdvice" pointcut-ref="planningServiceMethodsPointcut"/> 
    37  *   </aop:config> 
    38  *</code> 
    39  
    4030 * @since 10 januari 2009 
    4131 * @author Jacob Briscoe (thanks) 
  • his/trunk/tools/pom.xml

    r1285 r1300  
    3030    <modules> 
    3131        <module>archetype</module> 
    32         <module>migration</module> 
    3332    </modules> 
    3433</project>