ILO Yellowpages (YPAGES) database Technical documentation

ILO Yellowpages (YPAGES) database Technical documentation

ILO Yellowpages (YPAGES) database ILO Yellowpages (YPAGES) database Technical documentation Technical documentation Environment . . 5 Dependencies . . 5 System Software . . 5 Other information systems . . 5 Functional Description . . 6 End-User read-only interface . . 6 End-User edit interface . . 7 Super-User edit interface . . 7 User management . . 8 Requesting access for a new user . . 8 Changing password . . 8 Forgotton password . . 8 Page headers and footers . . 9 Text Messages . . 10 Mechanism . . 10 Viewing a complete list of text messages . . 10 Viewing text message IDs on a normal page . . 10 Attached Documents and Photos . . 11 Mechanism . . 11 DAD configuration for attached documents . . 11 User Authentication . . 12 Mechanism . . 12 DAD configuration for custom authentication . . 12 HTML templates . . 13 ILO_ENVT - Apache webserver environment variable . . 13 APPENDIX I - PL/SQL Packages Used . . 14 Package names and entry points . . 14 Package entry points . . 14 Package name . . 14 Procedure name . . 14 Description . . 14 CODE_COUNTRIES . . 14 CODE_EXPERTISES . . 14 CODE_LANGUAGES . . 14 Stephenson and Associates Ltd. Page 1 http://www.s-and-a.com

CODE_STATUSES . . 14 CODE_TEXTMSGS . . 14 GENUTILS . . 15 OWA_CUSTOM . . 15 TPKG_YPERSONS . . 15 TPKG_YPERSON_ADDRESSES . . 15 TPKG_YPERSON_COUNTRY_EXP . . 16 TPKG_YPERSON_EDUCATION . . 16 TPKG_YPERSON_EMAILS . . 16 TPKG_YPERSON_EXPERTISES . . 17 TPKG_YPERSON_LANGUAGES . . 17 TPKG_YPERSON_NATIONALITIES . . 17 TPKG_YPERSON_PHOTOS . . 18 YPCONST . . 18 YPMAIN . . 18 YPSECURITY . . 19 YPUTILS . . 19 APPENDIX II – Complete list of tables and columns . . 21 Table: ACCESSLOG Accesslog . . 21 Table: ACTIVATED_USERS This table is used to implement custom activatation . . 22 Table: ATTACHED_DOCUMENTS Table for storing attached documents (required by Oracle). All column names and utilisation are imposed by Oracle . . 22 Table: ATTACHED_DOCUMENTSPART Table for storing parts of attached documents (required by Oracle). All column names and utilisation are imposed by Oracle . . 23 Table: COUNTRIES Country list . . 23 Table: DEBUG This is a general use table for debugging output . . 23 Table: EXPERTISES Expertise list . . 23 Table: HTML_TEMPLATES HTML template for the web pages . . 24 Stephenson and Associates Ltd. Page 2 http://www.s-and-a.com

Table: LANGUAGES Languages . . 24 Table: LANGUAGE_PROFICIENCIES Reference table for language proficiencies . . 24 Table: STATUSES Statuses . . 25 Table: TEXTMSGS Table used to store text that will appear on the screen. Can also be used for image names or URLs. . . 25 Table: YPERSONS Main table of Persons . . 25 Table: YPERSON_ADDRESSES Person addresses . . 26 Table: YPERSON_COUNTRY_EXPERIENCE Person countries . . 27 Table: YPERSON_DOCUMENTS Table linking to BLOB documents in the ATTACHED_DOCUMENTS tables . . 27 Table: YPERSON_EDUCATION educational history table . . 27 Table: YPERSON_EMAILS Person e-mail addresses . . 27 Table: YPERSON_EXPERTISES Association between Person and the extertise list . . 28 Table: YPERSON_LANGUAGES Person languages . . 28 Table: YPERSON_NATIONALITIES Person nationalities . . 28 Stephenson and Associates Ltd. Page 3 http://www.s-and-a.com

Table: YPERSON_PHOTOS Person Photos . . 29 Stephenson and Associates Ltd. Page 4 http://www.s-and-a.com

Environment Developed using: Oracle10gR2 PL/SQL web toolkit YUI Ajax toolkit 2.5.2 Webserver environment: Oracle Apache Web Server – mod_plsql DAD name (read- only) ypages DAD name (update) ypagesedit Oracle schema owner ypages Dependencies System Software ♦ Oracle10gR2 ♦ Oracle Apache Web Server Other information systems Owner HTTPUTILS a PL/SQL toolkit. YELLOWPAGES table/view from ILO Yellowpages user If the YELLOW_VIEW view is unavailable for any reason the application main PL/SQL package YPMAIN will become invalid and the application will cease to function until the valid view is available again.

DATABANK table/view from ILO Yellowpages user If the YPAGES_ILO_OFFICIALS view is unavailable for any reason the application main PL/SQL package YPMAIN will become invalid and the application will cease to function until the valid view is available again. Stephenson and Associates Ltd. Page 5 http://www.s-and-a.com

Functional Description The YPAGES application was inspired by the EMP/ENT resource platform application and is built to allow ILO officials to enter data about themselves and, in particular, their areas of expertise. The distinction between the edit interface and the super-user interface depends on the privilege level assigned to the user in the activated_users table. There are three user interfaces, these are the: ♦ an end-user read-only interface, used for interrogating the database in read- only mode. The URL for this interface is : http://servername/dyn/ypages/ ♦ an edit interface (requires username and password), used for interrogating the database in read-only mode and for updating the user's own personal data. New users can request a username and password which will be e-mailed to them. The URL for this interface is : http://servername/dyn/ypagesedit/ ♦ a super-user editing-mode interface (requires username and password), is used for application administration. The URL for this interface is : http://servername/dyn/ypagesedit/ End-User read-only interface The interface starts by bringing the user to an introductory page (ypmain.home). The user can search by clicking on the search link in the left menu and defining his search criteria in the search pages (ypmain.listPersons) The results of the search are displayed as a page of persons that meet the criteria specified. By clicking on the person's View profile link the user can see a sheet displaying all the details that have been entered concerning that person. Users may access their own profile by clicking on the "My profile" link in the left menu. They will then be prompted for their username and password before passing to the edit-interface.

If the user does not yet have a username and password, or has forgotton them. They may register/re-register using the "Request Access" option in the left menu. Stephenson and Associates Ltd. Page 6 http://www.s-and-a.com

End-User edit interface Once logged-in users are now in their "edit" interface. Users can only edit their own profiles (i.e. the profile to which they are logged on). This may be done either by clicking the "edit" link under the "My Profile" section of the left menu or by clicking the "edit" link at the top right of their profile. Once a user clicks "edit", they are brought to an "Update Profile" page for their profile. Here they can edit different parts of their profile. In order to present so mich information on a single page a YUI (Yahoo User Interace) tab layout is used. The tabs are as follows, entry of data into these is currently optional: • General - general information about the user • Overview - textual description of the user's experience • Education - textual description of education, and language proficiencies • Expertise - areas of expertise according to ILO classification • Geog. Exp. - country experience • Addresses - street and e-mail address. • Photo - an uploaded photo • Hobbies, etc. - textual description of the user's extra-professional interests • Docs - a place to upload any relevant docements that will be then available via the user's profile The "save changes" button on the bottom of the page saves changes made to all tabs. Similarly, the "cancel" button cancels all changes made in any tab. Super-User edit interface Super-users are the administrators of the application. Their entry in the activated_users table contains the keyword SUPER in the role column. These users, in addition to all the functionality described above, can change the contents of the text messages table and other application reference tables such as countries, expertise, languages and language proficiencies. Stephenson and Associates Ltd. Page 7 http://www.s-and-a.com

User management The table ACTIVATED_USERS deals with the management of super-users and contributors. When a user requests access, an entry is created in this table containing • the user name (the part before the @ in the ILO e-mail address) • a generated password (using one-way SH1 encryption) • role (left null for normal users) • yperson_id (the unique identifier within the system). Requesting access for a new user New users can request access by clicking on the "Request access" link in the left menu. They will then be asked to provide their valid ILO e-mail address. The e-mail address entered is immediately checked against the YELLOWPAGES.YELLOW_VIEW view in the database. If it matches a valid ILO e-mail address an e-mail is sent to the user with his username and his initial password. The username corresponds to the stem (i.e. the part before the "@" of their ILO e-mail address) and the initial password is randomly generated and may be changed by the user once logged-in.

When a user is first created, some information is copied into his entry from the YELLOWPAGES.YELLOW_VIEW and DATABANK.YPAGES_ILO_OFFICIALS views in the database. Changing password Users can change their password at any time by clicking on the "change password" link in the left menu. They are then prompted for the old password, and asked to enter the new password twice. If the old password is correct, and the two new passwords match then the user entry is changed in the ACTIVATED_USERS table. Note: The user will be prompted to log-in again immediately after a successful password change. This is because the browser recognises that the existing authentication is no longer valid.

Forgotton password Stephenson and Associates Ltd. Page 8 http://www.s-and-a.com

Users can reset their forgotton password at any time by clicking on the "request access" link in the left menu. A new password is generated, the user entry is changed in the ACTIVATED_USERS table, and an e-mail is sent to the user with the new password. Page headers and footers Page headers and footers are retrieved from the standard ILO headers and footers using the URLs entered in the TEXTMSGS table. The relevant entries are: URL_GLOBAL_HEADER URL_DEPT_HEADER URL_GLOBAL_FOOTER The database makes a http request for these URLs and inserts the retrieved html in the appropriate positions of the application's html template. It has been suggested that this mechanism be modified sometime in the future in order to cache the retrieved html in a database table and thus reduce the http traffic between the database server and the ILO web servers.

Stephenson and Associates Ltd. Page 9 http://www.s-and-a.com

Text Messages Mechanism The text messages table is an exception to the generic code table structure. Its structure is as follows: textmsgs TEXTMSG_ID NUMBER(22) Numeric ID (PK) TEXTMSG_CODE VARCHAR2(50) Unique message code (UK) TEXTMSG_NAME_EN VARCHAR2(4000) English translation TEXTMSG_NAME_FR VARCHAR2(4000) French translation TEXTMSG_NAME_ES VARCHAR2(4000) Spanish translation This table is maintained via the code_textmsgs.listAll page. As with code tables, updates can be made by clicking on the message id.

Viewing a complete list of text messages The "text messages" link in the administration section of the left menu allows a super- user to view the complete list of all application text messages. Viewing text message IDs on a normal page In order to see what MSG_ID corresponds to the text on a page, edit the URL and change the p_lang=en parameter to p_lang=xx, or, if necessary, add the p_lang=xx parameter to the url. This will result in all the application texts being followed by a hyperlink directly to their editing page. This hyperlink is in the form of a lower-case letter "e". It is neccessary to be logged-in as a super-user in order to see this. Clicking on this hyperlink opens an editing page for that message in another window. This allows changes to be made and viewed immediately.

Stephenson and Associates Ltd. Page 10 http://www.s-and-a.com

Attached Documents and Photos Mechanism While loading new photos and documents they are initially loaded into the attached_documents table. In the case of photos they are then moved to the yperson_photos table and immediatly removed from the attached_documents table. The photos are stored as Oracle Media ordimage data types. This is an image- specific datatype that stores the image in its binary form and also stores other image- specific information. Attached documents remain in the attached_documents table and a reference between teh person and the document is inserted in the yperson_documents tables. Attached files are loaded using the Oracle Apache Web Server mod_plsql gateway (see metalink note Note:113471.1 for examples and details). Three tables (attached documents and attached_documentspart) are used and have their structure imposed by Oracle.

attached_documents (stores the document) name VARCHAR2(256) mime_type VARCHAR2(128) doc_size NUMBER(20,0) dad_charset VARCHAR2(128) last_updated DATE content_type VARCHAR2(128) blob_content BLOB attached_documentspart (stores the parts of a multipart document) document VARCHAR2(256) part VARCHAR2(256) uploaded CHAR(1) DAD configuration for attached documents The Oracle Apache web server DADs (ypages and ypagesedit) must be configured with the following parameters for attached documents document_table = attached_documents document_path = docs document_proc = ypdocs.download Stephenson and Associates Ltd. Page 11 http://www.s-and-a.com

User Authentication Mechanism Users are authenticated using Oracle custom authentication. This is implemented via the OWA_CUSTOM package’s AUTHORIZE function. This function returns a boolean TRUE or FALSE depending on whether the user is authorised or not. The Oracle built-in DBMS_CRYPTO package is used to implement 1-way 128-bit SHA1 encryption. Passwords cannot be decrypted. For authentication purposes, the password entered is encrypted and compared to the existing encrypted password stored in the database table.

Users accessing from outside the ILO will be first prompted for ILO intranet credentials. If they then navigate to a password-protected section of the application they will be prompted again, this time for their YPAGES applicationusername and password. DAD configuration for custom authentication Both of the Oracle Apache web server DADs (ypages and ypagesedit) must be configured with the Custom_OWA parameter for custom authentication Stephenson and Associates Ltd. Page 12 http://www.s-and-a.com

HTML templates The application uses pre-defined HTML page templates. These templates are stored as CLOBs in the HTML_TEMPLATES table. The templates are derived from the standard ILO templates and have been marked up with "replacable" sections. Some PL/SQL functions (located in the GENUTILS package) are then used to retrieve the template, insert the appropriate ILO headers and footers and then replace the tagged sections by the dynamically generated data to be inserted. A typical tag looks like this Its contents are replaced by calling the genutils.replaceTag function v_clob := genutils.replaceTag(p_tag => 'YPHOMEPAGEMAINCONTENT', p_replace_tag => v_content, p_clob => v_clob); and then output to the http stream using the genutils.outputClob function. ILO_ENVT - Apache webserver environment variable As with many ILO applications, the ILO Yellow Pages application relies on the Apache environment variable ILO_ENVT being correctly set by the webserver. This variable is used to ascertain whether the user is access from withing ILO HQ, from an ILO Field office, from a registed UN partner organisation or from the rest of the world. This variable must also be specified in the Oracle HTTP server DAD as being available applications runing in that DAD.

Stephenson and Associates Ltd. Page 13 http://www.s-and-a.com

APPENDIX I - PL/SQL Packages Used Package names and entry points Package entry points Package name Procedure name Description CODE_COUNTRIES Package to maintain countries table CODE_COUNTRIES LISTALL List all countries CODE_COUNTRIES UPD Update a country CODE_COUNTRIES PROCESSUPD Process the update of a country CODE_EXPERTISES Package to maintain expertise table CODE_EXPERTISES LISTALL List all expertise CODE_EXPERTISES UPD Update an expertise entry CODE_EXPERTISES PROCESSUPD Process the update of an expertise entry CODE_LANGUAGES Package to maintain languages table CODE_LANGUAGES LISTALL List all languages CODE_LANGUAGES UPD Update a language entry CODE_LANGUAGES PROCESSUPD Process the update of a language entry CODE_STATUSES Package to maintain statuses table CODE_STATUSES LISTALL List all statuses CODE_STATUSES UPD Update a statuses entry CODE_STATUSES PROCESSUPD Process the update of a statuses entry CODE_TEXTMSGS Package to maintain textmsgs table CODE_TEXTMSGS LISTALL List all textmsgs CODE_TEXTMSGS UPD Update a textmsgs entry CODE_TEXTMSGS PROCESSUPD Process the update of a textmsgs entry Stephenson and Associates Ltd. Page 14 http://www.s-and-a.com

