-
Notifications
You must be signed in to change notification settings - Fork 0
Technical Overview
The source code is organized into modules, some of which inherit properties from other modules. The easiest way to get started is to understand the details of the "base module" - the parent that multiple children inherit properties from.
This "base module" represents an "ACIP Center." The idea of the "Center" is generic in the sense that this center could be performing almost any function imaginable. Yet every ACIP Center, no matter what it is actually doing, needs to have certain software tools available to do that work. So ACIP Center implements these tools. For example, it is assumed that every ACIP Center will have multiple people working at this center. Each of these workers will have their own workstation, and will log into it to do whatever they do. It is also assumed that workers will produce something, and collaborate with each other in the process.
In general, each module has its own Java Package, which can contain an entire hierarchy of child packages underneath it. Most modules are wrapped inside a single Eclipse project, which has the same name. For example, source code for the ACIP Center "base module" is located in the org.asianclassics.center project.
The Center module is "abstract," meaning it is meant as a base module for its children to inherit properties from. However, it can be compiled and run on its own, and one can test login/logout and other functionality. Once logged in, a "dummy" test screen is shown, where you can't really do anything but log back out.
The two child modules that have been implemented so far are the cataloging module called org.asianclassics.center.catalog and the input module called org.asianclassics.center.input.
When something is produced by the workers at an ACIP Center, it needs to be stored somewhere. Also, there needs to be a place to store the "source material" that the workers are working with. (For example, if workers are inputting scans, they need access to the scans.) Finally, user information and configuration data needs to be accessed and updated. A database management system (DBMS) is used for all of these tasks. The DBMS used here is called CouchDB. To connect with CouchDB from Java code, Ektorp is used.
Every workstation at a center joins a "cluster" and then messages are passed among members of this group to find the "local master database" for that center. (See Network Topology for details.) The framework that is used for this message-passing is called JGroups.
Jackson is used to work with JSON data (and is also core to Ektorp.)
The pecha input software has spell checking and discrepancy highlighting features, and this is made possible by integrating RSyntaxTextArea into the input module.
There are a few other tools that are used in the base module, and throughout the source code. A dependency injection framework called Guice and the message bus from Guava are used to tie code components together. Using Joda Time saved some coding time.
Several tools have been developed in-house that can be used in many kinds of Java projects. Because their scope of usefulness is broader than just the ACIP project, they have been placed in their own Github repository called java-util.
From the perspective of networking, the LinkManager class is the heart of the system. LinkManager handles the link between the current workstation and the workstation that holds the master database. Note that when the current workstation holds the master database, it connects to itself. In addition, LinkManager uses JGroups to tie all the workstations together into a cluster. (See Network Topology for details.) If activities among all the workstations in the cluster need to be synchronized, then the entire cluster can be "locked" to prevent deadlock and contention.
The first thing that happens when LinkManager comes online is that it connects to a local instance of CouchDB and looks for the "bootstrap" database, which indicates that the other databases needed to run the center are located here as well. (See Database Setup for details on the bootstrap.) Then, LinkManager tries to join the cluster. If other workstations are found on the network, and if the current workstation has the bootstrap (and is therefore the "master server") the current workstation broadcasts its IP address to everyone else, so they can all connect to the same master instance of CouchDB.
From the perspective of the user interface, the entry point is the CenterApp class. CenterPanel is the root "panel" or "window" that all other widgets and panels get added to. Note that CenterPanel gets its main child panel added by the function setTaskView(). This allows children modules to add their own panels that provide the UI needed for their respective functions.