org.jafer.osid.provider
Class Repository

java.lang.Object
  extended by org.jafer.osid.provider.Repository
All Implemented Interfaces:
java.io.Serializable, org.osid.repository.Repository

public class Repository
extends java.lang.Object
implements org.osid.repository.Repository

Main implementation class for the Jafer OSID provider. Please see the OKI osid api 2.0 for all interface documentation.

The approach taken in this implementation is to create Maps and Vectors containing the PartStructure elements for the different resultType types that are supported. When a consumer performs a search, it can specify which resultType should be created and the Part and PartStructure lists will provide the results according to that Type. Presently implemented are; a "standard" Jafer type containing typical fields from a z39.50 library repository, a MODS xml string, and MIT's Type from the Sakai project.

A search is performed by calling the Jafer ZClient class to search against a target z39.50 server. Results are returned by Jafer as MODS records and then mapped to the Type specified as a request option (as described above).

See Also:
Serialized Form

Field Summary
(package private) static java.lang.String DEFAULT_RECORD_SCHEMA
           
private  java.lang.String displayName
           
private  org.osid.shared.Type jaferType
           
(package private)  java.util.Hashtable jaferTypesMap
           
(package private)  java.util.Vector jaferTypesVector
           
private  org.osid.shared.Type mitType
           
(package private)  java.util.Hashtable mitTypesMap
           
(package private)  java.util.Vector mitTypesVector
           
private  org.osid.shared.Type modsType
           
(package private)  java.util.Hashtable modsTypesMap
           
(package private)  java.util.Vector modsTypesVector
           
 
Constructor Summary
protected Repository(java.lang.String displayName)
           
 
Method Summary
 org.osid.shared.Id copyAsset(org.osid.repository.Asset asset)
           
private  Asset createAsset(org.w3c.dom.Element modsRoot, org.osid.shared.Type resultType)
           
 org.osid.repository.Asset createAsset(java.lang.String displayName, java.lang.String description, org.osid.shared.Type assetType)
           
 void deleteAsset(org.osid.shared.Id assetId)
           
 org.osid.repository.Asset getAsset(org.osid.shared.Id assetId)
           
 org.osid.repository.Asset getAssetByDate(org.osid.shared.Id assetId, long date)
           
 org.osid.shared.LongValueIterator getAssetDates(org.osid.shared.Id assetId)
           
 org.osid.repository.AssetIterator getAssets()
           
 org.osid.repository.AssetIterator getAssetsBySearch(java.io.Serializable searchCriteria, org.osid.shared.Type searchType, org.osid.shared.Properties searchProperties)
           
 org.osid.repository.AssetIterator getAssetsByType(org.osid.shared.Type assetType)
           
 org.osid.shared.TypeIterator getAssetTypes()
           
 java.lang.String getDescription()
           
 java.lang.String getDisplayName()
           
 org.osid.shared.Id getId()
           
 org.osid.repository.RecordStructureIterator getMandatoryRecordStructures(org.osid.shared.Type assetType)
           
 org.osid.shared.PropertiesIterator getProperties()
           
 org.osid.shared.Properties getPropertiesByType(org.osid.shared.Type propertiesType)
           
 org.osid.shared.TypeIterator getPropertyTypes()
           
 org.osid.repository.RecordStructureIterator getRecordStructures()
           
 org.osid.repository.RecordStructureIterator getRecordStructuresByType(org.osid.shared.Type recordStructureType)
           
 org.osid.shared.TypeIterator getSearchTypes()
           
 org.osid.shared.Type getStatus(org.osid.shared.Id assetId)
           
 org.osid.shared.TypeIterator getStatusTypes()
           
 org.osid.shared.Type getType()
           
 void invalidateAsset(org.osid.shared.Id assetId)
           
private  java.util.Vector jaferSearch(java.lang.String host, int port, java.lang.String databaseName, int maxRecords, java.lang.String cqlString, org.osid.shared.Type resultType)
           
 boolean supportsUpdate()
           
 boolean supportsVersioning()
           
private  java.lang.String toXMLString(org.w3c.dom.Element node)
          Helper class to print out the xml returned.
 void updateDescription(java.lang.String description)
           
 void updateDisplayName(java.lang.String displayName)
           
 boolean validateAsset(org.osid.shared.Id assetId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RECORD_SCHEMA

static final java.lang.String DEFAULT_RECORD_SCHEMA
See Also:
Constant Field Values

jaferType

private org.osid.shared.Type jaferType

mitType

private org.osid.shared.Type mitType

modsType

private org.osid.shared.Type modsType

displayName

private java.lang.String displayName

jaferTypesMap

java.util.Hashtable jaferTypesMap

jaferTypesVector

java.util.Vector jaferTypesVector

modsTypesMap

java.util.Hashtable modsTypesMap

modsTypesVector

java.util.Vector modsTypesVector

mitTypesMap

java.util.Hashtable mitTypesMap

mitTypesVector

java.util.Vector mitTypesVector
Constructor Detail

Repository

protected Repository(java.lang.String displayName)
Method Detail

createAsset

private Asset createAsset(org.w3c.dom.Element modsRoot,
                          org.osid.shared.Type resultType)
                   throws org.osid.repository.RepositoryException
Throws:
org.osid.repository.RepositoryException

jaferSearch

private java.util.Vector jaferSearch(java.lang.String host,
                                     int port,
                                     java.lang.String databaseName,
                                     int maxRecords,
                                     java.lang.String cqlString,
                                     org.osid.shared.Type resultType)
                              throws org.osid.repository.RepositoryException
Throws:
org.osid.repository.RepositoryException

getDisplayName

public java.lang.String getDisplayName()
                                throws org.osid.repository.RepositoryException
Specified by:
getDisplayName in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getAssetsBySearch

public org.osid.repository.AssetIterator getAssetsBySearch(java.io.Serializable searchCriteria,
                                                           org.osid.shared.Type searchType,
                                                           org.osid.shared.Properties searchProperties)
                                                    throws org.osid.repository.RepositoryException
Specified by:
getAssetsBySearch in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

toXMLString

private java.lang.String toXMLString(org.w3c.dom.Element node)
Helper class to print out the xml returned.


updateDisplayName

public void updateDisplayName(java.lang.String displayName)
                       throws org.osid.repository.RepositoryException
Specified by:
updateDisplayName in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getId

public org.osid.shared.Id getId()
                         throws org.osid.repository.RepositoryException
Specified by:
getId in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getType

public org.osid.shared.Type getType()
                             throws org.osid.repository.RepositoryException
Specified by:
getType in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getDescription

public java.lang.String getDescription()
                                throws org.osid.repository.RepositoryException
Specified by:
getDescription in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

updateDescription

public void updateDescription(java.lang.String description)
                       throws org.osid.repository.RepositoryException
Specified by:
updateDescription in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

createAsset

public org.osid.repository.Asset createAsset(java.lang.String displayName,
                                             java.lang.String description,
                                             org.osid.shared.Type assetType)
                                      throws org.osid.repository.RepositoryException
Specified by:
createAsset in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

deleteAsset

public void deleteAsset(org.osid.shared.Id assetId)
                 throws org.osid.repository.RepositoryException
Specified by:
deleteAsset in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getAssets

public org.osid.repository.AssetIterator getAssets()
                                            throws org.osid.repository.RepositoryException
Specified by:
getAssets in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getAssetsByType

public org.osid.repository.AssetIterator getAssetsByType(org.osid.shared.Type assetType)
                                                  throws org.osid.repository.RepositoryException
Specified by:
getAssetsByType in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getAssetTypes

public org.osid.shared.TypeIterator getAssetTypes()
                                           throws org.osid.repository.RepositoryException
Specified by:
getAssetTypes in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getPropertiesByType

public org.osid.shared.Properties getPropertiesByType(org.osid.shared.Type propertiesType)
                                               throws org.osid.repository.RepositoryException
Specified by:
getPropertiesByType in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getPropertyTypes

public org.osid.shared.TypeIterator getPropertyTypes()
                                              throws org.osid.repository.RepositoryException
Specified by:
getPropertyTypes in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getProperties

public org.osid.shared.PropertiesIterator getProperties()
                                                 throws org.osid.repository.RepositoryException
Specified by:
getProperties in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getRecordStructures

public org.osid.repository.RecordStructureIterator getRecordStructures()
                                                                throws org.osid.repository.RepositoryException
Specified by:
getRecordStructures in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getRecordStructuresByType

public org.osid.repository.RecordStructureIterator getRecordStructuresByType(org.osid.shared.Type recordStructureType)
                                                                      throws org.osid.repository.RepositoryException
Specified by:
getRecordStructuresByType in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getMandatoryRecordStructures

public org.osid.repository.RecordStructureIterator getMandatoryRecordStructures(org.osid.shared.Type assetType)
                                                                         throws org.osid.repository.RepositoryException
Specified by:
getMandatoryRecordStructures in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getSearchTypes

public org.osid.shared.TypeIterator getSearchTypes()
                                            throws org.osid.repository.RepositoryException
Specified by:
getSearchTypes in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getStatusTypes

public org.osid.shared.TypeIterator getStatusTypes()
                                            throws org.osid.repository.RepositoryException
Specified by:
getStatusTypes in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getStatus

public org.osid.shared.Type getStatus(org.osid.shared.Id assetId)
                               throws org.osid.repository.RepositoryException
Specified by:
getStatus in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

validateAsset

public boolean validateAsset(org.osid.shared.Id assetId)
                      throws org.osid.repository.RepositoryException
Specified by:
validateAsset in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

invalidateAsset

public void invalidateAsset(org.osid.shared.Id assetId)
                     throws org.osid.repository.RepositoryException
Specified by:
invalidateAsset in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getAsset

public org.osid.repository.Asset getAsset(org.osid.shared.Id assetId)
                                   throws org.osid.repository.RepositoryException
Specified by:
getAsset in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getAssetByDate

public org.osid.repository.Asset getAssetByDate(org.osid.shared.Id assetId,
                                                long date)
                                         throws org.osid.repository.RepositoryException
Specified by:
getAssetByDate in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

getAssetDates

public org.osid.shared.LongValueIterator getAssetDates(org.osid.shared.Id assetId)
                                                throws org.osid.repository.RepositoryException
Specified by:
getAssetDates in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

copyAsset

public org.osid.shared.Id copyAsset(org.osid.repository.Asset asset)
                             throws org.osid.repository.RepositoryException
Specified by:
copyAsset in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

supportsVersioning

public boolean supportsVersioning()
                           throws org.osid.repository.RepositoryException
Specified by:
supportsVersioning in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException

supportsUpdate

public boolean supportsUpdate()
                       throws org.osid.repository.RepositoryException
Specified by:
supportsUpdate in interface org.osid.repository.Repository
Throws:
org.osid.repository.RepositoryException