GENUTILS General utilities package GENUTILS WRITELOG Write to log GENUTILS BRTOCR Change to cr character GENUTILS CRTOBR Change cr character to GENUTILS GETTEMPLATE retrieve a template from the html templates table GENUTILS INCLUDEURL retrieve teh HTML from a URL GENUTILS MAKEPLACEHOLDE RS make place holders in a CLOB GENUTILS OUTPUTCLOB output a CLOB to the HTML flux GENUTILS REPLACETAG Replace a tag by a string OWA_CUSTOM Implementation of Oracle custom authentication OWA_CUSTOM AUTHORIZE Authentication function - returns true or false TPKG_YPERSONS API package for YPERSONS table TPKG_YPERSONS GETNEXTSEQ Get the next available ID TPKG_YPERSONS GETREC Get a record TPKG_YPERSONS INSREC Insert a record TPKG_YPERSONS INSREC Insert an array of records TPKG_YPERSONS UPDREC Update a record TPKG_YPERSONS UPDREC Update an array of records TPKG_YPERSONS DELREC Delete a record TPKG_YPERSONS MERGEREC "Upsert" a record TPKG_YPERSONS MERGEREC "Upsert" an array of records TPKG_YPERSON_ADDR ESSES API package for YPERSON_ADDRESSES table TPKG_YPERSON_ADDRESSES GETNEXTSEQ Get the next available ID TPKG_YPERSON_ADDRESSES GETREC Get a record TPKG_YPERSON_ADDRESSES INSREC Insert a record TPKG_YPERSON_ADDRESSES INSREC Insert an array of records TPKG_YPERSON_ADDRESSES UPDREC Update a record TPKG_YPERSON_ADDRESSES UPDREC Update an array of records TPKG_YPERSON_ADDRESSES DELREC Delete a record TPKG_YPERSON_ADDRESSES MERGEREC "Upsert" a record Stephenson and Associates Ltd. Page 15 http://www.s-and-a.com

TPKG_YPERSON_ADDRESSES MERGEREC "Upsert" an array of records TPKG_YPERSON_COUN TRY_EXP API package for YPERSON_COUNTRY_EXPERIENCES table TPKG_YPERSON_COUNTRY_EX P GETNEXTSEQ Get the next available ID TPKG_YPERSON_COUNTRY_EX P GETREC Get a record TPKG_YPERSON_COUNTRY_EX P INSREC Insert a record TPKG_YPERSON_COUNTRY_EX P INSREC Insert an array of records TPKG_YPERSON_COUNTRY_EX P UPDREC Update a record TPKG_YPERSON_COUNTRY_EX P UPDREC Update an array of records TPKG_YPERSON_COUNTRY_EX P DELREC Delete a record TPKG_YPERSON_COUNTRY_EX P MERGEREC "Upsert" a record TPKG_YPERSON_COUNTRY_EX P MERGEREC "Upsert" an array of records TPKG_YPERSON_EDUC ATION API package for YPERSON_EDUCATION table TPKG_YPERSON_EDUCATION GETNEXTSEQ Get the next available ID TPKG_YPERSON_EDUCATION GETREC Get a record TPKG_YPERSON_EDUCATION INSREC Insert a record TPKG_YPERSON_EDUCATION INSREC Insert an array of records TPKG_YPERSON_EDUCATION UPDREC Update a record TPKG_YPERSON_EDUCATION UPDREC Update an array of records TPKG_YPERSON_EDUCATION DELREC Delete a record TPKG_YPERSON_EDUCATION MERGEREC "Upsert" a record TPKG_YPERSON_EDUCATION MERGEREC "Upsert" an array of records TPKG_YPERSON_EMAIL S API package for YPERSON_EMAILS table TPKG_YPERSON_EMAILS GETNEXTSEQ Get the next available ID TPKG_YPERSON_EMAILS GETREC Get a record TPKG_YPERSON_EMAILS INSREC Insert a record TPKG_YPERSON_EMAILS INSREC Insert an array of records Stephenson and Associates Ltd. Page 16 http://www.s-and-a.com

TPKG_YPERSON_EMAILS UPDREC Update a record TPKG_YPERSON_EMAILS UPDREC Update an array of records TPKG_YPERSON_EMAILS DELREC Delete a record TPKG_YPERSON_EMAILS MERGEREC "Upsert" a record TPKG_YPERSON_EMAILS MERGEREC "Upsert" an array of records TPKG_YPERSON_EXPE RTISES API package for YPERSON_EXPERTISES table TPKG_YPERSON_EXPERTISES GETNEXTSEQ Get the next available ID TPKG_YPERSON_EXPERTISES GETREC Get a record TPKG_YPERSON_EXPERTISES INSREC Insert a record TPKG_YPERSON_EXPERTISES INSREC Insert an array of records TPKG_YPERSON_EXPERTISES UPDREC Update a record TPKG_YPERSON_EXPERTISES UPDREC Update an array of records TPKG_YPERSON_EXPERTISES DELREC Delete a record TPKG_YPERSON_EXPERTISES MERGEREC "Upsert" a record TPKG_YPERSON_EXPERTISES MERGEREC "Upsert" an array of records TPKG_YPERSON_LANG UAGES API package for YPERSON_LANGUAGES table TPKG_YPERSON_LANGUAGES GETNEXTSEQ Get the next available ID TPKG_YPERSON_LANGUAGES GETREC Get a record TPKG_YPERSON_LANGUAGES INSREC Insert a record TPKG_YPERSON_LANGUAGES INSREC Insert an array of records TPKG_YPERSON_LANGUAGES UPDREC Update a record TPKG_YPERSON_LANGUAGES UPDREC Update an array of records TPKG_YPERSON_LANGUAGES DELREC Delete a record TPKG_YPERSON_LANGUAGES MERGEREC "Upsert" a record TPKG_YPERSON_LANGUAGES MERGEREC "Upsert" an array of records TPKG_YPERSON_NATIO NALITIES API package for YPERSON_NATIONALITIES table TPKG_YPERSON_NATIONALIT IES GETNEXTSEQ Get the next available ID TPKG_YPERSON_NATIONALIT IES GETREC Get a record TPKG_YPERSON_NATIONALIT IES INSREC Insert a record TPKG_YPERSON_NATIONALIT INSREC Insert an array of records Stephenson and Associates Ltd. Page 17 http://www.s-and-a.com

IES TPKG_YPERSON_NATIONALIT IES UPDREC Update a record TPKG_YPERSON_NATIONALIT IES UPDREC Update an array of records TPKG_YPERSON_NATIONALIT IES DELREC Delete a record TPKG_YPERSON_NATIONALIT IES MERGEREC "Upsert" a record TPKG_YPERSON_NATIONALIT IES MERGEREC "Upsert" an array of records TPKG_YPERSON_PHOT OS API package for YPERSON_PHOTOS table TPKG_YPERSON_PHOTOS GETNEXTSEQ Get the next available ID TPKG_YPERSON_PHOTOS GETREC Get a record TPKG_YPERSON_PHOTOS INSREC Insert a record TPKG_YPERSON_PHOTOS INSREC Insert an array of records TPKG_YPERSON_PHOTOS UPDREC Update a record TPKG_YPERSON_PHOTOS UPDREC Update an array of records TPKG_YPERSON_PHOTOS DELREC Delete a record TPKG_YPERSON_PHOTOS MERGEREC "Upsert" a record TPKG_YPERSON_PHOTOS MERGEREC "Upsert" an array of records YPCONST Package of constants YPMAIN Package containing the main procedures YPMAIN HOME Home page YPMAIN LEFTMENU Left menu YPMAIN SHOWPERSON Show one person YPMAIN EDITPERSON Edit a person (requires privs) YPMAIN PROCESSEDITPER SON Process a person edit YPMAIN SHOWPHOTO Retrieve the person's photo YPMAIN LISTPERSONSJS Retrieve a list of persons for AJAX YPMAIN MAKELIST Make a list of persons YPMAIN PLEASELOGIN Ask the user to login YPMAIN LISTEXPERTISE List expertise YPMAIN REQUESTACCESS Register a new user Stephenson and Associates Ltd. Page 18 http://www.s-and-a.com

YPMAIN PROCESSREQUEST ACCESS Process the registration of a new user YPMAIN HTMLEMAIL Send a HTML-formatted e-mail from the application YPMAIN LISTPERSONS List people accounding to search criteria YPMAIN EXPERTISE Expertise list for javascript YPMAIN CHANGEPWD Change password YPMAIN PROCESSCHANGEP WD Process password change YPSECURITY Package to implement application security YPSECURITY GETUSERNAME Get current username YPSECURITY GETYPERSONID Get current user's yperson_id YPSECURITY ISADMINISTRATO R true if current user is an administrator YPSECURITY ISSUPERUSER true if current user is an super-user YPSECURITY ISSAMEUSER true if current user is the same user as the yperson_id supplied YPSECURITY ADMINMODE return adminmode URL YPSECURITY ISAUTHORISED true if operation is authorised YPSECURITY ENCRYPTPASSWOR DSH1 encrypts password as SHA1 YPUTILS Application-specific utilities YPUTILS ADDTOLINK Add a parameter to a URL YPUTILS BRTOCR Change to cr character YPUTILS CRTOBR Change cr character to YPUTILS DEBUG Output debug messages YPUTILS FORMATYYYYMMDD Format a VARCHAR2(8) partial date YPUTILS FORMATDATE Format an Oracle date YPUTILS GETNUMBER Get a number from the TEXTMSGS table YPUTILS GETTEXT Get language-specific text from the TEXTMSGS table YPUTILS GETTEXTMSGREC Get a record from the TEXTMSGS table YPUTILS NOTNVL opposite to nvl YPUTILS PRINT same as htp.p YPUTILS GETUSERREC Get a user record YPUTILS SELECTLANG returns the appropriate parameter depending on current language setting Stephenson and Associates Ltd. Page 19 http://www.s-and-a.com

