Installation
The DLC-MODS Workbook is a set of files in one directory WB
Put WB/* wherever you like.
To use locally on WINDOWS with Inetpub, put WB in C:\Inetpub\wwwroot\WB
To use locally on WINDOWS with Tomcat, put WB in the webapps directory of your TOMCAT_HOME
To use on linux, put WB under any public_html/ directory
To use on linux with apache/tomcat, put WB in the webapps directory of your TOMCAT_HOME
In discussion below, I will refer to files as WB/filename.
|
Before you begin...
This workbook requires the use of popup windows. Please turn off your popup blocker now.
The download function of this workbook uses the file save.php. If you do not have php installed, this function will not work. A future feature
will be an asp download button.
For now if you lack php, you have two options.
1. Use the View MODS TAGS button on the final page and then cut and paste that output into notepad to create an output file.
2. Use the Display XML as HTML and use View Source to retrieve the XML file button
What this lacks in elegance, it pays back in functionality.
|
Debug and No Debug
The typical user will access these pages using the no debug option.
To look under the covers and develop your own code, use the debug option.
no debug Link to WB/workbook.htm
debug Link to WB/workbook_debug.htm
The difference between debug and no debug is
the definition of the frameset ( allowing display of all frames )
the list of links in the left frame with some of my help notes
the display of document.form[0].elements array at the bottom of each input page
the link to the Reload dev page (development reload) with a full xml test page hardcoded into the input textarea
Each of the features on the debug workbook was developed by me to help myself.
|
The no debug frameset
<frameset cols="160,*" border="0" name="P">
<frame name="T" src="page_links_static.htm" >
<frameset rows="0,0,*" >
<frame name="U" src="page_10_upper.htm" >
<frame name="L" src="page_11_lower.htm" >
<frame name="D" src="page_welcome.htm" scrolling="yes">
</frameset>
</frameset>
|
The debug frameset
<frameset cols="160,*" border="01" name="P">
<frame name="T" src="page_links_debug_static.htm" >
<frameset rows="150,15,*" >
<frame name="U" src="page_10_upper.htm" >
<frame name="L" src="page_11_lower.htm" >
<frame name="D" src="page_welcome.htm" scrolling="yes">
</frameset>
</frameset>
|
The Upper Frame
This is page_10_upper.htm, loaded once when you first load the WB/workbook.htm page.
It is for storage and contains two forms, UF and U2.
parent.U.document.UF -- for storage of input from tag pages
input text boxes containing header comments and some debug code
textareas named XX_block_list containg data arrays for each tag input page
parent.U.document.U2 -- for storage of input from reload page
textarea containing the entire ingested xml file (chomp)
textareas containing the xml block for each input page
The page in this frame persists the data throughout the session.
For debug, you can change values in the upper frame to manipulate what is written into the display frame.
For example, change the block iteration value on abstract to 4 and then display the <abstract> page.
|
The Upper Frame: PAGE VALIDATION
The defaults for PAGE VALIDATION are set in page_10_upper.htm.
The code looks like this.
<input type="text" name="VVcomment_04" value="<!-- PAGE VALIDATION :a:b:c:d:E:f:G:h:I:j:K:L:m:N:o: -->" size="80">
If you have downloaded the code to your own computer, you can change these defaults to suit your needs.
To change the default for a page, just change the case of the character representing that page.
The Review Page has a table showing how the PAGE VALIDATION characters match to each page.
For example, the <subject> page is represented by lowercase j.
This makes it mandatory to build at least one <subject> element.
If you change the default to uppercase J in the validation stirng on page_10_upper.htm, subject tags are no longer required.
Then the PAGE VALIDATION input would look like this:
<input type="text" name="VVcomment_04" value="<!-- PAGE VALIDATION :a:b:c:d:E:f:G:h:I:J:K:L:m:N:o: -->" size="80">
If you are working in debug mode, you can make this page on the page_10_upper.htm form and the change is temporary.
|
The Upper Frame: parent.U.split_token
The split_token is defined in the Upper Frame (page_10_upper.htm).
In code it is referred to as parent.U.split_token
This is the universal parsing token for all pages.
The current definition of parent.U.split_token is:
In the input pages, form variables are stored in an array.
Each input page corresponds to a block_list textarea in the upper frame, where the input array values are catenated with a token between each value.
The split_token is used for
1. storing input values from display frame to upper frame
(See function populate_DF_blocklist_from_DF_webform in file vv_dyn_functions.js)
2. restoring input values from upper frame to display frame
(See function populate_DF_blocklist_from_UF_blocklist in file vv_dyn_functions.js)
3. tag generation functions for all pages (See file vv_compose_tags.js)
4. reload functions for all pages (See file vv_process_tags.js)
What happens when an input box is empty or a drop-down form is not selected?
empty input >>>> "empty_string" dummy value is loaded
no menu selection >>>> "_zero" dummy value is loaded
|
The Lower Frame
This is page_11_lower.htm, loaded once when you first load the WB/workbook.htm page.
This page includes all functions, arrays, and anything else that can be called a constant.
These functions are referenced by parent.L.functionName()
This page includes the propmts for username and institution name and the "welcome" alert,
which do not appear until everything else has been loaded.
I added the prompts and alerts to slow down my users who were so eager to start work that they
would click on links in the left frame before the functions in the lower frame were fully loaded. Remove these features at your own peril.
Because all these functions are loaded at the beginning, they are immediately available to display pages for the life of the session.
|
The Display Frame
This is every page that can be accessed from the Link Frame.
Welcome, Contents, Begin, Documentation, , etc.
When the display page contains an input form, the form is always named DF.
|
The Link Frame
This frame contains the link table running down the left side of the page in the parent.T frame.
When this frame first loads, the source filename contains the word static.
After you click on a link, the source filename contains the word active.
This was so I could highlight the name of the page in the Display Frame.
There are 4 of these link files, 2 for non-debug and 2 for debug.
WB/page_links_static.htm
WB/page_links_active.htm
WB/page_links_debug_static.htm
WB/page_links_debug_active.htm
|
How the frames work together to build the output
Use the debug option.
Select <titleInfo> on the link page.
Enter required (yellow input boxes) data, click the Save and View MODS Tags button.
You will see the tags you created for the <titleInfo> with input in red.
Click the Back button to return to the page.
Scroll to the bottom.
You will see the all of the document.DF.form[0].elements.name values displayed in the DF.elements array.
You will see DF.elements[0].name = sentinel_00
Further down you will see DF.elements[?].name = sentinel_01
Between the sentinel elements are the values to be saved to the upper frame.
If the name starts with dyn_, the value is saved to ti_block_list in the upper frame.
If you enlarge the upper frame, you will see the textarea ti_block_list for <titleInfo> filled in.
Since the ti_block_list array must contain values for all array elements, empty form values are saved as
"empty_string" for empty text input
"_zero" for non-selected drop down menu
The next time you visit this input page, your values are preserved, because they have been loaded from the upper frame.
So each time you save a page, values are loaded from the display frame to the upper frame.
And each time you click on the link for any page, values are loaded from upper frame to display frame.
This is done by the function load_UF_form and function load_DF_form on each page.
The final page submits values from the upper frame to build the output.
All tags for all pages are built in the file WB/vv_compose_tags.js.
|
Reloading Data (Reload Page, Reload dev Page)
If you have an incomplete file or a file you wish to revise, you can use reload.
Open the XML file with notepad.
Cut and paste into the input box on the Reload Page.
Push the Process Data in Text Area button.
This dumps your field data into the upper frame. ( view in debug option )
Start revising your data.
This is handy if you haven't finished your whole file by the end of the day or if you are reviewing data and finding errors.
The Reload dev page is helpful for code development.
I have added a Load Test File to load a hard-coded output file of a completely fictional resource which I created.
You should probably make your own test file and replace my whimsical xml with your own.
The input data is parsed and processed in WB/vv_process_tags.js.
|
Submit Button(s)
At the bottom of each input form there are two buttons
Save Data and View MODS TAGS
Clear Data and Restart this Page
The Save button saves the data for the current page to the appropriate block_list textarea in the upper frame.
The Clear button clears the textarea in the upper frame and resets the values for PAGE VALIDATION and BLOCK ITERATION.
|
Final Page
The purpose of the final page is to View or Download your xml file.
The display contains validation status by page (complete/incomplete).
If any page is incomplete, you will have to create and incomplete xml file.
This file can be saved and then copied to the Reload page for continuation of work at a later date.
If all pages are in status complete, you may create the final xml file.
There are 3 buttons on this page.
View MODS TAGS -- A quick way to preview the file.
Create Incomplete XML File -- Save the work you have done so far, complete later.
Create FINAL XML File with valildation -- Final work, validation will catch any incomplete pages.
And please note: The behavior of the file download popup is controlled by your browser settings and not by
the workbook!
If you cannot get the file download code to work with your browser, you can always click on View MODS TAGS
and then cut and paste that output into a notepad file to save.
|
Review Page
The Review Page is discussed in detail in the User Documentation.
I initially considered this page was just a service to users.
As I wrote the page, I discovered it could be extremely useful for debugging.
So if you are adding new code, you may wish to add your new fields to the Review Page, just to make sure they work as expected.
|