public class ItemImport extends 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,
String sourceDir,
String mapFile,
boolean template) |
void |
addItemsAtomic(Context c,
Collection[] mycollections,
String sourceDir,
String mapFile,
boolean template) |
static void |
cleanupZipTemp() |
void |
deleteBatchUpload(Context c,
String uploadId) |
static void |
emailErrorMessage(EPerson eperson,
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,
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 List<BatchUpload> |
getImportsAvailable(EPerson eperson) |
static String |
getImportUploadableDirectory(int ePersonID) |
static String |
getTempWorkDir() |
static File |
getTempWorkDirFile() |
static void |
main(String[] argv) |
static void |
processUIImport(String filepath,
Collection owningCollection,
String[] otherCollections,
String resumeDir,
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 String |
unzip(File zipfile) |
static String |
unzip(File zipfile,
String destDir) |
static String |
unzip(String sourcedir,
String zipfilename) |
public void addItemsAtomic(Context c, Collection[] mycollections, String sourceDir, String mapFile, boolean template) throws Exception
Exceptionpublic void addItems(Context c, Collection[] mycollections, String sourceDir, String mapFile, boolean template) throws Exception
Exceptionpublic static String unzip(File zipfile) throws IOException
IOExceptionpublic static String unzip(File zipfile, String destDir) throws IOException
IOExceptionpublic static String unzip(String sourcedir, String zipfilename) throws IOException
IOExceptionpublic static void processUIImport(String filepath, Collection owningCollection, String[] otherCollections, String resumeDir, String inputType, Context context) throws 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 contextExceptionpublic static void emailSuccessMessage(Context context, EPerson eperson, 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, String error) throws javax.mail.MessagingException
eperson - - EPerson to send the error message toerror - - the error messagejavax.mail.MessagingExceptionpublic static List<BatchUpload> getImportsAvailable(EPerson eperson) throws Exception
Exceptionpublic static String getImportUploadableDirectory(int ePersonID) throws Exception
Exceptionpublic void deleteBatchUpload(Context c, String uploadId) throws Exception
Exceptionpublic static String getTempWorkDir()
public static File getTempWorkDirFile()
public static void cleanupZipTemp()
Copyright © 2014 DuraSpace. All Rights Reserved.