public class ReportGenerator extends Object
| Constructor and Description |
|---|
ReportGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getItemInfo(Context context,
String handle)
get the information for the item with the given handle
|
static void |
main(String[] argv)
main method to be run from command line.
|
static Statistics |
prepareStats(Map<String,String> aggregator,
boolean sort,
boolean translate)
a standard stats block preparation method for use when an aggregator
has to be put out in its entirity.
|
static void |
processReport(Context context,
Report report,
String myInput)
using the pre-configuration information passed here, read in the
aggregation data and output a file containing the report in the
requested format
|
static void |
processReport(Context context,
String myFormat,
String myInput,
String myOutput,
String myMap)
using the pre-configuration information passed here, read in the
aggregation data and output a file containing the report in the
requested format
this method is retained for backwards compatibility, but delegates the actual
wprk to a new method
|
static void |
readInput(String input)
read the input file and populate all the class globals with the contents
The values that come from this file form the basis of the analysis report
|
static void |
readMap(String map)
read in the action map file which converts log file line actions into
actions which are more understandable to humans
|
static void |
setParameters(String myInput)
set the passed parameters up as global class variables.
|
static String |
translate(String text)
look the given text up in the action map table and return a translated
value if one exists.
|
static void |
usage()
output the usage information to the terminal
|
public static void main(String[] argv) throws Exception, SQLException
argv - ExceptionSQLExceptionpublic static void processReport(Context context, String myFormat, String myInput, String myOutput, String myMap) throws Exception, SQLException
context - the DSpace context in which this action is performedmyFormat - the desired output format (currently on HTML supported)myInput - the aggregation file to be turned into a reportmyOutput - the file into which to write the reportmyMap - the mapException - if errorSQLException - if database errorpublic static void processReport(Context context, Report report, String myInput) throws Exception, SQLException
context - contextreport - reportmyInput - inputException - if errorSQLException - if database errorpublic static Statistics prepareStats(Map<String,String> aggregator, boolean sort, boolean translate)
aggregator - the aggregator that should be convertedsort - should the resulting stats be sorted by valuetranslate - translate the stat name using the map filepublic static String translate(String text)
text - the text to be translatedpublic static void readMap(String map) throws IOException
map - the map fileIOException - if IO errorpublic static void setParameters(String myInput)
myInput - regex for log file namespublic static void readInput(String input) throws IOException, ParseException
input - the aggregator fileIOException - if IO errorParseException - if parse errorpublic static String getItemInfo(Context context, String handle) throws SQLException
context - the DSpace context we are operating underhandle - the handle of the item being looked up, in the form
1234/567 and so forthSQLException - if database errorpublic static void usage()
Copyright © 2016 DuraSpace. All rights reserved.