public class ItemImport
extends java.lang.Object
A second use assumes the bitstream files already exist in a storage resource accessible to DSpace. In this case the bitstreams are 'registered'. That is, the metadata is loaded to the DSpace database and DSpace is given the location of the file which is subsumed into DSpace.
The distinction is controlled by the format of lines in the 'contents' file. See comments in processContentsFile() below.
Modified by David Little, UCSD Libraries 12/21/04 to allow the registration of files (bitstreams) into DSpace.
| Constructor and Description |
|---|
ItemImport() |
| Modifier and Type | Method and Description |
|---|---|
void |
addItems(Context c,
Collection[] mycollections,
java.lang.String sourceDir,
java.lang.String mapFile,
boolean template) |
void |
addItemsAtomic(Context c,
Collection[] mycollections,
java.lang.String sourceDir,
java.lang.String mapFile,
boolean template) |
static void |
cleanupZipTemp() |
void |
deleteBatchUpload(Context c,
java.lang.String uploadId) |
static void |
emailErrorMessage(EPerson eperson,
java.lang.String error)
Since the BTE batch import is done in a new thread we are unable to communicate
with calling method about success or failure.
|
static void |
emailSuccessMessage(Context context,
EPerson eperson,
java.lang.String fileName)
Since the BTE batch import is done in a new thread we are unable to communicate
with calling method about success or failure.
|
static java.util.List<BatchUpload> |
getImportsAvailable(EPerson eperson) |
static java.lang.String |
getImportUploadableDirectory(int ePersonID) |
static java.lang.String |
getTempWorkDir() |
static java.io.File |
getTempWorkDirFile() |
static void |
main(java.lang.String[] argv) |
static void |
processUIImport(java.lang.String filepath,
Collection owningCollection,
java.lang.String[] otherCollections,
java.lang.String resumeDir,
java.lang.String inputType,
Context context)
Given a local file or public URL to a zip file that has the Simple Archive Format, this method imports the contents to DSpace
|
static java.lang.String |
unzip(java.io.File zipfile) |
static java.lang.String |
unzip(java.io.File zipfile,
java.lang.String destDir) |
static java.lang.String |
unzip(java.lang.String sourcedir,
java.lang.String zipfilename) |
public static void main(java.lang.String[] argv)
throws java.lang.Exception
java.lang.Exceptionpublic void addItemsAtomic(Context c, Collection[] mycollections, java.lang.String sourceDir, java.lang.String mapFile, boolean template) throws java.lang.Exception
java.lang.Exceptionpublic void addItems(Context c, Collection[] mycollections, java.lang.String sourceDir, java.lang.String mapFile, boolean template) throws java.lang.Exception
java.lang.Exceptionpublic static java.lang.String unzip(java.io.File zipfile)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String unzip(java.io.File zipfile,
java.lang.String destDir)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String unzip(java.lang.String sourcedir,
java.lang.String zipfilename)
throws java.io.IOException
java.io.IOExceptionpublic static void processUIImport(java.lang.String filepath,
Collection owningCollection,
java.lang.String[] otherCollections,
java.lang.String resumeDir,
java.lang.String inputType,
Context context)
throws java.lang.Exception
filepath - The filepath to local file or the public URL of the zip fileowningCollection - The owning collection the items will belong tootherCollections - The collections the created items will be inserted to, apart from the owning oneresumeDir - In case of a resume request, the directory that containsthe old mapfile and datainputType - The input type of the data (bibtex, csv, etc.), in case of local filecontext - The contextjava.lang.Exceptionpublic static void emailSuccessMessage(Context context, EPerson eperson, java.lang.String fileName) throws javax.mail.MessagingException
context - - the current Contexteperson - - eperson to send the email tofileName - - the filepath to the mapfile created by the batch importjavax.mail.MessagingExceptionpublic static void emailErrorMessage(EPerson eperson, java.lang.String error) throws javax.mail.MessagingException
eperson - - EPerson to send the error message toerror - - the error messagejavax.mail.MessagingExceptionpublic static java.util.List<BatchUpload> getImportsAvailable(EPerson eperson) throws java.lang.Exception
java.lang.Exceptionpublic static java.lang.String getImportUploadableDirectory(int ePersonID)
throws java.lang.Exception
java.lang.Exceptionpublic void deleteBatchUpload(Context c, java.lang.String uploadId) throws java.lang.Exception
java.lang.Exceptionpublic static java.lang.String getTempWorkDir()
public static java.io.File getTempWorkDirFile()
public static void cleanupZipTemp()
Copyright © 2018 DuraSpace. All Rights Reserved.