Add Accession Option in LSF Refile Update Program
- Add the argument to accept "Accession" as the program's input option. In this way, If there is no "Accession" passed in, the program will read refile barcode file. If there is "Accession" passed in, the program will read accession barcode file.
- When processing accession barcodes, the program only resets the item status from "In Transit Discharged" to "Not Charged" by using APIs.
- All of outputs are not emailed out to staff, only are saved in the log file on the server.
Develop Orbis RSS Feed
- Design the application structure to be best having fastest response time when getting Voyager bib data.
- Queries are saved in external XML file. In this way, the queries can be easily read and changed.
- Tried three ways: Java Servlet with DOM, Java Servlet with out print, JSP with Java Servlet Init applied. The way of DOM is slow, because it needs to wait the whole XML file to be generated, then displays on the browser. The second way can display the results right away for the existing results, and at mean time, it continues to retrieve the data from database to add in display. However the diacritics can't display correctly. The third way uses Java Servlet's init to retrieve qualified bibids that may take a longer time. The init only runs once when starting the application in Tomcat. JSP retrieves each RSS element in the queries that have index fields. In this way, the response time is instantly.
- Solve the diacritics display problem. Diacritics can't display correctly in Java Servelet. They can display correctly in JSP. The method should use: new String(rsTitle.getString("rss_title").getBytes("8859_1"),"UTF-8").
Analyze LC Call Number Sorting Rule
- Use an example to explain. DS1, DS12, DS2, DS112, DS26, DS3.
- The computer will sort them as DS1, DS2, DS3, DS12, DS26, DS112. But this order is wrong in LC sorting rule.
- The correct sorting should be DS1, DS112, DS12, DS2, DS26, DS3.
- In order to achieve this by computer, it need to add spaces(use b to present a space) between letters and digits to make the lenght is 7.
- DS1 shoud be DSbbbb1. DS112 should be DSbb112. DS12 should be DSbbb12. DS2 shoud be DSbbbb2. DS26 shoud be DSbbb26. DS3 shoud be DSbbbb3.
Make Changes of Course Reserve List Service Based on Feedback
- Display the reserve charges for the selected semester if the selected semester is after Fall 07 (including Fall 07). Otherwise display the current reserve charges for the purpose of reference.
- "Search By" result only shows reserve list title with check box, "SELECT ALL" box, "Preview", "Export" buttons. Detail data that include bib, holding and item data will be retrieved by clicking "Preview" or "Export" button. Detail data only is only extracted when the list title is checked.
- Set up relations between the content of "search by" and term code. e.g. at MUSIC Course Reserve Desk, there is only term code "SP04" pop up. That means at this location only includes "SP04" reserve list, no other semester has reserve list.
- Searching input area should be "search by" box appeared before term code input box.
- Only search locations that have reserve list, not all locations in the libraries.
- Clear out the display area on the right when clicking the menu on the left.
- Highlight the menu selection after clicking.
- The detail data display The link function effects Ajax functions that have been used. Must consider clicking behavior.
Develop Course Reserve List Service
- In the html, apply DIV for the layout; CSS for the appearance; Ajax Prototype and Scriptaculous Autocompleter function.
- In the JavaScript:
- Random number in the URL to avoid browser's caching.
- "&" is used as delimiter of URL parameters, it can't pass over as content between client and server, it must be replaced with its encoding by using replace(/&/g,"%26") when passing into server or replace(/%26/g,"&") when getting data from server.
- Make connection between client and server by using myRequest.getXMLHttpRequest(), myRequest.responseXML; Control click action by using Event.observe.
- Use document.getElementById function to pass values between html and Javascript.
- Use xmlResponse.getElementsByTagName to get data from server.
- Write html syntax into the string variable, then write back to browser by using document.getElementById('ResultDisplay').innerHTML= '<div id="ReturnResponseContainer">' + variable.
- Some JavaScript can not be used in both IE and Firefox.
- The JSP that relates with Autocompleter retrieves data from Oracle database by using LIKE search. Any typing will invoke query searching database by the condition LIKE '?%'
- The JSP that relates with searching reserve list data has these features:
- In the Oracle query "&" is treated as parameter input. If the input includes "&", it must be replaced by "&'||'" for the query.
- Use HashMap, and Hashtable save data from department, instructor, course, reserve location Oracle tables. So that they don't need to directly participate in the query to make searching much faster. The "&" that comes from Oracle table is saved as "&" in the HashMap and Hashtable. It needs to be converted back by using function replaceAll("&", "&").
- Queries are saved in external XML file. The input part is replaced by each searching category in the JSP. In the query, use right join (+) to avoid missing the records that don't have data in some fields.
- Two searching modes: "StartsWith" whose query uses "LIKE '?%'" condition; "Exact" whose query uses "=?" condition.
- Term Code is from reserve list title's data between first and second space.
- inputData.replaceAll("&'||'", "&") doesn't work correctly. It should use inputData.substring(0,inputData.indexOf("&'||'")) + "%26" + inputData.substring(inputData.indexOf("&'||'")+5,inputData.length());
- Syntaxes of return data back to browser:
response.setContentType("text/xml");
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
......
- Use session to pass query results, HashMap, Hashtable for the JSP that exports data into MS Excel sheet.
- The JSP that relates with export to MS Excel sheet receives the data from session, and:
- html codes don't be recognized in the Java's "if" condition <% if {...} %>
- Use jstl core library to loop the result set, and convert data between jstl, Java, html, such as:
<c:forEach var="row" items="${getRecordQuery.rows}" begin="0">
<c:if test="${reserveID != row.reserve_list_id}">
<c:set var="dept" value="${row.department_id}" />
<jsp:useBean id="dept" type="java.math.BigDecimal" />
<% out.println(((dept.toString().equals("0")) || deptHash.get(dept) == null) ? "" : deptHash.get(dept)); %>
- Use CSS to control colors, typography, layout schemes, translate into greater power and efficiency, create cleaner, standards-compliant code, improve the accessibility and usability.
Design Course Reserve List Service
- Interface layout, color, font, header, footer, menu, display area, convenience and easily use.
- Interface friendly input design will use Ajax Prototype and Scriptaculous autocomplete to prompt what the database has. This will greatly help user for their right input. Use CSS to create nice readable interface.
- Client side Javascript connects interface's activities into server side actions. Javascript gets interface's parameters'value; processes to generate new values; passes them into server; gets response back from server; if server returns the result, parses, and write into interface to display, otherwise write waiting statement.
- Server side JSP gets request from Javascript, search data from Oracle database, wrap the results into XML to return into Javascript. In JSP, it uses Java technique to make less Oracle tables involved into the runtime querying to make searching time as fast as possible .
- Analyze, test Oracle tables to create the efficient queries.
- Easy export to MS Excel format feature.
Develop Generic OAI Orbis Extract Tool
- Externalize the SQL query for extracting different category data without changing program.
- Add location Hash tables that include mapping relations among location id, code, display name to improve searching speed.
- Add resumptionToken that is applied in three verbs: ListRecords, ListIdentifiers, ListSets.
- Add RSS feed. The elements follow these guidelines:
- title and description: oai_dc crosswalk.
- link: use the record's 856$u data. If there is no data in 856$u, use data in link field from elink_index table with record type as MFHD. If none of them are existed, use OPAC URL with this record's bib id.
- guid: OPAC URL with this record's bib id.
- category: the record's location code.
- The channel title, link and description are declared in external file OAI.properties.
- Update the data resource of oai_dc_identifier as the same as RSS'link guideline.
- Update CERL OAI, Map OAI, LWL OAI to obey the same guideline as the generic OAI Orbis.
- Write technical documentations about OAI Orbis, OAI CERL, OAI Map, OAI LWL
Update LSF Refile Program
- Read LSF EOD file to separate item barcodes into different actions.
- If the barcode doesn't start with 39002, it's non-Voyager barcode. It will be saved on the server.
- If the barcode starts with LSFMD, it's Kirtas barcode, count it, and display on the screen.
- All other barcodes will go through following process:
- If the barcode's location starts with lsf, and item status is "In Transit Discharged",
Apply API DELISTATUS to remove the item status.
Apply API ADDISTATUS to add the item status "Not Charged".
- If the barcode's location starts with lsf, but item status is not "In Transit Discharged",
Apply API CIRCDEFS to set this barcode's perm location.
Apply API DISCHARGE to discharge this barcode to "Not Charged".
Report the fine/fee in the exception file if there is one.
- If the barcode's location doesn't start with lsf, report to exception file.
- Write all exception messages into Excel sheet file.
- Send the email to LSF staff attached with the exception Excel sheet file.
- Screen display all the result's numbers.
- Write technical documentations about LSF Refile Update
Test Voyager DISCHARGE API
- Find out that another Voyager API CIRCDEFS must be applied for discharge location before DISCHARGE API.
- If CIRCDEFS is applied a circ desk location, DISCHARGE's status is "discharged"; otherwise is "Not Charged".
- Overdue items can be DISCHARGEd, and the amount of fine/fee will be in the result of DISCHARGE.
- If the item has other item status, such as hold, recall, lost etc will not be DISCHARGEd.
- Work with colleagues to review the test results.
Research Database Auto Reconnection and 0 downtime Issue
- Find the solution for Tomcat web application to reconnect datasource automatically without re-starting Tocmat. The configuration of Oracle and MySQL is different.
- For Oracle, there two situation:
- If the datasource is configured in server.xml(context.xml), add testOnBorrow="true" under "Resource".
- If the datasource is configured in Java program, use setAutoCommit(true).
con = DriverManager.getConnection("jdbc:oracle:thin:@magellan.library.yale.edu:PORT:SID,database_name,database_password);
con.setAutoCommit(true);
- For MySQL, add "?autoReconnect=true" at the end of datasource URL in web.xml.
<init-param>
<param-name>dbURL</param-name>
<param-value>jdbc:mysql://exlib2.library.yale.edu:3309/sfxtst3?autoReconnect=true</param-value>
</init-param>
- Find the solution to make two datasources on two servers alternate work if one server is down. Put primary datasource in Java "try" section, and put secondary datasource in this "try"'s catch block. The primary datasource will be connected all the time unless it lose the connection; then the datasource connection will be automatically switched to secondary datasource. Whenever the primary datasource is back to work again, the datasource connection will be automatically switched back to primary datasource immediately. This approach can make applications work 24 hours 7 days if two servers are not down at the same period.
SUN TECH DAYS 2007 - 2008
- Attend this conference, here is my note.
- JMaki
- JMaki wraps many existing cool Ajax tools together, such as JSF, Dojo, GWT(Google Web Tools) Yahoo ajax tool, FishEys, TreeNodes etc in NetBeans 6.0. You just drag them into coding area, the NB will generate codes structure for you. Then you can add yourself codes.
- Profiler
- NB 6.0 builds in Profiler which can monitor threads, CPU, memory leaking problem, and can take you right to where the bad code is, and other more.
- Java FX
- A new scrip language which is just announced at this year's JavaOne conference(Jeff and Roy went this one, right?). Mainly for web design. The concept is: When the web designer is not the web developer, it's very hard for the web designer to write Java code. With Java FX, the web designer doesn't need to write pure Java code, Java FX will do for you.
- Ruby
- In NB, it's called JRuby(Java Ruby). JRuby is built in NB 6.0.
- Java DB
- It called Java Deby database. It is Sun's open source. Java DB is built in NB 6.0. Maybe in the future, we can build our local tables in Java DB, instead of in Oracle.
- XSLT project module, and XSLT editor that looks like XMLSpy style.
- SQL project module, and pull out the results with XML format option.
- Kill the running job at output window. This is very helpful. Right now, I have to close entire NB in order to kill the job.
Research JIRA
- Standard JIRA has Notification and Permission two schemes. Enterprise JIRA has more schemes.
- Notification Schemes are used for sending email notifications. Different events can be added into one notification scheme that make what activity should send email.
- Permission Schemes are used to define user's privileges in the project. This relies on the configurations of users, user groups, and project roles.
- Issue Security Schemes are used to control who can and cannot view issues. They consist of a number of security levels which can have users/groups assigned to them. When creating the new project, add Issue Security Scheme and Security Levels on this project. In this way, the issues can only be accessed by the users/groups that are assigned in security levels.
- JIRA doesn't have real Archive feature. By adding a permission scheme that doesn't link to any users, groups and roles, it can achieve the "Archive" feature. Whenever the project is done, change the project's permission scheme to this "Archive" scheme. Then this project won't be showed in any users' login project's list. It's only displayed in Administration project's list with the red colored in "Default Assignee" field. If this project needs to work again, change the "Archive" scheme to other working permission scheme.
- JIRA has three level's hierarchy structure: project -> issue -> subtask.
- JIRA can plug in Subversion. atlassian-subversion-plugin.jar*, javasvn-.jar*, ganymed-.jar* need to be placed in WEB-INF/lib directory, and local Subversion server data needs to be put in a properties file subversion-jira-plugin.properties that should be placed into WEB-INF/classes directory.
- JIRA has two ways to create public user account. This is controled by JIRA two modes which are in General Configuration:
- Public - Any user can signup and post issues.
- Private - Only administrators can create new users.
By combining the configuration of security levels in Issue Security Schemes, the public users can be restricted to access issues that they create only. The public users can see all project's names. When they click each project, they can't see any issues that are created by others. However, the public users can create the new issues on all projects.
Install NetBeans 5.5.1, Subversion, Maven
- Solve the problem in NetBeans5.5.1 + Tomcat 5.5 that JDBC driver can't be found.
- Place ojdbc14.jar into Program Files -> netbeans-5.5.1 -> enterprise3 -> apache-tomcat-5.5.17 -> common -> lib.
- Change context.xml to tomcat5.5 format:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/CurrencyJSP">
<Resource
auth="Container"
description="DB Connection"
name="jdbc/xxxxxx"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@xxxxxx:1521:xxxxxx"
username="xxxxxx"
password="xxxxxx"
maxIdle="2"
maxWait="5000"
maxActive="4"/>
</Context>
- Plug in Subversion in NetBeans5.5.1:
- Download SVN client from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
- Go to NetBeans Tools -> Update Center -> check NetBeans Update Center, Next -> Select Subversion -> Add, then install.
- Subversion tab will appear next to CVS tab.
- Click Subversion -> Checkout -> in Repository URL, enter http://xxxxxx/svn/repository/
- Enter username and password, find the project that you want to check out by "Browse", select Local Folder, then Finish.
- Plug in Maven in NetBeans5.5.1:
- Download Maven client latest version (Maven2 Support) from http://mevenide.codehaus.org/m2-site/index.html.
- Unzip .nbm files into one folder.
- Go to NetBeans Tools -> Update Center -> check Install Manually Downloaded Modules (.nbm Files), Next -> Add all unziped .nbm files, then install.
- Installation reference URL: http://mevenide.codehaus.org/m2-site/mevenide2-netbeans/installation.html
- Build maven web application sample URL: http://mevenide.codehaus.org/m2-site/mevenide2-netbeans/tutorials/helloWorldWebApp.html
SFX A-Z List Data Search - XML output
- Learn SFX, and MySQL.
- Download and install MySQL Query Builder.
- Analyze SFX database tables, and the relationship among the tables.
- Create keyword search, category/subcategory search queries, and document the analyzing thoughts for other staff to share.
- Use Java Servlet to program the application.
- Specially use Java Regular Expressions to code translation from SFX holding availability raw data to readable data.
- Code to merge SFX holding availability local and global data.
- Figure out Java servlet code to output UTF8 data correctly in XML format.
String CONTENT_TYPE = "text/xml; charset=UTF-8";
response.setContentType(CONTENT_TYPE);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
Document doc = parser.newDocument();
OutputFormat format = new OutputFormat(doc, "UTF-8", true);
- Document "How to use this application - URL explanation".
SQL Developer Test
- For the months since November 2006, downloaded and installed different SQL Developer versions, due to bugs in the SQL Developers. Test using its functions, especially test "Query Builder" function. Find the problems, and contact with Oralce expert for the solutions. After Oracle issued a few new patch releases to fix the problems, now SQL Developer 1.1.3 is ready for us to use.
Investigate Voyager Oracle tables UTF-8 issue
- Voyager's Oracle database has US7ASCII defined as NLS_CHARACTERSET. This affects all VARCHAR2 and CHAR columns. Tables which contain MARC data, like bib_data and bib_text, store that data in these US7ASCII VARCHAR2 columns. All MARC data is encoded as UTF-8, a sequence of 8-bit bytes. Oracle does store all 8 bits of each byte, so the UTF-8 encoded MARC data is *stored* safely in these US7ASCII columns. It's just that when most programs ask Oracle for this data, Oracle reasonably enough returns the data as US7ASCII since that's what the NLS_CHARACTERSET says is correct, which causes the diacritic data to
be corrupted.
- In Voyager, only MARC data is encoded as UTF-8. Other data, like patron names, can have
diacritics, but all the non-MARC data is encoded as ISO8859-1.
Continue Developing and finish Collection Analysis Version 2 Revision 1
- Research how to, and programming init() in servlet, and jspInit() in JSP to load locations with their LC holding counts at the stage of compiling the application, not invoking the application by browser.
- init() can be precompiled, executed, and cached only once at the level of tomcat operations, such as start tomcat, start or reload application; don't need to use browser.
- jspInit() can be precompiled, executed, and cached only once at the level of application first invoke by browser.
- Output the correct diacritics depends on many factors, Java methods with parameters, the functions of output stream receivers, such as browsers, editors, MS Excel, Access etc.
One Jave method with one parameter may be work for browser to display diacritics correctly, but not good for txt format. There is no one generic Java method with parameter can work great for all situations.
Research how to, and programming output diacritics correctly into txt file.
- Finish, war, and deploy the application to test server.
- Write Collection Analysis Version 2 Revision 1 technical documentation.
- Write Read Me file for how to deploy this application on server.
- Write instruction file of how to apply AJAX open source DWR in programming.
Continue Developing Collection Analysis Output Function
- Use SQL PrepareStatement to run the query instead of using CreateStatement. In this way if the query in the loop, only loading the query once.
- Use jspInit() for the one time run job. In this way, the one time job only is executed once at the first time loading the JSP page; then stay in the cache. This method can improve the performance.
- Update the LC class range design as two level hierarchy structure with category id to group the categories, and avoid to oupput the same record repeatedly.
- Use AJAX to build the connection between server and client. The client (browser) issues the request, and server runs the queries. The queries are built dynamically based on each request. The results will be written to a txt file, and saved on the server. The file name is timestamped with netid.
- The user will be notified in a email when the file is available. The user click the link in the email, then the user will be taken to the directory that her/his file is saved.
- Use Java Mail to send the email to the user automatically. There are two email domain server names on the campus. Use user profile group name to decide the user's email domain server name.
- The txt file is delimited by pipe "|". The txt can be imported to Microsoft Excel or Access.
- It is recommended that number of output records should be less than 40,000.
Develop Invoice Transfer Java Version
- Investigate the relations among acquisition database tables that relate with invoice, fund, line items, other charges.
- Master both library and account payable's requirements and criteria for invoice transfer.
- Investigate the problems that sometimes happen in the invoice transfer files caused by Voyager's bug.
- Investigate the problems that sometimes happen in the invoice transfer files caused by foreign currency conversion.
- Use Java Excel API to create snapshot excel sheet reports. Open source jar file: poi-2.5.1-final-20040804.jar.
- Design the effient, and flexible programming methods to create invoice transfer files.
- Use Java mail function to send snapshot excel sheet reports to library staff through emails automatically.
- The open source jar files are used for emailing function: mail.jar, activation.jar.
Interface Design - Collection Analysis Tool Version 2, Revision 1
- Create all queries for generating lists from four select boxes.
- AJAX, Java thread, hashmap, treemap, collection are used to the function of process result sets, progress monitor display.
- Create three local tables to hold LC call numbers information.
- Create header logo, title icons, buttons using PhotoShop.
- Apply CSS on the interface.
- Create footer.
Call Number Select - Collection Analysis Tool Version 2, Revision 1
- Use AJAX, Java HashMap, TreeMap, Collection to sort, select, execute call number and location data.
- Select Location(s) - sort as location code; value is location code.
- Select Class(es) - sort as location code, call number class; value is location code + class.
- Select Subclass(es) - sort as location code, call number subclass; value is location code + subclass.
- Select Range(s) - sort as location code, call number range; list display with call number range's hierarchy and sequence.
Learn Cognos and Analyzer
- Learn Cognos Business Intelligence Demo.
- Endeavor Analyzer is the product that applies Cognos Business Intelligence onto Voyager, currently onto Meridian.
- The relationships in presentation layer are predefined. You can only get reports that fields are in presentation layer.
- Other reports that fields are not in presentation layer may can get through database schema.
- The output formats are very flexible, such as HTML, EXCEL, PDF, DISHBORAD, PIE GRAPH, BAR GRAPH, etc.
Build LC Subclass Range Tables
- Design and create LC class table, LC subclass table and LC subclass range table.
- Class table has two fields - class letter and class label. Index is class letter field.
- Subclass table has three fields - class letter, subclass letter and subclass label. Index are class letter and subclass letter fields.
- Subclass range table has four fields - subclass letter, start number, end number, and subclass range label. Index are subclass letter, start number, and end number fields.
- These tables are used for new collection analysis tool.
Taking Training Class: Web Development with Cascading Style Sheets
- Cascading Style Sheets(CSS) is an important component of successful Web design. It is integrated into HTML 4.0, so to create valid HTML 4.0
pages, we should use CSS to control our colors, typography, and layout schemes, rather than the HTML style-oriented tags and attributes of previous versions of HTML.
Research and Investigate Tomcat Realm
- Create example programs to test three tomcat realms.
- File-Based Realm: UserDatabase:
- Add user names and role names in tomcat-users.xml.
- Test authentication mechanisms in two choices: BASIC and FORM.
- Add <security-constraint>, <security-role>, and <login-config> in web.xml.
- Use default realm mechanism in server.xml: <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>.
- Combine Yale's CAS netid and password into tomcat realm as login authentication verification, so add dummy password in tomcat-users.xml.
- JDBC Realm:
- Add user names and role names in operator1(users), roles, user_roles tables.
- Test FORM authentication mechanisms.
- Add <security-constraint>, <security-role>, and <login-config> in web.xml.
- Add JDBC realm mechanism in server.xml: <Realm className="org.apache.catalina.realm.JDBCRealm"
connectionName="xxxxxx" connectionPassword="xxxxxx"
connectionURL="jdbc:oracle:thin:@<HOST>:<PORT>:<SID>" debug="99"
driverName="oracle.jdbc.driver.OracleDriver" roleNameCol="role_name"
userCredCol="password" userNameCol="operator_id" userRoleTable="user_role" userTable="operator1"/>.
- Combine Yale's CAS netid and password into tomcat realm as login authentication verification; so add dummy password in operator1(users) table.
- Try to use Voyager operator table as tomcat realm users table, but it didn't work, because voyager tables and tomcat realm tables are in different schema.
- DataSource Realm: setting are the same as JDBC realm, except for realm configuration in server.xml:
- <Realm className="org.apache.catalina.realm.DataSourceRealm" debug="99"
dataSourceName="jdbc/authority" userTable="operator1" userNameCol="operator_id" userCredCol="password"
userRoleTable="user_role" roleNameCol="role_name"/>.
- Add "jdbc/authority" into <GlobalNamingResources> through tomcat GUI in admin - Resources - Data Sources.
Move up Applications for Production Run
- Finish up Circ Reports, Fund Management Tool, Fund Administration Tool and promote them to production run.
- Work on authentication recognized by non-student, individual netid.
- Update YUL_TOOLKIT to include Circ Reports, Fund Management Tool, Fund Administration Tool and Currency Exchange Rates Estimator.
- Solve the problem that applications having VoyAuth filter can't work from staff front door.