YPUTILS SETLANG set the current language YPUTILS UPDATEACCESSLO G update the access log table YPUTILS GETYPERSONEMAI LS get and format e-mail addresses for a person YPUTILS GETLANGUAGEPRO FICIENCY get and format language proficiencies for a person YPUTILS DATESELECT html select for YYYY MM DD YPUTILS GETLANGUAGE get a language name YPUTILS EXPANDPARENTS expand the parents of an Ajax tree YPUTILS POPPARENTRESUL TS Populate the AJAX tree parents YPUTILS GENERATETREE Generate a tree from a PL/SQL array YPUTILS COUNTRYJSON Source for country AJAX YPUTILS GETUNIT get a unit name YPUTILS COUNTCHILDRENI NTREE count the number of children a particular tree node has YPUTILS PRUNERESULTS prune "dead" results from a tree YPUTILS ISACTIVATED return true if this user is activated YPUTILS ISACTIVATEDYN return Y if this user is activated YPUTILS LASTUPDATE return a last update date appropriate to the parameters passed Stephenson and Associates Ltd. Page 20 http://www.s-and-a.com

APPENDIX II – Complete list of tables and columns Table: ACCESSLOG Accesslog PAGE VARCHAR2(50) Page viewed YPERSON_ID NUMBER(22) YPERSON_ID (if the person is authenticated) LANG VARCHAR2(2) Language of user interface TIMESTAMP DATE Time stamp CGI_AUTH_TYPE VARCHAR2(255) CGI environment variable CGI_DOCUMENT_ROOT VARCHAR2(255) CGI environment variable CGI_GATEWAY_INTERFACE VARCHAR2(255) CGI environment variable CGI_HTTP_ACCEPT VARCHAR2(255) CGI environment variable CGI_HTTP_ACCEPT_ENCODI NG VARCHAR2(255) CGI environment variable CGI_HTTP_ACCEPT_LANGU AGE VARCHAR2(255) CGI environment variable CGI_HTTP_ACCEPT_CHARSE T VARCHAR2(255) CGI environment variable CGI_HTTP_CACHE_CONTRO L VARCHAR2(255) CGI environment variable CGI_HTTP_CONNECTION VARCHAR2(255) CGI environment variable CGI_HTTP_HOST VARCHAR2(255) CGI environment variable CGI_HTTP_REFERER VARCHAR2(255) CGI environment variable CGI_HTTP_USER_AGENT VARCHAR2(255) CGI environment variable CGI_HTTP_VIA VARCHAR2(255) CGI environment variable CGI_HTTP_X_FORWARDED_ FOR VARCHAR2(255) CGI environment variable CGI_PATH VARCHAR2(255) CGI environment variable CGI_PATH_INFO VARCHAR2(255) CGI environment variable CGI_PATH_TRANSLATED VARCHAR2(255) CGI environment variable CGI_QUERY_STRING VARCHAR2(255) CGI environment variable CGI_REMOTE_ADDR VARCHAR2(255) CGI environment variable CGI_REMOTE_HOST VARCHAR2(255) CGI environment variable Stephenson and Associates Ltd. Page 21 http://www.s-and-a.com

CGI_REMOTE_PORT VARCHAR2(255) CGI environment variable CGI_REQUEST_METHOD VARCHAR2(255) CGI environment variable CGI_REQUEST_URI VARCHAR2(255) CGI environment variable CGI_REMOTE_USER VARCHAR2(255) CGI environment variable CGI_SCRIPT_FILENAME VARCHAR2(255) CGI environment variable CGI_SCRIPT_NAME VARCHAR2(255) CGI environment variable CGI_SERVER_ADDR VARCHAR2(255) CGI environment variable CGI_SERVER_ADMIN VARCHAR2(255) CGI environment variable CGI_SERVER_NAME VARCHAR2(255) CGI environment variable CGI_SERVER_PORT VARCHAR2(255) CGI environment variable CGI_SERVER_PROTOCOL VARCHAR2(255) CGI environment variable CGI_SERVER_SIGNATURE VARCHAR2(255) CGI environment variable CGI_SERVER_SOFTWARE VARCHAR2(255) CGI environment variable INSIDE_FIREWALL VARCHAR2(1) Flag Table: ACTIVATED_USERS This table is used to implement custom activatation USERNAME VARCHAR2(50) The user's username PASSWORD VARCHAR2(50) The user's password USER_ROLE VARCHAR2(50) The user's role: e.g. ADMIN, SUPER YPERSON_ID NUMBER(22) Reference to YPERSONS Table: ATTACHED_DOCUMENTS Table for storing attached documents (required by Oracle). All column names and utilisation are imposed by Oracle.

