E-Appointment Service - Development Report - Ver 1.0

March 28, 2018 | Author: Jaswinder Singh Narula | Category: E Government, Application Programming Interface, Use Case, Integrated Truss Structure, Business Process


Comments



Description

e-Appointment Service Development ReportElsa Estevez Vincent Douwe Tomasz Janowski type date version location Technical Report 14 April 2009 1.0 www.egov.iist.unu.edu/outputs UNU-IIST Center for Electronic Governance www.egov.iist.unu.edu UNU-IIST Center for Electronic Governance Identity: An International Center of Excellence on research and practice in Electronic Governance, part of United Nations University - International Institute for Software Technology, located in Macao, China. Mission: To support governments in developing countries in strategic use of technology to transform the working of public organizations and their relationships with citizens, businesses, civil society, and with one another. Activities: Applied and policy research, capacity building, and various forms of development – strategy development, software development, institutional development and development of communities of practice. Copyright © 2009, UNU-IIST Center for Electronic Governanc SUMMARY i SUMMARY This document describes the development of the eAppointment Service, part of the software infrastructure for Electronic Government, enabling government customers to make appointments for public services. The system enables government agencies to define the locations and working hours for serving their customers. It also allows citizens to make appointments, as well modify or cancel previous appointments. In addition, the system notifies citizens about confirmed appointments. The document first presents the scope of the Macao Data Exchange Gateway Project and an introduction to the e-Appointment Service. Next, it specifies in detail the software requirements, conceptual and use case models, followed by design, implementation and deployment diagrams. A glossary of terms and some implementation artifacts, such as XML Schemas, configuration files, Application Programming Interfaces and the main Java classes of the Appointment System are included in the appendices. This work was partly funded by Macao Foundation under the e-Macao Program (www.emacao.gov.mo). UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist.unu.edu ................... 24 4................................................ Technologies ..................................................... 59 D.............. Non-Functional Requirements....................................................................................................................................................................................................................................................................... Java Classes .............................................................................................2.......................................... Design ............................................ ii List of Tables....................................................................................... 53 C............................................................................................. v Abbreviations ............................. 2 2....................................................... 45 6........... Use Case Model ................ 32 5......................................... Background ....................................................................................................................................................................................................................................................................................................................... 51 A....................... 49 References......................... Deployment .. 46 7......................... 3 2.................................... Improvements .............................................1................................ 2 2........................................................... 64 E....................................... i Table of Contents ................................ Implementation Approach .............................................. Concepts ............................1.................................................................................. Functional Requirements...................................................................1........ Detailed Behavioural Design Diagrams ...................................................................................................................................................................................................... Architecture – Static View .................................................................unu....... Glossary ........................................................................ 1 2.............................................................................2................................... Case Studies ............................................................................................................................................... Implementation ......................... 30 5...................................................................................3................................................................. vi 1....................................................................... vi Revisions .................iist....................................................... Conclusions ............................................................................................................................................................. Motivation ..................................................... Modeling ......1..3................................................ 72 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www................................................................................................................................................................................................................ Requirements .............................................................................................................................. 48 8................................................................................................... 24 4.......................................... XML Schemas........................................................................... 31 5.......................................................................................... 38 6...................................................................................... 51 B................................ 14 3.............................................................................................. 30 5.......... 4 2............................................................................................................................1.............................2.......................................................... Challenges.............................................................................................. iv List of Requirements ................ 7 2....................egov... 14 3........................................................................................................ Conceptual Model .......................................................................................................... 7 3............................................................................................................................................................................................................................................5..............................................................................................................................................................................3................... 21 4................................................................................................................................................................................................ 43 6......................................... 50 Appendices . Introduction ..............................................4......................................................... 43 6..........edu ............................................................6......................................................................TABLE OF CONTENTS ii TABLE OF CONTENTS Summary ................................ Application Programming Interfaces................... Detailed Structural Design Diagrams ...................................................................................................................... 5 2....................................................... iii List of Figures ........................................... Architecture – Dynamic View .............................................................................................................................................................................................................................................................2...... Configuration File .................................2........................................................ 25 5.................................................................................................................................................................................................................................4. Process............................................................................................................................................................................... Overview..... ................... 2 Table 2: Main Tasks of the e-Appointment Business Process ............................................................................................................................................ 28 Table 10: Use Cases – Use Software Infrastructure...............................unu............................................................................................................................................................................................................................ 8 Table 6: Top-Level Use Cases ....................................... 28 Table 11: Use Cases versus Functional Requirements...............Performance Indicators ............................................................................................................................. 4 Table 3: Implementation Approach for Main Tasks of the e-Appointment Business Process ............................................................................................................................................. 5 Table 4: e-Appointment Functions ........................... 27 Table 9: Use Cases – Request Appointments .................... 6 Table 5: Greece DDYEP e-Appointment Service ................................................................................edu ...................................................................................................................................................LIST OF TABLES iii LIST OF TABLES Table 1: Examples of Public Services Requiring Appointment.......................................................................................................................................................................................egov........................... 26 Table 8: Use Cases – Manage Supported Services . 25 Table 7: Use Cases – Manage e-Appointment Service ......................... 45 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www................................... 29 Table 12: Technologies Used by e-Appointment Service .........iist...... ................................................................................................................................................................................. 13 Figure 9: Singapore – LRWD e-Appointment Service – Retrieving an Appointment ......................................................................................................................................................................................................................... 24 Figure 11: Top Level Use Case Diagram. 37 Figure 25: Sequence Diagram for Adding an Agency...................................................................................................................................... 11 Figure 6: Singapore – LRWD e-Appointment Service – Terms and Conditions.......................................................................................................................... 39 Figure 27: Sequence Diagram for Making an Appointment – Steps 1 and 2 ................................................................................................................................................................................................................................ 10 Figure 4: Singapore – ICA e-Appointment Service – Retrieving an Appointment............................................... 25 Figure 12: Use Case Diagram – Manage e-Appointment Service ..................... 34 Figure 21: Design Class Diagram – Service ............................. 33 Figure 19: Design Class Diagram – e-Appointment Portal Web Pages ............................................unu............................................ 10 Figure 5: Singapore – ICA e-Appointment Service – Appointment Receipt ....................................................................................................................... 31 Figure 18: Design Class Diagram – e-Appointment Common Web Pages ......... 9 Figure 3: Singapore – ICA e-Appointment Service – Authenticating Applicants.........................................................................................................edu ....................................... 12 Figure 8: Singapore – LRWD e-Appointment Service – Providing Personal Data .............................................................................................................................................................................................................................................................. 41 Figure 29: Implementation Diagram ........ 26 Figure 14: Use Case Diagram – Request Appointments ........ 27 Figure 15: Use Case Diagram – Use Software Infrastructure ................................................................................. 38 Figure 26: Sequence Diagram for Deleting an Agency ..................................................................................................................................... 43 Figure 30: Deployment Diagram – A Possible Scenario ......................................... 40 Figure 28: Sequence Diagram for Making an Appointment – Steps 3 and 4 ........ 25 Figure 13: Use Case Diagram – Manage Supported Services ................................................................................................................................................................................... 7 Figure 2: Singapore – ICA e-Appointment Service .......................................... 36 Figure 23: Design Class Diagram – Communication ............................................................................................................................... 30 Figure 17: Architecture – Dynamic View for Making an Appointment .....................................................................................................................................LIST OF FIGURES iv LIST OF FIGURES Figure 1: Appointment Negotiation Process ................................................................................................................ 36 Figure 24: Design Class Diagram – Database ...........iist..............................................................................................................................................egov....................................................................... 48 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www................................................................................................................................ 33 Figure 20: Design Class Diagram – e-Appointment Agency Web Pages ................................................................... 28 Figure 16: Architecture – Static View ............... 11 Figure 7: Singapore – LRWD e-Appointment Service – Negotiating Time ................................................ 36 Figure 22: Design Class Diagram – Util ............. 13 Figure 10: Conceptual Model ............................. ................. 23 Requirement 19: Ensuring Interoperability .......................................................................................................................... 22 Requirement 17: Ensuring Confidentiality ..................................................................................................................... 21 Requirement 16: Authenticating users ............................................... 17 Requirement 7: Managing Working Hours ........................................ 17 Requirement 8: Viewing Appointments ............LIST OF REQUIREMENTS v LIST OF REQUIREMENTS Requirement 1: Administering Agencies .....................................................................................................................................................................................................................................egov............................................................................... 16 Requirement 5: Managing Centers ................................. 16 Requirement 6: Managing Non-Working Days ................................................................................................................................ 20 Requirement 13: Notifying Applicant ...........................................................................................................................................................................................................................................edu .................................................................................................... 15 Requirement 3: Managing Public Holidays....................................................................................................................................................................................iist........... 18 Requirement 9: Exporting Appointments............................................................................................................................................... 18 Requirement 10: Making Appointment ............................................................... 19 Requirement 11: Cancelling Appointment ............. 15 Requirement 4: Managing Services Data .............................................................................................................................................................unu............................................ 20 Requirement 14: Reminding Applicant ............................................... 14 Requirement 2: Administering Services List ........................... 19 Requirement 12: Modifying Appointment .......................................................................................................................................... 23 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www............................................................................................................................................. 22 Requirement 18: Ensuring Generality ....................................................................................... 21 Requirement 15: Exchanging Appointment-related Information..................................................................................................................................................................................................... 97 0.unu.96 0.ABBREVIATIONS AND REVISIONS vi ABBREVIATIONS EPS IAS ID IPIM SAFP SI4EG SS UML UNU UNU-IIST UNU-IIST-EGOV XML XSL XSLT Electronic Public Services Social Welfare Institute Macao Sports Development Board Macao Trade and Investment Promotion Institute Public Administration and Civil Services Bureau Software Infrastructure for Electronic Government Health Bureau Unified Modeling Language United Nations University UNU International Institute for Software Technology Center for Electronic Governance at UNU-IIST eXtensible Markup Language eXtensible Stylesheet Language XSL Transformations REVISIONS DATE 24/01/2009 09/02/2009 20/02/2009 14/04/2009 RESPONSIBLE Elsa Estevez Vincent Douwe Elsa Estevez Tomasz Janowski SCOPE First version Second draft version Second draft version revised Final version VERSION 0.egov.edu .0 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.iist.98 1. deployment and reliable delivery. o2) The encryption-decryption extension of the Messaging Gateway will be re-implemented using the certificates provided by Macao Post Office. Subsequently. INTRODUCTION The provision of Electronic Public Services (EPS) in terms of number. mediation. notifications to applicants. as it requires the availability of pre-existing components. The Gateway enables asynchronous exchange of messages among registered members (e. To achieve the last objective. software applications or human users) through dynamically created and subscribed channels. tools and artifacts that can be used for rapid development. guidelines and implementation frameworks that can be used for accelerating EPS development. transformation.SECTION 1 – INTRODUCTION 1 1. reducing the costs of developing EPS by individual agencies. and various extensions providing enhanced functionality . and resource discovery. a new release of the Gateway was delivered including new APIs and enhanced services. UNU will submit the Message Gateway Quality Assurance report. the objectives of the Macao Data Exchange Gateway Project were revised producing the following: o1) In order to facilitate the use of the Messaging Gateway by Macao Government Agencies. configuration files. a set of appendices include the XML schemas. A meeting was held between SAFP. maturity and accessibility is central for measuring the progress of Electronic Government development.g. However. tools and artifacts constitute the so-called Software Infrastructure for Electronic Government. depicted by the Conceptual and Use Case models. application programming interfaces. two services were developed – Queuing and Appointment. enabled on the platform. and enabling the integration of applications built with different technologies. Section 4 describes the domain concepts and the required functionality. Section 6 and 7 introduce implementation details and possible deployment scenarios. and message exchange between software applications. rapidly and efficiently. It comprises a core framework supporting plain exchange of messages. Section 3 defines the functional and non-functional requirements for the service. encryption/decryption. validation. the Software Infrastructure for Electronic Government Project was defined by the UNU-IIST Center for Electronic Governance to be executed as part of the e-Macao Program during 2007. facilitating the creation of cross-agency EPS. The project aim was to develop a unified message infrastructure based on the UNU’s Extensible Message Gateway and DSC’s e-DocX Service – Unified Macao Government Message Gateway. and the main Java classes of the eAppointment Service.unu. This report constitutes the development report for the e-Appointment Service. Section 2 introduces some concepts and motivation for providing an appointment service. Consequently. Some conclusions are drawn in Section 8. the Extensible Messaging Gateway – Quality Assurance Report [29] was delivered to SAFP. DSC and UNU-IIST representatives to discuss the integration of the Extensible Message Gateway and e-DocX Service. o4) To develop a pilot e-service enabling the management of customer queues by government agencies. The availability of such infrastructure is one of the major facilitators for scaling up. Finally. e-document exchange and multi-channel service delivery. To fulfill the third objective. it was concluded that it would be simpler for government agencies to use both tools independently of the other. UNU will provide APIs to invoke the Message Gateway services by software applications running on the IT platforms most commonly used by Macao Government.edu . respectively. In 2008.egov. o3) In order to facilitate the testing of the Messaging Gateway by SAFP. the rapid provision of mature EPS cannot be achieved following a case-by-case approach.iist. promoting the adoption of standards across government. This integration leverages the strengths of the two solutions to support integration of back-office applications. establishing a platform for collaboration between agencies and between public and private sector on EPS and infrastructure development. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. the Macao Data Exchange Gateway Project was carried out by UNU-IIST Center for Electronic Gover- nance. main benefits that can be gained by delivering such infrastructure for Electronic Government include: providing standardized services to all agencies based on common technical standards. To achieve the former two objectives. based on specific needs. Section 5 presents the architecture and detailed design of the service. The rest of this document is structured as follows. The Message Exchange Gateway (Gateway). These components. Such infrastructure includes design-time artifacts – like readyto-customize domain models. was delivered by this project. Based on the motivation and prospective benefits of providing software infrastructure. a major infrastructure service.such as message logging. In addition to the motivation explained above. as well as run-time components and services supporting or realizing common software functionality required for the efficient and reliable delivery of services – like submission of citizen data through electronic forms. the provision of EPS. a consultation is booked with the specialist for the patient to receive adequate treatment. a patient visits a hospital to receive medical assistance.making better use of scarce government resources and avoid applicants queuing. 2) Table 1: Examples of Public Services Requiring Appointment AGENCY SERVICE APPOINTMENT REQUIREMENT SS Out-patient Medical Assistance An appointment with a specialist is booked IAS Financial Assistance to Individuals Applicant books an appointment to visit the social welfare center. Likewise. In order to deliver such services more efficiently .egov.5 (Challenges) outlines some of the challenges for implementing and delivering the service. Section 2. Examples of public services delivered by the Government of Macao SAR requiring appointments were extracted from the survey carried out as part of the eMacao Project (Phase I). Finally. Volume 2 Agencies report [4]. Once the patient is referred to a specialist.SECTION 2 – BACKGROUND 2 2. documented in The State of Electronic Government in Macao. MOTIVATION The delivery of some public services requires the applicant to visit a government agency or a centre providing specialized public services. BACKGROUND The aim of this section is to provide background information related to the e-appointment service in order to get a better understanding of its scope. usually part of the scarce human resources in government. like government officials or medical doctors.4 (Implementation Approach) discusses an approach for implementing each of the steps of the service business process.2 (Concepts) introduces definitions related to the service. after the application is complete and the computer records are created for the applicant. by presenting concrete public services delivered by the Government of Macao SAR requiring appointments as part of their business processes. Health Bureau (SS) provides Out-patient Medical Assistance service. For example. Section 2. as well as appointments for follow-up clinical analysis.edu . Section 2.6 (Case Studies) illustrates some examples of eAppointment services. a business owner visits a government agency to sign the establishment of a new company. some kind of agreement is required to schedule such visits. a government official visits the applicant to inspect his/her life conditions in order to complete the assessment of the applicant’s financial status. These agreements are managed through appointments. Section 2. In addition. These examples are depicted in Table 1 and explained as follows: 1) 2.1 (Motivation) presents the need for providing an appointment service as part of the software infrastructure for Electronic Government. After paying the visit to the specialist.1.unu.iist. Section 2. Government official visits the applicant to inspect his/her life conditions IPIM One-stop Investor Service An appointment is done with IPIM notary for signing the company establishment ID Sport Medical Services Appointments with physiotherapy are booked for the patient UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Social Welfare Institute (IAS) provides the Financial Assistance to Individuals service. These visits involve skillful or professional civil servants. Applicants need to book an appointment to visit the social welfare center to apply for the service. new appointments may be required for follow-up consultations. The section is structured as follows. it may also require a civil servant to visit the applicants’ facilities – for example.3 (Business Process) explains the different stages for delivering the service. Section 2. an official inspecting the sanitary conditions of a new establishment. or booking a seat for a government press conference. etc. should be supported through ICT. Since we are focusing on appointments which are involved in the delivery of public services. benefit delivered by the service. or in a virtual place – like an e-forum. they are able to fulfill the pre-defined requirements for the future interaction. the interactions between parties . 3) 4) 5) 6) For example.. the concrete benefit delivered by the service is an agreement. Our proposed definition is presented below. The following definition of e-Appointment is proposed. while bookings involve physical resources. like booking a venue. He emphasizes that appointments involve agreements between social actors – like persons or institutions.unu.e. and the agreement is not restricted to be done through the Internet. requiring the patient not to eat during a given time before the analysis takes place. Therefore. the agreement is about interacting in the future (i.2.for making the arrangement. Definition 2: e-Appointment e-Appointment is a service providing an agreement between a service consumer and the service provider for interacting at a certain future time and place (physical or virtual) for a specific purpose. Definition 1: Appointment An appointment is an arrangement between parties for interacting at a certain time and place for a specific purpose. an agreement for clinical analysis. Once the submission of all the necessary documentation by the applicant is completed. 2) 2. As illustrated. consultation is carried out and a prescription is issued to the patient. it is achieved through interactions supported by ICT. The patientmakes payment and an appointment is booked for the applicant to visit the physiotherapy.SECTION 2 – BACKGROUND 3 3) Macao Trade and Investment Promotion Institute (IPIM) provides One-Stop Investor service. Klischewski [3] differentiates between the appointment and the booking services. such as: 1) e-Appointment is a service – all service-related concepts can be applied. appointments are included as part of the business processes of various public services. For example. the interaction will take place on a future date and time. In this way. business process supporting the delivery of the service. such as a business meeting or medical treatment [3]. the concept of e-Appointment emerges.edu . the future interaction may take place in a physical place – like a hospital. In order to transform the appointment service into an e-service. the interactions for providing the service. Since parties know in advance the purpose of the meeting. providing an e-Appointment service as part of the software infrastructure for Electronic Government would facilitate the rapid development and efficient provision of such services. like service consumer and provider. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. the appointment itself can be treated as a service. the agreement is achieved through a series of interactions. instead of developing individual solutions for each of these services. Consequently. a citizen and the local government who agree to have a meeting in a given place for the citizen to be examined before issuing a driving license. the applicant makes an appointment with IPIM notary to sign the company establishment. as defined by the Merrian-Webster Dictionary [2]. CONCEPTS An appointment is an arrangement for a meeting. the agreement pursues a specific purpose.iist. Macao Sports Development Board (ID) provides Sport Medical services. the agreement involves two parties – service consumer and service provider. it can be transformed into an e-service. The agreement is achieved through a series of ICT-supported interactions. 7) 8) Finally. After the patient is received and registered at the center.egov. 4) Main differences can be highlighted between the last definition and the one provided by Klischewski. Klischewski defines e-Appointment as an Internetmediated agreement between two or more parties as social subjects (person or institution) to interact at a certain time and place for a certain purpose. delivery channels.iist. and Post-Appointment activities. At the same time. supporting documents. and how many minutes in advance the service provider would like to remind the applicant about the agreed interaction (reminder notification) time.number of consumers served at a time. find the e-appointment service supporting the delivery of S. The Pre-Application phase comprises all the tasks that the parties can execute before negotiation of the agreement takes place. during this phase. define the locations (places) and working hours (times) where the interactions regarding S can take place. like the application form.mean time for serving each consumer. like number of customers that can be served at a time. delivery channels. the service provider shall announce the e-appointment service in support of a public service (S). required supporting documents. In addition. and register some performance measures related to S. … Negotiate place for S-related interaction Negotiate time for S-related interaction Receive pre-defined requirements for attending the agreed interaction Notify the service provider about special conditions Fulfill the requirements for attending the agreement Cancel existing agreement Modify existing agreement Be present at the place at the agreed time S7 Postapplication P8 Notify consumer about the agreement S8 P9 Ensure resources are available for providing S on the agreed places and at the agreed time Remind consumer about the agreement S9 S10 S11 P10 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. etc. . However. like: . .egov. delivery centers. Aiming at defining the underlying business process for providing e-Appointment services. The process is depicted in Table 2 and explained below. in order to avoid any confusion that could be raised by using the Post-Appointment name to refer to the actions that could take place after the agreement itself (appointment) and not after the date on which the appointment was agreed. For instance. the service consumer can search for the required service (S). eligibility criteria. delivery centers. Table 2: Main Tasks of the e-Appointment Business Process ACTIVITY Preapplication SERVICE PROVIDER – TASKS P1 Announce the e-Appointment service in support of a public service (called S) Define places for S-related interactions Define times for S-related interactions Register performance measures for S. and provides concrete examples for the interactions taking place during these phases. PROCESS In order to better understand the requirements for developing an e-Appointment service. and find information about S. we rename the activities as Pre-Application. Application P5 P6 P7 Negotiate place for S-related interaction Negotiate time for S-related interaction Provide pre-defined requirements for attending the agreed interaction S4 S5 S6 SERVICE CONSUMER – TASKS S1 Search for the required service (S) P2 P3 P4 S2 S3 Find e-Appointment for S Find S-related information.notification period of time. Application and Post-Application phases. Klischewski [3] identifies three main phases as part of the process for delivering the service – Pre-appointment Activities. we enrich the model by defining tasks that the two parties – service provider and service consumer can ex- ecute during these phases. we follow the three main stages identified by Klischewski.3.SECTION 2 – BACKGROUND 4 2.edu . like: application form. mean time for serving a customer. Appointment Negotiation.unu. iist. IMPLEMENTATION APPROACH Based on the business process tasks defined in the previous section.Be present at the place and time agreed. S8 Fulfill the requirements for attending the agreement. In addition. The service consumer fulfills the requirements before at-tending the interaction and is available at the time and place agreed. the service consumer can notify the service provider about special conditions he/she would like before an interaction is agreed upon. The following section discusses implementation approaches for each phase. and S11 . The Post-application phase comprises all possible actions that the parties can execute after the agreement is established. an implementation approach for each of them is depicted in Table 3 and explained as follows. the service provider notifies the consumer about the confirmed agreement. Some of the tasks executed by the service consumer are out of the scope of public administrations since they are consumer’s responsibility.SECTION 2 – BACKGROUND 5 The Application phase involves those interactions between the parties that enable them to set the agreement. and remind the service consumer some time in advance that the interaction will take place. 2.egov. like: S6 . P1 Announce the e-Appointment service in support of another public service (called S). both parties need to negotiate the place and time for the interaction. P7 . and S3 – Find S-related information. For instance. In addition. For instance. Table 3: Implementation Approach for Main Tasks of the e-Appointment Business Process ACTIVITY Preapplication SERVICE PROVIDER – TASKS P1 P2 P3 P4 Application P5 Service of the government portal e-Appointment function e-Appointment function e-Appointment function e-Appointment function S4 e-Appointment function and optionally Authentication service e-Appointment function and optionally Authentication service Out of scope e-Appointment function Out of scope SERVICE CONSUMER – TASKS S1 S2 S3 Search service of the government portal Search service of the government portal Search service of the government portal P6 e-Appointment function S5 P7 e-Appointment function and/or search services of the government portal S6 S7 Postapplication P8 e-Appointment function and Notification service Organizational procedures S8 P9 S9 S10 e-Appointment function e-Appointment function Out of scope P10 e-Appointment function and Notification service S11 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.Receive pre-defined requirements for attending the agreed interaction. should be executed according to organizational procedures.unu.edu . S2 – Find eAppointment for S. the service provider shall provide information about the requirements that the consumer needs to fulfill before the meeting. Task P9 . S1 – Search for the required service (S). assures all the required resources will be available for the interaction.Provide predefined requirements for attending the agreed interaction. For example. In addition. Some tasks could be provided by available services offered by the government portal since they involve publishing information on the portal and facilitating access to an e-service through the portal. while the service consumer shall receive such information. the service consumer can modify or cancel an existing agreement.4.Assure resources are available for providing S at the agreed places at the agreed time. the provider and optionally. may involve the notification service of the software infrastructure. and the provider confirms the agreement. the consumer selects and submits his/her choice. since they involve updating information in a database. The sequence is illustrated in Figure 1. Therefore. we present a more refined version explained as follows. the provider presents the available choices matching the consumer’s preferences. selects the date and time. notify and remind the service consumer about the agreement. Table 4 presents the list of tasks that shall be considered as functionality offered by the eAppointment service. In addition. all other functions involved in the eAppointment service are simple tasks to be automated. the agreement negotiation can be executed according to the following sequence: 1) service provider informs available places. can be supported by the Authentication service of the software infrastructure. P6 and S5 – Negotiate time for S-related interaction. first selects the location. the one adopted in this work. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. The tasks include defining places. Consequently. notify the service producer about special conditions. negotiate place and time for the interaction. and each of them may have different working hours. and second. tasks S4 and S5 – Negotiate place and time for S-related interaction. S7 – Notify the provider about special conditions.egov. One-on-one appointment .the provider informs the available dates and times. P8 and P10 – Notify and Remind the consumer about the agreement.Register performance measures for S. However. S9 – Cancel the agreement. In summary. the consumer. and cancel and modify an existing agreement.Define places for S-related interactions. Klischewski [3] differentiates two possible approaches for negotiating the agreement: 1) Consultation hour . P10 – Remind the consumer about the agreement. and 6) service consumer confirms place and time. 2) service consumer selects place. like P2 . 3) service provider informs available times. P3 . Except for the appointment negotiation tasks (P5-S4 and P6-S5). In summary. For the appointment negotiation tasks.Provide pre-defined requirements for attending the agreed interaction. P7 .unu. P4 . the consumer selects and submits his/her choice.SECTION 2 – BACKGROUND 6 Table 4: e-Appointment Functions ACTIVITY Preapplication FUNCTIONS P2 P3 P4 Application P5 – S4 P6 – S5 P7 Post-application P8 P10 S9 S10 Define places for S-related interaction Define times for S-related interaction Define performance measures for S Negotiate place for S-related interaction Negotiate time for S-related interaction Notify the service provider about special conditions Notify consumer about agreement Remind consumer about agreement Cancel existing agreement Modify existing agreement All other tasks should be provided by the e-appointment service. We introduce the idea that there might be several locations where the interaction can take place. times and performance measures for S-related interaction.edu . 5) service provider confirms place and time.Define times for S-related interactions. and S10 – Modify the agreement. P8 – Notify the consumer about the agreement. P5 and S4 – Negotiate place for S-related interaction.iist. the consumer confirms the agreement. 2) The first approach minimizes the number of interactions required to reach an agreement and is the most commonly used. 4) service consumer selects time.the consumer submits his/her choices and/or restrictions. In addition. if the service requires authenticating the applicant. meaning that service consumers should be able to make appointments through various channels. Both solutions are different. permanent residents and tourists.all provided by the same government agency. uses different data for each service. there are no scientific publications about e-Appointment mainly due to the rather simple implementation problem when considering the appointment for one single service.SECTION 2 – BACKGROUND 7 Figure 1: Appointment Negotiation Process agreements made with different IT platforms on which these software applications are deployed. although is not an eAppointment infrastructure service since it only sup-ports services provided by one government agency. C4) Multi-Channel Delivery – as any other service. If a multi-channel delivery approach is implemented. Two experiences from Singapore were analyzed – i) provided by the Ministry of Home Affairs and ii) provided by the Ministry of Manpower. the e-Appointment solution shall be able to fit within the existing approach. The Singapore experience from the Ministry of Home Affairs shows an e-Appointment service supporting various services delivered to different recipients – like citizens. FINDINGS 1) The experience from Greece. fax.unu. Standardized data shall be available for the e-Appointment solution to be able to retrieve them.iist.5. A secure communication infrastructure is needed to exchange appointment-related information between the government portal and agencies providing services. The next sections present in details each of the case studies analyzed.egov. However. phone.6. a multi-channel delivery approach may be adopted for e-Appointment. is deployed. the service needs to provide information about the confirmed agreements to several government agencies responsible for delivering services using the e-Appointment solution.edu . CHALLENGES As Klischewski has pointed out [3]. etc.6. Some of them are presented below. 2. SMS. like portal. The findings are presented in Section 2. part of the software infrastructure.1.1. while attempting to generalize the appointment service and conceiving it as an infrastructure service. CASE STUDIES Experiences of e-Appointment services from Greece and Singapore were analyzed. showing the lack of a common e-Appointment service. The eAppointment shall be able to communicate the 2. C5) Service Parameterization – since each service using the e-Appointment may have its own performance measures. The service does not provide a standardized mechanism for authenticating applicants. counter. part of software infrastructure for Electronic Government. various challenges arise. explains clearly the benefits achieved by implementing an e-Appointment solution. C3) Back-Office Heterogeneity – each government agency providing services using the e-Appointment solution may have its own software applications supporting the back-office processes. should be accessible through the government portal. C6) Infrastructure Integration – if a software infrastructure providing common functionality – like authentication and notification services. 2. C1) Communication Infrastructure – the e-Appointment service. the e-Appointment solution shall be able to integrate and interact with the infrastructure components and services. 2) 3) UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. C2) Standardized Data – each government agency providing services using the e-Appointment solution may have its own computerized records about the available places and times in which the interactions can take place. the e-Appointment solution shall provide a mechanism to easily configure parameters for each service. The case study presents concrete performance indicators and measurements demonstrating the improvements achieved in efficiency.6. However. call centre. per assessor. modification and withdraw of marketing authorizations. food supplements. and vi) to build capacity among pharmaceutical companies and staff for future development comprising e-services. and continuously improved. ii) to eliminate idle time between companies visits. per category. for example. GREECE – E-APPOINTMENT SERVICE IN HEALTH AREA The National Organization for Medicines (EOF) [5] of Greece is a public entity under the Ministry of Health and Solidarity responsible for ensuring the public health and safety regarding specific products. although it seems very unreliable – no exhaustive validations are executed and while submitting the results of a questionnaire about the service. ii) to ensure fair treatment to all pharmaceutical companies. and cosmetics. medical devices. repeated. per a given time.unu. iv) to better utilize the time of personnel and stakeholders. measured. and iv) to ensure effective long term scheduling for staff activities. available and non-available dates for appointments. for ensuring all receive the services they require. iii) to provide services based on the consumers’ needs rather than on the division capabilities. for a given time. iii) to seek out and make use of available technologies. v) to develop a standardized process which can be monitored. etc BEFORE 8063 1675 1-5 1-3 50% 20% not known AFTER 9024 2112 0 1-2 20% 0 recorded recorded analyzed IMPROVEMENT 12% 26% 100% 50% 60% 100% 100% not known 100% UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.6. The Singapore experience from the Ministry of Manpower shows a very simple and friendly service. ii) to be more customer-focused. and for storing and maintaining all EOF records. For example. feeding stuffs and food additives. for issuing all EOF licensing decisions concerning approval. missed. an error was obtained informing that the database was not available. the Validation of Applications and Marketing Authorization Division (DDYEP) is responsible for validating all applications submitted to Table 5: Greece DDYEP e-Appointment Service . analyzed. DDYEP has deployed an e-Appointment system [5] through which pharmaceutical companies can arrange scheduled appointments. among others. iv) to create an environment of common purpose and cooperation between DDYEP and the pharmaceutical companies. and v) to secure transparency and equity.iist. the time in advance for changing an appointment. like medicines for human and veterinary use.2. renewal. The strategic objectives include: i) to increase process transparency by directly involving the consumers (pharmaceutical companies) in the formulation of the visit schedule. The operational objectives comprise: i) to increase effectiveness by controlling the amount of time for serving each company. Some of the driving forces creating the need for the e-Appointment solution include: i) to provide a solution to the increasing pressure on resource utilization.Performance Indicators KEY PROCESS INDICATOR Number of appointments Number of appointments served per staff Number of calls for arranging appointment Number of visits for arranging appointment Variance between appointment desired and scheduled Employee time spent in arranging appointments Statistics available to pharmaceutical companies – number of appointments scheduled. iii) to control the differences between the time spent with each company.egov. 2) managing different validation rules for each service. held. it made good use of colors to highlight different options – like holidays.edu . Two special features implemented in the solution provided by the Ministry of Home Affairs of Singapore include: 1) issuing of a receipt after confirming the appointment for some services. Within EOP. EOF. Strategic and operational objectives were defined for the e-Appointment service. missed. held. the applicant is required to bring the receipt to the appointment. 5) 6) 2.SECTION 2 – BACKGROUND 8 4) A good design feature implemented in the solution provided by the Ministry of Home Affairs of Singapore is the user interface. etc Statistics available to DDYEP – number of appointments scheduled. per category. Figure 2: Singapore – ICA e-Appointment Service UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Figure 2 shows the different types of services which are supported by the e-Appointment service.unu. Results about the improvements gained with the deployed solution are presented in Table 5. i) citizens can arrange appointments for collecting Identity Card (IC) and passport. ICA has deployed an e-Appointment system [5] through which citizens. permanent residents and visitors can arrange an appointment to receive various services. 2) a systematic analysis of statistics enables to improve efficiency in managing the workload and making better use of limited resources.3.E-APPOINTMENT SERVICE IN MINISTRY OF HOME AFFAIRS The Immigration and Checkpoints Authority (ICA) [7] of Singapore is a government agency under the Ministry of Home Affairs.SECTION 2 – BACKGROUND 9 Some of the lessons learnt after deploying the solution include: 1) the increased transparency for scheduling visits has proactively addressed pharmaceutical companies’ grievances. ii) permanent residents can arrange appointments for applying for Permanent Residence (PR). SINGAPORE . while the number of visits for the same purpose also decreased by 50%. iii) visitors can arrange appointments for completing visit pass and Secure Trade Partnership (STP) formalities.egov. The latter two results help to reduce the time spent by employees in arranging appointments to zero. The differences between the appointments desired and scheduled improved by 60%.edu . The results show how the total number of appointments served increased by 12%. the number of appointments served by each staff increased by 26%. 2. for renewing or transferring the Re-Entry Permit (REP) or Certificate of Identity (CI). and has helped in cultivating spirit of common purpose. Finally. air and sea checkpoints. and 3) analysis of the statistics of visit schedules enables better staffing decisions. and for completing Permanent Residence formalities. and for changing an existing appointment (e-XTEND). ICA is responsible for the security of Singapore’s borders including the entry of undesirable persons and cargo through land. For example. and various immigration permits and visas for tourists.iist. statistics are available for the pharmaceutical companies and for DDYEP. and for modifying an existing appointment (Citizenship Registration). and hence provides better services to companies. the number of calls for arranging appointments dropped to zero. ICA is also responsible for issuing ID cards and passports to Singapore citizens.6. while for applying for permanent residence the appointment can be changed at least one day before the scheduled date. when a citizen would like to change an appointment. a calendar is shown on the screen. while days on which all appointments are booked are shown in grey (like Thursday 24). For instance.unu.iist. The applicant is re- quired to carry this acknowledgment when attending the appointment. he/she needs to provide the NRIC and the File reference numbers. For instance. he/she needs to provide the number of the National Registration Identity Card (NRIC) and the NRIC date of issue. the available dates are shown in green (like Friday 18). Validation rules are defined for each service. A receipt. Figure 3: Singapore – ICA e-Appointment Service – Authenticating Applicants 2) 3) 4) Figure 4: Singapore – ICA e-Appointment Service – Retrieving an Appointment UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Figure 3 shows these examples.edu . he/she needs to provide the application ID. like the one presented in Figure 5. non-working days are indicated in pink (like Sunday 20). The current applicant’s appointment is highlighted in orange (Thursday 31). is issued for some of the services. For instance. for collecting ICs.egov. while for collecting the passport (Collection of Passport). as the one presented in Figure 4. if a citizen would like to change a previous appointment (Citizenship Registration). and scan it in the Self Service Ticketing Kiosk for the queue ticket. for collecting the IC (Collection of IC). Colors are used for indicating to the service consumer the status of the available times. appointments can be changed at least two days before the appointment date and the appointment can be changed only twice.SECTION 2 – BACKGROUND 10 Four main features of the solution include: 1) Different data is used to authenticate the service consumer depending on the service. LRWD provides an e-Appointment service [10]. A demo online – provided as a pdf file. LRWD is responsible for promoting and maintaining industrial peace and stability in Singapore by providing a legal framework to balance the interests of employers and employees.) Consumers must accept the conditions to access the service.egov. view. Main features of the solution include: The first mandatory page for accessing the eAppointment service is related to terms and conditions of the use of the service (Figure 6.unu. The service enables the applicant to make a new appointment.6. The service allows a person to book an appointment through the Internet to consult the Division Advisory Officers on the Employment Act. 2) 3) 4) Figure 6: Singapore – LRWD e-Appointment Service – Terms and Conditions UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. the e-Appointment solution only supports one service.iist.SECTION 2 – BACKGROUND 11 Figure 5: Singapore – ICA e-Appointment Service – Appointment Receipt 1) 2. is available for explaining the process for obtaining the appointment to the applicant.edu . SINGAPORE .4. The applicant is not authenticated when accessing the service. Therefore. cancel or re-schedule an existing appointment.E-APPOINTMENT SERVICE IN MINISTRY OF MANPOWER The Labour Relations and Workplace Division (LRWD) [9] is a government unit under the Ministry of Manpower of the Government of Singapore. edu . To retrieve an existing appointment. The second step requests the applicant to fill a form indicating the type of appointment requested – claim or enquiry about Employment Act.SECTION 2 – BACKGROUND 12 Figure 7: Singapore – LRWD e-Appointment Service – Negotiating Time 5) The process comprises three steps. or view an existing appointment. Finally. email address. It is possible to make an appointment with entirely fake data – only a valid phone is required. A survey is available for providing feedback. 7) 8) UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. and requests the applicant to select his choice – See Figure 7. the applicant must remember these data in order to modify. The form is illustrated in Figure 8. an error message was presented indicating that the system/database was down. After completing and submitting the form. and his personal data – like type of identifier (NRIC. Passport. cancel. FIM – Foreigner Identification Number. See Figure 9. home address. no other validations are applied. The first step presents a calendar showing the available dates and time.unu. mobile. and available times are indicated in blue (like all times on 11 February). Except controlling that all mandatory fields are completed and that the home/office phone is valid. Non-working days are identified in grey (like 7-8 February). the applicant needs to inform the identification he/she used to make the appointment and the appointment date. In this way. unavailable times are shown in orange (like all times on 9 February). name. and an explanation of the purpose of the visit.egov.iist. the third step confirms the appointment and allows the applicant to print a receipt. or Work Permit) and number. and office/home phones. 6) Few validations are executed when making an appointment. unu.egov.edu .SECTION 2 – BACKGROUND 13 Figure 8: Singapore – LRWD e-Appointment Service – Providing Personal Data Figure 9: Singapore – LRWD e-Appointment Service – Retrieving an Appointment UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.iist. 3. add two agencies. Each requirement is assigned the following fields: 1) 2) 3) 4) 5) 6) 7) 8) a unique identifier. textual description. 3. High It can be implemented through a simple function updating data in a database.Managing Supported Services.3 – Requesting Appointments. to avoid applicants booking an appointment on a public holiday. presents the functionality for service providers. REQUIREMENTS This section describes the functional and non-functional software requirements for the e-Appointment service. user categories: i) portal administrator – person responsible for the administration of the government portal. access to the e-Appointment service should be offered through the one-stop government portal. FUNCTIONAL REQUIREMENTS The functionality that shall be provided by the eAppointment service is defined according to three main Requirement 1: Administering Agencies ID CATEGORY DESCRIPTION F1 Functional Information about agencies providing services requiring appointments as part of their delivery process shall be available. list of glossary terms used. view the updated data.1. and the agencies providing those services. requirements category.1. Data about the communication structures used for exchanging information with these agencies shall be maintained. ii) service providers – persons responsible for operating the e-Appointment Service in each of the agencies delivering services supported by e-Appointment. In addition. Log in as portal administrator. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. The requirements are explained in the following sections as follows: 1) Section 3. The functionality that shall be provided for the portal administrator involves managing data about those services for which appointments are required as part of their business process.1 – Managing e-Appointment Service. Communication Structures Allows keeping information about the agencies which are responsible for carrying out the appointments and all communication-related data enabling information exchange between the portal and the agencies. The following sections describe in details the functional and non-functional requirements. feasibility of the requirement and criteria for verifying the requirement. and iii) service consumers – persons requesting appointments. and log out. MANAGING E-APPOINTMENT SERVICE As any other e-service.1.edu . The implementation priority has three possible values: high. implementation priority. describes the functionality for the portal administrator. data about public holidays shall be available.2 . view the updated data. Section 3. introduces the functionality for service consumers. and Section 3. 2) 3) The category field has two possible values: functional or non-functional. view agencies. The following three requirements address these needs. Agency.SECTION 3 – REQUIREMENTS 14 3. medium or low.iist.1. remove one agency.egov. justification for the requirement.unu.1.1. view the updated data. Log in as portal administrator. view the updated data. and log out.edu . and log out. view holidays.unu. select an agency. the applicant shall specify the service for which he/she is requesting the appointment. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION Requirement 3: Managing Public Holidays ID CATEGORY DESCRIPTION F3 Functional Public holidays representing non-working days for all government agencies shall be maintained. High It can be implemented through a simple function updating data in a database.SECTION 3 – REQUIREMENTS 15 Requirement 2: Administering Services List ID CATEGORY DESCRIPTION F2 Functional Information about the services requiring appointments as part of their delivery processes shall be available. Log in as portal administrator. If the government portal already maintains information about public holidays. information about the providing agency shall also be maintained. In this case. Public Holiday A list of all non-working days for all government agencies shall be maintained to avoid applicants booking appointments for those days. add two new holidays. remove the second added service. this information should not be duplicated. High It can be implemented through a simple function updating data in a database. Service To make an appointment. add two new services.iist. delete one holiday.egov. view the updated data. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. For each service. this requirement shall be interpreted as providing a function to get this data. Requirement 4: Managing Services Data ID CATEGORY DESCRIPTION F4 Functional Information about services requiring appointments shall be available. Log in as agency administrator. In addition. select an agency.unu. delete one center.egov. and one center can serve appointments for several services. minutes in advance to remind the applicant about the appointment (reminder notification time). Finally. MANAGING SUPPORTED SERVICES Service providers (agencies) shall be able to define which of the services provided by them require applicants to make appointments (supported services). not necessarily the government agency. and hours in which appointments can take place (working hours). The following requirements specify these functions. service providers shall be able to update service parameters – like number of persons that can be served at a time (counters). For each service. view the updated data. where the services are provided (centers). TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION Requirement 5: Managing Centers ID CATEGORY DESCRIPTION F5 Functional For each service requiring appointments. add two new services. Reminder Notification Time Information about the service time is required for being able to show applicants the available times for the appointments. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.2. select an agency. mean time for serving a person (service time). days in which appointments cannot be made (non-working days). data about performance measures – like mean time for serving a person (service time).SECTION 3 – REQUIREMENTS 16 3.iist. Service Time. remove the second added service.like name and address. High It can be implemented through a simple function updating data in a database. add one service. Information about these places shall be stored.edu . view the updated data. Information about the reminder notification time is needed for sending an appointment reminder to applicants. update the parameters of the first added service. service providers shall be able to view and export to a file the appointments done for a particular date. add two centers. and minutes in advance to remind the applicant about the appointment (reminder notification time) shall be maintained. Counter Appointments related to one service can take place in more than one place.1. information . view the updated data. Appointments for a service can be provided in more than one center. Log in as portal administrator. For each center and service. about the centers in which the appointments can take place shall be maintained. High It can be implemented through a simple function updating data in a database. and log out. view centers. and log out. the number of applicants that can be served at a time shall be maintained (Counters) Center. add its parameters. add two working hours. add one service. Log in as agency administrator.SECTION 3 – REQUIREMENTS 17 Requirement 6: Managing Non-Working Days ID CATEGORY DESCRIPTION F6 Functional Each agency shall be able to define its own non-working days in addition to the public holidays. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. view working hours. working hours are needed for defining the available times. view the updated data. select an agency. and log out. delete one working hour. Non-working days are applicable to all centers serving appointments for the services provided by the agency. Working Hour In order to make appointments. Log in as user. and log out. try to make an appointment during non-working hours. Working hours are related to the service and the center . Non-working Day An agency should be able to define a non-working days in addition to public holidays. view non-working days.unu. and log out.egov. High It can be implemented through a simple function updating data in a database. add one center. view the updated data. make an appointment during working-hours.edu .different services may have different working hours. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION Requirement 7: Managing Working Hours ID CATEGORY DESCRIPTION F7 Functional Each agency shall be able to define the working hours. Log in as agency administrator. try to make an appointment for the non-working day. Log-in as user. and log out. delete one nonworking day. High It can be implemented through a simple function updating data in a database. and the same service can be delivered during different working hours in the centers. add two non-working days.iist. Make appointments for one date. PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. PRIORITY FEASIBILITY VERIFICATION Requirement 9: Exporting Appointments ID CATEGORY DESCRIPTION TERMS JUSTIFICATION F9 Functional Each agency shall be able to export the appointments done for a particular date.edu .egov. and log out. Log in as agency administrator. view the appointments. export the appointments and log out. High It can be implemented through a simple function retrieving data from the database. and to be able to export these data for being able to process it by another software application. Appointment It is necessary to know in advance the appointments confirmed for a specific date in order to plan the required resources for serving government customers. High It can be implemented through a simple function retrieving data from the database. Export It is necessary to know in advance the appointments confirmed for a specific date in order to plan the required resources for serving government customers. input the date for which the appointments have been made. Make appointments for one date.SECTION 3 – REQUIREMENTS 18 Requirement 8: Viewing Appointments ID CATEGORY DESCRIPTION TERMS JUSTIFICATION F8 Functional Each agency shall be able to retrieve the appointments done for a particular date. input the date for which the appointments have been made.iist. Log in as agency administrator. Appointment.unu. re- ceive notifications about the appointments they confirmed or cancelled. Once the agency receives the data about the appointment. and confirming the choice. make an appointment. Appointment This is the main function provided by the service. The process shall be clearly explained to the user before it starts. and log out. High It requires exchanging information between the government portal and the agency. view appointments. view appointments. Log in as user.3. The applicant needs to be authenticated for cancelling an appointment. Log in as user. Log in as agency administrator. Once the agency receives the data about the appointment.SECTION 3 – REQUIREMENTS 19 2. The negotiation process executed by the consumer includes: selecting the service for which the appointment is required. and in each step the user shall be allowed to continue or return back to the previous step. make an appointment. selecting the center. and receive a reminder before the appointment will take place.edu . view appointments.unu. selecting a suitable date and time. and log out. The negotiation process shall be divided in steps. Log in as agency administrator. the data shall be stored in the agency database. and log out. Cancel the appointment. Log in as agency administrator. and log out. The following requirements define these functions. and log out. REQUESTING APPOINTMENTS Government customers shall be able to make appointments. Appointment Enabling the user to cancel an existing appointment allows reducing the number of applicants no showing up and making better use of government resources – since another user can booked an appointment for the center/date/time of the one who was cancelled.iist.egov. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. The applicant shall receive a notification about the cancelled appointment. Requirement 10: Making Appointment ID CATEGORY DESCRIPTION F10 Functional The system shall implement a function enabling a user to make an appointment for a particular service. High It requires exchanging information between the government portal and the agency. cancel or modify an existing appointment. An estimation of the amount of time required for completing the process shall be informed to the applicant when the process starts. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION Requirement 11: Cancelling Appointment ID CATEGORY DESCRIPTION F11 Functional The system shall implement a function enabling a user to cancel an existing appointment.1. these data shall be updated in the database (the existing appointment shall be deleted). Log in as agency administrator. and log out. Appointment.SECTION 3 – REQUIREMENTS 20 Requirement 12: Modifying Appointment ID CATEGORY DESCRIPTION F12 Functional The system shall implement a function enabling a user to modify an appointment that was previously done. Modify the existing appointment and receive notification.iist. and log out. Make an appointment and receive notification. The applicant shall receive a notification about the new appointment. Appointment Enabling the user to modify an existing appointment allows reducing the number of applicants no showing up and making better use of government resources – since another user can booked an appointment for the center/date/time of the one who was changed.unu.egov. Notifications shall be sent through e-mail and SMS. view appointments. High It requires exchanging information between the government portal and the agency. these data shall be updated in the database (the existing appointment shall be deleted and a new appointment shall be added). Log in as agency administrator. Make an appointment. Notification It is important for the user to receive a notification that the system registered precisely the action he/she requested (make. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. cancelled or modified. Modify the appointment. Once the agency receives the data about the appointment. cancel or modify an appointment) High It requires notifying the applicant according to his/her preferred channel (e-mail or SMS). Cancel the existing appointment and receive notification. view appointments. The service shall delete the previous appointment and add the new one.edu . TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION Requirement 13: Notifying Applicant ID CATEGORY DESCRIPTION F13 Functional The system shall implement a function notifying the applicant every time an appointment is done. and log out.edu . RELIABILITY The e-Appointment must essure that information about appointments confirmed and cancelled through the government portal is received by the agencies providing the services. High The property can be fulfilled if communications between the government portal and government agencies are supported by reliable communication infrastructure. The service provider defines the reminder notification time as part of the service parameters. Reliability Users (service providers and consumers) shall trust the service is reliable.iist.egov.SECTION 3 – REQUIREMENTS 21 Requirement 14: Reminding Applicant ID CATEGORY DESCRIPTION F14 Functional The system shall implement a function reminding the applicant that the appointment will take place. Log in as one of the service providers. Log in as user.1. Requirement 15: Exchanging Appointment-related Information ID CATEGORY DESCRIPTION NF15 Non-Functional The e-Appointment service shall be able to ensure that all appointments confirmed and cancelled through the government portal are sent to the proper agencies. security. those indicated by the reminder notification time. Reminder Notification Time It is important for the user to receive a notification reminding him/her about the appointment. 3. make two appointments for two different services delivered by different agencies. NON-FUNCTIONAL REQUIREMENTS The non-functional requirements for the e-Appointment service address four major aspects of system quality: reliability. An agency shall receive only appointment-related information for the services delivered by it. The notification shall be sent some minutes in advance. Each of them is described as follows. view the appointments done and log out. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION 3.2. High It requires notifying the applicant according to his/her preferred channel (e-mail or SMS). Appointment.unu.2. Log in as the other service provider. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Make an appointment and receive a notification before the appointment will take place. generality and interoperability. view the appointments done and log out. control the available functions and log out. Confidentiality ensures that minimum data are requested from applicants for making appointments. Check that the authentication mechanism is in place.iist. and log out. check the information is only related to services delivered by the agency. Check that only the authorized functions are available for each user type. Check policies for accessing databases. Requirement 16: Authenticating users ID CATEGORY DESCRIPTION NF16 Non-Functional Users – like service consumers. and that these data are stored and exchanged without risks of being tampered. For instance. Authentication Only authorized users can have access to information managed by the e-Appointment service. Log in as service provider. in order to cancel an appointment.egov. access to databases is restricted only to those authorized. make an appointment. Information stored and exchanged shall be protected. view and export appointments for a specific date. Log in as portal administrator. and communications rely on a secure network.edu . Authentication ensures that access to the e-Appointment service and its data is restricted to those who can provide the appropriate proof of identity.SECTION 3 – REQUIREMENTS 22 3. The following requirements address these issues. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.unu. Log in as user. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION Requirement 17: Ensuring Confidentiality ID CATEGORY DESCRIPTION NF17 Non-Functional Information used for authenticating applicants shall be minimal. High The property can be fulfilled if an authentication mechanism is used. control the available functions. service providers and portal administrator shall be authenticated for accessing functionality and data about appointments.2. and log out. SECURITY Authentication and confidentiality are the security requirements defined for the e-Appointment service. Confidentiality The amount of personal information used by the e-Appointment service shall be minimized and disclosure of these data must be avoided. High Authentication is a common feature in software applications.2. the applicant needs to be authenticated. check the times for making appointments.4. and log out. GENERALITY Generality tries to minimize the need for changing the software due to restrictions introduced during the de- sign phase. TERMS JUSTIFICATION PRIORITY FEASIBILITY VERIFICATION 3. like the government portal. Parameterization techniques can be used for providing a general solution enabling service consumers to make appointments for various services delivered by different agencies. check the service mean time for a service.egov. authentication and notification services. Requirement 19: Ensuring Interoperability ID CATEGORY DESCRIPTION TERMS JUSTIFICATION NF19 Non-Functional The system shall be able to interact with other software infrastructure components. Requirement 18: Ensuring Generality ID CATEGORY DESCRIPTION NF18 Non-Functional The system shall rely as much as possible on service parameters which shall enable functions to show different behavior according to the value of the parameters.2. and be able to exchange information through the messaging gateway. service reminder notification time.unu. Check whether messages are exchanged using the messaging gateway. Log in as service consumer. and log out. modify the service mean time for the service.edu . Possible parameterization include: service mean time. Specific requirements for each service shall be considered. The following requirement describes this feature. High Interoperability can be assured if open standards and open source technologies and tools are used for software development. PRIORITY FEASIBILITY VERIFICATION UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Log in as service provider.3. INTEROPERABILITY The e-Appointment service shall be able to interoperate with other software infrastructure components and services like authentication. among others. not only one. and log out.iist. notification. make an appointment. High Parameterization techniques are a common feature of software applications Log in as service provider.SECTION 3 – REQUIREMENTS 23 3. Configuration file The e-Appointment service shall be able to support various services. Configuration file The e-Appointment service shall be able to interact with other software infrastructure components. whether the applicant needs to be authenticated or not for making appointments. and the Messaging Gateway. Log in as service consumer. and log out.2. An Appointment involves a Notification. One Service can be delivered at various Centers. For each concept. MODELING The following two sections describe the conceptual (Section 4.2) models for the eAppointment service. A Counter serves one consumer at a time. Services are delivered at Centers through Counters. like those sent through SMS or e-Mail. ii) Service Provider – persons responsible for managing appointments at the agencies providing supported services. Three types of Users are identified: i) Service Consumer – applicants making appointments. CONCEPTUAL MODEL The conceptual model depicted in Figure 10 describes the e-Appointment-related concepts and their relationships. Appointments are requested by Service Consumers for a given Service. There exist different types of Notifications (Notification Type).unu. and several Services can be delivered in one Center. Services are delivered at Centers every day. and iii) Portal Administrator – person responsible for maintaining the Government portal.edu . which include Public Holidays. 4. Non-working Days are defined for each Center. except Non-working Days.egov. Figure 10: Conceptual Model UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. An Agency delivers Services (supported services) through Centers. a definition is provided in the Glossary and an explanation follows. Each Counter may define its own Working Hours.iist.1) and use case (Section 4.1.SECTION 4 – MODELING 24 4. Information about an existing agency can be modified.iist. its identifier. Four main groups of services are provided: 1) Manage e-Appointment Service 2) 3) 4) Manage Supported Services Request Appointments Use Software Infrastructure The top-level use cases are listed in Table 6 and are described in the following sections. Figure 11: Top Level Use Case Diagram Table 6: Top-Level Use Cases ID UC-1 UC-2 UC-3 UC-4 DESCRIPTION Manage e-Appointment Service Manage Supported Services Request Appointments Use Software Infrastructure 4.unu.2. For each agency.egov.1. The Manage Agencies use case enables management of information about the agencies delivering services which require appointments as part of their delivery processes.SECTION 4 – MODELING 25 4. MANAGE E-APPOINTMENT SERVICE The functionality provided to the portal administrator is defined by the high-level use case Manage eAppointment Service. name and the channel identifier used for exchanging messages through the Messaging Gateway shall be maintained. and Manage Public Holidays. This use case comprises three uses cases: Manage Agencies. New agencies can be added. USE CASE MODEL The top-level use case diagram is depicted in Figure 11. or deleted if the agency no longer deliver services requiring appointments.edu . Figure 12: Use Case Diagram – Manage e-Appointment Service UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Manage Services. These uses cases are depicted in Figure 12 and are identified in Table 7.2. Manage Non-Working Days. View Appointments. if information about public holidays is already available at the government portal. For each service. are stored. The Manage Working Hours use case allows defining the time frame in which appointments can be requested. if the service no longer requires appointments. New centers can be added. information about centers used for delivering the service is also maintained. and the data of existing centers can be modified and deleted. Finally. Manage Counters. MANAGE SUPPORTED SERVICES The functionality offered to service providers is defined by the high-level use case Manage Supported Services. its identifier.2. This data can be updated.edu . Information about services can be modified. The Manage Centers use case enables management of the identification and addresses of those places where appointments take place.SECTION 4 – MODELING 26 The Manage Service List use case allows keeping information about the services for which the service consumers can request appointments. To avoid information duplication. Manage Centers. together with information about the agency that is responsible for its delivery. Each holiday has an identifier and a date. modified and deleted. New services can be added to the list. and Export Appointments. These uses Figure 13: Use Case Diagram – Manage Supported Services UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. For each day of the week. and existing services can be removed if they do not require appointments. Each center can define its own Non-working Days. Each agency stores information about the centers used for delivering its services. New Non-working Days can be added and existing Nonworking Days can be deleted. the starting and ending times for arranging appointments is stored. name and its performance measures – like service time and reminder notification time.iist. The Manage Services Data use case enables management of information about those services requiring appointment which are delivered by a particular agency. For each service. Working Hours can be added. The Manage Counters use case enables defining how many applicants can be served at a time for a particular service in a given center. Manage Working Hours.2. the Manage Public Holidays use case enables storing information about official holidays for all government agencies and centers. Table 7: Use Cases – Manage e-Appointment Service ID UC-1-1 UC-1-2 UC-1-3 DESCRIPTION Manage Agencies Manage Services Manage Public Holidays cases are depicted in Figure 13 and are identified in Table 8.egov. In addition. the functionality provided by this use case shall be replaced by a function able to get the list of public holidays. An existing service can be deleted. The Manage Non-working Days use case allows registeration of dates in which appointments cannot be requested. 4. This use case comprises seven use cases: Manage Services Data.unu. its identifier and name are maintained. The notification is sent as many minutes in advance to the appointment as the value of this attribute indicates. a notification is sent to the applicant. For sending the reminder. 4. Cancel Appointment.3. The Send Notification use case allows sending a notification to the applicant. The Change Appointment use case enables the applicant to change the date and time for an existing appointment. the service attribute reminderNotificationTime is used.iist.unu. the process follows the set of interactions depicted in Figure 1. Some validation rules can be defined for avoiding applicants booking many appointments. Table 8: Use Cases – Manage Supported Services ID UC-2-1 UC-2-2 UC-2-3 UC-2-4 UC-2-5 UC-2-6 UC-2-7 DESCRIPTION Manage Services Data Manage Centers Manage Non-Working Days Manage Counters Manage Working Hours View Appointments Export Appointments pointment. Finally. The Send Reminder use case enables to send a notification to the applicant before the appointment will take place. The Make Appointment use case enables the applicant to arrange an appointment related to a specific service. The Cancel Appointment use case enables the applicant to cancel an existing appointment. In the pilot implementation. a notification is sent to the applicant.2. These uses cases are depicted in Figure 14 and are identified in Table 9.edu . After changing an appointment.egov. After cancelling the appointment.SECTION 4 – MODELING 27 The View Appointments use case enables the service provider to retrieve all the appointments arranged for a given date. a notification is sent to the applicant. the rule specifies that an applicant is not allowed to book more than three appointments with a given agency. Once the appointment is confirmed. After selecting the service. and Change Appointment. the Export Appointments use case enables the service provider to generate a file with data about all the appointments arranged for a given date. The software infrastructure notification service could be used for this purpose. This use case comprises three uses cases: Make Ap- Figure 14: Use Case Diagram – Request Appointments UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. REQUEST APPOINTMENTS The functionality offered to service consumers is defined by the high-level use case Request Appointment. USE SOFTWARE INFRASTRUCTURE The e-Appointment service can rely on three software infrastructure components and services: Authentication. the e-Appointment service relies on the Gateway APIs. it sends notifications by e-mail and by SMS using Clickatell [26] service.2.egov. However. Since the implementation of the first two use cases (UC4-1 and UC-4-2) highly depends on the software infrastructure services. The Use Authentication use case aims to integrate the eAppointment service and the authentication service of the software infrastructure.iist. they are not implemented in the current release. The implementation of this use case could be done based on an attribute defined for the service. and Messaging Gateway. The Use Messaging Gateway use case enables to invoke the services of the Gateway for exchanging information between the government portal and the agencies delivering the supported services.edu . The Use Notification use case aims to integrate the eAppointment service and the notification service of the software infrastructure. not all services supported by the e-Appointment service require au- Figure 15: Use Case Diagram – Use Software Infrastructure UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. In the current release. Notification. Table 10: Use Cases – Use Software Infrastructure ID UC-4-1 UC-4-2 UC-4-3 DESCRIPTION Use Authentication Use Notification Use Messaging Gateway 4. This function shall invoke the notification service provided by the software infrastructure.4. For sending and receiving messages.unu.SECTION 4 – MODELING 28 The Notify Applicant use case sends notifications to service consumers. The implementation of this use case is merely the invocation of the software infrastructure service. Table 9: Use Cases – Request Appointments ID UC-3-1 UC-3-2 UC-3-3 UC-3-4 UC-3-5 UC-3-6 DESCRIPTION Make Appointment Cancel Appointment Change Appointment Send Notification Send Reminder Notify Applicant thenticating the applicant. These uses cases are depicted in Figure 15 and are identified in Table 10. For creating the communication structures – like registering members and creating and subscribing to channels. the user interface of the Gateway is used. Table 11: Use Cases versus Functional Requirements USE CASE UC-1-1 UC-1-2 UC-1-3 UC-2-1 UC-2-2 UC-2-3 UC-2-4 UC-2-5 UC-2-6 UC-2-7 UC-3-1 UC-3-2 UC-3-3 UC-3-4 UC-3-5 UC-4-1 UC-4-2 UC-4-3 DESCRIPTION Manage Agencies Manage Services List Manage Public Holidays Manage Services Data Manage Centers Manage Non-Working Days Manage Counters Manage Working Hours View Appointments Export Appointments Do Appointment Cancel Appointment Change Appointment Send Notification Send Reminder Use Authentication Use Notification Use Messaging Gateway FUNCTIONAL REQUIREMENTS F1 F2 F3 F4 F5 F6 F5 F7 F8 F9 F10 F11 F12 F13 F14 F10. F11. F12 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov. F11. USE CASES VERSUS INFORMAL REQUIREMENTS This section relates the informal requirements presented in Section 3 to the use cases described in Section 4.unu. The relation is depicted in Table 11. F12 F10.SECTION 4 – MODELING 29 4.iist. F11.2.edu .3. F12 F10. ARCHITECTURE – STATIC VIEW The static view of the system is depicted in Figure 16. a set of pages with the functions offered to the portal administrator and users (Portal). and Service – for defining services requiring appointments. 5. it comprises classes implementing methods for making.1. It implements operations required for storing.edu .4. Centers – for defining the places where the appointments will take place. Finally. The Entities package implements the system entities.SECTION 5 – DESIGN 30 5. Next. Entities. User Interface – Agency. DESIGN This section presents the design details of the eAppointment System. among others. while detailed behavioral diagrams are presented in Section 5. Figure 16: Architecture – Static View UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.3.egov. detailed structural design diagrams for the major components are provided in Section 5. like Agency – for representing government units.2 respectively. The system design follows a layered architecture comprising the following five main packages .User Interface – Portal. for sending and receiving messages between the government portal and the agencies providing services (Communication) and for storing some parameters of the delivery channels used for sending notifications (Util) . and a set of pages offering functions to the service providers (Agency). cancelling and modifying an appointment (Service).unu.iist. The User Interface – Portal and the User Interface – Agency provide classes implementing all the web pages offering the functionality that is available through a browser. updating.1 and 5. The Core Business package implements the e-Appointment business logic. the static and dynamic views of the architecture models are presented in Sections 5. and deleting an entity from the database. The web pages are grouped in three components: a common set of pages required at the government portal and the agencies (Common). the Database package is responsible for managing the database. for instance. Core Business. and Database. First. reading. The collaborations are divided in four steps following the process for negotiating the appoint- ment. reside at the agency providing the service for which the appointment is requested. The three objects on the left – depicted in green.egov. Figure 17 presents high-level collaborations for making an appointment.SECTION 5 – DESIGN 31 5. ARCHITECTURE – DYNAMIC VIEW For illustrating a dynamic view of the architecture.edu .iist. reside at the government portal side. while the two objects on the right – depicted in orange.unu.2. The collaborations for each step are explained as follows. Figure 17: Architecture – Dynamic View for Making an Appointment UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Finally. 23:workingHours. 24:workingHours. A message is formatted 29:msgToSend. After receiving the request. 22:receiveMessage(workingHours). and the user confirms – 27:confirmation. the user is requested to provide appointmentrelated data. ii) web. In Step 2. SecureTemplate – is a base class for all web pages requiring authentication. the new appointment is stored in the database – 31:store(Appointment). and iv) web. which is built using Apache Wicket (Wicket) framework [11]. the user selects the preferred time for the appointment – 25:selectedTime. For instance. DETAILED STRUCTURAL DESIGN DIAGRAMS The following sections present detailed design for the main layers of the architecture: User Interface. DateSection – a template for displaying the schedule of working hours for a particular date. and sends the message – 19:sendMessage(getWorkingHours). After receiving the message at the provider agency (AgencyA). Result – a general template to display some information. In Step 4.4:getCenters. 9:receiveMessage(centers). a request for getting the working hours is sent to the portal business layer – 17:getWorkingHours. is forwarded to the portal business layer. In addition. the user is requested to select the service for which the appointment is required . and appointment. and iii) UI-Agency. The information is sent back through all the involved components until it reaches the user – 8:centers. Four main packages are shown: i) Wicket Component. Finally. 5. either at the portal or at the agency side. The applicant provides his/her data – 14:applicantData.edu . a request is sent to the database to retrieve this information – 7:retrieve(centers). three main components implement the user interface: i) UI-Common. the information exchange between the government portal and the provider agency is done through the Messaging Gateway. A request is sent to the portal business layer for sending the information about the new appointment to the provider agency – 28: NewAppointment.template.2:requestService. Core Business and Database. who prepares the message to be sent to the provider agency . and 1011:centers.template comprises the following classes: o Template – is an abstract class defining a general template for all web pages. It is used when a deletion request cannot be satisfied due to this reason. It shows which are the available and the unavailable times. The component web.3. However. this class is used for getting the user’s confirmation. working hours. every time an entity is handled – like centers. A request for getting the centers . a web page is shown for confirming the appointment – 26:requestConfirmation. USER INTERFACE LAYER The e-Appointment user interface is implemented as part of a web application. although this component was not shown for the same reason. o o o o o UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.3. Its content can be filled and displayed. the Entities component was not shown. the User requests a new appointment 1:makeAppointment. Then. In Step 3. and the user selects the service . Upon reception to the message at the agency.session. Wicket is a framework enabling the rapid development of Java-based web applications. the user selects the center – 12:selectedCenter.unu. and informs his/her choice – 16:selectedDate. the core business component at the agency forwards the request to the database – 20:retrieveWorkingHours.iist. and is sent to the agency – 30:sendMessage(new Appointment). through all the objects requesting it – 21:workingHours.SECTION 5 – DESIGN 32 In Step 1. It provides a simple box. For simplicity of the diagram.1.3:selectedService. the data is processed through the Entities component.5:msgToSend. The detailed design class diagram of UI-Common is shown in Figure 18. based on the working hours indicated.6:sendMessage(getCenters). iii) web. the template includes the page header and footer. like preferred delivery channels for receiving notifications. and text message to be sent to the provider agency – 13:requestApplicantData. which prepares the message to be sent to the provider agency – 18:msgToSend. by any of the tiers – user interface. Every time a deletion request is submittted. As mentioned before. The information obtained is sent back to the user. core business or database. ii) UIPortal. The Wicket Component represents the development framework used. 5. PendingAppointment – a general template displaying a fixed message explaining that there are pending appointments.egov. ConfirmLink – a general template requesting a confirmation. and sends the message . he/she is requested to select the appointment date – 15:requestDate. stantiating SecureTemplate for implementing the home page of the application.template component. information about the current user is maintained.unu. and iv) web. The web.service. showing the hour and minutes. ii) web.session.SECTION 5 – DESIGN 33 o TimeField – a template for managing the starting and ending time of working hours.egov. and iii) Home Page – is a concrete page in- Figure 18: Design Class Diagram – e-Appointment Common Web Pages Figure 19: Design Class Diagram – e-Appointment Portal Web Pages UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.holidays.agency. In this release. it enables the user to log in. The detailed design class diagram of UI-Portal is shown in Figure 19.session contains one class – My.iist. iii) web.edu . ii) Login – is a concrete page instantiating the Template class provided by the web. Four main packages are shown: i) web.appointment The web component includes three classes: i) Application – this class is required by the Wicket framework for managing all requests. for handling the sessions. In addition.holidays package includes classes for managing the creation of a new holiday or non-working day for the agency (CreateFromAgency) and for listing this information (ListFromAgency).service package comprises two classes: CreateFromPortal – enables to include one service requiring appointments. iii) web. and for listing information about these centers (ListCenters).holidays package contains two classes for creating public holidays (Create) and for listing and deleting existing public holidays (List). Update – implements the functions for modifying an appointment. web. web. One more package is depicted in Figure 19 – web.workingHours. web. AppointmentPage – is used to initiate the appointment process. o o o o Figure 20: Design Class Diagram – e-Appointment Agency Web Pages UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. ii) web. and ListFromPortal – allows viewing and deleting services supported by the e-Appointment service. The detailed design class diagram of the UI-Agency is shown in Figure 20. The package is shown in green colour.edu .iist. which comprises deleting the existing appointment and creating a new appointment.service.center. The web. for keeping the relation between the service and the centers where appointments related to the service can take place (Center). Similarly. Cancel – implements the functions for deleting an appointment. The web. for listing information about existing services (List).egov. it contains one class for managing the interactions when there is a request for creating a non-working day for an agency and there are appointments that will take place at this date (HolidayPendingAppointment). In addition.agency package comprises two classes for creating or editing agencies providing services requiring appointments (Create) and for listing and deleting these agencies (List). the web.SECTION 5 – DESIGN 34 The web.center package includes classes for managing the creation of a new center (Create) and for listing information about existing centers (List). It keeps information about the current step and allows moving to the previous and next steps. Five main packages are shown: i) web.service package includes classes for managing the creation of a new service (Create). and v) web. it contains one class for managing the interactions when there is a request for deleting a center and there are appointments that will take place at this center (CenterPendingAppointment). iv) web.appointment package contains the following classes: o NewAppointment – implements the functions for showing information related to the appointment process when a new appointment is requested. AppointmentWizard – implements the negotiation process for getting an appointment.template.holidays. since it belongs to the e-Appointment Common Web Pages package.unu.appointment. All classes in the eAppointment Portal Web Pages package are subclasses of the SecureTemplate class provided by the web-template package. 2) AppointmentService – manages data and functions related to appointments.workingHours package.unu.SECTION 5 – DESIGN 35 web. In addition. All classes in the eAppointment Agency Web Pages package are subclasses of one of the classes contained in the web.2.3.center package. 11) SMSSender – is a subclass of Sender responsible for sending notifications through SMS. AppointmentService provides implementation for the operations defined in IAppointmentService. Create. 12) EmailSender – is a subclass of Sender responsible for sending notifications through e-mails. Center and ListCenters – from the web. for instance. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. As illustrated in the figure. 3) 4) 5) 6) 7) 8) 9) 10) Sender – is an abstract class for sending notifications to applicants. It is a composite class involving SMSParameter and EmailParameter classes – each of these classes defines the parameters used to send notifications through SMS and e-Mail. NotificationService – manages data and function related to notifications to applicants. The relationships between the rest of the classes are as follows: Create and List – from the web. AgencyService – manages data and functions related to agencies. Host – manages the reminder notifications that are sent to applicants before the appointment takes place. The package is shown in green colour.appointment package.egov. CitizenService – manages data and functions related to citizens requesting appointments. and List and Export – from the web.iist.workingHours package includes classes for managing the creation of new working hours (Create) and for listing this information (List). IServiceService. these relationships are only shown for the web. CreateFromAgency and ListFromAgency – from web. 5. The component includes the following classes: 1) ServiceFactory – acts as a factory for instantiating different types of objects like concrete implementation of: IAppointmentService. web. and WorkingHourPendingAppointment are subclasses of PendingAppointment.service package. although for simplicity. while WorkingHourPendingAppointment is a subclass of PendingAppointment. are all subclasses of SecureTemplate. since it belongs to the e-Appointment Common Web Pages package. IHolidayService. HolidayPendingAppointment.template. Util and Communication.edu . it contains one class for managing the interactions when there is a request for updating working hours and there are appointments that will take place at the time that will be changed (WorlkingHourPendingAppointment). The design class diagram for the Service component is depicted in Figure 21. WorkingHourService – manages data and functions related to working hours. HolidayService – manages data and functions related to holidays. The name of the interface defining the operations of the class starts with capital I and is followed by the class name. IWorkingHourService. respectively. among others. ServiceService – manages data and functions related to the services requiring appointments. ICitizenService. Create and List are subclasses of SecureTemplate.holidays package. List. ServicePendingAppointment. Functions of classes 2) to 8) implement the operations defined in their interfaces.appointment package includes classes for listing existing appointments (List) and exporting information about existing appointments to a file (Export). 13) AppointmentServiceException – manages the exceptions raised by processing errors. CORE BUSINESS LAYER The core business layer comprises three main components: Service. and INotificationService. One more package is depicted in Figure 20 – web. The component includes the ConfigurationParameter class for storing parameters to send notifications and other data used by the application like the id of the member to be used or the name of the current agency.template package. CenterPendingAppointment. The design class diagram for the Util component is depicted in Figure 22. IAgencyService. the Communication component involves two classes for receiving messages through the Messaging Gateway: i) AgencyApplicationListener – implements a listener enabling the providing agency to receive messages. and findById (CRUD operations). the portal database stores information about agencies. Finally. subclasses of DAO. IAgencyDao. Figure 24 depicts the general design for the database.egov. centers. agencies. update. counters. like – add. holidays. IHolidayDao. citizens. respectively. AppointmentManager.3. ICounterDao. working hours. counters and citizens. remove. different data is stored in the portal database and in agency databases. Similarly. However. These classes provide implementation for the corresponding interfaces. For instance. CounterManager. appointments. CenterManager. like: NotificationManager. and citizens. all subclasses of GenericDAO. IWorkingHoursDao.unu. The XG2GSynchron implements the operations defined by the IXG2GSynchron interface for getting the reply messages. nonworking days. ServiceManager. For instance.iist. appointments. Figure 23: Design Class Diagram – Communication UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. IAppointmentDao. CitizenManager – for managing notifications to applicants. appointments.edu . centers. working hours. agencies. while the agency database stores information about services. AgencyManager. The design class diagram for the Communication component is depicted in Figure 23. HolidayManager. in addition to GenericDAO. In addition to IDAO. NotificationManager implements INotificationDao.SECTION 5 – DESIGN 36 Figure 21: Design Class Diagram – Service Figure 22: Design Class Diagram – Util 5. The component includes a Generic Access Object (GenericDAO) implementing an interface (IDAO) which provides general functions for accessing the database. working hours. and ICitizenDao – for defining specific operations for accessing notifications. the XG2GSynchron class allows synchronizing the reply messages with the request messages for simulating synchronous communications based on the asynchronous communications provided by the Messaging Gateway. In addition.3. services. services. and notifications. WorkingHoursManager. holidays. ii) PortalApplicationListener – implements a listener enabling the government portal to receive messages. IServiceDao. there are other classes. centers. listAll. there are other specific interfaces. DATABASE LAYER The design class diagram for the Database component is shown in Figure 24. services and holidays. like INotificationDao. counters. respectively. ICenterDao. unu.iist.edu .SECTION 5 – DESIGN 37 Figure 24: Design Class Diagram – Database UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov. ii) deleting an agency. Figure 25: Sequence Diagram for Adding an Agency UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. The IAgencyService object forwards the request to the interface of the agency entity to store the data in the database (14:add). The function is requested by the portal administrator (1:manageAgencies). DETAILED BEHAVIOURAL DESIGN DIAGRAMS Three detailed sequence diagrams are shown for explaining the behavior of the system.4. are sent back and presented to the user (8:listOfAgencies). The diagrams present the collaboration between objects for: i) adding an agency. Similarly.egov.4.1. The request is processed by the Application object. as a reply. ADDING AN AGENCY The sequence diagram for adding an agency is presented in Figure 25 and is explained below. Application requests this object to get the list of all existing agencies (4:getAllAgencies). Adding an agency is part of the use case for managing agencies. Application requests this object to create the new agency (13:create). Each of these diagrams is presented in the following sections. and asks the ServiceFactory to get the interface object responsible for managing agencies (11:getAgencyService). the IAgencyService object is received (12:IAgencyService). the user decides to add a new agency (9:addAgency). The Application object creates a new object (10:newAgency). the IAgencyService object is received (3:IAgencyService).edu .unu. The IAgencyService object forwards the request to the interface of the agency entity for retrieving the list of agencies from the database (5:getAll). and iii) making an appointment. 5.SECTION 5 – DESIGN 38 5. After viewing the list of agencies.iist. who asks the ServiceFactory to get the interface object responsible for managing agencies (2:getAgencyService). The replies 6:reply(listOfAgencies) and 7:reply(listOfAgencies). As a reply. steps 1) to 9) are the same as those explained for adding an agency.4.2. DELETING AN AGENCY The sequence diagram for deleting an agency is presented in Figure 25 and is explained below.iist.SECTION 5 – DESIGN 39 5. Application requests this object to delete the selected agency (12:delete). Therefore. As a reply.unu. The IAgencyService object forwards the request to the interface of the agency entity to delete the record from the database (14:destroy). the IAgencyService object is received (11:IAgencyService). Deleting an agency is part of the use case for managing agencies.egov. The Application object asks the ServiceFactory to get the interface object responsible for managing agencies (10:getAgencyService).edu . Figure 26: Sequence Diagram for Deleting an Agency UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. After viewing the list of agencies. the user may decide to delete an existing agency (9:deleteAgency). however.egov. Finally. The request is forwarded to IAgencyDao 11:getAll(Centers). Application requests the IAgencyService to get the list of centers where appointments for the selected service can take place . Application requesting IServiceService to get the list of services. Application requests ServiceFactory to get the interface for the object managing Agencies (IAgencyService) 4:getAgencyService. The member acting on behalf of the agency providing the service (ag:Member) receives the message and delivers it to the AgencyApplicationListener 9:receiveMessage. he/she selects one 3:selectedService. who forwards it to AgencyApplicationListener.16:receiveMessage. ServiceFactory to provide this object. the AgencyApplicationListener requests the IAgencyService to get all centers. it prepares the message to be sent as reply – 14:msgtoSend.iist. while the four objects on the right – depicted in orange reside at the agency side. this action is shown as a simple action in the diagram. When the list of centers is received by this later object. and asks the member acting on behalf of the government portal in the Messaging Gateway (p:Member) to send the message . The request is processed by Application. For simplicity. A detailed sequence diagram of the collaborations involved in the first two steps of the negotiation process is presented in Figure 27. Once the list of services are shown to the user.8:sendMessage. The reply (listOfCenters) is received by IAgencyService – 12:reply(listOfServices). and ServiceDao object getting all services from the database. and requests ag:Member to send the message – 15:sendMessage.1:makeAppointment. who shows the list of centers to the user – 19:listOfCenters. reside at the portal side. the user selects the center – 20:selectedCenter. who sends the list of centers received to the IAgencyService – 17:reply(listOfCenters). Upon interpreting the message. IAgencyService prepares the message to be sent to the agency – 7:msgToSend. IAgencyService sends the reply to Application – 18:reply(listOfCenters). it involves requesting ServiceFactory to get the interface of the object managing services (IServiceService).6:getCenters.3.edu . who gets the list of services and requests the user to select one 2:requestService.unu. The six objects on the left of the diagram – depicted in green. The message received by p:Member is forwarded to PortalApplicationListener . For simplicity. action 16 is shown as a single interaction but it involves collaboration from IXG2GSynchron for synchronizing the request and the reply messages. MAKING AN APPOINTMENT Making an appointment involves various collaborations among several objects. and the object is returned 5:reply(IAgencyService).4.SECTION 5 – DESIGN 40 5. The process starts when the user requests to make an appointment . Figure 27: Sequence Diagram for Making an Appointment – Steps 1 and 2 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. reside at the agency side.SECTION 5 – DESIGN 41 Step 2 of the process involves Application requesting the user to provide appointment-related information. IAgencyService prepares the message to be sent to the agency – 2:msgToSend. forwards it to PortalApplicationListener – 9:receiveMessage. and the user provides these data – 22:applicantData. it replies to AgencyApplicationListener – 6:reply(workingHours). and forwards it to AgencyApplicationListener – 4:receiveMessage. Once IAgencyService has the information about working hours. like the preferred channel for notifications and a text message to the provider agency – 21:requestApplicantInformation. and the user selects his/her preferred date – 24:selectedDate. The member at the portal. after receiveing the message. the seven objects on the left – depicted in green. ag:Member receives the message. Application requests the appointment date – 23:requestDate. The collaborations involved for executing the third and fourth step of the appointment negotiation process are shown in Figure 28. For simplicity. and sends the message – 8:sendMessage. who asks IAgencyService to get the working hours – 5:getWorkingHours. after receiving the date selected by the user. and IWorkingHoursDAO for getting this information from the database are not shown. IServiceService. As in the previous figure. Application requests IAgencyService to get the working hours – 1:getWorkingHours. based on the available hours. 11:reply(working Hours). the user selects their choice – 13:selectedTime. In addition. IWorkingHoursService. and 12: workingHours.iist. who prepares the message to be sent to the portal – 7:msgToSend.unu. collaborations between IAgencyService. In Step 3. and requests the p:Member to send the message – 3:sendMessage. Finally. Reply messages are sent back to the objects requesting the information – 10:reply(workingHours).edu . Figure 28: Sequence Diagram for Making an Appointment – Steps 3 and 4 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov. reside at the portal side. while the four on the right – depicted in orange. Therefore. and requests ag:Member to send the message – 24:sendMessage. Further collaborations.SECTION 5 – DESIGN 42 In Step 4. not shown in the diagram.egov. AgencyApplicationListener requests the IAppointmentService at the agency side (ag:IAppointmentService) to create the new appointment – 22:createAppointment. take place among ag:IAppointmentService and IAppointmentDao to store the record in the database.edu . and the user confirms – 15:confirmation. All replies are sent back through all the objects involved. After updating the database.iist. p:IAppointmentService prepares the message to be sent to the agency – 19:msgToSend. After receiving the message. forwards it to AgencyApplicationLis- tener – 21:receiveMessage. ag:Member. after receiving the time selected by the user. after receiving the message.unu. Application requests IAppointmentService to create a new appointment – 18:newAppointment. until the user is informed – 2627-28:reply(appointmentConfirmed). Application requests ServiceFactory to get the interface object for managing appointments (p:IAppointmentService) – 16:getAppointmentService. and requests p:Member to send the message – 20:sendMessage. p:Member forwards it to PortalApplicationListener. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. and receives the object as reply – 17:reply(IAppointmentService). Application request a confirmation of the appointment – 14:requestConfirmation. AgencyApplicationListener creates a message to confirm the registration of the appointment at the agency – 23:msgToSend. 1.SECTION 6 – IMPLEMENTATION 43 6.edu . technologies used (Section 5. and the relationships with other software infrastructure components – depicted in orange.1).unu.egov.iist.3). 6. IMPLEMENTATION The following three sections provide a general overview of the implementation phase of the e-Appointment service (Section 5. OVERVIEW Figure 29 presents the implemented components. and further customization details that could improve the current functionality (Section 5. Figure 29: Implementation Diagram UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.2). the relationships among them. and IAppointmentDao. The possible values include: portal and agency. emailport . the Service component provides the interfaces required by the user interface layer. The Communication component implements the IXG2GSynchron interface used by UIPortal and the ApplicationListener used by the Messaging Gateway. and iii) Util. In addition. numbermonth – number of months in advance when appointment can be booked . emailtemplate – text of the e-mail to be sent to the applicant as a reminder of the appointment o o o o o o o o o o UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. an interface provided by the Communication component to synchronize requests and replies between the portal and the agencies. use the interfaces of the core business layer provided by the Service component. The Database package implements a general interface IDAO – used by the core business layer. IServiceDao. ii) Communication. IAppointmentService. like.3. IDAO is refined by several interfaces – one for each table of the database.unu. UI-Common. a software infrastructure component used by the e-Appointment service is also depicted. iv) Entities – a set of classes for manipulating the data structure of each entity.smtp port number. ICenterDao. through the Application class.e-mail address of the sender.flag for indicating if authentication is required for sending e-mails. The Entities package provides one class for managing every entity. The following parameters are defined in the file: o memberId .role of the application deployed at the node. Communication and Util.password for authenticating the sender. and the IMember interface provided by the Messaging Gateway. like: o o o emailserver . UIPortal uses IXG2GSynchron. INotificationService. the user interface packages include three components: UI-Common. The specification of eAppointmentConfigurationFile is included in Appendix C. ICitizenDao.identification of the member acting on behalf of the software applications deployed on the node agencyName . All three components – Service.identification of the hosting agency agencyDescription – full name of the hosting agency channelId . emailsenderpassword . and vi) Database – implementing data persistence through the database. For instance. it uses the interfaces provided by the Database component – IDAO and all its sub-classes. As explained in Section 5.iist. use the Entities component for processing the entity data structures. Core Business.Portal – implementing the user interface for users and the portal administrator. UI-Portal. UI-Portal and UI-Agency. and UIAgency. IHolidayService.egov. it uses the Service component for processing the received messages.identification of the channel used by the hosting agency to communicate with the government portal type . The Messaging Gateway – xG2G. iii) e-Appointment Core Business –implementing the business logic. Parameters for sending notifications through emails. as well as the component for sending notification – Utils. and IServiceService.edu . User Interface – Agency. IHolidayDao. if the current date is 6 February 2009. or a member acting on behalf of a providing agency. In addition. The package is used by all other packages: User Interface – Portal. INotificationDao. IAgencyDao. isemailauthenticationrequired .flag for indicating if transport layer security (tls) is enabled.smtp server . and Database. ii) User Interface – Agency – implementing the user interface for service providers. uses the IVisitor interface provided by the Messaging Gateway to restart a member – either a member acting on behalf of the portal. it will allow to book appointments till 6 May 2009. The classes contained in this package use the classes of the Entities package. It also uses the Util component to access the configuration file. a configuration file for the eAppointment service is provided – eAppointConfigurationFile. In addition. sendermail . As explained above. All three– UI-Common.SECTION 6 – IMPLEMENTATION 44 Five packages were implemented: i) User Interface . The possible values are true and false. istlsenabled . The CoreBusiness package includes three components: i) Service. These inferfaces include: IAgencyService. The Util component uses the eAppointmentConfigurationFile. IWorkingHourDao. Log4J [22] API is used for logging messages. TECHNOLOGIES The guiding principle for implementing the eAppointment Service was to adopt open-source technologies and open-standards.egov. o Parameters for sending notifications through SMS. Therefore.4 [11]. cancelnotificationtemplate – text of the e-mail template to be sent to the applicant as a confirmation of the cancelled appointment. 1) o number of appointments per citizen – in order to avoid misusing the service.6 MySQL 5 Hibernate 3. 2) o 6.unu. The exchange of messages is supported by the e-Macao Messaging Gateway [21].0 Log4j 1. The set of technologies used by the e-Appointment service is depicted in Table 12.5 UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.2 xG2G 1.SECTION 6 – IMPLEMENTATION 45 o newnotificationtemplate – text of the e-mail to be sent to the applicant as a confirmation of the appointment. For instance. MAPPING MESSAGING OBJECT-XML MAPPING LOGGING FRAMEWORK MAIL FRAMEWORK WEB FRAMEWORK WEB SERVER CONTAINER Java 1.3.-REL. a citizen booking most of the appointments. The database used is MySQL [14][15]. and the Spring 2. The development framework used for implementing the web application is Apache Wicket 1.0 (e-Macao infrastructure) XMLBeans 2.3. updatenotificationtemplate text of the e-mail to be sent to the applicant as a confirmation of the updated appointment. A bound is defined to set the maximum number of appointments a citizen can request..4 Apache Tomcat 6 Spring 2.5 [25] container is used to instantiate different objects. like: o username – name of the user holding the account used for sending SMS smsuserpassword – password of the user holding the account used for sending SMS smsapiid – key enabling the user to send SMS smstemplate – text of the SMS to be sent to the applicant as a reminder of the appointment. o o o Two bounds are defined in the configuration file: Table 12: Technologies Used by e-Appointment Service Appointment Application – Technologies LANGUAGE DATABASE OBJ. and Hibernate [16][17] is applied for the object-relational mapping.2. and number of months – a bound is defined for showing future days in the calendar when the user is requesting or updating an appointment.2 JavaMail Apache Wicket 1. and composed and decomposed using XMLBeans [20]. The web server used for deploying the web application is Apache Tomcat 6 [24]. and JavaMail [23] for sending e-mails. Messages are written using eXtensible Markup Language (XML) [18][19].edu .3.iist. all software components were implemented in Java [12][13]. 3. the e-Appointment service could be integrated with other software applications supporting the delivery of services for which appointments are requested.3.3). the current release uses the services of Clickatell for sending SMS notifications. a web page is used for simulating the need for authentication. The SecureTemplate class of the web. 6. Therefore. which enables users to prove their identity before accessing some public services. for sending the reminder notifications. we discuss the integration with authentication and notification services. Therefore. SERVICE INTEGRATION The proposed e-Appointment service aims to deliver a general solution for managing appointments supporting the delivery of public services.Appointment component shall be modified. 6. possible improvements related to service parameters could be introduced in further releases. only the list of agencies and services using e-Appointment service. service parameterization (Section 6. An authentication service is usually provided as part of the software infrastructure for Electronic Government. the following service-related parameters are proposed to be introduced: UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. the e-Appointment service should be integrated with the authentication service already in place. In addition. In particular. The integration of the e-Appointment service with an authentication service shall discard the use of the eAppointment authentication page. A multi-channel delivery approach for delivering public services requires providing access to a centralized database containing information about citizens. One more improvement is to automatically update the table of services requiring appointments at the portal by exchanging messages through the Extensible Messaging Gateway every time a service is updated in the providing agency.unu.iist. and replace it by an invocation to the authentication service. and validating that these agencies and services exist in the corresponding tables of the portal database. However. In addition. as well as the class managing persistence in the database – CitizenDao. it should be integrated with software infrastructure components and services.3. the AppointmentWizard class of the web. In such case.egov. A notification service which enables notification of applicants through various channels can also be part of the software infrastructure for Electronic Government. but by some other infrastructure component. notification texts. Therefore. public holidays. For instance. and the government portal database. SERVICE PARAMETERIZATION The e-Appointment service aims to provide a general solution for making appointments for delivering various public services. The integration of the e-Appointment service with a notification service will require introducing changes to the following classes in the Service component: i) Sender – for invoking the infrastructure notification service instead of sending the notifications itself. like the citizen’s contact details for each channel. In the current release.3. A general solution for addressing these specific service needs can be provided through parameterization. One possible scenario for such integration is already supported by the current release through the function exporting an XML file with information about the appointments for a given date. In addition. Each of these services may have its own requirements related to applicant’s authentication.1). like other e-services. the user should be requested to authenticate only once and gain access to different services – single sign on. this data should not be handled by the e-Appointment service. The integration of e-Appointment and government portal databases will require replacing the function for updating public holidays in the e-Appointment database by a function retrieving this information from the portal database.3. a multi-channel delivery strategy.3. the e-Appointment service can request from the applicant which is his preferred channel for receiving appointment-related notifications and manage this information. For instance. as part of the software infrastructure for Electronic Government.2) and service reliability (Section 6. The current implementation of the e-Appointment service manages information that should be part of the government portal database. among others.Template component should be modified. notifications should be sent by this infrastructure service and not by the e-Appointment service. and number of appointments required for the service delivery. If so. it will require keeping in the eAppointment database at the portal side. In the future. Three areas of improvements are identified and discussed in the following sections. and ii) Host – likewise.SECTION 6 – IMPLEMENTATION 46 6. The integration of the e-Appointment service with a multi-channel delivery strategy will require changes to the data manipulated in the second step of the appointment negotiation process.2. Therefore.1.edu . In order to deliver these services following a customer-focus approach through a one-stop contact. the interface with Clickatell [26] should be replaced by the interface to the telecommunication company chosen by the government. Further improvements could consider importing appointment-related information from these applications for udating the database managed by the e-Appointment service. IMPROVEMENTS The current release presents a prototype implementation of the e-Appointment service that could be improved in different ways. integration with other software infrastructure components (Section 6. it would be advisable to define the number of admissible appointments for a citizen as a service related parameter. and others. the applicant should present some supporting documents during the appointment. changing and cancelling an appointment (same text regardless the channel used for sending notifications). Moreover. For instance. among others.3.SECTION 6 – IMPLEMENTATION 47 o isAuthenticationRequired – a flag for indicating if the appointment requires or not applicant’s authentication.unu. an alternative mechanism shall be provided for such cases in order to improve reliability.egov. the configuration file manages different parameters for notification texts for reminding applicants through e-mail and through SMS. notificationTexts – each service may need to define different texts for notifying applicants about appointments. Managing these appointment pre-requisites in the eAppointment service will enable reminding the applicant about such prerequisites when sending the notifications confirming and reminding the appointment. an improvement is proposed for providing a function enabling service providers to update servicerelated parameters.edu . A proposed improvement is to define notifications texts for each delivery channel. SERVICE RELIABILITY In the current release. o UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. a proposed im- provement is to define the months ahead for booking appointments as a service related parameter. in case of medical analysis. a general parameter is defined for setting the number of months ahead for arranging appointments. the completion time of the business process for delivering services depends on the service. Possible solutions include providing a secondary database at the government portal with information updated daily through batch processes. 6. as service-related parameters. o appointmentPre-requisites – each service may have its own prerequisites for applicants attending appointments. Therefore. and enssuring members are deployed on servers. In the current release. numberOfAppointments – a general parameter is defined in the configuration file of the eAppointment service for controlling that an applicant is not allowed to book more than a given number of appointments. and for confirming. different texts may be required for each delivery channel. o o Finally.3.iist. monthsAheadForBookingAppointments – likewise the previous case. Since the number of appointments required for delivering a service depends on the service. the applicant should not eat within certain amount of hours prior to the appointment. Therefore. However. it may happen that the member acting on behalf of the e-Appointment service at the agency side is not available when the application at the government portal is trying to exchange information with it. which may or may not be deployed on the same node as e-Appointment Service (P). Depending on the value defined for the parameter type in the configuration file. regardless of its role. In any deployment scenario. and the e-Appointment Service.unu. The Portal Component corresponds to the government portal application. Portal uses e-Appointment Service (P).egov.e-Appointment Service (P). the e-AppointmentDatabase is created on the hosting node. DEPLOYMENT There is only one deployment component – eAppointmentService providing the functionality for all users.SECTION 7 – DEPLOYMENT 48 7. As depicted in Figure 30. The node Government Portal represents the Portal role. the component plays two roles: i) Portal – provides the functionality for the portal administrator and users requesting appointments . While deploying the e-Appointment Service. and as many nodes as required hosting the e-Appointment Service with the Agency role – at least as many as government units using the e-Appointment service. there must be only one node playing the Portal role.edu . are required on all nodes hosting an eAppointment Service component. uses the e-AppointmentDatabase and xG2G. while all other nodes correspond to the Agency role.iist. Figure 30: Deployment Diagram – A Possible Scenario UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. The libraries of the Messaging Gateway – xG2G. Figure 30 presents a possible deployment scenario for the software components. and ii) Agency – provides the functionality for service providers – e-Appointment Service (A). SECTION 8 – CONCLUSIONS 49 8. CONCLUSIONS This report presents technical details of the eAppointment service development. The development was carried out by UNU-IIST Center for Electronic Government during 2008 for the Government of Macao SAR, under the Macao Data Exchange Gateway Project, part of the e-Macao Program. The e-Appointment service enables booking of appointments between service consumers and service providers related to public service delivery. The proposed solution presents a general approach for managing appointments supporting the delivery of services provided by different agencies. The appointmentrelated information exchanged between the government portal and the agencies is supported by the Extensible Messaging Gateway [1]. The service can be considered part of the software infrastructure for Electronic Government. The e-Appointment service is built upon the following concepts: i) appointment – an arrangement between parties for interacting at a certain time and place for a specific purpose; ii) appointment negotiation process – required steps for making an appointment; iii) service – a public service requiring appointments as part of its delivery process; iv) center – a physical or virtual place where appointments are held; v) public holiday – a day on which government agencies are officially closed; vi) non-working day – a day on which an agency is not serving customers; and vii) working hours – a period of time in which appointments can be arranged. The service distinguishes three types of users: i) portal administrator – a person responsible for administering the government portal; ii) service providers – administrators of the government units delivering services; and iii) service consumers – persons who request appointments. Portal administrator is responsible for maintaining information about the government agencies delivering services requiring appointments, services for which appointments can be requested, and public holidays. Service providers are responsible for managing information about services delivered by them, centers in which these services are delivered, non working days and working hours. In addition, they can view and export the arranged appointments for a given day. Service consumers can make, change or cancel an appointment. They are notified about appointments made and re- minded about coming appointments. In the current release, these notifications are delivered through e-mail and SMS. This report presented the development stages followed for implementing the software component. It also introduced some of the development artifacts produced. An introduction to the project scope, its aim and objective were presented in Section 1. Section 2 introduced some background for developing an e-Appointment service. The motivation for an e-Appointment service was presented, as well as e-Appointment-related concepts, business process, implementation approach, challenges for implementing and delivering the service, and case studies. Section 3 presented functional and nonfunctional requirements for the e-Appointment service. A set of functional requirements was introduced for specifying the functionality to be provided to the portal administrator, service providers and consumers. Four non-functional requirements were specified, related to: i) reliability, ii) security, iii) generality and iv) interoperability. A domain conceptual model and a use case model were presented in Section 4. In addition, the section introduced cross-references between the functional requirements identified in Section 3 and the use cases defined. The service top level and detailed design were explained in Section 5. Static and dynamic views of the architecture were presented, as well as design class diagrams and sequence diagrams explaining the structure and behavior of the service, respectively. Section 6 presented implementation details including some technologies used, and possible improvements to the current release. Section 7 illustrated a possible deployment scenario. Finally, appendices describing glossary of terms, configuration file, XML schemas, Application Programming Interfaces (APIs), and main Java classes were included. The main contributions of the e-Appointment development process include: i) providing a prototype solution for managing appointments in delivering public services, ii) presenting a general solution that can be used for delivering any service requiring appointments, iii) illustrating the exploitation of the Extensible Messaging Gateway, and iv) proposing enhancements based on the experience gained. This development report is complemented by the eAppointment User Manual [27]. Information about the project is also available at the project website [28]. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist.unu.edu REFERENCES 50 REFERENCES [1] Elsa Estevez, Vincent Douwe and Tomasz Janowski, Extensible Messaging Gateway - Enhanced Services and New APIs, Macao Data Exchange Gateway Project, UNU-IIST-EGOV, February 2009. [2] Merrrian-Webster Online, available at http://www.merriam-webster.com/, visited on 25 January 2009. [3] Ralf Klischewski, The Challenges of e-Appointment: Process Modeling, Infrastructure, and Organizational Context, available at http://swtwww.informatik.unihamburg.de/publications/./files/ibim_klischewski.pdf visited on 25 January 2009. [4] Tomasz Janowski, Adegboyega Ojo and Elsa Estevez (Eds), The State of Electronic Government in Macao, Volume 2 Agencies, e-Macao Project, available at www.emacao.gov.mo, Deliverables - Survey, report 2, visited on 25 January 2009. [5] National Organization for Medicines (EOF), Ministry of Health, Government of Greece, http://eof1.eof.gr/eof_en/enhome.html. [6] S. Giannakou, Providing e-Appointment System to Pharmaceutical Companies for Licensing Applications and Guidance, Validation of Applications and Marketing Authorization Division (DDYEP), National Organization for Medicines (EOF), Government of th Greece, 5 Quality Conference for Public Administration in the EU, Paris, 20-22 October 2008, available at www.5qualiconference.eu/bib_res/364.pdf, 27 January 2009. [7] Ministry of Home Affairs, Government of Singapore, Inmigration and Checkpoints Authority (ICA), http://ica.gov.sg. [8] Ministry of Home Affairs, Government of Singapore, E-Appointment at ICA, https://eappointment.ica.gov.sg/ibook/index.do, visited 26 January 2009. [9] Ministry of Manpower, Government of Singapore, Labour Relations and Worplace Division, http://www.mom.gov.sg/publish/momportal/en/a bout_us/divisions_and_statutory/labour_relations_ department.html, visited 27 January 2009. [10] Ministry of Mapower, Government of Singapore, EAppointment at LRWD, http://app.etools.mom.gov.sg/eindex.aspx, visited 27 January 2009. [11] Apache Wicket, http://www.wicket.apache.org, visited 3 February 2009. [12] Herbert Schildt, Java 2 The Complete Reference, th Osborne, 5 Edition, 2002. [13] Sun Microsystems, The Java Tutorial, 2004, http://java.sun.com/docs/books/tutorial. [14] Sun Microsystems, MySQL, http://www.mysql.com. [15] Paul DuBois, MySQL Cookbook, O’Reilly, November 2006. [16] Hibernate, Relational Persistence for Java and .Net, http://www.hibernate.org. [17] Christian Bauer and Gavin King, Hibernate in Action (In Action series), Hanning, August 2004. [18] W3C, Extensible Markup http://www.w3.org/XML/. Language (XML), [19] Erik T. Ray, Learning XML, O’Reilly, 2001. [20] The Apache XML Project, Apache XMLBeans, http://xmlbeans.apache.org. [21] Vincent Douwe, Elsa Estevez, Tomasz Janowski, Extensible Message Gatewa - Development Report, Software Infrastructure for e-Government Project, UNU-IIST-EGOV, April 2008. [22] Logging Apache Org, Logging Services (LOG4J), http://logging.apache.org/log4j/1.2/index.html. [23] Sun Developer Network (SDN), J2EE Java Mail, http://java.sun.com/products/javamail/. [24] The Apache Software Foundation, Apache Tomcat, http://tomcat.apache.org. [25] The Spring Source http://www.springsource.org/. Community, [26] Clickatell, Any message, Anywhere, Messaging Solutions, http://www.clickatell.com/solutions.php. [27] Elsa Estevez, Vincent Douwe, and Tomasz Janowski, e-Appointment Service – User Manual, Macao Data Exchange Gateway Project, UNU-IIST-EGOV, February 2009. [28] Macao Data Exchange Gateway Project, http://www.egov.iist.unu.edu/index.php?/cegov/p rojects/infras-tructure. [29] Elsa Estevez, Vincent Douwe and Tomasz Janowski, Extensible Messaging Gateway – Quality Assurance Report, Macao Data Exchange Gateway Project, UNU-IIST-EGOV, September 2008. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist.unu.edu APPENDICES 51 APPENDICES A. GLOSSARY ID T1 TERM Agency DESCRIPTION An administrative division of the government providing and receiving services. An arrangement between parties for interacting at a certain time and place for a specific purpose. The process of determining whether a member is authentic and eligible to access the e-Appointment service and its data. The process involves using the authentication service provided by the software infrastructure. A place where appointments can take place. Members, Channels, and Extensions of the Messaging Gateway used for information exchange. File storing parameters used by some functions of the service. A place, usually physical, where customers can be served. To generate information and store it in a file to be used by another software application. A delivery channel for sending notifications. A day in which appointments cannot be arranged. Acknowledgement of a fact. The e-Appointment service shall send notifications every time an appointment is confirmed or cancelled. A criteria for classifying notifications based on the delivery channel used for sending notifications. Person responsible for maintaining the Government Portal. A day in which government agencies are officially closed. The ability of a system or component to perform its required function under stated conditions for a specified period of time (IEEE). Time in advance from the appointment, in which a notification to the applicant will be sent for reminding him/her about the appointment. The outcome produced and delivered in interaction between a service provider and a service consumer in order to benefit the consumer or fulfill the consumer’s needs. A person or entity receiving a public service. A government unit providing services. T2 Appointment T3 Authentication T4 T5 Center Communication Structures T6 T7 T8 Configuration File Counter Export T9 T10 T11 e-Mail Non-working Day Notification T12 Notification Type T13 T14 T15 Portal Administrator Public Holiday Reliability T16 Reminder Notification Time T17 Service T18 T19 Service Consumer Service Provider UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist.unu.edu iist. A delivery channel for sending notifications – SMS is the acronym of Short Message Service.edu . Any person accessing the e-Appointment service. T21 SMS T22 T23 User Working Hour UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.unu. Time frame for arranging appointments.APPENDICES 52 T20 Service Time Service-related time that is required for serving one customer. The appointment between service provider and consumer will last at most the service mean time. w3.edu/emacao/queue/messages"> <complexType name="NewAppointment"> <sequence> <element name="CustomerId" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="CustomerName" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="Date" type="date" maxOccurs="1" minOccurs="1"> </element> <element name="ServiceCode" type="string" maxOccurs="1" minOccurs="1"> </element> <choice maxOccurs="1" minOccurs="1"> <element name="EmailAddress" type="string"></element> <element name="MobilePhone" type="string"></element> </choice> <element name="Time" type="time" maxOccurs="1" minOccurs="0"> </element> <element name="Error" type="Q1:ErrorType" maxOccurs="1" minOccurs="0"> </element> <element name="ErrorDescription" type="string" maxOccurs="1" minOccurs="0"> </element> <element name="Details" type="string"></element> <element name="center" type="string" maxOccurs="1" minOccurs="1"> </element> </sequence> </complexType> <complexType name="UpdateAppointment"> UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist. XML SCHEMAS B.iist.unu.edu .1.iist.unu. SCHEMA FOR EXCHANGED MESSAGES XML Schema 1: Exchanged messages Schema <schema xmlns="http://www.org/2001/XMLSchema" targetNamespace="http://egov.unu.APPENDICES 53 B.edu/emacao/queue/messages" elementFormDefault="qualified" xmlns:Q1="http://egov. iist.unu.APPENDICES 54 <sequence> <element name="Service" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="CustomerId" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="Date" type="date" maxOccurs="1" minOccurs="1"> </element> <element name="NewDate" type="date" maxOccurs="1" minOccurs="1"> </element> <element name="Error" type="Q1:ErrorType" maxOccurs="1" minOccurs="0"> </element> <element name="ErrorDescription" type="string" maxOccurs="1" minOccurs="0"> </element> <element name="Center" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="Time" type="time" maxOccurs="1" minOccurs="1"></element> </sequence> </complexType> <complexType name="TrackAppointment"> <sequence> <element name="Service" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="Date" type="date" maxOccurs="1" minOccurs="1"> </element> <element name="Error" type="Q1:ErrorType" maxOccurs="1" minOccurs="0"> </element> <element name="ErrorDescription" type="string" maxOccurs="1" minOccurs="0"> </element> <element name="center" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="number" type="int" maxOccurs="1" minOccurs="0"></element> </sequence> UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.edu . APPENDICES 55 </complexType> <complexType name="CancelAppointment"> <sequence> <element name="Service" type="string" maxOccurs="1" minOccurs="1"></element> <element name="Date" type="date" maxOccurs="1" minOccurs="1"></element> <element name="CustomerId" type="string" maxOccurs="1" minOccurs="1"></element> <element name="Error" type="Q1:ErrorType" maxOccurs="1" minOccurs="0"></element> <element name="ErrorDescription" type="string" maxOccurs="1" minOccurs="0"></element> </sequence> </complexType> <simpleType name="ErrorType"> <restriction base="string"> <enumeration value="SUCESS"></enumeration> <enumeration value="FAILURE"></enumeration> <enumeration value="UNKNOWN"></enumeration> <enumeration value="NO_APPOINTMENT"></enumeration> </restriction> </simpleType> <simpleType name="MessageType"> <restriction base="string"> <enumeration value="REQUEST"></enumeration> <enumeration value="REPLY"></enumeration> </restriction> </simpleType> <complexType name="QueueMessages"> <sequence> <element name="Type" type="Q1:MessageType" maxOccurs="1" minOccurs="1"> </element> <choice maxOccurs="1" minOccurs="1"> <element name="newAppointment" type="Q1:NewAppointment"> </element> <element name="tractAppointment" type="Q1:TrackAppointment"> </element> <element name="cancelAppointment" type="Q1:CancelAppointment"> </element> <element name="updateAppointment" type="Q1:UpdateAppointment"> UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist.unu.edu APPENDICES 56 </element> <element name="listDates" type="Q1:ListDates"></element> <element name="listCenters" type="Q1:ListCenters"></element> </choice> <element name="messageId" type="long" maxOccurs="1" minOccurs="1"></element> </sequence> </complexType> <element name="QueueMessage" type="Q1:QueueMessages"></element> <complexType name="DateInterval"> <sequence> <element name="MinDate" type="time"></element> <element name="MaxDate" type="time"></element> </sequence> </complexType> <complexType name="ListDates"> <sequence> <element name="Service" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="MeanTime" type="int" maxOccurs="1" minOccurs="0"> </element> <element name="OldDate" type="date" maxOccurs="1" minOccurs="0"> </element> <element name="Occupied" type="Q1:DateInterval" maxOccurs="unbounded" minOccurs="0"> </element> <element name="Error" type="Q1:ErrorType" maxOccurs="1" minOccurs="0"> </element> <element name="ErrorDescription" type="string" maxOccurs="1" minOccurs="0"> </element> <element name="WorkHours" type="Q1:DateInterval" maxOccurs="unbounded" minOccurs="0"> </element> <element name="center" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="customerId" type="string" maxOccurs="1" minOccurs="1"> UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist.unu.edu APPENDICES 57 </element> <element name="NewDate" type="date" maxOccurs="1" minOccurs="1"></element> </sequence> </complexType> <complexType name="ListCenters"> <sequence> <element name="service" type="string" maxOccurs="1" minOccurs="1"> </element> <element name="center" type="string" maxOccurs="unbounded" minOccurs="0"> </element> <element name="errorType" type="Q1:ErrorType" maxOccurs="1" minOccurs="0"> </element> <element name="errorDescription" type="string" maxOccurs="1" minOccurs="0"> </element> <element name="customerId" type="string" maxOccurs="1" minOccurs="0"></element> </sequence> </complexType> </schema> B.2. SCHEMA FOR EXPORTING APPOINTMENTS XML Schema 2: Schema for Exporting Appointments <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://egov.iist.unu.edu/emacao/queue/export" xmlns:tns="http://www.example.org/export" elementFormDefault="qualified" xmlns:Q1="http://egov.iist.unu.edu/emacao/queue/export"> <complexType name="Appointment"> <sequence> <element name="ServiceCode" type="string" maxOccurs="1" minOccurs="1"></element> <element name="Time" type="time" maxOccurs="1" minOccurs="1"></element> <element name="CitizenId" type="string" maxOccurs="1" minOccurs="1"></element> <element name="CitizenName" type="string" maxOccurs="1" minOccurs="1"></element> <element name="CitizenContact" type="string" maxOccurs="1" minOccurs="1"></element> <element name="ServiceCenter" type="string" maxOccurs="1" minOccurs="1"></element> </sequence> </complexType> <complexType name="ListAppointment"> <sequence> UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov.iist.unu.edu edu .unu.iist.egov.APPENDICES 58 <element name="Date" type="date" maxOccurs="1" minOccurs="1"></element> <element name="Appointments" type="Q1:Appointment" maxOccurs="unbounded" minOccurs="0"></element> </sequence> </complexType> <element name="Appointments" type="Q1:ListAppointment"></element> </schema> UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. iist.unu. channelId=500001 # Defines the type of deploiment. It is only used by the agencies.edu # Specifies if the tls need to enabled to send emails.egov.iist. Possible values are agency and portal type=agency # Define the parameters required for sending email # Defines the smtp server emailserver=mailhost.edu # Defines the smtp port number.unu.unu. Default is 25 emailport=25 # Defines the sender password. Can be blank in case no password is required emailsenderpassword= # Defines if authentification is required. Possible values true or false isemailauthenticationrequired=false # Defines the address used to send emails [email protected] 59 C. CONFIGURATION FILE C. E-APPOINTMENT CONFIGURATION FILE Configuration File 1: e-Appointment Configuration File # Define the member id used by this agency memberId=100001 # The name of the hosting agency agencyName=SAFP # The description of the agency agencyDescription=Public Administration and Civil Service Bureau # Specifies the channel used for communication with the portal.edu .1. Possible values are true or false istlsenabled=false # Define the parameters required for sending sms using the clickatell sms gateway # The user account at clickatell smsuser=douwevincent # The user password UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. edu .unu. The default value is 3 numbermonth=3 # Define the number of appointment a citizen can make. The default value is 2 numberappointment=2 # Define the email template to send to the appointment maker to remind him about his appointment emailtemplate=Mr./Mrs <<name>>./Mrs <<name>>. The new date is <<date>> and the time is <<time>> \ We look forward at meeting you. this message is to inform you \ that your appointment with <<agency>> at the center <<center>> is confirmed for <<date>> at <<time>>. \ We look forward at meeting you. This message is to inform you that you \ have an appointment with <<agency>> today at <<time>>. \ We look forward at meeting you in the future. This message is to inform you that \ you have an appointment with <<agency>> today at <<time>>./Mrs <<name>>. this message is to inform you that the date your appointment with \ <<agency>> at the center <<center>> was successfully updated. this message is to inform you that your appointment with \ <<agency>> at the center <<center>> on <<date>> at <<time>> is successfully cancelled./Mrs <<name>>. \ We look forward to meeting you. # Define the email template to send to the appointment maker when an appointment is canceled cancelnotificationtemplate=Mr. # Define the email template to send to the appointment maker to confirm the appointment newnotificationtemplate=Mr. \ We look forward to meeting you.APPENDICES 60 smsuserpassword= # Defines the api key to be used smsapiid= # Define the number of months in advance that we can make an appointment. # Define the sms template to send to the appointment maker to remind him about his appointment smstemplate=Mr.egov./Mrs <<name>>. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. # Define the email template to send to the appointment maker when an appointment is updated updatenotificationtemplate=Mr.iist. iist.service.impl.emacao.impl.service.org/schema/beans" xmlns:xsi="http://www.database.0.queuing.egov.queuing.iist.NotificationManager" /> <bean id="appointmentManager" class="edu.unu.emacao.emacao.iist.iist.emacao.iist.unu.impl.ServingDetailsManager" /> <bean id="workingHoursManager" class="edu.iist.database.impl.database.emacao.xsd http://www.iist.springframework.springframework.emacao.impl.emacao.database.queuing.iist.ServiceManager" /> <bean id="servingDetailsManager" class="edu.impl.org/schema/tx http://www.unu.iist.2.unu.queuing.org/schema/beans/spring-beans-2.impl.APPENDICES 61 C.iist.iist.emacao.impl.AgencyManager" /> <bean id="agencyCenterManager" class="edu.springframework.unu.AgencyService"> <property name="agencyDao" ref="agencyManager" /> <property name="agencyCenterDao" ref="agencyCenterManager" /> <property name="centerDetailsDao" ref="centerDetailsManager" /> <property name="serviceService" ref="serviceService" /> <property name="serviceDao" </bean> <bean id="customerService" class="edu.WorkingHoursManager" /> <!-.impl.unu.emacao.database.unu.AppointmentManager" /> <bean id="customerManager" class="edu.database.0" encoding="UTF-8"?> <beans xmlns="http://www.unu.unu.database.impl.queuing.org/2001/XMLSchema-instance" xmlns:tx="http://www.database.Configuring the DAO layer --> <bean id="agencyManager" class="edu.CenterDetailsManager" /> <bean id="notificationManager" class="edu.unu.HolidayManager" /> <bean id="serviceManager" class="edu.org/schema/tx" xsi:schemaLocation="http://www.springframework.queuing.impl.queuing.unu.iist.emacao.queuing.org/schema/beans http://www.queuing.springframework.AgencyCenterManager" /> <bean id="centerDetailsManager" class="edu.queuing. SPRING CONFIGURATION FILE Configuration File 2: Spring Configuration File <?xml version="1.0.impl.unu.unu.emacao.database.org/schema/tx/spring-tx-2.iist.edu ref="serviceManager" /> .queuing.xsd"> <!-.CustomerService"> <property name="customerDao" ref="customerManager" /> </bean> <bean id="notificationService" UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.database.emacao.queuing.springframework.Configuring the Service layer --> <bean id="agencyService" class="edu.w3.CustomerManager" /> <bean id="holidayManager" class="edu. service.service.springframework.emacao.unu.emacao.NotificationService"> <property name="notificationDao" ref="notificationManager" /> </bean> <bean id="appointmentService" class="edu.service.iist.iist.unu.springframework.emacao.queuing.queuing.iist.emacao.edu .service.unu.unu.emacao.impl.AppointmentService"> <property name="appointmentDao" ref="appointmentManager" /> <property name="customerDao" ref="customerManager" /> <property name="serviceDao" ref="serviceManager" /> <property name="notificationDao" ref="notificationManager" /> <property name="agencyCenterDao" ref="agencyCenterManager" /> <!-.Configuring JPA layer --> <bean id="entityManagerFactory" class="org.iist.impl.impl.queuing.unu.impl.service.<bean id="xg2gSynchron" class="edu.unu.vendor.egov.queuing.ServiceService"> <property name="serviceDao" ref="serviceManager" /> <property name="centerDetailsDao" ref="centerDetailsManager" /> <property name="agencyCenterDao" ref="agencyCenterManager" /> <property name="servingDetailsDao" ref="servingDetailsManager" /> </bean> <bean id="serviceFactory" class="edu.XG2GSynchron"/> --> <bean id="serviceService" class="edu.jpa.APPENDICES 62 class="edu.unu.HolidayService"> <property name="holidayDao" ref="holidayManager" /> <property name="agencyDao" ref="agencyManager" /> <property name="agencyCenterDao" ref="agencyCenterManager" /> </bean> <bean id="workingHourService" class="edu.ServiceFactory"> <property name="serviceService" ref="serviceService" /> <property name="workingHourService" ref="workingHourService" /> <property name="holidayService" ref="holidayService" /> <property name="appointmentService" ref="appointmentService" /> <property name="agencyService" ref="agencyService" /> <property name="customerService" ref="customerService" /> <property name="notificationService" ref="notificationService" /> </bean> <!-.emacao.iist.HibernateJpaVendorAdapter"> <property name="showSql" value="false" /> <property name="databasePlatform" valUNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.emacao.iist.iist.jpa.impl.service.queuing.xg2g.queuing.unu.orm.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter"> <bean class="org.<property name="xg2gSynchron" ref="xg2gSynchron" /> --> </bean> <bean id="holidayService" class="edu.WorkingHourService"> <property name="workingHourDao" ref="workingHoursManager" /> </bean> <!-.orm.queuing.iist. exceptions traduction --> <bean class="org.DBCP datasource --> <bean id="dataSource" class="org.PersistenceExceptionTranslationPostProcessor" /> <!-.dialect.springframework.persistence annotations --> <bean class="org.springframework.egov.iist.dbcp.orm.unu.mysql.InstrumentationLoadTimeWeaver" /> </property> </bean> <!-.springframework.classloading.transaction manager --> <tx:annotation-driven transaction-manager="txManager" /> <bean id="txManager" class="org.jdbc.apache.edu .hibernate.PersistenceAnnotationBeanPostProcessor" /> </beans> UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.APPENDICES 63 ue="org.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <!-.support.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/appointment" /> <property name="username" value="root" /> <property name="password" value="" /> </bean> <!-.jpa.annotation.commons.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.MySQL5InnoDBDialect" /> <property name="generateDdl" value="true" /> </bean> </property> <property name="loadTimeWeaver"> <bean class="org.orm.springframework.instrument.jpa.dao. APPENDICES 64 D. public T create(T object) throws DataAccessException. } D.unu.emacao.entities. public void setManager(EntityManager manager) throws DataAccessException.iist. public interface IAgencyDao extends IDao<Agency.queuing.unu.queuing. import java.3.emacao.Customer.iist.iist.unu. IDAO INTERFACE Interface 1: IDao package edu.iist.queuing.entities.Agency.EntityManager. public Collection<T> findAll() throws DataAccessException. import java. IAPPOINTMENTDAO INTERFACE Interface 3: IAppointmentDao package edu. import edu.queuing. public void delete(T object) throws DataAccessException.util.util.entities. APPLICATION PROGRAMMING INTERFACES D.emacao.database.emacao.emacao.Serializable. } D.unu.edu .unu. public interface IDao<T.unu. public T update(T object) throws DataAccessException.iist.iist.iist.database. import edu.1.Appointment.queuing.emacao. import java.database.Date.emacao.queuing.unu.entities.ID extends Serializable> { public T findById(ID id) throws DataAccessException. IAGENCYDAO INTERFACE Interface 2: IAgencyDao package edu. import edu.queuing.Collection.AgencyCenter.io.emacao.unu. import java. import javax.queuing. Long> { public Agency findByName(String name) throws DataAccessException. import edu.util. import edu. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.persistence.2.Collection.iist.entities.egov.Service.unu.iist. import java. Date date) throws DataAccessException.database. Date date) throws DataAccessException.emacao. import edu.queuing.entities.egov. // relative to pending appointment public Collection<Appointment> getPendingAppointmentService(Service service.iist.unu. public interface ICitizenDao extends IDao<Customer. AgencyCenter center) throws DataAccessException. public Collection<Appointment> findByServiceDate(Service service.unu.iist. AgencyCenter center) throws DataAccessException. Long> { public Collection<CenterDetails> findByService(Service service) throws DataAccessException. public Collection<Appointment> getPendingAppointmentDate(Date date) throws DataAccessException.iist. Service service. public Collection<Appointment> findByServiceCenterDate(Service s. Long> { public Collection<Appointment> findByDate(Date date) throws DataAccessException. import edu. import edu.AgencyCenter.queuing. Date date) throws DataAccessException.APPENDICES 65 public interface IAppointmentDao extends IDao<Appointment. public Collection<Appointment> findByServiceDate(Customer customer. public Collection<Appointment> getRunningAppointment(Date d) throws DataAccessException.database.queuing. } D.unu.unu. public CenterDetails findByServiceAndCenter(Service service.iist.util. ICOUNTERDAO INTERFACE Interface 4: ICounterDao package edu. import edu.emacao.unu. public Collection<Appointment> getPendingWorkingHour(Date date.emacao. Long> { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Date d)throws DataAccessException.emacao.emacao.Date date. public Collection<CenterDetails> findByCenter(AgencyCenter center) throws DataAccessException. } D. Date timeS.4.iist.Customer. public interface ICounterDao extends IDao<CenterDetails.unu. Date date) throws DataAccessException.Service. public Appointment getLastAppointment(Service s.iist.5.edu . ICITIZENDAO INTERFACE Interface 5: ICitizenDao package edu.entities. public Collection<Appointment> getPendingAppointmentCenter(AgencyCenter center.Collection.queuing.emacao.entities.iist.unu.queuing.CenterDetails. Date timeE) throws DataAccessException.entities.queuing. queuing. INOTIFICATIONDAO INTERFACE Interface 6: INotificationDao package edu.iist.queuing. Long> { public Service findByCode(String code) throws DataAccessException.iist.emacao.iist.queuing.iist.unu.database.iist. } D.unu.queuing.edu . public interface IHolidayDao extends IDao<Holiday.iist.unu.Collection.unu.iist. public interface IServiceDao extends IDao<Service. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.unu. public Collection<Notification> getNotSentNotification(Date date) throws DataAccessException.8. public interface INotificationDao extends IDao<Notification. import java.emacao. IWORKINGHOURSDAO INTERFACE Interface 9: IWorkingHoursDao package edu. import edu.entities.Holiday.iist.queuing.database. import edu.emacao.unu.emacao.emacao.database. } D.Date. ISERVICEDAO INTERFACE Interface 7: IServiceDao package edu.APPENDICES 66 public Customer getById(String customerId) throws DataAccessException.queuing.entities.entities. import java.unu.emacao.queuing. } D.util.boolean used) throws DataAccessException.emacao.6.7.Service.database. Long> { public Collection<Notification> findByTime(Date timeInf.egov.9. Date timeSup. import edu. Long> { } D. IHOLIDAYDAO INTERFACE Interface 8: IHolidayDao package edu.unu.util.Notification. import edu.iist.queuing.iist.unu.Service.queuing.DayOfWeek.entities.emacao.iist.entities.emacao.12.queuing.unu.11. } D.unu. import edu.queuing.queuing.iist.unu.queuing.queue. import edu.AgencyCenter. import java.entities.entities.unu.database. import edu.iist. import edu.unu.APPENDICES 67 import edu.emacao.iist.iist. public interface IAgencyCenterDao extends IDao<AgencyCenter.unu.edu .unu.AgencyCenter. public QueueMessages getMessage(long id).iist.10.unu. import edu.emacao.queuing.Agency.iist. Long> { } D.emacao.WorkingHours.emacao. IAGENCYSERVICE INTERFACE Interface 12: IAgencyService package edu.WorkingHours.entities.emacao. ISYNCHRON INTERFACE Interface 11: ISynchron package edu.iist.unu.emacao.unu.messages.iist. public interface IXG2GSynchron { public void addMessage(QueueMessages msg).unu.entities.unu.queuing.egov.util.Collection.queuing.xg2g.service.emacao.Holiday. public interface IAgencyService { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. import edu.iist. public interface IWorkingHoursDao extends IDao<WorkingHours.emacao.egov.queuing.iist. IAGENCYCENTERDAO INTERFACE Interface 10: IAgencyCenterDao package edu. Long> { } D.emacao.entities.queuing.emacao.QueueMessages. import edu.entities. emacao.unu. public void deleteHoliday(Agency agency. public void deleteWorkingHour(AgencyCenter center. public interface IAppointmentService { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. public void delete(Agency agency) throws QueueServiceException.Collection. public Collection<Holiday> getHolidays(Agency agency)throws QueueServiceException.iist. public void deleteHoliday(AgencyCenter center.emacao.emacao.Appointment.Holiday holiday) throws QueueServiceException. public Agency findByName(String name) throws QueueServiceException. String address) throws QueueServiceException. public Collection<Holiday> getHolidays(AgencyCenter center)throws QueueServiceException. Service service)throws QueueServiceException.queuing.IXG2GSynchron. Service service.core.unu.unu.queuing.queuing. import edu.DayOfWeek day) throws QueueServiceException.unu. public Collection<Service> getServices(Agency agency)throws QueueServiceException.Holiday holiday) throws QueueServiceException.iist.entities.WorkingHours.iist. import edu. import edu.AgencyCenter center) throws QueueServiceException.unu.unu.queuing. public Collection<AgencyCenter> getCenterServingService(Agency agency. public Collection<WorkingHours> getWorkingHours(AgencyCenter center.entities. public AgencyCenter getCenter(Agency agency.AgencyCenter center) throws QueueServiceException.AgencyCenter. public AgencyCenter addCenter(Agency agency.Date. WorkingHours workingHour) throws QueueServiceException.queuing. import edu.APPENDICES 68 public Agency create(Agency agency)throws QueueServiceException. public void addHoliday(Agency agency.util.emacao.unu.Holiday holiday) throws QueueServiceException.iist. Service service.13.xg2g.emacao. public Collection<Agency> list()throws QueueServiceException.entities.entities.Member.xg2g.queuing. public Collection<WorkingHours> getWorkingHours(AgencyCenter center.iist.egov. public Collection<AgencyCenter> getCenters(Agency agency)throws QueueServiceException.Holiday holiday) throws QueueServiceException.emacao. public Agency update(Agency agency) throws QueueServiceException.unu.util. import java.emacao.edu . } D.WorkingHourDetails. IAPPOINTMENTSERVICE INTERFACE Interface 13: IAppointmentService package edu.iist. import java. import edu.iist.Service. Service service.WorkingHours workingHour) throws QueueServiceException.emacao. import edu. public void deleteCenter(Agency agency.iist.service. public void addHoliday(AgencyCenter center. public void addWorkingHour(AgencyCenter center.unu. import edu.iist.queuing.util. Service service) throws QueueServiceException. public Collection<Appointment> getPendingAppointmentForDate(Date date) throws QueueServiceException. public Collection<Appointment> findByServiceDate(String serviceCode.unu. String center) throws QueueServiceException.String customer.emacao. String center) throws QueueServiceException. public int trackAppointment(Service service) throws QueueServiceException. public Collection<Appointment> findByServiceCenterDate(String serviceCode. String message) throws QueueServiceException. public void cancelAppointment(String customerId.queuing.unu. Date newTime)throws QueueServiceException.Date date) throws QueueServiceException. public Collection<Appointment> findByServiceDate(String customerId. public Collection<WorkingHourDetails> getAvailableHours(Service service.egov.Date date. Date newDate. AgencyCenter center) throws QueueServiceException.Date oldDate.emacao.Service service)throws QueueServiceException.edu .unu. public void setXg2gSynchron(IXG2GSynchron synchron). public Appointment getLastAppointment(Service s. } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. public Collection<Appointment> getStillRunningAppointment()throws QueueServiceException.queuing.service.iist.Date date) throws QueueServiceException. public interface ICustomerService { public Customer getById(String customerId) throws QueueServiceException. public Appointment create(Appointment appointment) throws QueueServiceException. public void setMember(Member member).Service service. String serviceCode. // Method to notify citizen public void notifyCitizen(Collection<Appointment> appointments.entities. // Services related to pending appointment especially when we need to delete some data structures public Collection<Appointment> getPendingAppointmentForWorkingHour(WorkingHours working) throws QueueServiceException. public Collection<Appointment> getPendingAppointmentForCenter(AgencyCenter center) throws QueueServiceException.iist. } D.14 ICITIZENSERVICE INTERFACE Interface 14: ICitizenService package edu. Date d) throws QueueServiceException.Date newDate. public void delete(Appointment appointment) throws QueueServiceException. public String[] getCenter(String serviceCode) throws QueueServiceException. // CRUD method public Appointment update(Appointment appointment) throws QueueServiceException.Customer.iist.APPENDICES 69 public int newAppointment(Appointment appointment.Date date.Date date. public int updateAppointment(String customerId. import edu. public Collection<Appointment> getPendingAppointmentForService(Service serv) throws QueueServiceException. public Collection<Appointment> list() throws QueueServiceException. emacao.17.egov.entities.entities. import java. import java. Date date) throws QueueServiceException.iist. Date date) throws QueueServiceException. } D.unu.entities.iist.emacao.util. import java.util.queuing.emacao.queuing.unu.Agency.unu.emacao. public interface IHolidayService { public Holiday getById(Long id) throws QueueServiceException. public interface INotificationService { public void createNotification(Notification notification) throws QueueServiceException. public boolean isCenterHoliday(AgencyCenter center. import edu.queuing.iist.Date.Holiday. } D.emacao.unu.unu.edu .queuing. INOTIFICATIONSERVICE INTERFACE Interface 16: INotificationService package edu. public void delete(Notification notification) throws QueueServiceException.unu. IHOLIDAYSERVICE INTERFACE Interface 15: IHolidayService package edu. import edu.Collection.iist.iist.emacao.service. public Collection<Notification> listReadyToBeSent() throws QueueServiceException.unu.queuing.queuing.entities.15.APPENDICES 70 D. public void markAsSent(Notification notifcation) throws QueueServiceException.Notification. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.util. public void update(Notification notification) throws QueueServiceException.emacao.unu. import edu.queuing.queuing. public void delete(Holiday holiday) throws QueueServiceException.service.iist. ISERVICESERVICE INTERFACE Interface 17: IServiceService package edu.16.iist.unu.Date.AgencyCenter. public boolean isHoliday(Agency agency.iist. import edu.entities. import edu.service. import java.util.Collection.iist.emacao.AgencyCenter. iist.unu.Service.iist.edu .unu. import edu. public Collection<CenterDetails> getCenterDetails(Service service) throws QueueServiceException.unu. public void modifyNumCounters(Service serv. public interface IServiceService { public Service create(Service service)throws QueueServiceException.entities. public interface IWorkingHourService { public WorkingHours getById(Long id) throws QueueServiceException.entities.entities. public interface IServiceDao extends IDao<Service.APPENDICES 71 import edu. IWORKINGHOURSERVICE INTERFACE Interface 19: IWorkingHourService package edu.queuing. ISERVICEDAO INTERFACE Interface 18: IServiceDao package edu.Service.iist.queuing.emacao.service.emacao.unu.emacao.CenterDetails. public void delete(Service service) throws QueueServiceException.iist.egov. public int getCurrentServing(Service service) throws QueueServiceException.queuing. public Service findByCode(String code) throws QueueServiceException. public int getNumberCounters(Service serv.unu. public Service update(Service service) throws QueueServiceException. Date date) throws QueueServiceException.emacao. int numServing) throws QueueServiceException. } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. } D.AgencyCenter center. public Collection<Service> list() throws QueueServiceException.unu.queuing. Long> { public Service findByCode(String code) throws DataAccessException.19.iist.AgencyCenter center)throws QueueServiceException. int counters) throws QueueServiceException.iist.emacao.emacao. public void delete(WorkingHours workingHours) throws QueueServiceException.queuing. public void updateCurrentServing(Service service. } D.WorkingHours.entities. public int getCurrentServing(Service service.database. import edu.iist.18. import edu.unu.queuing. "name")). import edu.markup.template.1.html.iist.apache. import org.form. import org.apache. TextField nameText = new TextField("name".egov. ackDelayText. JAVA CLASSES E.html.apache.SecureTemplate.html. } public Create(Service service) { this.apache. } protected void setService(Service service) { this.queuing. public class Create extends SecureTemplate { private Service service.iist.Service.FeedbackPanel.unu.entities. new PropertyModel(service. } protected Service getService() { return service.html.apache. "ackDelay")). TextField codeText = new TextField("code".APPENDICES 72 E. import org.markup.emacao.setRequired(true).Button.markup.wicket.wicket. "code")). import org.TextField.form. new PropertyModel( service.unu.queuing.emacao.model.unu.markup.panel. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.html.wicket.wicket.setRequired(true).apache. TextField ackDelayText = new TextField("ackDelay".edu .PropertyModel.markup.web.apache. MyForm form = new MyForm("form").iist.iist.queuing.basic. new PropertyModel(service.QueueServiceException. import org.Form.service = service.ResourceModel. codeText.iist.wicket. public Create() { this(new Service()). import org.queuing.unu. SERVICE CREATE CLASS Class 1 : Create package edu.service.service.model.unu.service = service. import org.web. import edu.form.wicket.wicket.Label.emacao. import edu.emacao. button. setResponsePage(edu.class). "meanServiceTime")).header_edit"))). form. }else{ add(new Label("header". new PropertyModel(service.header_create"))). form.iist.setModel(new ResourceModel("service. form.queuing. form. } @Override protected void onSubmit() { Service service = getService().web. } catch (QueueServiceException e) { error(e. form.update(service). } form.setRequired(true). new PropertyModel(getAgency()."name"))).add(meanSerText).add(new Label("agency". } } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.service. else getServiceFactory().create")).add(ackDelayText).setModel(new ResourceModel("service.getMessage()).getServiceService().setRequired(true). service.getServiceService(). Button button=new Button("button").unu.List.edu . } @SuppressWarnings("serial") class MyForm extends Form { public MyForm(String id) { super(id).setAgency(getAgency()). new ResourceModel("service.getId()==null){ add(new Label("header". add(form). new ResourceModel("service.create(service).add(button).add(nameText). try { if(service.unu. TextField meanSerText = new TextField("meanServiceTime".APPENDICES 73 nameText.emacao. button.edit")).getId()==null) getServiceFactory().add(codeText).iist. meanSerText. add(new FeedbackPanel("feedback")). if(service.egov. apache.markup.emacao.repeater. import edu.markup.data. add(agenciesData).Agency.edu .unu.iist. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.emacao.template.repeater.unu. DataView agenciesData = new AgencyDataView("loops".egov.web.iist.emacao.queuing.unu.queuing.agencies.markup.wicket.apache.queuing.SecureTemplate.html.apache.iist.markup.link.APPENDICES 74 } @Override public String getPageTitle() { return "Appointment System .DataView.Label.wicket. AGENCY LIST CLASS Class 2: List package edu. import edu.markup.entities. import org.Link.ListDataProvider.repeater.unu.Create a service".iist.data. import org.unu.QueueServiceException.Item. listAgencies = getData().emacao.web.IDataProvider.queuing.iist.data.basic.apache. } private void refreshList(boolean test) { IDataProvider provider = new ListDataProvider(listAgencies).apache. provider). import edu.FeedbackPanel. refreshList(false).web.apache.wicket. import edu. import org.wicket. add(new FeedbackPanel("feedback")). } } E. import org. import org.panel.wicket. public class List extends SecureTemplate { java. import org.util.html.List<Agency> listAgencies.emacao.repeater.iist.template.queuing.markup.html.unu.service. public List() { add(new NewAgency("newAgency")). if (test) remove("loops").ConfirmLink.2.markup.wicket.wicket.apache. import org. IDataProvider dataProvider) { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.APPENDICES 75 } private java. } private void delete(Agency agency) { try { getServiceFactory().delete(agency).egov.util.edu .list().List( agency).List<Agency> result = null. } catch (Exception e) { e.getAgencyService(). } private void edit(Agency agency) { Create create = new Create(agency).queuing.getAgencyService().iist.unu. setResponsePage(List.List of agencies". setResponsePage(servList). } catch (QueueServiceException e) { error(e.web. error(e.queuing.List servList = new edu.getMessage()).List<Agency>) getServiceFactory() .iist.util.service.printStackTrace(). private AgencyDataView(String id. } @Override public String getPageTitle() { return "Appointment System . } private final class AgencyDataView extends DataView { private static final long serialVersionUID = 2202514093282421239L.getMessage()).emacao.util.emacao.List<Agency> getData() { java. try { result = (java. } return result.web.unu. setResponsePage(create). } } private void services(Agency agency) { edu.class).unu.iist.service. unu.getName())).add(new ServicesAction("services".add(new Label("channelId".add(new EditAction("edit". } @Override public void onClick() { setResponsePage(edu.add(new DeleteAction("delete".iist.add(new Label("description".edu .Create. ag)). } } private final class NewAgency extends Link { private static final long serialVersionUID = 67705242749863887L.getDescription())). Agency ag) { super(id). private NewAgency(String id) { super(id).emacao.egov.getChannelId())). ag)).add(new Label("name". private ServicesAction(String id. ag)). ag.ag = ag.queuing. } } private final class ServicesAction extends Link { private static final long serialVersionUID = -3877244923013587852L.iist. dataProvider). } @Override protected void populateItem(Item item) { final Agency ag = (Agency) item.web.agencies. item. ag. private final Agency ag. item. item. item. } @Override public void onClick() { services(ag). item.class). ag. this. item.getModelObject().APPENDICES 76 super(id. } } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.unu. APPENDICES 77 private final class EditAction extends Link { private static final long serialVersionUID = 7009843932421244396L. import org. } @Override public void onClick() { edit(ag).iist.Form. private final Agency ag.queuing. import org.wicket.wicket.wicket.iist.Label.html.panel.wicket.model.apache.markup. import org.wicket.wicket.TextField.form. } } private final class DeleteAction extends ConfirmLink { private static final long serialVersionUID = -8992796734551382870L. import org.ag = ag. import org.agencies.html.validator. this.unu. private final Agency ag.wicket. import org.Button.wicket. Agency ag) { super(id).markup.html. } } } E. private EditAction(String id.emacao. } @Override public void onClick() { delete(ag). this. import org.apache.apache.basic.apache.form.apache.markup.PatternValidator.html.unu.model.apache.validation.apache. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. import org.markup.apache.PropertyModel. Agency ag) { super(id).web.ResourceModel.markup.egov.FeedbackPanel. AGENCY CREATE CLASS Class 3: Create package edu. private DeleteAction(String id.ag = ag.form.3.edu .html. emacao.queuing. nameText. } else { add(new Label("header".template.unu. import edu.emacao. new PropertyModel(this. button. add(form). } form. TextField descriptionText = new TextField("description".service.description")).queuing.getId() == null) { add(new Label("header". new PropertyModel( this.unu. form.header_create"))). new ResourceModel("agency. } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. } public Create(Agency agenc) { agency = agenc.unu.QueueServiceException. protected Agency getAgency() { return agency. import edu.iist.add(channelIdText).channelId")). descriptionText.emacao.add(button).egov.add(new PatternValidator("[0-9]+")).setRequired(true).iist. button. Button button = new Button("button").SecureTemplate.header_edit"))).setRequired(true). channelIdText.create")). "agency. new ResourceModel("agency. form. new PropertyModel(this. if (getAgency().edit")).APPENDICES 78 import edu.iist. TextField nameText = new TextField("name".Agency.edu .queuing.add(nameText). "agency.setModel(new ResourceModel("agency.unu. channelIdText. } private Agency agency. public class Create extends SecureTemplate { public Create() { this(new Agency()).setModel(new ResourceModel("agency. MyForm form = new MyForm("form1"). form.setRequired(true). add(new FeedbackPanel("feedback")).add(descriptionText). "agency.web.iist.entities.name")). TextField channelIdText = new TextField("channelId". else getServiceFactory(). import java. public class ConfigurationParameter { private static final String memberId.queuing.Properties.edu .util. } catch (QueueServiceException e) { error(e.create(getAgency()).printStackTrace(). } @SuppressWarnings("serial") class MyForm extends Form { public MyForm(String id) { super(id).4.unu. import java.Create new agency".agency = agency.FileInputStream.getAgencyService().URL.util.egov. setResponsePage(List.iist.getMessage()). CONFIGURATIONPARAMETERS CLASS Class 4: ConfigurationParameter package edu. e. } @Override public void onSubmit() { try { if (getAgency().update(getAgency()). } } E.io.unu. import java.iist.class). UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. } } } @Override public String getPageTitle() { return "Appointment System .getId() == null) getServiceFactory().getAgencyService().emacao.net.APPENDICES 79 protected void setAgency(Agency agency) { this. setSenderPassword(prop. private static final String smsTemplate. emailParameter. emailParameter = new EmailParameter(). agencyDescription=prop.egov. static { try { URL url=ConfigurationParameter. private static final int numMonth.getProperty("emailserver")). smsParameter.getProperty("smsuserpassword")).properties".parseInt(prop.setEmailPort(prop.class. emailTemplate=prop. private static final String channelId.getProperty("agencyName").getProperty("emailport")).setTLSEnabled(prop.getProperty("emailtemplate").getProperty("isemailauthenticationrequired")). numMonth=Integer. agencyName=prop. private static final SMSParameter smsParameter.unu. smsParameter = new SMSParameter(). FileInputStream f=new FileInputStream(url.getProperty("agencyDescription"). private static final String agencyDescription.getProperty("channelId").getProperty("newnotificationtemplate").getPath()). type=prop. smsParameter. emailParameter. emailParameter. smsParameter. private static final String createNotificationTemplate.setAuthentificationRequired(prop. private static final String emailTemplate. private static final String agencyName.edu .getProperty("numbermonth")).getProperty("updatenotificationtemplate"). emailParameter. private static final int numAppointment.setSenderEmail(prop.APPENDICES 80 private static final String type.getProperty("smsuser")). Properties prop=new Properties(). private static final String cancelNotificationTemplate. prop. memberId = prop.getProperty("smstemplate"). cancelNotificationTemplate=prop.getResource(CONFIG_FILE).getProperty("senderemail")).setPassword(prop.getProperty("emailsenderpassword")).setApiId(prop.getProperty("numberappointment")).getProperty("type").getProperty("smsapiid")).getProperty("istlsenabled")). numAppointment=Integer.setUser(prop.load(f). private static final String CONFIG_FILE="/config/config. private static final String updateNotificationTemplate. smsTemplate=prop.parseInt(prop. channelId=prop. updateNotificationTemplate=prop.iist.getProperty("cancelnotificationtemplate"). createNotificationTemplate=prop.setEmailServer(prop. emailParameter.getProperty("memberId"). emailParameter. } catch (Throwable e) { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. private static final EmailParameter emailParameter. } public static String getSMSTemplate(){ return smsTemplate.egov. } public static String getChannelId() { return channelId. } public static String getAgencyName() { return agencyName.printStackTrace().iist. } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. } public static SMSParameter getSmsParameter() { return smsParameter. } public static String getAgencyDescription() { return agencyDescription.APPENDICES 81 e. } public static String getType() { return type.unu. throw new ExceptionInInitializerError("Unable to initialize the configuration parameters"). } public static String getEmailTemplate(){ return emailTemplate. } public static EmailParameter getEmailParameter() { return emailParameter.edu . } } public static String getMemberId() { return memberId. } public static String getSmsTemplate() { return smsTemplate. service. } public IAppointmentService getAppointmentService() { return appointmentService. } } E.emacao.iist. private IWorkingHourService workingHourService. SERVICEFACTORY CLASS Class 5: ServiceFactory package edu. } public static String getUpdateNotificationTemplate() { return updateNotificationTemplate. } public static String getCreateNotificationTemplate() { return createNotificationTemplate. } public static String getCancelNotificationTemplate() { return cancelNotificationTemplate.unu.APPENDICES 82 public static int getNumMonth() { return numMonth. private IHolidayService holidayService.agencyService = agencyService. public IAgencyService getAgencyService() { return agencyService. } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. private ICustomerService customerService.queuing.5. public class ServiceFactory { private IAgencyService agencyService. } public void setAgencyService(IAgencyService agencyService) { this.egov. private INotificationService notificationService.iist.edu . } public static int getNumAppointment() { return numAppointment.unu. private IServiceService serviceService. private IAppointmentService appointmentService. } public IServiceService getServiceService() { return serviceService. } } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. } public IHolidayService getHolidayService() { return holidayService. } public void setHolidayService(IHolidayService holidayService) { this.serviceService = serviceService. } public void setServiceService(IServiceService serviceService) { this. } public void setCustomerService(ICustomerService customerService) { this.iist.egov.customerService = customerService. } public INotificationService getNotificationService() { return notificationService. } public void setNotificationService(INotificationService notificationService) { this. } public IWorkingHourService getWorkingHourService() { return workingHourService.appointmentService = appointmentService.edu .APPENDICES 83 public void setAppointmentService(IAppointmentService appointmentService) { this.holidayService = holidayService.notificationService = notificationService. } public void setWorkingHourService(IWorkingHourService workingHourService) { this.unu.workingHourService = workingHourService. } public ICustomerService getCustomerService() { return customerService. impl. return manager. ID> { private Class<T> entityClass.database. import java.IDao.getActualTypeArguments()[0].lang. import javax. ID extends Serializable> implements IDao<T.reflect.iist.PersistenceContext.Collection.iist.emacao.queuing.persistence.DataAccessException.emacao.iist. import java. } public Class<T> getEntityClass() { return entityClass.database.Serializable.ParameterizedType. public class GenericDao<T.iist. import javax.6.edu . } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.EntityManager.util. import edu. GENERICDAO CLASS Class 6: GenericDao package edu. @SuppressWarnings("unchecked") public GenericDao() { entityClass = (Class<T>) ((ParameterizedType) getClass() .unu. import java. } public void setManager(EntityManager manager) { this. import edu.APPENDICES 84 E.unu.unu.manager = manager. @PersistenceContext private EntityManager manager.persistence.egov.unu.database.queuing.getGenericSuperclass()).emacao.io. } protected EntityManager getManager() throws DataAccessException{ if(manager==null) throw new DataAccessException("The entity manager has not yet been set").queuing. unu.iist. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. import javax.edu . import java.queuing. id). } @Override public T update(T object) throws DataAccessException { object=getManager().HashMap.emacao. APPLICATION CLASS Class 7: Application package edu.find(entityClass. import java.ServletContext.7.persist(object).util.unu.web.egov.util. return result.merge(object).getResultList().servlet. return object. } } E. return result.iist. } @SuppressWarnings("unchecked") @Override public Collection<T> findAll() throws DataAccessException { Collection<T> result=getManager().getName()+" u").remove(object).Map. } @Override public void delete(T object) throws DataAccessException { //object=findById(id) getManager().APPENDICES 85 @Override public T create(T object) throws DataAccessException { getManager(). } @Override public T findById(ID id) throws DataAccessException { T result=(T)getManager(). return object.createQuery(" select u from "+entityClass. import edu. import edu.Session. private Map<String. import edu.apache.unu.queuing.queuing.iist. import org.entities.MySession.Request.Agency.ServiceFactory.unu.iist.queuing.iist.wicket. import edu.ApplicationContext.apache. import org.queuing.unu.Anon.WebApplication.xg2g.queuing.core.wicket.util. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. import edu.iist.wicket. import org.xg2g.emacao.unu.unu.springframework.xg2g.wicket.emacao. public Application() { } @Override public Class<? extends Page> getHomePage() { return Login.lang. private Member member.http.egov.emacao.unu.emacao.agencies. import edu.util.iist.emacao.AgencyApplicationListener.XG2GSynchron. import edu. return session.protocol. User> users. import edu.iist.support.APPENDICES 86 import org.queuing.iist.QueueServiceException. import org.context.unu.iist.apache.unu. import org.queuing.edu .service.PackageName. import org.core.Host. } @Override public Session newSession(Request request.session.class. import edu.apache.emacao.emacao.WebApplicationContextUtils.emacao.entities.apache.emacao.iist. import edu.queuing.iist. import edu.Page.unu.emacao.unu.Response.service.unu.util. import edu.unu.xg2g.unu.emacao.emacao.xg2g.iist. import edu.emacao.unu.web.queuing.iist.User.web.Create.queuing.Member.PortalApplicationListener. Response response) { MySession session = new MySession(request).wicket. import org.springframework.context.iist.ConfigurationParameter.unu.queuing.xg2g.queuing.wicket. import edu.iist.apache.IXG2GSynchron.iist. public class Application extends WebApplication { private ServiceFactory serviceFactory.web.emacao. PackageName .workinghours.unu.forPackage(edu.getRequiredWebApplicationContext(servletContext).class . HomePage.class. mountBookmarkablePage("/pages/Home".unu. if ("portal".forPackage(edu.service.forPackage(Login.web.class .web. PackageName.getPackage())). mount( "/service".iist.getPackage())).iist. mount("/pages".forPackage(edu.getBean("serviceFactory").getType())) { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. serviceFactory = (ServiceFactory) applicationContext .class .emacao. PackageName .APPENDICES 87 } public ServiceFactory getServiceFactory() { return serviceFactory.Create.queuing. mount( "/holi".getPackage())).getPackage())).forPackage(edu.equalsIgnoreCase(ConfigurationParameter. } @Override protected void init() { super.emacao. users=new HashMap<String. PackageName . mount( "/app".holidays.egov.unu. PackageName.iist. ApplicationContext applicationContext = WebApplicationContextUtils .unu.getPackage())).appointment.emacao.init(). mount( "/work".unu.NewAppointment.web.web.queuing.class).iist.emacao.Create.edu . PackageName .class.queuing.iist. mount("/agency". User>().queuing.class . ServletContext servletContext = getServletContext().forPackage(Create.Create.getPackage())). 1)).APPENDICES 88 PortalApplicationListener pListener = new PortalApplicationListener(). "portal".0)). ag. "portal".setChannelId(ConfigurationParameter.getMember(ConfigurationParameter.getAgencyService().put("agency". users.setServiceFactory(serviceFactory). Anon anon = new Anon().unu. } else { AgencyApplicationListener aListener = new AgencyApplicationListener().getAgencyService()."user".getAgencyDescription()).setXg2gSynchron(synchron).printStackTrace(). } } catch (QueueServiceException e) { e.2)).getMemberId().put("user". getServiceFactory().setServiceFactory(serviceFactory). users. if(ag==null){ ag=new Agency(). UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. ag.egov.edu . serviceFactory."agency". pListener).getAppointmentService(). pListener.getAgencyName().findByName(name).getChannelId()). new User("agency". member = anon. if (name != null) { try { Agency ag = getServiceFactory().iist. } if (member != null) { serviceFactory. IXG2GSynchron synchron = new XG2GSynchron()."agency". aListener. new User("user". aListener).setMember(member).getMemberId().setDescription(ConfigurationParameter. new User("portal". Host h = new Host(time).getMember(ConfigurationParameter. ag.setXg2gSynchron(synchron). } // Create the hosting if it does not already exists in the database // Now we need to decide what to do if the member and the agency are not specificy String name = ConfigurationParameter. member = anon."user".getAppointmentService(). long time = 30000L. aListener. h.setMember(member).setName(name). Anon anon = new Anon().create(ag).put("portal".start(). users. h. iist.unu.unu.queuing.queue.NotificationType.egov. import edu.UpdateAppointment.emacao.emacao.APPENDICES 89 } } } public Map<String. import edu.apache.NewAppointment.queue.entities.iist.util.Collection.unu. import edu. import java. } } E.edu .iist.Customer.iist.entities.unu.emacao.queuing.queuing.Calendar.DayOfWeek.iist.util.queue.emacao. import edu.unu.messages. import edu.iist.UserMessage.emacao.egov.Notification.iist.iist. import edu.messages.entities.unu.AgencyCenter.iist.messages. import edu.emacao.unu. import edu. import edu. import edu.gateway.queue. import java.emacao.queuing.ListDates.CancelAppointment.ArrayList.egov.unu.unu.queuing. import edu.Map. import java.iist. import edu.util.unu.queue.messages.xmlUtil.unu.emacao.HashMap.NoResultException. import java.emacao.unu.egov.egov.ErrorType. import edu.iist.persistence.ListCenters.iist.queue.emacao.unu.unu. import java.DateInterval.messages. import java. import javax.entities.XmlException.text.iist.util.Date. import edu.queue.emacao.emacao.queuing.xmlbeans.egov.messages.messages. import java.entities.queue.egov.egov.8.entities. import edu.queue.queuing.MessageType.emacao.entities.unu.emacao. import edu.Service.queuing.iist.messages.iist.xg2g.emacao.egov. import org.Appointment.QueueMessages.messages.emacao. AGENCYAPPLICATIONLISTENER CLASS Class 8: AgencyApplicationListener package edu.SimpleDateFormat.iist.egov.emacao.util.emacao. import edu.unu.iist.unu.iist.unu.unu. User> getUsers() { return users.util. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.iist. import edu.QueueServiceException.unu.xg2g.service. import edu.iist.unu.WorkingHours. import edu.Message.unu. @Override public void recChExtensionReply(String message) { } @Override public void recConfigureChExtensionReply(String message) { } @Override public void recCreateChannelReply(String message) { } @Override public void recDestroyChannelReply(String message) { } @Override public void recForwardReply(String message) { } @Override public void recGetMemberReply(String message) { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.core.ServiceFactory. import edu. import edu.iist.iist.unu.unu.emacao.entities.iist. private Member member.queuing.unu. public class AgencyApplicationListener implements ApplicationListener { private ServiceFactory serviceFactory.Util.Member.queuing.egov.emacao. final static int CANCEL = 2.unu.queuing. final static int UPDATE = 1. final static int CREATE = 0.iist.emacao.core.iist.xg2g.iist.util.emacao.xg2g.emacao.unu.queuing.unu.edu .queuing.APPENDICES 90 import edu. import edu.emacao.util.emacao.ApplicationListener.service.core.iist.emacao. import edu.iist.ConfigurationParameter. edu .iist.unu.APPENDICES 91 } @Override public void recManageReply(String message) { } @Override public void recMemberUnsubscribe(String message) { } @Override public void recReceiveMessageReply(String message) { } @Override public void recRegisterReply(String message) { } @Override public void recSendMessageReply(String message) { } @Override public void recSubscribeChannelReply(String message) { } @Override public void recUnRegisterReply(String message) { } @Override public void recUnsubscribeChannelReply(String message) { } @Override public void receiveMessage(String message) { // This is the only method we need to implement UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.egov. qMsg).getDate().edu . String emailAddress = nMsg.APPENDICES 92 // We get the message content // we get the type of message // do the required processing // send back the message to the sender try { Message msg = new Message(message). aDate. center. String serviceCode = nMsg. String serviceId = upMsg.getDate().getContent() .isSetUpdateAppointment()) { UpdateAppointment upMsg = qMsg. phoneNumber.getCustomerName().isSetCancelAppointment()) { // Get the parameter CancelAppointment cMsg = qMsg. details.getListDates().getService().getCustomerId(). customerId.getTime(). String details = nMsg.getCustomerId(). } else if (qMsg. String customerId = cMsg.getUserDefinedMessage()). if (qMsg.getService().getServiceCode().isSetListDates()) { ListDates lMsg = qMsg. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. qMsg).parse(uMsg. Date appointmentDate = cMsg.isSetNewAppointment()) { NewAppointment nMsg = qMsg.getCenter().getTime().getDetails().getNewAppointment(). qMsg). appointmentDate.getEmailAddress().toString()).getTime(). customerId. emailAddress. String reply = null. String serviceCode = lMsg. UserMessage uMsg = UserMessage.getTime().unu.egov.getTime().getTime(). Date startTime = nMsg. } else if (qMsg.getService().iist. String customerName = nMsg.parse(msg . Date newTime = upMsg.getCancelAppointment().getUpdateAppointment(). String center = nMsg. reply = cancelAppointment(serviceId. oldDate. customerName. String serviceId = cMsg. String phoneNumber = nMsg.getNewDate().Factory.getTime(). newDate.getDate(). reply = newAppointment(serviceCode. reply = updateAppointment(serviceId. newTime.getMobilePhone(). Date oldDate = upMsg. QueueMessages qMsg = QueueMessages. startTime. } else if (qMsg. Date aDate = nMsg.Factory. customerId. String customerId = upMsg.getTime(). Date newDate = upMsg. String customerId = nMsg.getCustomerId(). } catch (XmlException e) { e. msg. customerId. } else { // TODO Give a value to reply here // reply=?? } uMsg = UserMessage.setType(MessageType. m.APPENDICES 93 String center = lMsg.setErrorType(ErrorType.setReceiverId(ids). qMsg). qMsg). } if (s != null) { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.getServiceService().setMessageDate(new Date()). reply = listCenters(service. Date newDate = lMsg. oldDate.getCustomerId().getTime(). Date oldDate = (lMsg. c.getOldDate(). msg. } else if (qMsg.getListCenters().setSenderId(msg.getTime(). newDate.unu.setErrorDescription("Unknown service " + service). msg.FAILURE). ListCenters c = msg.printStackTrace(). msg.findByCode(service). try { Service s = null. String service = centers.getOldDate() == null) ? null : lMsg .parse(reply).REPLY).getSenderId().egov.newInstance().isSetListCenters()) { ListCenters centers = qMsg.getChannelId(). String ids = msg.Factory. msg. uMsg. QueueMessages m = QueueMessages.Factory. String customerId = lMsg.getListCenters().edu . } } private String listCenters(String service.setContent(m). center.getMessageStep() + 1). QueueMessages msg) { msg.setUserDefinedMessage(uMsg.setMessageStep(msg. String chId = msg. sendMessage(chId.toString()).getNewDate().iist.getService().getCenter(). } catch (NoResultException e) { c.toString()). reply = listDates(serviceCode.getReceiverId()). try { s = serviceFactory. AgencyCenter cent = null. } private String listDates(String serviceCode.unu. serviceCode.setTime(newDate). Date oldDate. if (center == null) { Collection<Appointment> aps = serviceFactory .getAddress()). for (AgencyCenter ce : listc) { if (serviceFactory.getInstance(). Date newDate.size() != 0) { values = new String[val.setType(MessageType. String center.getAppointmentService(). int day = cal.setErrorType(ErrorType.getServiceService() . } return msg. try { Service s = serviceFactory. } String[] values = null.APPENDICES 94 Collection<AgencyCenter> listc = serviceFactory .size()]. ld. val.findByServiceDate(customerid. } } } catch (QueueServiceException e) { c.getDayFromInt(day).get(Calendar. Calendar cal = Calendar. cal.egov.iist. String customerid.size() != 0)) { UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.setErrorDescription(e. ce) > 0) val.getListDates().DAY_OF_WEEK).getAgency()).setCenterArray(values). if (val.getCenters(s. } c.toString().getMeanServiceTime()).getAgencyService().findByCode( serviceCode). if ((aps != null) && (aps.toArray(values).add(ce. oldDate).FAILURE).REPLY). if ((listc != null) && (listc. Collection<WorkingHours> listW = null.getNumberCounters(s.setMeanTime(s. msg.size() != 0)) { Collection<String> val = new ArrayList<String>().getServiceService(). c.getMessage()). QueueMessages msg) { ListDates ld = msg. DayOfWeek d = Util.edu . } } else { cent = serviceFactory. i++.getAgency().getEndTime()). return msg.isCenterHoliday(cent.getNumberCounters(s. if (Util.getAgencyService().getCenter( s. } else { if (serviceFactory.FAILURE).unu.getAgencyService(). dt .getMeanServiceTime()). s. if ((listW != null) && (listW. for (WorkingHours dt : listW) { listD[i] = getDateInterval(dt. } int numCounters = serviceFactory.egov.getWorkingHours(cent.iterator().getCenter(). ld.getAgency().setErrorDescription((new SimpleDateFormat("dd/MM/yyyy")) .setErrorDescription("No appointment defined for customer " + customerid + " for " + (new SimpleDateFormat("dd/MM/yyyy"). newDate)) { ld.getCenter( s. } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. return msg.getHolidayService(). int i = 0.format(oldDate))). ld.setError(ErrorType. center). } if (cent == null) { ld.FAILURE). s.getAddress(). center). } listD = new DateInterval[listW.APPENDICES 95 center = aps. } listW = serviceFactory.toString().today(newDate)) { listW = getWHours(listW.iist.getServiceService() .getAgencyService(). cent = serviceFactory.format(newDate) + " is not a working date for " + center).edu .toString(). cent).size()].size() != 0)) { DateInterval[] listD = null.getStartTime().next().setError(ErrorType. d). UNKNOWN).iist. int meanTime) { Collection<WorkingHours> list = new ArrayList<WorkingHours>(). ld.getStartTime().getStartTime().toArray(val). e. listD.SUCESS).unu.getAppointmentService(). } ld. if ((listBusy != null) && (listBusy. newDate. } catch (QueueServiceException e) { ld. } // check only the services for the specified center Collection<Appointment> listBusy = serviceFactory . listBusy.APPENDICES 96 ld. } private boolean alreadyConsidered(Appointment ap.size()]. numCounters)) { if (!alreadyConsidered(ap. } return msg.getEndTime())). ld.add(getDateInterval(ap. } private Collection<WorkingHours> getWHours(Collection<WorkingHours> listW.setError(ErrorType. for (WorkingHours h : listW) if (!Util.getMessage()).edu .size() != 0)) { Collection<DateInterval> listD = new ArrayList<DateInterval>().equals(inter.setWorkHoursArray(listD). meanTime)) list. cent). Collection<DateInterval> listD) { for (DateInterval inter : listD) { if (ap.toString().isBetween(h.egov.setOccupiedArray(val).getMinDate(). ap .add(h).findByServiceCenterDate( serviceCode.printStackTrace(). listD)) listD.setErrorDescription(e. for (Appointment ap : listBusy) { if (isFull(ap.setError(ErrorType.getTime()) UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. return list. } } DateInterval[] val = new DateInterval[listD. equals(p.findByCode( serviceCode).size() != 0) { for (Appointment aps : ap) { if (aps != null) { aps. } protected String updateAppointment(String serviceCode. c1. Date newTime.APPENDICES 97 && ap. int numCounters) { int val = 0. try { Service s = serviceFactory.edu .getServiceService().getInstance().getAppointmentService() .Factory. Calendar c = Calendar.getEndTime()))) val++.newInstance(). return c1.unu. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. } private Calendar calendarFromDate(Date d) { Calendar c1 = Calendar. Date dateMax) { DateInterval result = DateInterval.egov.getEndTime(). return val >= numCounters. return result.getUpdateAppointment().setTime(newTime). Date newDate.equals(inter.getEndTime().setMaxDate(calendarFromDate(dateMax)). String customerId.equals(p. aps.setStartTime(newTime).getInstance(). } return false. for (Appointment p : listBusy) if (ap.setTime(d).iist.setMinDate(calendarFromDate(dateMin)).setDate(newDate).REPLY). oldDate).getStartTime()) && (ap.getTime())) return true. QueueMessages msg) { UpdateAppointment u = msg.getStartTime(). if (ap != null && ap. Date oldDate. Collection<Appointment> ap = serviceFactory. } private DateInterval getDateInterval(Date dateMin. msg. result.findByServiceDate(customerId.setType(MessageType. result. c.getMaxDate(). } private boolean isFull(Appointment ap. Collection<Appointment> listBusy. serviceCode. iist.setDate(ns. QueueMessages msg) { msg. e. String customerName.format(oldDate)))). customerId.getMeanServiceTime()). } // Generate the reply here } catch (QueueServiceException e) { u. Date startTime. serviceFactory. u. } } } else { u.setError(ErrorType.getMessage()).FAILURE).APPENDICES 98 c.getMessage()). String details.toString().setType(MessageType. String center. f.unu. String phoneNumber. UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www. Date date.getNotificationService() . serviceFactory.setEndTime(c.getTime()).getNotification().MINUTE.getAppointmentService().edu .UNKNOWN).update(aps). f. } Notification ns = createNotification(aps.setError(ErrorType.createNotification(ns).setTime(ns.setMessage(ns.format( "No appointment defined for the citizen %s at the date of %s". null.setErrorDescription(e. if (f != null) { Notification ns = createNotification(aps. String emailAddress. aps.setError(ErrorType.update(f). NewAppointment n = msg. -1).printStackTrace(). f.getNotificationService(). u . } protected String newAppointment(String serviceCode. Notification f = aps.getTime()).getDate()). new Date().getNewAppointment(). String customerId. UPDATE). serviceFactory.REPLY).egov.SUCESS). } return msg.setErrorDescription(String . s. (new SimpleDateFormat( "dd/MM/yyyy"). u.add(Calendar. getCustomerService().setDate(date).getAgency().findByCode( serviceCode).create(ap). // Create the notification here Notification ns = createNotification(ap. c. } else { Appointment ap = new Appointment().setEmail(emailAddress).setNotification(ns).setCustomerId(customerId). } ap.MINUTE.setErrorDescription("You can not have an appointment on holiday").FAILURE).setMobile(phoneNumber).createNotification(ns). center). serviceFactory. ns.setName(customerName). ap. Calendar t = Calendar.setError(ErrorType. c.// getAppointment(s.add(Calendar.isCenterHoliday(ac. Customer c = serviceFactory. ap.update(ap).egov. c.SUCESS). -1).getById( customerId).getAgencyService(). // Add another notification UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.iist. date).setCenter(ac). // ap. s. if (serviceFactory.edu .setAppointement(ap).unu. getServiceFactory().setNotification(ns). n.getTime()).setCustomer(c). ap.setEndTime(t.getServiceService().setTime(startTime). ap = serviceFactory.getMeanServiceTime()).getNotificationService().setError(ErrorType. date)) { n. ap.getInstance(). c.setService(s).getAppointmentService().getHolidayService().getCenter( s. null. ap.setStartTime(startTime). ap. if (c == null) { c = new Customer(). n . t. AgencyCenter ac = serviceFactory. t. ap.APPENDICES 99 try { Service s = serviceFactory.getAppointmentService().setDetails(details). setError(ErrorType. serviceFactory.getCustomer(). case CANCEL: template = ConfigurationParameter.printStackTrace().getCustomer().getInstance().SMS : NotificationType.EMAIL).getCancelNotificationTemplate(). new SimpleDateFormat("MM/dd/yyyy") .add(Calendar. notification.setDate(ap.put("<<date>>". String> props = new HashMap<String.iist. break.getEmailTemplate(). n. break. } private Notification createNotification(Appointment ap. Map<String. CREATE).setType((ap. notification. notification . notification. notification.setDate(ap.UNKNOWN).getDate()).setErrorDescription(e. } return msg.getEmail() == null) ? NotificationType.getCustomer(). notification. String>().unu.egov.getCustomer(). case UPDATE: template = ConfigurationParameter.getMobile()).getEmail()).format(date)).getMessage()).setEmail(ap. } if (date != null) { cal. int type) { Notification notification = new Notification().APPENDICES 100 Notification nss = createNotification(ap. Calendar cal = Calendar.getSMSTemplate() : ConfigurationParameter.getDate()).toString().MINUTE. default: template = (ap.setNumber(ap.getEmail() == null) ? ConfigurationParameter .getUpdateNotificationTemplate().setDate(date). props. 5). UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.getDate()).setDate(ap.getNotificationService(). String template.edu . break. notification.createNotification(nss). Date date.getCreateNotificationTemplate().getDate()). new Date(). switch (type) { case CREATE: template = ConfigurationParameter.setDate(ap. e. } } catch (QueueServiceException e) { n. notification. ap.findByServiceDate(customerId.egov.setTime(cal.getName()). String customerId. props.put("<<name>>". props.setTime(cal.unu.REPLY).getNotificationService().getNotificationTemplate().getCustomer().getCancelAppointment().setError(ErrorType. } protected String cancelAppointment(String serviceCode.MINUTE.APPENDICES 101 notification. cal.getAppointmentService(). c .getAppointmentService() . serviceFactory.getAckDelay()). new Date(). ap.getAckDelay()).delete(aps). notification. } else { cal.put("<<agency>>".getAddress()).setErrorDescription(String .size() != 0)) { for (Appointment aps : ap) { serviceFactory.getAgency().setType(MessageType.getTime()).FAILURE). -ap. } c. return notification. CANCEL). if ((ap != null) && (ap.edu .iist. notification. try { Collection<Appointment> ap = serviceFactory .getService().add(Calendar. props.getTime()).setError(ErrorType. "" + ap.getService(). ap. props. } else { c.getStartTime()). QueueMessages msg) { CancelAppointment c = msg.format( "No appointment UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.format(template.createNotification( ns).getName()). } props. Date appointmentDate.setMessage(Util.put("<<center>>". new SimpleDateFormat("H:mm"). props)). // template = ConfigurationParameter.format(ap . appointmentDate). msg. serviceCode.getStartTime())).SUCESS). Notification ns = createNotification(aps.getService().put("<<time>>".put("<<delay>>".getCenter().setTime(ap. iist. } public Member getMember() { return member.setError(ErrorType.egov.setErrorDescription(e. c.getMessage()). null). } } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.edu .unu. } private void sendMessage(String chId. } } catch (QueueServiceException e) { c.toString(). msg. customerId.printStackTrace(). msgs).sendMessage(chId.formatMessage(chId. (new SimpleDateFormat( "dd/MM/yyyy")) . } return msg.serviceFactory = serviceFactory. } } public ServiceFactory getServiceFactory() { return serviceFactory. String msg) { if (member != null) { String msgs = member.format(appointmentDate))).member = member.APPENDICES 102 defined for citizen %s at the date of %s". } public void setServiceFactory(ServiceFactory serviceFactory) { this. member. e.UNKNOWN). } public void setMember(Member member) { this. APPENDICES 103 E.util.emacao.unu.9.get(id). while(msg==null){ msg=listMessage.iist. import java.unu.sleep(1000). } } @Override public QueueMessages getMessage(long id) { QueueMessages msg=null.util. public XG2GSynchron(){ listMessage=new HashMap<Long.egov. import edu. public class XG2GSynchron implements IXG2GSynchron { private Map<Long.edu . } @Override public void addMessage(QueueMessages msg) { if(msg!=null){ listMessage. } } return msg.printStackTrace().Map.unu. import java.xg2g.iist.getMessageId().emacao. QueueMessages>(). msg).QueueMessages. } catch (InterruptedException e) { // TODO log this message e. } } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.iist.queue.HashMap.messages.queuing. QueueMessages> listMessage. XG2GSYNCHRON CLASS Class 9: XG2GSynchron package edu. try { Thread.put(msg.egov. import edu.ApplicationListener. import edu.queuing.iist.xg2g.unu.gateway.unu.XmlException.unu.emacao. import edu.QueueMessages.APPENDICES 104 E.unu.emacao. import edu.unu.emacao.apache.iist. public PortalApplicationListener(){ } @Override public void recChExtensionReply(String message) { } @Override public void recConfigureChExtensionReply(String message) { } @Override public void recCreateChannelReply(String message) { } @Override public void recDestroyChannelReply(String message) { } @Override public void recForwardReply(String message) { } @Override UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.iist.Message.emacao.10.UserMessage.iist.xg2g.iist.iist.xg2g. PORTALAPPLICATIONLISTENER CLASS Class 10: PortalApplicationListener package edu.egov.xmlUtil. import org.core.egov.xmlbeans.emacao.unu.edu .core.messages.queue. public class PortalApplicationListener implements ApplicationListener{ private IXG2GSynchron xg2gSynchron. egov.edu .APPENDICES 105 public void recGetMemberReply(String message) { } @Override public void recManageReply(String message) { } @Override public void recMemberUnsubscribe(String message) { } @Override public void recReceiveMessageReply(String message) { } @Override public void recRegisterReply(String message) { } @Override public void recSendMessageReply(String message) { } @Override public void recSubscribeChannelReply(String message) { } @Override public void recUnRegisterReply(String message) { } @Override public void recUnsubscribeChannelReply(String message) { } @Override UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.iist.unu. } } public IXG2GSynchron getXg2gSynchron() { return xg2gSynchron.addMessage(msg).getUserDefinedMessage()). } } UNU-IIST CENTER FOR ELECTRONIC GOVERNANCE | www.edu .iist.printStackTrace().parse(m.APPENDICES 106 public void receiveMessage(String message) { // We need to implement this method in order to enable the portal to // receive messages.xg2gSynchron = xg2gSynchron.toString()).egov. } catch (XmlException e) { e. } public void setXg2gSynchron(IXG2GSynchron xg2gSynchron) { this. The simple idea is to extract the content and put it in a queue try { QueueMessages msg=null.Factory.Factory. UserMessage uMsg = UserMessage. msg = QueueMessages.unu.parse(uMsg. xg2gSynchron.getContent() . Message m=new Message(message). . UNU-IIST Center for Electronic Governance .
Copyright © 2024 DOKUMEN.SITE Inc.