|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.repository.RepositoryService
public class RepositoryService
Methods to wrap the RepositoryManager
class
and provide other methods and services over the repository.
Constructor Summary | |
---|---|
RepositoryService(ServletContext servletContext)
Constructor for the RepositoryService object, requiring ServletContext. |
Method Summary | |
---|---|
void |
addListener(RepositoryEventListener listener)
Adds a feature to the Listener attribute of the DcsDataRecord object |
RecordList |
batchCopyMoveRecords(RecordList records,
String collection)
Moves a batch of records into the specified collection. |
RecordList |
batchDeleteRecords(RecordList records)
returns list of records that could not be deleted |
RecordList |
batchMoveRecords(RecordList records,
String collection)
Moves a batch of records into the specified collection. |
RecordList |
batchStatusUpdate(RecordList records,
StatusEntry statusEntry)
Updates the status of a set of records (but does not validate or update the lastTouchDate. |
String |
copyMoveRecord(String srcRecordId,
String destCollection)
Write a copied version of a metadata record into a destination collectioni |
XMLDocReader |
copyRecord(String originalId,
User user)
Create a new record within the same collection as the original. |
void |
deleteCollection(String collection)
Delete a collection from the repository |
void |
deleteRecord(String recId)
Delete a record from the repository |
List |
getAuthorizedSets(User user,
Roles.Role requiredRole)
Gets the authorizedSets attribute of the RepositoryService object |
RecordList |
getCollectionItemRecords(String collection)
Gets all item records for the specified collection by performing index query. |
static String |
getDateString()
Gets the dateString attribute of the RepositoryService class |
DcsDataRecord |
getDcsDataRecord(String recId)
Gets the dcsDataRecord attribute of the RepositoryService object |
List |
getDups(String url,
String collection)
Gets the dups attribute of the RepositoryService object |
static String |
getRecordFormat(String id,
RepositoryManager rm)
Gets the recordFormat attribute of the RepositoryService class |
RepositoryWriter |
getRepositoryWriter()
Gets the repositoryWriter attribute of the RepositoryService object |
ArrayList |
getSetInfos()
Update the list of sets. |
List |
getSims(String url,
String collection)
Gets the sims attribute of the RepositoryService object |
XMLDocReader |
getXMLDocReader(String id)
Gets the xMLDocReader attribute of the RepositoryService object |
static XMLDocReader |
getXMLDocReader(String id,
RepositoryManager rm)
Gets the XMLDocReader associated with an id |
void |
indexAnnotatedRecord(DocMap annoDocMap)
Reindexes the annotated item record of an annotation record so the annotated item record is linked to its annotation. |
static boolean |
indexedRecordIsStale(File sourceFile,
XMLDocReader docReader)
Test to see if record has been modified outside of DCS. |
boolean |
indexedRecordIsStale(String id)
NOT YET DOCUMENTED |
boolean |
isAuthorizedSet(String collection,
User user,
Roles.Role requiredRole)
Returns true if the specified user is authorized for the specified collection (set). |
String |
moveRecord(String recId,
String collection)
Move record to the destination collection, returning the ID of the new record. |
void |
removeListener(RepositoryEventListener listener)
Description of the Method |
void |
saveEditedRecord(String recId,
Document doc,
User user)
Save an edited record to disk and update the index accordingly. |
void |
saveNewRecord(String recId,
String recordXml,
String collection,
String username)
Saves and indexes a newly created record. |
void |
updateRecord(String recId)
Updates the record by writing it to the repository. |
void |
updateRecordStatus(String recId,
StatusEntry statusEntry)
Update the status of a metadata record with provided statusEntry instance. |
void |
validateRecord(Object record,
DcsDataRecord dcsData,
String xmlFormat)
Validate the record and update the DcsDataRecord. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RepositoryService(ServletContext servletContext) throws Exception
servletContext
-
Exception
- if repositoryWriter or autoExport service cannot be
initialized.Method Detail |
---|
public RepositoryWriter getRepositoryWriter()
public List getDups(String url, String collection)
url
- NOT YET DOCUMENTEDcollection
- NOT YET DOCUMENTED
public List getSims(String url, String collection)
url
- NOT YET DOCUMENTEDcollection
- NOT YET DOCUMENTED
public boolean indexedRecordIsStale(String id) throws Exception
id
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic static boolean indexedRecordIsStale(File sourceFile, XMLDocReader docReader)
sourceFile
- file on diskdocReader
- the docReader
public void indexAnnotatedRecord(DocMap annoDocMap) throws Exception
annoDocMap
- NOT YET DOCUMENTED
Exception
- Description of the Exceptionpublic void updateRecordStatus(String recId, StatusEntry statusEntry) throws Exception
recId
- id of record to updatestatusEntry
- new status for record
Exception
- if record cannot be saved and indexed with provided
statuspublic void saveEditedRecord(String recId, Document doc, User user) throws Exception
recId
- id of metadata record to be saveddoc
- metadata record as dom4j.Documentuser
- NOT YET DOCUMENTED
Exception
- if unable to successfully update indexpublic void saveNewRecord(String recId, String recordXml, String collection, String username) throws Exception
Callers of this method are controllers who collect key information from user and create an item-level metadata record outside of the metadata editor (currently only CreateADNRecordAction.handleNewRecordRequest does this).
recId
- record idrecordXml
- record content as delocalized xml stringcollection
- collection key (e.g., "dcc")username
- NOT YET DOCUMENTED
Exception
- if unable to save new recordpublic void updateRecord(String recId) throws Exception
Called by DCSSchemEditAction.indexAnnotatedRecord() and ThreadedServices.validate().
recId
- Description of the Parameter
Exception
- Description of the Exceptionpublic void validateRecord(Object record, DcsDataRecord dcsData, String xmlFormat)
dcsData
- status record corresponding to the xml record.record
- An xml record, represented either as String or FilexmlFormat
- NOT YET DOCUMENTEDpublic RecordList batchMoveRecords(RecordList records, String collection) throws Exception
records
- A list of records to move to collectioncollection
- collection key of the destination collection
Exception
- NOT YET DOCUMENTEDpublic RecordList batchCopyMoveRecords(RecordList records, String collection) throws Exception
records
- A list of records to move to collectioncollection
- collection key of the destination collection
Exception
- NOT YET DOCUMENTEDpublic RecordList batchStatusUpdate(RecordList records, StatusEntry statusEntry) throws Exception
records
- an array of records represented as ResultDocsstatusEntry
- contains status, statusNote and editor information to
be added to each record
Exception
- NOT YET DOCUMENTEDpublic String moveRecord(String recId, String collection) throws Exception
Ensures that source and destination collections are different before making move, so batch moves don't have to make this check.
recId
- id of the record to be movedcollection
- Destination collection for the record to be moved
Exception
- Description of the Exceptionpublic RecordList batchDeleteRecords(RecordList records) throws Exception
records
- Description of the Parameter
Exception
- NOT YET DOCUMENTEDpublic void deleteCollection(String collection) throws Exception
collection
- key of collection to be deleted
Exception
- NOT YET DOCUMENTEDpublic void deleteRecord(String recId) throws Exception
recId
- Description of the Parameter
Exception
- Description of the Exceptionpublic XMLDocReader copyRecord(String originalId, User user) throws Exception
originalId
- id of the record to be copied
Exception
- Description of the Exceptionpublic String copyMoveRecord(String srcRecordId, String destCollection) throws Exception
originalId
- NOT YET DOCUMENTEDdestCollection
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic DcsDataRecord getDcsDataRecord(String recId) throws Exception
recId
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic XMLDocReader getXMLDocReader(String id) throws Exception
id
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic static XMLDocReader getXMLDocReader(String id, RepositoryManager rm) throws Exception
id
- Record IDrm
- RepositoryManager
Exception
- NOT YET DOCUMENTEDpublic static String getRecordFormat(String id, RepositoryManager rm) throws Exception
id
- NOT YET DOCUMENTEDrm
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic ArrayList getSetInfos()
public boolean isAuthorizedSet(String collection, User user, Roles.Role requiredRole)
collection
- NOT YET DOCUMENTEDuser
- NOT YET DOCUMENTEDrequiredRole
- NOT YET DOCUMENTED
public List getAuthorizedSets(User user, Roles.Role requiredRole)
user
- NOT YET DOCUMENTEDrequiredRole
- NOT YET DOCUMENTED
public RecordList getCollectionItemRecords(String collection)
collection
- collection key
public void addListener(RepositoryEventListener listener)
listener
- The feature to be added to the Listener attributepublic void removeListener(RepositoryEventListener listener)
listener
- Description of the Parameterpublic static String getDateString()
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |