class: ImportLog

public class: ImportLog
Author: franke (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 2605 $ $LastChangedDate: 2009-05-07 10:; Complexity: 1
Dates: Created: 16.07.2009 15:32:44; Modified: 16.07.2009 15:32:44;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {7F23E3FA-937A-4518-B04B-22E861B8CF3C}
Class that describes an import.
 

Goto: Custom Properties, Fields, Methods

See also: ImportData, ImportItems, DeleteProcess, ImportLogItem, ErrorLevel, Status, ImportLogItem, ImportLogItem, ImportProcess, SubmitProcess

Appears in: multipleimport

Connections
 
Custom Properties
 
ImportLog Attributes
Attribute Details
private String
  action
private Connection
  connection
private String
  context
private ImportLogItem
  currentItem
Initial: null
public static const SimpleDateFormat
  DATE_FORMAT
Initial: new SimpleDateFormat("yyyy-MM-dd HH:mm")
Notes: The data format that is used to display start- and end-date. Example: 2009-12-31 23:59
private Date
  endDate
private ErrorLevel
  errorLevel
private String
  format
private ArrayList
  items
Initial: new ArrayList()
private static Logger
  logger
Initial: Logger.getLogger(ImportLog.class)
private String
  message
private int
  percentage
private Date
  startDate
private Status
  status
private int
  storedId
private String
  user
private String
  userHandle
private Workflow
  workflow
 
ImportLog Methods
Operation Details
public
activateItem(
   ImportLogItem item):void
Sequential
Notes: Puts the import's focus on this item.
public
addDetail(
   ErrorLevel errLevel,
   String msg):void
Sequential
Notes: Adds a detail to the focused item using the given error level and message key. Start- and end-date are set to the current date. Status is set to FINISHED. Defaults: - The detail id will be set to null
public
addDetail(
   ErrorLevel errLevel,
   String msg,
   String detailId):void
Sequential
Notes: Adds a detail to the focused item using the given error level, message key and detail id. Start- and end-date are set to the current date. Status is set to FINISHED.
public
addDetail(
   ErrorLevel errLevel,
   Exception exception):void
Sequential
Notes: Adds a detail to the focused item using the given error level and a previously caught exception. Start- and end-date are set to the current date. Status is set to FINISHED. The exception is transformed into a stack trace.
public
close():void
Sequential
Notes: Called when, for any reason, this action is over.
public
closeConnection():void
Sequential
public
deleteAll():String
Sequential
Notes: JSF action to delete all items of an import from the repository.
@return Always null.
protected
escape(
   String string):String
Sequential
Notes: An XML-safe representation of the given string.
@return the escaped string
private static
fillDetail(
   ResultSet resultSet,
   ImportLogItem currentItem):ImportLogItem
Sequential
Tags: throws=SQLException
Notes: @return
private static
fillItem(
   ResultSet resultSet,
   ImportLog result):ImportLogItem
Sequential
Tags: throws=SQLException
Notes: @return
private static
fillLog(
   ResultSet resultSet):ImportLog
Sequential
Tags: throws=SQLException
Notes: @return The filled import
public
finishItem():void
Sequential
Notes: Sets the status of the focused item to FINISHED and the end date to the current date, then removes the focus of the import.
public
getAction():String
Sequential
Notes: @return the action
public static
getConnection():Connection
Sequential
Notes: Reads the database configuration from the properties and then creates a {@link Connection}.
@return An open connection to the import database
public
getContext():String
Sequential
Notes: @return the context
public
getCurrentItem():ImportLogItem
Sequential
Notes: @return the currentItem
public
getEndDate():Date
Sequential
Notes: @return the endDate
public
getEndDateFormatted():String
Sequential
Notes: @return the endDate
public
getErrorLevel():ErrorLevel
Sequential
Notes: @return the errorLevel
private
getExceptionMessage(
   Throwable exception):String
Sequential
Notes: Transforms an exception into a Java stack trace.
@return The stack trace
public
getFinished():boolean
Sequential
Notes: Checks if the import is already finished.
@return true if the import is finished
public
getFormat():String
Sequential
Notes: @return the format
public
getImportedItems():boolean
Sequential
Notes: Checks if at least one item was imported.
@return true if one or more items were imported, otherwise false.
public static
getImportLog(
   int id):ImportLog
Sequential
Notes: Get a single import by its stored id. Defaults: - items are loaded - item details are loaded
@return The import
public static
getImportLog(
   int id,
   boolean loadDetails):ImportLog
Sequential
Notes: Get a single import by its stored id. Defaults: - items are loaded
@return The import
public static
getImportLog(
   int id,
   boolean loadItems,
   boolean loadDetails):ImportLog
Sequential
Notes: Get a single import by its stored id.
@return The import
public static
getImportLogs(
   String action,
   AccountUserVO user,
   SortColumn sortBy,
   SortDirection dir):List
Sequential
Notes: Retrieves a users imports from the database. Defaults: - items are loaded - item details are loaded
@return A list of imports
public static
getImportLogs(
   String action,
   AccountUserVO user,
   SortColumn sortBy,
   SortDirection dir,
   boolean loadDetails):List
Sequential
Notes: Retrieves a users imports from the database. Defaults: - items are loaded
@return A list of imports
public static
getImportLogs(
   String action,
   AccountUserVO user,
   SortColumn sortBy,
   SortDirection dir,
   boolean loadItems,
   boolean loadDetails):List
Sequential
Notes: Retrieves a users imports from the database.
@return A list of imports
public
getItems():List
Sequential
Notes: @return the items
public
getItemsLink():String
Sequential
Notes: @return A link to a JSP page showing the items of this import (no details)
public
getLocalizedMessage():String
Sequential
Notes: Reads a localized message from the message resource bundle.
@return A string holding the localized message
public
getLogLink():String
Sequential
Notes: @return A link to a JSP page showing only this import (no items)
public
getMessage():String
Sequential
Notes: @return the message
public
getMyItemsLink():String
Sequential
Notes: @return A link to the MyItems page filtering for this import
public
getPercentage():int
Sequential
Notes: @return the percentage
protected
getRelevantString():String
Sequential
public
getSimpleWorkflow():boolean
Sequential
Notes: Indicates whether the workflow of the currently used context is SIMPLE.
@return true if the workflow of the currently used context is SIMPLE.
public
getStartDate():Date
Sequential
Notes: @return the startDate
public
getStartDateFormatted():String
Sequential
Notes: @return the startDate
public
getStatus():Status
Sequential
Notes: @return the status
public
getStoredId():int
Sequential
Notes: @return the storedId
public
getUser():String
Sequential
Notes: @return the user
public
getUserHandle():String
Sequential
Notes: @return the userHandle
private
getWorkflow():Workflow
Sequential
protected
ImportLog():
Sequential
Notes: Implicit constructor for inheriting classes.
public
ImportLog(
   String action,
   String user,
   String format):
Sequential
Notes: Constructor.
public
isDone():boolean
Sequential
Notes: @return true if this import is already finished
public static
loadDetails(
   int id,
   String userid):List
Sequential
Notes: Get the details of a certain import item.
@return A list of details
public
remove():String
Sequential
Notes: JSF action to remove an import from the database.
@return Always null.
public
reopen():void
Sequential
Notes: Called when this process shall continue.
private
saveDetail(
   ImportLogItem detail):void
Sequential
private
saveItem(
   ImportLogItem item):void
Sequential
private
saveLog():void
Sequential
public
setAction(
   String action):void
Sequential
public
setConnection(
   Connection connection):void
Sequential
public
setContext(
   String context):void
Sequential
public
setEndDate(
   Date endDate):void
Sequential
public
setErrorLevel(
   ErrorLevel errorLevel):void
Sequential
public
setFormat(
   String format):void
Sequential
public
setItemId(
   String id):void
Sequential
Notes: Sets the (eSciDoc) id of the focused item.
public
setItems(
   List items):void
Sequential
public
setItemsLink(
   String link):void
Sequential
Notes: Dummy setter to avoid JSF warnings.
public
setItemVO(
   PubItemVO itemVO):void
Sequential
public
setLogLink(
   String link):void
Sequential
Notes: Dummy setter to avoid JSF warnings.
public
setMessage(
   String message):void
Sequential
public
setPercentage(
   int percentage):void
Sequential
public
setStartDate(
   Date startDate):void
Sequential
public
setStatus(
   Status status):void
Sequential
public
setStoredId(
   int storedId):void
Sequential
public
setUser(
   String user):void
Sequential
public
setUserHandle(
   String userHandle):void
Sequential
public
startItem(
   String msg):void
Sequential
Notes: Creates a new item using the given message. Defaults: - Item id will be set to null - Start date will be set to the current date - Error level will be set to FINE.
public
startItem(
   String msg,
   String itemId):void
Sequential
Notes: Creates a new item using the given message and item id, then putting the focus of the import on it. Defaults: - Start date will be set to the current date - Error level will be set to FINE.
public
startItem(
   String msg,
   Date sDate,
   String itemId):void
Sequential
Notes: Creates a new item using the given message, item id and start date, then putting the focus of the import on it. Defaults: - Error level will be set to FINE.
public
startItem(
   ErrorLevel errLevel,
   String msg):void
Sequential
Notes: Creates a new item using the given error level and message, then putting the focus of the import on it. Defaults: - Item id will be set to null - Start date will be set to the current date
public
startItem(
   ErrorLevel errLevel,
   String msg,
   Date sDate,
   String itemId):void
Sequential
Notes: Creates a new item using the given error level, message, item id and start date, then putting the focus of the import on it.
public
submitAll():String
Sequential
Notes: JSF action to submit/release all items of an import from the repository.
@return Always null.
public
submitAndReleaseAll():String
Sequential
Notes: JSF action to submit/release all items of an import from the repository.
@return Always null.
public
suspendItem():void
Sequential
Notes: Sets the status of the focused item to SUSPENDED. This should be done when it is planned to visit this item again later. I.e. in a first step, all items are transformed and validated, then suspended. In a second step, all items are imported into the repository.
public
toString():String
Sequential
Notes: {@inheritDoc}
public
toXML():String
Sequential
Notes: @return An XML representation of this import. Used to store it in the repository.
private
updateItem(
   ImportLogItem item):void
Sequential
private
updateLog():void
Sequential