|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.archive.webinterface.BitpreserveFileState
public class BitpreserveFileState
Class encapsulating methods for handling web requests for ActiveBitPreservation.
Method Summary | |
---|---|
static java.lang.String |
makeCheckbox(java.lang.String command,
java.lang.String... args)
Create a generic checkbox as used by processMissingRequest. |
static java.lang.String |
presentChecksum(java.util.List<java.lang.String> csum,
java.util.Locale locale)
Present a list of checksums in a human-readable form. |
static void |
printChecksumErrorStateForReplica(javax.servlet.jsp.JspWriter out,
Replica replica,
java.util.Locale locale)
Print HTML formatted state for checksum errors on a given replica in a given locale. |
static void |
printFileName(javax.servlet.jsp.JspWriter out,
java.lang.String filename,
int rowCount,
java.util.Locale locale)
Print a table row with a file name and a checkbox to request more info. |
static void |
printFileState(javax.servlet.jsp.JspWriter out,
PreservationState fs,
java.util.Locale locale)
Print a file state table for a file. |
static void |
printMissingFileStateForReplica(javax.servlet.jsp.JspWriter out,
Replica replica,
java.util.Locale locale)
Print HTML formatted state for missing files on a given replica in a given locale. |
static void |
printToggleCheckboxes(javax.servlet.jsp.JspWriter out,
java.util.Locale locale,
int numberOfMissingCheckboxes,
int numberOfUploadableCheckboxes)
Print checkboxes for changing state for files. |
static PreservationState |
processChecksumRequest(java.lang.StringBuilder res,
javax.servlet.jsp.PageContext context)
Processes a checksum request. |
static java.util.Map<java.lang.String,PreservationState> |
processMissingRequest(javax.servlet.jsp.PageContext context,
java.lang.StringBuilder res)
Processes a missingFiles request. |
static java.lang.String |
processUpdateRequest(javax.servlet.jsp.PageContext context)
Extract the name of the replica (parameter Constants.BITARCHIVE_NAME_PARAM) and the type of update requested (parameter Constants.UPDATE_TYPE_PARAM). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String processUpdateRequest(javax.servlet.jsp.PageContext context) throws ArgumentNotValid, ForwardedToErrorPage
context
- the current JSP context
ForwardedToErrorPage
- if an unknown bitarchive or update type
is posted, or one of the two required parameters are missing.
ArgumentNotValid
- If the context is null.public static java.util.Map<java.lang.String,PreservationState> processMissingRequest(javax.servlet.jsp.PageContext context, java.lang.StringBuilder res) throws ArgumentNotValid, ForwardedToErrorPage
context
- the current JSP context.res
- the result object. This is updated with result
information, and expected to be printed to the resulting
page.
ArgumentNotValid
- If the context or res is null.
ForwardedToErrorPage
- if the commands have the wrong number of
arguments.public static PreservationState processChecksumRequest(java.lang.StringBuilder res, javax.servlet.jsp.PageContext context) throws ArgumentNotValid
res
- the result object. This is updated with result
information, and expected to be printed to the resulting
page.context
- the current JSP pagecontext.
ArgumentNotValid
- If the context or res is null.public static java.lang.String makeCheckbox(java.lang.String command, java.lang.String... args)
command
- The name of the commandargs
- Arguments to the command
public static void printMissingFileStateForReplica(javax.servlet.jsp.JspWriter out, Replica replica, java.util.Locale locale) throws java.io.IOException
out
- The writer to write state to.replica
- The replica to write state for.locale
- The locale to write state in.
java.io.IOException
- On IO trouble writing state to the writer.public static void printChecksumErrorStateForReplica(javax.servlet.jsp.JspWriter out, Replica replica, java.util.Locale locale) throws java.io.IOException
out
- The writer to write state to.replica
- The replica to write state for.locale
- The locale to write state in.
java.io.IOException
- On IO trouble writing state to the writer.public static void printFileName(javax.servlet.jsp.JspWriter out, java.lang.String filename, int rowCount, java.util.Locale locale) throws java.io.IOException
out
- The stream to print to.filename
- The name of the file.rowCount
- The rowcount, used for styling rows.locale
- The current locale for labels.
java.io.IOException
- On trouble writing to stream.public static void printFileState(javax.servlet.jsp.JspWriter out, PreservationState fs, java.util.Locale locale) throws java.io.IOException
out
- The stream to print to.fs
- The file state for the file.locale
- The locale to print labels in.
java.io.IOException
- On trouble printing to a stream.public static void printToggleCheckboxes(javax.servlet.jsp.JspWriter out, java.util.Locale locale, int numberOfMissingCheckboxes, int numberOfUploadableCheckboxes) throws java.io.IOException
out
- The stream to print the checkboxes
to.locale
- The locale of the labels.numberOfMissingCheckboxes
- The total possible number of missing
checkboxes.numberOfUploadableCheckboxes
- The total possible number of
reestablish checkboxes.
java.io.IOException
- On trouble printing the checkboxes.public static java.lang.String presentChecksum(java.util.List<java.lang.String> csum, java.util.Locale locale)
csum
- List of checksum stringslocale
- The given locale.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |