public interface ItemImportService
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.
| Modifier and Type | Method and Description |
|---|---|
void |
addBTEItems(Context c,
List<Collection> mycollections,
String sourcedir,
String mapfile,
boolean template,
String bteInputType,
String workingDir)
Add items
|
void |
addItems(Context c,
List<Collection> mycollections,
String sourceDir,
String mapFile,
boolean template)
Add items
|
void |
addItemsAtomic(Context c,
List<Collection> mycollections,
String sourceDir,
String mapFile,
boolean template) |
void |
cleanupZipTemp()
Cleanup
|
void |
deleteBatchUpload(Context c,
String uploadId)
Delete a batch by ID
|
void |
deleteItems(Context c,
String mapfile)
Delete items via mapfile
|
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.
|
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.
|
List<BatchUpload> |
getImportsAvailable(EPerson eperson)
Get imports available for a person
|
String |
getImportUploadableDirectory(EPerson ePerson)
Get import upload directory
|
String |
getTempWorkDir()
Get temporary work directory
|
File |
getTempWorkDirFile()
Get temporary work directory (as File)
|
void |
processUIImport(String url,
Collection owningCollection,
String[] collections,
String resumeDir,
String inputType,
Context context,
boolean template)
Given a public URL to a zip file that has the Simple Archive Format, this method imports the contents to DSpace
|
void |
replaceItems(Context c,
List<Collection> mycollections,
String sourcedir,
String mapfile,
boolean template)
Replace items
|
void |
setQuiet(boolean isQuiet)
Set quiet flag
|
void |
setResume(boolean isResume)
Set resume flag
|
void |
setTest(boolean isTest)
Set test flag
|
void |
setUseWorkflow(boolean useWorkflow)
Set use workflow
|
void |
setUseWorkflowSendEmail(boolean useWorkflowSendMail) |
String |
unzip(File zipfile)
Unzip a file
|
String |
unzip(File zipfile,
String destDir)
Unzip a file to a destination
|
String |
unzip(String sourcedir,
String zipfilename)
Unzip a file in a specific source directory
|
void addItemsAtomic(Context c, List<Collection> mycollections, String sourceDir, String mapFile, boolean template) throws Exception
c - DSpace Contextmycollections - List of CollectionssourceDir - source locationmapFile - map filetemplate - whether to use template itemException - if errorvoid addItems(Context c, List<Collection> mycollections, String sourceDir, String mapFile, boolean template) throws Exception
c - DSpace Contextmycollections - List of CollectionssourceDir - source locationmapFile - map filetemplate - whether to use template itemException - if errorString unzip(File zipfile) throws IOException
zipfile - fileIOException - if errorString unzip(File zipfile, String destDir) throws IOException
zipfile - filedestDir - destination directoryIOException - if errorString unzip(String sourcedir, String zipfilename) throws IOException
sourcedir - source directoryzipfilename - file nameIOException - if errorvoid processUIImport(String url, Collection owningCollection, String[] collections, String resumeDir, String inputType, Context context, boolean template) throws Exception
url - The public URL of the zip fileowningCollection - The owning collection the items will belong tocollections - 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 contexttemplate - whether to use template itemException - if errorvoid 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.MessagingException - if errorvoid emailErrorMessage(EPerson eperson, String error) throws javax.mail.MessagingException
eperson - - EPerson to send the error message toerror - - the error messagejavax.mail.MessagingException - if errorList<BatchUpload> getImportsAvailable(EPerson eperson) throws Exception
eperson - EPerson objectException - if errorString getImportUploadableDirectory(EPerson ePerson) throws Exception
ePerson - EPerson objectException - if errorvoid deleteBatchUpload(Context c, String uploadId) throws Exception
c - DSpace ContextuploadId - identifierException - if errorvoid replaceItems(Context c, List<Collection> mycollections, String sourcedir, String mapfile, boolean template) throws Exception
c - DSpace Contextmycollections - List of Collectionssourcedir - source directorymapfile - map filetemplate - whether to use template itemException - if errorvoid deleteItems(Context c, String mapfile) throws Exception
c - DSpace Contextmapfile - map fileException - if errorvoid addBTEItems(Context c, List<Collection> mycollections, String sourcedir, String mapfile, boolean template, String bteInputType, String workingDir) throws Exception
c - DSpace Contextmycollections - List of Collectionssourcedir - source directorymapfile - map filetemplate - whether to use template itembteInputType - The input type of the data (bibtex, csv, etc.), in case of local fileworkingDir - working directoryException - if errorString getTempWorkDir()
File getTempWorkDirFile()
void cleanupZipTemp()
void setTest(boolean isTest)
isTest - true or falsevoid setResume(boolean isResume)
isResume - true or falsevoid setUseWorkflow(boolean useWorkflow)
useWorkflow - whether to enable workflowvoid setUseWorkflowSendEmail(boolean useWorkflowSendMail)
useWorkflowSendMail - whether to send mailvoid setQuiet(boolean isQuiet)
isQuiet - true or falseCopyright © 2016 DuraSpace. All rights reserved.