NAME VARCHAR2(256) File name MIME_TYPE VARCHAR2(128) Content mime-type DOC_SIZE NUMBER(22) Size in bytes DAD_CHARSET VARCHAR2(128) Character set of DAD used LAST_UPDATED DATE Last update date CONTENT_TYPE VARCHAR2(128) Content type BLOB_CONTENT BLOB The document / file Stephenson and Associates Ltd. Page 22 http://www.s-and-a.com

Table: ATTACHED_DOCUMENTSPART Table for storing parts of attached documents (required by Oracle). All column names and utilisation are imposed by Oracle. DOCUMENT VARCHAR2(256) File name PART VARCHAR2(256) Part name UPLOADED CHAR(1) Uploaded flag Table: COUNTRIES Country list COUNTRY_ISO2_ID VARCHAR2(2) ISO 2 character code COUNTRY_NAME_FR VARCHAR2(50) Country name in French COUNTRY_ISO_NUMERIC NUMBER(22) ISO numeric code COUNTRY_ISO_3CHAR VARCHAR2(3) ISO 3 character code COUNTRY_NAME_EN VARCHAR2(50) Country name in English COUNTRY_NAME_ES VARCHAR2(50) Country name in Spanish REGION_ID VARCHAR2(30) Reference to ILO Regions (not used in this application) Table: DEBUG This is a general use table for debugging output. TEXT VARCHAR2(4000) Debug output text TIMESTAMP DATE Time stamp Table: EXPERTISES Expertise list EXPERTISE_ID NUMBER(22) Primary key EXPERTISE_CODE VARCHAR2(75) Code EXPERTISE_NAME_EN VARCHAR2(765) Expertise name in English EXPERTISE_NAME_FR VARCHAR2(765) Expertise name in French EXPERTISE_NAME_ES VARCHAR2(765) Expertise name in Spanish Stephenson and Associates Ltd. Page 23 http://www.s-and-a.com

USAGE_START_DATE DATE Date usage started USAGE_END_DATE DATE Date usage ended Table: HTML_TEMPLATES HTML template for the web pages HTML_TEMPLATE_NAME VARCHAR2(50) Primary key - template name TEMPLATE CLOB Template as CLOB Table: LANGUAGES Languages LANGUAGE_ID VARCHAR2(2) Primary key ILO_RANKING NUMBER(22) Language ranking within ILO LANGUAGE_EN VARCHAR2(100) Language name in English LANGUAGE_ES VARCHAR2(100) Language name in Spanish LANGUAGE_FR VARCHAR2(100) Language name in French LANGUAGE_CODE VARCHAR2(2) Language ISO 2-char code Table: LANGUAGE_PROFICIENCIES Reference table for language proficiencies LANGUAGE_PROFICIENCY_I D NUMBER(22) Primary key LANGUAGE_PROFICIENCY_ CODE VARCHAR2(20) Proficiency code LANGUAGE_PROFICIENCY_ NAME_EN VARCHAR2(50) Proficiency name in English LANGUAGE_PROFICIENCY_ NAME_FR VARCHAR2(50) Proficiency name in French LANGUAGE_PROFICIENCY_ NAME_ES VARCHAR2(50) Proficiency name in Spanish Stephenson and Associates Ltd. Page 24 http://www.s-and-a.com

Table: STATUSES Statuses STATUS_ID VARCHAR2(2) Primary key STATUS_CODE VARCHAR2(10) Status code STATUS_EN VARCHAR2(100) Status name in English STATUS_FR VARCHAR2(100) Status name in French STATUS_ES VARCHAR2(100) Status name in Spanish Table: TEXTMSGS Table used to store text that will appear on the screen. Can also be used for image names or URLs. MSG_ID VARCHAR2(50) Primary key ETEXT VARCHAR2(4000) Text in english FTEXT VARCHAR2(4000) Text in french STEXT VARCHAR2(4000) Text in spanish Table: YPERSONS Main table of Persons YPERSON_ID NUMBER(22) Primary Key GENDER_CODE VARCHAR2(1) M or F FIRST_NAME VARCHAR2(50) Person's first name LAST_NAME VARCHAR2(50) Surname MIDDLE_NAMES VARCHAR2(50) Middle names FREE_TEXT_AREA_TITLE VARCHAR2(50) Title of free text that user can add FREE_TEXT_AREA VARCHAR2(4000) Area where the person can add free-form text describing himself in more details URL VARCHAR2(255) Link PUBLISHED_FLAG VARCHAR2(1) Is this profile published Y/ N DATE_OF_BIRTH VARCHAR2(8) date of birth Stephenson and Associates Ltd. Page 25 http://www.s-and-a.com

