SiriusWB source tree contains all major packages from the main Sirius application, with the exception of several modules that were not included in the applet version and/or required additional libraries (molecular dynamics, remote database connections, reading mmCIF files, etc.). COMPILATION NOTE: The entire application is compiled using Java 1.4. This is done to maximize its compatibility. A substantial number of user systems are relatively out of date and only have 1.4 plugins installed. Using 1.5 as the minimum system requirement would unnecessarily restrict use. In addition, the entire Sirius application was developed using exclusively 1.4 syntax, so there is no real need to compile using Java 5.0. CHECKING APPLET INPUT: It may be necessary to check what input parameters are read by the applet (username, server url, etc.). To enable the corresponding menu item (under the Help menu), set checkINputParameters boolean variable in Viewer class to true. APPLET SIGNING: The CD includes a perl script for generating certificates and signing jars. Run sign.pl and enter signer information at prompts. On Windows, run command in the terminal as "perl sign.pl", provided the perl command is in the path. IMPORTANT: both sirius_wb.jar and looks_1.3.jar must be signed with the same certificate. JAR COMPATIBILITY: Don't try to upgrade JOGL jars or platform-specific jars that are required for the applet, unless you have enough time on your hands to fix all the dependencies. It's best to keep the setup as is, since any new functionality provided by the updated jars will not be used anyway. PDB LOADING: In the future it's possible that PDB will change their file loading URL. Since the url is hard-coded in the loading method, such a change (however unlikely) will break PDB file loading. Therefore, if PDB loading will ever fail, first check in the doRcsbLoad() method of Viewer in the root package and compare to the download location given by the PDB developers. All workbench-specific class files that reside in the applet are in package edu.sdsc.sirius.workbench, while the server-side source is in org.ngbw.web.actions. WBManager All actions associated with manipulation of workbench entries are handled by WBManager, which is instantiated by the parent Viewer class (extends Applet) at the time of initialization. WBManager keeps track of all Sirius-readable items in the user's WB account. Once a new Entry is loaded, it checks against the list and creates an association between the actual Entry and its WB mirror. This way, attributes of a WB item (label, folder name, data type) can be accessed when working with a loaded Entry. At the same time, subclassing Entry wouldn't work, since the two serve distinctly different purposes: Entry is the actually loaded fully qualified Sirius object, and WBEntry is a bookkeeping entry. WBManager defines all methods for handling item listing, loading, saving and deleting. In addition, when an Entry is removed from the workspace, it cleans up any remaining associations to avoid memory leaks. WBManager instance is received from the parent implementing edu.sdsc.sirius.util.Manager interface via getWBManager() method. WBEntry This class is a container for information that is associated with a particular item in the user's workbench account. It stores attributes like label, folder name, data type, etc. It's used to associate a loaded Entry with its corresponding set of WB properties. For instance, when a loaded Entry comes from the workbench and is saved out to the user's account, information from WBEntries is used to retrieve destination folder options and assign a default label. WBListDialog The dialog is instantiated when a list of current workbench entries is retrieved from the server. It contains WBListPanel, which is the functional part of it. WBListPanel The list panel uses a JTree implementation to show items in the user's account. They are grouped by folders (folder labels assigned by the user). The tree uses two types of user data container classes that are assigned to DefaultMutableTreeNodes: DataNode and FolderNode. DataNode is a container for the corresponding workbench entry information (id, label, folder label, etc.). Its toString() method is overridden to provide a description in the tree display. Each readable type is designated as Structure, Sequence, Sequence alignment, or View. Only data types that are readable by Sirius are displayed. These include: SEQUENCE (fasta, aln, msf, genbank, uniprot) SEQUENCE_ALIGNMENT (fasta, aln, msf) STRUCTURE (pdb, mol2) BINARY_VIEW (or whatever the current equivalent of a View) In principle, Sirius can also read SDF format used widely to store small molecule structures. In this case, a separate handler will need to be implemented in the loadWBEntry() method to call the corresponding loader and create a new Entry. In this case, however, there is a potential added complexiti if the SDF file contains multiple structures, rather than one. In this case, handling of PDB NMR structure files would be a good example, since it also provides the user with a choice of models stored in the file and the ability to load them independently of each other. When a node is selected in WBListPanel, it corresponding Entry and WBEntry are accessible, so all operations rely on this connection. WBSaveDialog It collects all the information necessary to save a data item or a view to the user's workbench account and calls the corresponding method in the WBManaget. The latter, in turn, packages a request and sends it to the server. org.ngbw.web.actions.WBRequest This class is a container for all requests that are sent to the server from the applet. It defines several constants that are used to determine the nature of the request: LIST_ACTION LOAD_ACTION SAVE_ACTION DELETE_ACTION In addition, it provides a flag for the type of the item in question: data or view. Since the two types need different handling on the server, WBDispatcher checks this flag first. In addition to flags, WBRequest contains fields specific to the request: String label, folder label, etc., as well as Object data that may hold the content of the file being saved. The applet class. Viewer extends Applet and contains all basic applet methods. init() contains a call to initialize() method, which effectively creates the application including GUI elements and reading user preferences. start() method is called once the browser environment has decided to start it. Here we check for any requests to load data at startup (as in the case of loading data from a displayed list). This can only be placed in the start() method, because we need a guarantee that all initialization has completed before trying to actually load the data. Here we check for the id and type of the requested item. If they are provided, a call is forwarded to WBManager for loading. Both data and views are processed this way. The bulk of the Viewer class is definition of the menu structure, toolbar functions and corresponding control statements. In addition, it defines methods that are used for inter-component communication. COMMUNICATION WITH THE SERVER The applet uses direct http connection to the servlets that reside on the workbench server. The expected response format can be found in each of the methods of WBManager that call the server. In all cases, they are arrays of Objects, but in some cases the object is cast to a String, while in others (like in View retrieval) - to StateObject. The responsibility of the WBDispatcher servlet is to parse the WBRequest coming from the applet, retrieve the requested data from the database, format the output to be compatible with the applet's requirements and send it back via the same http connection. Server-side services include: sequence alignment, structure alignment and generation of a ray-traced image of the current 3D view. A handler servlet is designated for each operation. PKR-02 BACKUP SERVICES While the servlet functions are (being) moved to the workbench servers, these urls can be used as backup: Sequence alignment: http://pkr-02.sdsc.edu:8888/servlets-examples/servlet/SequenceAlignmentDispatcher StructureAlignment: http://pkr-02.sdsc.edu:8888/serlvets-examples/servlet/AlignmentDispatcher Ray Tracer: http://pkr-02.sdsc.edu:8888/servlets-examples/servlet/RayTraceDispatcher These urls should be placed in the corresponding methods of WBManager.