input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
private string get db title db db string au id throws sqlexception db result result get au record by id db au id if result null log info failed to obtain database record for au id au id return null try result set result set result get set int journal id result set get int db journalid result close result db query select from db title table where db journalid new string string value of journal id result set result get set if result set next return result set get string db title return null finally db utils close result
|
get the journal title for this au from the ui database
|
public void initialize throws sqlexception if broker null throw new illegal state exception connection broker already initialized broker new ddconnection broker driver get database url username password cb min connect cb max connect cb timeout cb lease logfile
|
initialize the connection broker one time only
|
public void do page footer image table table table new table 0 standard table align center add to page table the lockss text add rows table 1 table new row table new cell table add image lockss table new cell table add image tm
|
render the end of image the lots of copies
|
public void commit transaction throws sqlexception log debug transaction commit connection commit
|
commit a transaction leave autocommit as is
|
public void rollback transaction log debug transaction rollback try if connection null connection rollback catch exception exception log warning rollback failed exception
|
rollback undo a transaction leave autocommit as is
|
public result query string query string throws sqlexception result set result set null statement statement null try get connection statement connection create statement result set type scroll insensitive result set concur updatable result set statement execute query query string return new result result set statement catch sqlexception exception close components result set statement throw exception
|
send a standard sql query
|
public result query string query string string values throws sqlexception prepared statement statement null result set result set null try get connection statement format statement query string values result set type scroll insensitive result set concur updatable result set statement execute query return new result result set statement catch sqlexception exception close components result set statement throw exception
|
send an sql query using a prepared statement this provides a
|
public void execute string command string throws sqlexception statement statement null try get connection statement connection create statement statement execute update command string close components null statement catch sqlexception exception close components null statement throw exception
|
execute an sql command no database response expected
|
private void increment reference count db db string au id throws sqlexception db result result null try result set result set int reference fetch the database record for this au if result get au record by id db au id null throw new render base render exception no such au id au id update the au reference count result set result get set reference result set get int db aureference result set update int db aureference reference 1 result set update row finally db utils close result
|
increment the au id reference count
|
private string get database url string buffer connection url new string buffer database iterator iterator parameters entry set iterator char seperator while iterator has next map entry entry map entry iterator next connection url append seperator connection url append string entry get key connection url append connection url append string entry get value if seperator seperator log debug database url connection url to string return connection url to string
|
format the database specification and jdbc connector options to create
|
private void set title db db array list au info list string title throws sqlexception for iterator iterator au info list iterator iterator has next au info au info au info iterator next log debug setting title for au info au name title set title db au info au id title au info journal title title
|
specify a title for this au id
|
private void close components result set result set statement statement try if result set null result set close catch exception ignore try if statement null statement close catch exception ignore
|
close result set and statement dont error out
|
public result set get set return result set
|
fetch the result set
|
public void close try if statement null statement close statement null catch sqlexception ignore try if result set null result set close result set null catch sqlexception ignore
|
release result resources
|
private string new title string buffer title new string buffer lockss title append title if display active cluster string cluster cluster utils get active cluster servlet interface title append title append cluster return title to string
|
set up the page title add active cluster if available
|
private string encode name string name string au id return name http utils encode au id
|
create a unique parameter name
|
private table new banner table table new table 0 standard table width 100 font font new font 2 block banner new block block bold font add banner banner add font table new row table new cell align center valign top nowrap table add banner add banner detail table return table
|
set up the page banner add active cluster if available
|
private void redirect to add member page string target redirect to add member page target null
|
redirect to the update titles page
|
private void redirect to add member page string target string text string buffer url new string buffer ccp command setmember add parameters status message url append url append ap e detail url append url append urlencoder encode target url append added if string util is null string text url append url append ap e status url append url append urlencoder encode text log debug url url to string try get servlet interface redirect page render base new href url to string catch ioexception exception log error redirect failed exception throw new render base render exception redirect failed exception to string
|
redirect to the update titles page
|
protected boolean display active cluster return cluster cache cluster count 1 cluster utils is active cluster defined servlet interface
|
display the active cluster do so if
|
private string format count field string field name string value value parse utils get text get xml utils get response root field name return string util is null string value 0 value
|
fetch requested count field ap e field1 title au combinations
|
private boolean called from add cluster member page return ccp command setmember equals ignore case get parameter ap e id
|
invoked from the add cluster members page
|
public void add banner detail table table cluster if display active cluster string cluster cluster utils get active cluster servlet interface table new row table new cell align center valign top nowrap table add cluster table add cluster add rows table 1 1 return
|
banner details the fine print are rendered here
|
public void add bread crumb trail table outer table add bread crumb trail outer table banner rule size
|
add a bread crumb trail to the specified table
|
public void add bread crumb trail table outer table string width table table new table 0 standard table width width align center table new row table new cell align left valign top nowrap table add new bread crumb html outer table add table
|
add a bread crumb trail to the specified table
|
private void init exporter this set compress output format is compressible
|
initialise the exporter with properties it inherits from the output format
|
public void add kbart title kbt if combined title null this combined title new kbart title kbt update end values kbt combined title add the title to the list or start the coverage notes string according to the format kb titles add kbt
|
add a kbart title to the coverage notes record
|
public void set filter kbart export filter filter this filter filter use the filter to sort the titles for custom output filter sort titles by first two fields
|
set the filter to be used on this exporter
|
public void reset this kb titles clear this combined title null
|
reset the coverage set
|
protected void setup output stream os throws ioexception output stream writer osw new output stream writer os default encoding if compression is enabled wrap the stream in a zip stream before the os writer if compress output format as file zip new zip output stream os zip set level 9 zip put next entry new zip entry get filename osw new output stream writer zip default encoding print writer new print writer new buffered writer osw auto flush
|
setup output code print writer code before code do export code is
|
public void reset kbart title kbt this reset this add kbt
|
reset the coverage set and init the combined title to match the supplied
|
public string construct coverage notes string builder coverage notes new string builder if format is summary create coverage notes from start of first and end of last format add summary coverage kb titles coverage notes else for kbart title kbt kb titles format add title coverage kbt coverage notes return coverage notes to string
|
construct the coverage notes string from the list of kbart titles
|
protected void clearup throws ioexception close the zip output stream if it is not null if zip null string buffer sb new string buffer sb append export created on append new date append by append get host name sb append n exported append export count append kbart titles from append tdb title total append tdb titles zip close entry zip set comment sb to string zip finish print writer flush print writer close
|
finish up after export in particular flush and close the output
|
public kbart title get combined title if combined title null return null combined title set field coverage notes construct coverage notes return combined title
|
get a kbart title representing the combination of the titles listed in
|
protected void add active cluster select table table form form select select if display active cluster return form new form select new cluster select 10 select attribute on change this form submit return true form add select add rows table 1 1 standard row spacing table new row table new cell align center valign top nowrap table add form
|
add cluster select list wrapped in a form
|
private void do export throws ioexception emit header for kbart title title titles don t output some titles if filter is title for output title duplicate count continue export count emit record filter get visible field values title flush writer and all its underlying streams print writer flush
|
do the actual exporting
|
public void export output stream os setup and perform the export try setup os do export catch ioexception e record error problem exporting to output format get label e clear up after the export try clearup catch ioexception e record error error clearing up after export e finally if print writer null print writer flush print writer close print writer null
|
run the export process
|
protected string get comparison string kbart title title return title get field sort field
|
get from a title the string which informs the comparison
|
public void append range join string builder sb boolean has range end if has range end this append range join sb
|
override the join sep dont add if there is nothing following
|
public string get filename if this filename null this filename generate filename return this filename
|
provide a filename for kbart output based on the kbart
|
protected void set cursor focus org mortbay html element element element attribute id focus here
|
set cursor focus at the specified element
|
private string get provider name return get host name
|
return the name of the current provider this should be the web domain
|
public void append start string builder sb kbart title kbt string ys kbt get field date first issue online sb append ys if show vol kbt has field value num first vol online sb append append kbt get field num first vol online append
|
append start data to the given string builder
|
public void append end string builder sb kbart title kbt string ye kbt get field date last issue online sb append ye if show vol kbt has field value num last vol online sb append append kbt get field num last vol online append
|
append end data to the given string builder
|
public void append equal range string builder sb kbart title kbt append start sb kbt
|
append start data to the given string builder
|
public void set tdb title total int n this tdb title total n
|
set the total number of tdb titles informing this export
|
public void append range join string builder sb boolean has range end append range join sb
|
append a range join string to the given string builder
|
protected void set cursor focus on success org mortbay html element element if get global status set cursor focus element
|
set cursor focus only if the previous command was successfull
|
public void set content scope content scope scope this scope scope
|
set the scope of the export
|
protected void add summary coverage list kbart title kb titles string builder sb kbart title start kb titles get 0 kbart title end kb titles get kb titles size 1 kbart title dummy kbt new kbart title start report format update end values end dummy kbt add title coverage dummy kbt sb
|
append a summary coverage note for the range represented in
|
public void set compress boolean val compress val
|
set the compression option
|
public output format get output format return output format
|
provide a reference to the output format of the exporter
|
public string get omitted fields summary return filter omitted fields manually string format manually omitted columns s string util separated string enum set complement of filter get field ordering get fields
|
provide a user friendly summary of which fields were omitted from the output
|
public string get omitted titles summary return duplicate count 0 string format duplicate records omitted s s duplicate count duplicates explanation
|
provide a user friendly summary of how many kbart records were omitted
|
public string get empty summary return filter omitted empty fields string format empty columns omitted s string util separated string filter get omitted empty fields
|
provide a user friendly summary of which fields were omitted from the output
|
public form get html custom form return custom form
|
return the custom form for html output
|
public kbart title clone return new kbart title this
|
implementation of the code object
|
public void set html custom form form form if is html throw new unsupported operation exception if this output format is html this custom form form
|
set the html form which represents customisable options
|
public kbart title set field field field string value if field null return this if value null value fields put field normalise value return this
|
set the value of a field
|
public string get field field field if blank if coverage to present contains field try string last year get field value field date last issue online return blank if the year is empty or current if string util is null string last year integer parse int last year bibliographic util get this year return catch number format exception e ignore and return actual value return get field value field
|
get the display value of the field
|
public boolean has field value field f return string util is null string fields get f
|
check whether the title has a non null value for the given field
|
public string get field value field field if field null return string value fields get field return value null value
|
get the recorded value of the field
|
public string get valid issn identifier return has field value field print identifier get field field print identifier get field field online identifier
|
attempts to return a valid issn from the titles fields
|
public int hash code hash code builder hcb new hash code builder for field f field values hcb append get field f return hcb to hash code
|
implement hash code using all the field values as used in equals
|
public string to string return string format kbart title s s s s fields get field publication title fields get field print identifier fields get field date first issue online fields get field date last issue online
|
construct a string description from identifying fields of the kbart title
|
protected iterator get response list iterator return response list get iterator
|
get an iterator for the command response list
|
public boolean is alphanumeric return sort type sort type alphanumeric
|
whether the field should be considered alphanumeric for comparison
|
public boolean is numeric return sort type sort type numeric
|
whether the field should be considered numeric for comparison
|
protected int get response list size return response list size
|
get the number of documents in the response list
|
public boolean is omit empty fields return omit empty fields
|
whether this filter is set to omit empty fields
|
public boolean is show health ratings return show health ratings
|
whether this filter is set to show health ratings
|
public field ordering get field ordering return field ordering
|
get the field ordering with which this filter is configured
|
public boolean omitted fields manually return field ordering get ordering size field values length
|
whether fields were omitted manually
|
protected boolean get global status document document response list get status message document iterator iterator if document null get status document return false iterator response list get iterator while iterator has next examine each error response if get status document iterator next return false return true
|
get the global status of an entire series of cluster transactions
|
public boolean omitted empty fields if omit empty fields return false set field omittable fields get omitted empty fields return omit empty fields omittable fields size 0
|
whether empty fields were omitted
|
protected int get global success count iterator iterator response list get iterator int count 0 while iterator has next examine each error response if get status document iterator next count return count
|
get global success count the number of sysems that returned success
|
protected string get status message document document try return parse utils get status message api document get document element catch xml exception exception throw new render base render exception exception to string
|
get any status text associated with the last transaction
|
private int find field index field field list string labs get field labels string name field get label for int i 0 i labs size i if labs get i equals name return i return 1
|
find the index of the named field in the current output
|
protected string get detail message document document try return parse utils get detail message api document get document element catch xml exception exception throw new render base render exception exception to string
|
get any detail text associated with the last transaction
|
static public string get range set start string range set if range set null return null list string ranges bibliographic util split range set range set string range if ranges size 0 range range set else range ranges get 0 return bibliographic util is range range number util get range start range range
|
get the range start of a set of ranges
|
public static enum filename translation xlate none none public string xlate string s return s xlate windows windows public string xlate string s return string utils replace chars s windows from windows to xlate mac mac os public string xlate string s return string utils replace chars s mac from mac to private final string label filename translation string label this label label public string get label return label public abstract string xlate string s
|
enum of filename translation types
|
static public string get range set end string range set if range set null return null list string ranges bibliographic util split range set range set string range if ranges size 0 range range set else range ranges get ranges size 1 return bibliographic util is range range number util get range end range range
|
get the range end of a set of ranges
|
protected document get setup document return response list get setup document
|
get the setup document created by
|
public string get issn string the issn get issn l if the issn null the issn get eissn if the issn null the issn get print issn return the issn
|
returns a representative issn for the bibliographic item
|
protected string get server name document document try return parse utils get server name api document get document element catch xml exception exception throw new render base render exception exception to string
|
get the name of the lockss cache server
|
protected string get text string name return parse utils get text api request document get document element name
|
get text associated with a named element from the request document
|
public string to string return string format title range s s first get journal title year range
|
produces a friendly string representation of the range
|
public boolean is valid return string utils is empty first string utils is empty last
|
whether the range contains two valid volume strings that is non null
|
protected string get parameter string name return get text name
|
get a parameter value from the client request a synonym for get text
|
public string to string return string format volumes s s first last
|
produces a friendly string representation of the range
|
protected void populate document document metadata parse utils get dynamic fields api document metadata name
|
build up a map of dynamic page input field data
|
public boolean is valid return first 0 last 0
|
whether the range contains two valid year values that is not zero
|
protected int size return metadata size
|
get the size of the metadata list
|
public string to string return string format years d d first last
|
produces a friendly string representation of the range
|
protected string default value string parameter string default value if use default value return get parameter parameter return default value
|
select a default parameter value if appropriate preserve previously
|
public boolean are decreasing string first string second return bibliographic util change of formats first second false are volumes increasing first second
|
we consider a volume to be decreasing if it is not monotonically
|
protected string get parameter string name verify list return string metadata get name
|
return the value of a named parameter
|
protected string get key int index verify list return string metadata get key index
|
return a key name by index
|
protected string get value int index verify list return string metadata get value index
|
return a value by index
|
protected int get protocol rev return v3 protocol rev
|
method suitable for unit tests
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.