YYYYMMDD (partial dates possible) EXPERIENCE_OVERVIEW VARCHAR2(4000) Free text describing experience ILO_PERS_NUMBER VARCHAR2(6) ILO Personnel number (allows cross-referencing with IRIS, etc.) LAST_UPDATED_BY VARCHAR2(50) Person who last updated this entry DATE_OF_ENTRY DATE Date this entry was made DATE_OF_LAST_UPDATE DATE Date of last update via the application DATE_OF_ANY_CHANGE DATE Date of last change (application independent) HOBBIES VARCHAR2(4000) Free text for hobbies OTHER_INFO VARCHAR2(4000) Free text for other information Table: YPERSON_ADDRESSES Person addresses YPERSON_ADDRESS_ID NUMBER(22) Primary key YPERSON_ID NUMBER(22) Reference to YPERSONS ADDRESS_SEQ NUMBER(22) Sequencing ADDRESS VARCHAR2(500) Street address CITY VARCHAR2(50) City name STATE_PROVINCE VARCHAR2(50) State, Province, County, Canton, etc..

POSTAL_CODE VARCHAR2(20) Postal code COUNTRY_ISO2_ID VARCHAR2(2) Reference to COUNTRIES PHONE_NUMBER VARCHAR2(50) Telephone number FAX_NUMBER VARCHAR2(50) Fax number ADDRESS_TYPE VARCHAR2(50) Free text to describe the address type (hone, office, temorary, secondary . ) PRIMARY_ADDRESS_YN VARCHAR2(1) Flag for the primary address MOBILE_NUMBER VARCHAR2(50) Mobile phone number Stephenson and Associates Ltd. Page 26 http://www.s-and-a.com

Table: YPERSON_COUNTRY_EXPERIENCE Person countries YPERSON_COUNTRY_EXPER IENCE_ID NUMBER(22) Primary key YPERSON_ID NUMBER(22) Reference to YPERSONS COUNTRY_ISO2_ID VARCHAR2(2) Reference to COUNTRIES Table: YPERSON_DOCUMENTS Table linking to BLOB documents in the ATTACHED_DOCUMENTS tables YPERSON_ID NUMBER(22) Reference to YPERSONS DOCUMENT_TYPE VARCHAR2(20) Document type FILENAME VARCHAR2(256) File name (reference to NAME in ATTACHED_DOCUMEN TS table) DATE_FILE_LOADED DATE Date file was loaded TITLE VARCHAR2(500) Document title Table: YPERSON_EDUCATION educational history table YPERSON_EDUCATION_ID NUMBER(22) YPERSON_ID NUMBER(22) reference to YPERSONS EDUCATION VARCHAR2(255) free text field describing education SEQ NUMBER(22) for sequencing purposes Table: YPERSON_EMAILS Person e-mail addresses YPERSON_EMAIL_ID NUMBER(22) Primary key YPERSON_ID NUMBER(22) Reference to YPERSONS EMAIL VARCHAR2(255) e-mail address Stephenson and Associates Ltd. Page 27 http://www.s-and-a.com

SEQ NUMBER(22) sequencing Table: YPERSON_EXPERTISES Association between Person and the extertise list YPERSON_EXPERTISE_ID NUMBER(22) Primary key YPERSON_ID NUMBER(22) Reference to YPERSONS EXPERTISE_ID NUMBER(22) Reference to EXPERTISES Table: YPERSON_LANGUAGES Person languages YPERSON_LANGUAGE_ID NUMBER(22) Primary key YPERSON_ID NUMBER(22) Reference to YPERSONs LANGUAGE_CODE VARCHAR2(2) Reference to LANGUAGES SPEAK_LANGUAGE_PROFICI ENCY_ID NUMBER(22) Spoken language proficiency - reference to LANGUAGE_PROFICIE NCIES READ_LANGUAGE_PROFICIE NCY_ID NUMBER(22) Reading language proficiency - reference to LANGUAGE_PROFICIE NCIES WRITE_LANGUAGE_PROFICI ENCY_ID NUMBER(22) Writing language proficiency - reference to LANGUAGE_PROFICIE NCIES Table: YPERSON_NATIONALITIES Person nationalities YPERSON_NATIONALITY_ID NUMBER(22) Primary key YPERSON_ID NUMBER(22) Reference to YPERSONS NATIONALITY_ID VARCHAR2(2) Reference to NATIONALITIES SEQ NUMBER(22) Sequencing Stephenson and Associates Ltd. Page 28 http://www.s-and-a.com

Table: YPERSON_PHOTOS Person Photos YPERSON_PHOTO_ID NUMBER(22) Primary Key YPERSON_ID NUMBER(22) Reference to YPERSONS SEQ NUMBER(22) A sequence number THEPHOTO ORDIMAGE(1) The photo HEIGHT NUMBER(22) Height in pixels WIDTH NUMBER(22) Width in pixels CONTENTLENGTH NUMBER(22) Size in bytes FILEFORMAT VARCHAR2(4000) File format CONTENTFORMAT VARCHAR2(4000) Content format COMPRESSIONFORMAT VARCHAR2(4000) Compression format MIMETYPE VARCHAR2(4000) Mime type Stephenson and Associates Ltd. Page 29 http://www.s-and-a.com