UIUC OAIHarvesterObj 2.0 ActiveX DLL
This software and documentation was developed as part of the
Open Archives Initiative Metadata Harvesting Project
at the University of Illinois at Urbana-Champaign, funded by the
Andrew Mellon Foundation, and it is distributed under the
University of Illinois/NCSA Open Source License.
Object Model
Custom Error Messages
Notes:
Properties or methods marked as 2.0 are generally only applicable to OAI 2.0 compliant repositories. If an attempt is made to access mandatory
or required OAI 2.0 properties from an OAI 1.x repository an error will be generated. However, if an attempt is made to access optional
OAI 2.0 properties from an OAI 1.x repository, a default or 'unknown' value will be returned; the same as if the property had been omitted
by the OAI 2.0 repository.
Source Files
For every public object there are two classes and two source files. All of the classes whose names end in 'Obj' are public, and they are merely
wrappers for the base classes which actually implement the functionality. The APIs for the base and wrapper classes are nearly identical except for
some minor changes.
The wrapper 'Obj' classes generally use Variant data types for all parameters; this is so the classes can be used more easily in scripting environments
which support only Variant. The parameters used in the base classes are usually more strongly typed, i.e. String, Long, etc.
Another reason for the base and wrapper classes is so that the same code can be used to create both ActiveX DLL style libraries or included in
stand-alone VB projects. The 'Obj' wrapper classes are used to create the ActiveX DLL. However, the base classes can be included in any VB project
and essentially statically linked into the project. This allows stand-alone VB applications to be created using our objects that do not require
the separate ActiveX DLL.
OAIRegRepoListObj
This object represents a list of all registered repositories as returned by the http://www.openarchives.org/Register/ListFriends.pl script.
This class is similar to a read-only, forward-only database cursor.
This object may be created using the New operator. Its ProgID is 'OAIHarvesterObj.OAIRegRepoListObj',
and its VB Class Name is 'OAIRegRepoListObj'.
Properties
- Class read-only
- The name of this class 'OAIRegRepoListObj'
- CompleteListSize read-only
- Returns the number of registered repositories.
- CurrentBaseURL read-only
- The base URL of the current registered repository
- CurrentIndex read-only
- The index of the current item in the list (0 to CompleteListSize - 1)
- CurrentRepository([validation]) read-only (default property)
- Return an OAIRepositoryObj object for the current repository. If the validation parameters is used,
the repository object will be set to the validation mode. Validation defaults to Strict (0).
- CurrentRepositoryIdentifier read-only
- The identifier registered for the repository
- ListFriendsURL read/write
- The URL of the ListFriends script. This is URL which returns the list of all registered repositories.
It defaults to http://www.openarchives.org/Register/ListFriends.pl. When this value is set Requery automatically happens.
- MoreItems read-only
- Returns True if there are more items in the list.
- RawXML read-only
- Returns a DOMDocument40 object containing the raw XML as returned by the ListFriends script, mostly intended for debugging purposes.
RepositoryCount read-only, deprecated
- This property is deprecated. It is replaced by CompleteListSize to match the property used by other List classes
Methods
- IsListValid
- Returns true if the list is valid; else False
- MoveNext
- Moves the cursor location to the next record in the list
- Requery
- This will reset the entire list to the beginning, redoing the query from scratch
OAIRepositoryObj
Object which exposes properties and methods for interacting with OAI repositories.
This object may be created using the New operator, or it is returned by the OAIRegRepoListObj.CurrentRepository property.
Its ProgID is 'OAIHarvesterObj.OAIRepositoryObj', and its VB Class Name is 'OAIRepositoryObj'.
Properties
- AdminEmail([index]) read-only
- The e-mail address of the administrator of the repository; the index parameter indicates which email to return:
0 to AdminEmailCount-1; if there is no AdminEmail at a specific index an empty string is returned.
Repositories prior to OAI 2.0 supported only a single AdminEmail.
- AdminEmailCount read-only
- The number of AdminEmails returned in the Identify response. Only OAI 2.0 repositories can return more than one AdminEmail.
- BaseURL read/write (default property)
- The BASE-URL of the repository; must be set before most other properties or methods can be used
- Class read-only
- The name of this class 'OAIRepositoryObj'
- Compression([index]) read-only (2.0)
- A compression encoding supported by the repository; the index parameter indicates which compression to return:
0 to CompressionCount-1; if there is no Compression at a specific index an empty string is returned.
- CompressionCount read-only (2.0)
- The number of Compressions returned in the Identify response.
- DeletedItem read-only (2.0)
- The manner in which the repository supports the notion of deleted item . Legitimate values are no, transient, or persistent.
- Description([index]) read-only
- One of the repository descriptions returned by the Identify request as an XML DOMDocument40 object;
the index parameter indicates which description to return: 0 to DescriptionCount-1; if there is no description Nothing returned
- DescriptionCount read-only
- The number of descriptions returned in the Identify response
- EarliestDateStamp read-only (2.0)
- The guaranteed lower limit of all datestamps of items in the repository.
- From read/write
- The value to be used in the From field of the HTTP request header. This is usually the email address of the person running the harvester.
Defaults to 'someone@somewhere.edu'. This property should be reset to email address of the person responsible for harvester.
- Granularity read-only (2.0)
- The finest harvesting granularity supported by the repository. The legitimate values are
YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ.
- LastOAIError([index]) read-only (2.0)
- Returns an OAIError object which represents one of the OAI Errors returned by the last request to the repository;
the index parameter indicates which error to return: 0 to LastOAIErrorCount-1; if there is no Error at a specific index Nothing is returned.
- LastOAIErrorCount read-only (2.0)
- The number of OAI errors returned by the last request to this repository.
- MaxRetryMinutes read/write
- The maximum allowable minutes to wait for a retry without failing. If a repository returns a 503 status with a retry-after field
which specifies a retry period which exceeds this value, an error will be raised. The default value is 60 minutes.
- ProtocolMajorVersion read-only
- The major version number of the OAI protocol supported by the repository, currently 1 or 2
- ProtocolVersion read-only
- The version of the OAI protocol supported by the repository
- RawResponse read-only
- Returns a string containing the raw response from the last OAI request made to this repository, mostly intended for debugging purposes.
- RepositoryIdentifier read-only
- If one of the descriptions returned by the Identify request is an oai-identifier, this parameter will contain the registered identifier
of the repository. Also, if this Repository was returned by the OAIRegRepoListObj object, it will have the value specified by that object.
If there is no oai-identifier description, then an empty string will be returned, or if Validation is Very Strict an error.
- RepositoryName read-only
- A human readable name for the repository
- RequestBaseURL read-only
- The Request Base URL (minus all query string params) returned by the most recent request to the repository. If validation is loose and there is a missing requestURL,
an empty string will be returned; otherwise, an error will be raised.
- RequestFrom read-only
- The 'from' query parameter returned by the most recent response from the repository.
- RequestIdentifier read-only
- The 'identifier' query parameter returned by the most recent response from the repository.
- RequestMetadataPrefix read-only
- The 'metadataPrefix' query parameter returned by the most recent response from the repository.
- RequestResumptionToken read-only
- The 'resumptionToken' query parameter returned by the most recent response from the repository.
- RequestSet read-only
- The 'set' query parameter returned by the most recent response from the repository.
- RequestUntil read-only
- The 'until' query parameter returned by the most recent response from the repository.
- RequestURL read-only
- The Request URL returned by the most recent request to the repository. This is the RequestBaseURL with a concatenated
query string for each of the query parameters. If validation is loose and there is a missing requestURL element or request element,
an empty string will be returned; otherwise, an error will be raised.
- RequestVerb read-only
- The 'verb' query parameter returned by the most recent response from the repository.
- ResponseDate read-only
- The Response Date returned by the most recent request to the repository. If validation is loose and there is a missing responseDate,
an empty string will be returned; otherwise, an error will be raised.
- RetryLimit read/write
- The number of times to retry if a HTTP status of 503 is returned by the repository; defaults to 5
- SampleIdentifier read-only
- If one of the descriptions returned by the Identify request is an oai-identifier, this parameter will contain the sample OAI
identifier contained therein. If there is no oai-identifier description, then an empty string will be returned, or if Validation
is Very Strict an error.
- UserAgent read/write
- The value to be used in the User-Agent field of the HTTP request header. This is usually the name of the harvester.
Defaults to 'OAIHarvesterObj V University of Illinois Library' where V is the revision number of this OAIRepositoryObj object
- Validation read/write
-
Sets the type of validation to perform on OAI responses:
- ValidationStrict (0)
- This is the default. The only check which is initially performed is if the XML is well-formed. If it is not well-formed,
including invalid characters, an error will be generated and processing will stop. However, the program may still generate
errors if the XML does not contain certain expected elements.
- ValidationVeryStrict (1)
- This will cause the XML responses to be initially validated against the XML schemas, as indicated by the xsi:schemaLocation
attributes. If the validation passes, this program should encounter no further errors.
- ValidationLoose (2)
- This will attempt to continue processing even if some non-well-formed XML is encountered. In most case a dummy record
will be created which contains the invalid record in some fashion. If there is a resumptionToken, basic string parsing
techniques will be used to get the value, so it can be used to continue with the next chunk of data.
Methods
- GetEPrintsDescription
- If one of the descriptions returned by the Identify request is an eprints, this method will return the eprints description as
an XML DOMDocument40 object. Nothing is returned if there is no E-Prints description.
- GetOAIIdentifierDescription
- If one of the descriptions returned by the Identify request is an oai-identifier, this method will return the oai-identifier
description as an XML DOMDocument40 object. Nothing is returned if there is no OAI-Identifier description.
- GetRecord(Identifier, [MetadataPrefix])
- Returns an OAIRecordObj object for the given OAI Identifier; the MetadataPrefix defaults to oai_dc if omitted
- GetTimeouts()
-
Returns an array with four values:
- GetTimeouts(0) = resolveTimeout
- A long integer. The value is applied to mapping host names (such as "www.microsoft.com") to IP addresses;
the default value is 0, meaning no timeout.
- GetTimeouts(1) = connectTimeout
- A long integer. The value is applied to establishing a communication socket with the target server, with a default
timeout value of 60 seconds.
- GetTimeouts(2) = sendTimeout
- A long integer. The value applies to sending an individual packet of request data (if any) on the communication socket
to the target server. A large request sent to a server will normally be broken up into multiple packets; the send timeout
applies to sending each packet individually. The default value is 30 seconds.
- GetTimeouts(3) = receiveTimeout
- A long integer. The value applies to receiving a packet of response data from the target server. Large responses will be
broken up into multiple packets; the receive timeout applies to fetching each packet of data off the socket.
The default value is 1800 seconds (30 minutes). This applies to all requests except for Identify which uses 1/10 of this value.
- Identify([url])
- Send an Identify request to a repository; if the url parameter is set, it becomes the new BaseURL for this object;
if it is not set the BaseURL property which has been previously set is used; if the Identify request is successful,
the RepositoryName will be returned
- ListIdentifiers([untild] , [fromd], [SetSpec], [MetadataPrefix])
- Returns an OAIRecordListObj object containing the records returned by the repository for the given
MetadataPrefix, untild, fromd, and SetSpec. MetadataPrefix is only supported by OAI 2.0 repositories. It is
ignored for OAI 1.x repositories.
- ListMetadataFormats([Identifier])
- Returns an OAIMetaDataFrmtListObj object containing the metadata formats supported by the repository or by a specific record
- ListRecords([MetadataPrefix], [untild], [fromd], [SetSpec])
- Returns an OAIRecordListObj object containing the records returned by the repository for the given MetadataPrefix,
untild, fromd, and SetSpec
- ListSets()
- Returns an OAISetListObj object containing the sets returned by the repository
- SetTimeouts([resolveTimeout],[connectTimeout],[sendTimeout],[receiveTimeout])
-
Sets various timeout values used for HTTP:
- resolveTimeout
- A long integer. The value is applied to mapping host names (such as "www.microsoft.com") to IP addresses;
the default value is 0, meaning no timeout.
- connectTimeout
- A long integer. The value is applied to establishing a communication socket with the target server,
with a default timeout value of 60 seconds.
- sendTimeout
- A long integer. The value applies to sending an individual packet of request data (if any) on the communication
socket to the target server. A large request sent to a server will normally be broken up into multiple packets;
the send timeout applies to sending each packet individually. The default value is 30 seconds.
- receiveTimeout
- A long integer. The value applies to receiving a packet of response data from the target server.
Large responses will be broken up into multiple packets; the receive timeout applies to fetching each
packet of data off the socket. The default value is 1800 seconds (30 minutes). This applies to all
requests except for Identify which uses 1/10 of this value.
- UsesEPrints
- Returns True if the Identify request includes an eprints description; otherwise False
- UsesOAIIdentifier
- Returns True if the Identify request includes an oai_identifier description; otherwise False
OAIRecordObj
Module representing an OAI Record. The record may be an Identifier-only record, meaning it contains only the record
identifier and possibly a status. If an attempt is made to access the metadata from an Identifier-only record,
a GetRecord will be performed, turning the recored into a full record.
This object is returned either by the OAIRepositoryObj.GetRecord method or by the OAIRecordListObj.CurrentItem property.
Properties
- About([index]) read-only
- Returns an about section of the record as an XML DOMDocument, if there is no about section at the given
index then Nothing is returned. The index parameter indicates which about to return:
0 to AboutCount-1; if there is no About at a specific index Nothing is returned.
Repositories prior to OAI 2.0 supported only a single About.
- AboutCount read-only
- The number of about sections associated with the record. Repositories prior to OAI 2.0 supported only a single About.
- AboutNamespaceURI([index]) read-only
- Returns the namespace URI of an about section of the record, if there is no about section an Empty variant is returned
The index parameter indicates which about namespace to return:
0 to AboutCount-1; if there is no About at a specific index an Empty variant is returned.
Repositories prior to OAI 2.0 supported only a single About.
- Class read-only
- The name of this class 'OAIRecord'
- DateStamp read-only
- Returns the Datestamp of the record as a String
- Deleted read-only
- Returns True if the record has a status attribute of 'deleted'
- Identifier read-only (default property)
- Returns the OAI identifier of the record
- IdentifierOnly read-only
- Returns True if this is an identifier-only record, meaning that it was probably created as a result of a ListIdentifiers request;
else False; an identifier-only record can be explicitly converted to a complete record by calling the RefreshRecord method;
accessing any of the properties or methods which return metadata will also implicitly convert it to a complete record
- Metadata read-only
- Returns the metadata section of the record as an XML DOMDocument, if there is no metadata section Nothing is returned
- MetadataNamespaceURI read-only
- Returns the metadata namespace URI of the record, if there is no metadata section an Empty variant is returned
- MetadataPrefix read-only
- Returns the metadata prefix used to create the record; the metadata prefix of the record can be changed by calling the RefreshRecord method
- Record read-only
- Returns the complete record as an XML DOMDocument40 object; includes everything starting at the <record> tag
- SetSpec([index]) read-only
- Returns a setSpec associated with the record. The index parameter indicates which setSpec to return:
0 to SetSpecCount-1; if there is no SetSpec at a specific index an empty string is returned.
Repositories prior to OAI 2.0 do not support this property.
- SetSpecCount read-only
- The number of setSpecs associated with the record. Repositories prior to OAI 2.0 do not support this property.
Methods
- IsRecordValid
- Returns True if the record appears to be valid (well-formed, and if the Validation is Very Strict also valid according to the XML Schemas);
if the Validation is Loose and the record is not well-formed, False is returned
- RefreshRecord([meta])
- This will re-retrieve the record from the repository; this can be used to turn a identifier-only record into a complete
record or to change the record to a different metadataPrefix; if the meta parameter is blank, the current MetadataPrefix will be used
OAIRecordListObj
Module representing a list of OAI Records, as returned by the ListRecords or ListIdentifiers OAI requests.
This module is similar to a read-only, forward-only database cursor. It will automatically handle resumptionTokens
and any other flow control used by a repository, such as HTTP redirects or retries.
This object is returned either by the OAIRepositoryObj.ListIdentifiers or the OAIRepositoryObj.ListRecords methods.
Properties
- Class read-only
- The name of this class 'OAIRecordList'
- CompleteListSize read-only (2.0)
- Returns the count of the total number of records in the list, or -1 if this value is unknown. If an OAI 2.0 resumptionToken
includes a completeListSize attribute, that value will always be used for the property. Otherwise, this value will be unknown (-1)
until the very last part of the list is retrieved from the repository (there is no resumptionToken or it is empty). Then this property
will return the actual number of items which have been retrieved.
- CurrentIndex read-only
- Returns the index number of the current record in the list, ranging from 0 to CompleteListSize - 1.
- CurrentItem read-only (default property)
- Returns and OAIRecordObj object for the current record in the list
- MoreItems read-only
- Returns True if there are more records in the record list; else False
- OAIRepositoryObj read-only
- Returns the OAIRepositoryObj object from which this list was created
Methods
- IsListValid
- Returns True if the record list appears to be valid (well-formed, and if the Validation if Very Strict
also valid according to the XML Schemas); if the Validation is Loose and the record is not well-formed, False is returned
- MoveNext
- Moves the cursor location to the next record in the list
- Requery
- This will reset the entire list to the beginning, redoing the query from scratch
OAIMetadataFormatObj
Module representing an OAI Metadata Format.
This object is returned by the OAIMetaDataFrmtListObj.CurrentItem property.
Properties
- Class read-only
- The name of this class 'OAIMetadataFormat'
- MetadataNamespace read-only
- The XML namespace of this metadata format
- MetadataPrefix read-only (default property)
- The prefix used for this metadata format.
- Schema read-only
- The URL of the XML schema for this metadata format
Methods
- IsMetadataFormatValid
- Returns True if the record list appears to be valid (well-formed, and if the Validation if Very Strict also
valid according to the XML Schemas); if the Validation is Loose and the record is not well-formed, False is returned
OAIMetaDataFrmtListObj
Module representing a list of Metadata Formats, as returned by the ListMetadataFormats OAI request.
This module is similar to a read-only, forward-only database cursor. It will automatically handle resumptionTokens
and any other flow control used by a repository, such as HTTP redirects or retries.
This object is returned by the OAIRepositoryObj.ListMetadataFormats method.
Properties
- Class read-only
- The name of this class 'OAIMetadataFormatList'
- CompleteListSize read-only (2.0)
- Returns the count of the total number of metadata formats in the list, or -1 if this value is unknown. If an OAI 2.0 resumptionToken
includes a completeListSize attribute, that value will always be used for the property. Otherwise, this value will be unknown (-1)
until the very last part of the list is retrieved from the repository (there is no resumptionToken or it is empty). Then this property
will return the actual number of items which have been retrieved.
- CurrentIndex read-only
- Returns the index number of the current metadata format in the list, ranging from 0 to CompleteListSize - 1.
- CurrentItem read-only (default property)
- Returns an OAIMetadataFormatObj object for the current record in the list
- MoreItems read-only
- Returns True if there are more records in the record list; else False
- OAIRepositoryObj read-only
- Returns the OAIRepositoryObj object from which this list was created
Methods
- IsListValid
- Returns True if the record list appears to be valid (well-formed, and if the Validation if Very Strict also
valid according to the XML Schemas); if the Validation is Loose and the record is not well-formed, False is returned
- MoveNext
- Moves the cursor location to the next record in the list
- Requery
- This will reset the entire list to the beginning, redoing the query from scratch
OAISetObj
Module representing an OAI Set.
This object is returned by the OAISetListObj.CurrentItem method.
Properties
- Class read-only
- The name of this class 'OAISet'
- SetDescription([index]) read-only (2.0)
- One of the set descriptions associated with the set as an XML DOMDocument40 object;
the index parameter indicates which description to return: 0 to DescriptionCount-1; if there is no description Nothing returned
- SetDescriptionCount read-only (2.0)
- The number of descriptions associated with the set
- SetName read-only
- The human-readable name of the set
- SetSpec read-only (default property)
- The identifier for the set
Methods
- IsSetValid
- Returns True if the set appears to be valid (well-formed, and if the Validation if Very Strict also valid according to the XML Schemas);
if the Validation is Loose and the record is not well-formed, False is returned
OAISetListObj
Class representing a list of Sets, as returned by the ListSets OAI request. This class is similar to a read-only, forward-only database cursor.
It will automatically handle resumptionTokens and any other flow control used by a repository, such as HTTP redirects or retries.
This object is returned by the OAIRepositoryObj.ListSets method.
Properties
- Class read-only
- The name of this class 'OAISetList'
- CompleteListSize read-only (2.0)
- Returns the count of the total number of sets in the list, or -1 if this value is unknown. If an OAI 2.0 resumptionToken
includes a completeListSize attribute, that value will always be used for the property. Otherwise, this value will be unknown (-1)
until the very last part of the list is retrieved from the repository (there is no resumptionToken or it is empty). Then this property
will return the actual number of items which have been retrieved.
- CurrentIndex read-only
- Returns the index number of the current set in the list, ranging from 0 to CompleteListSize - 1.
- CurrentItem read-only (default property)
- Returns an OAISetObj object for the current record in the list
- MoreItems read-only
- Returns True if there are more records in the record list; else False
- OAIRepositoryObj read-only
- Returns the OAIRepositoryObj object from which this list was created
Methods
- IsListValid
- Returns True if the record list appears to be valid (well-formed, and if the Validation if Very Strict also valid according to the
XML Schemas); if the Validation is Loose and the record is not well-formed, False is returned
- MoveNext
- Moves the cursor location to the next record in the list
- Requery
- This will reset the entire list to the beginning, redoing the query from scratch
OAIErrorObj (2.0)
Module representing an OAI 2.0 Error response.
This object is returned by the OAIRepositoryObj.LastOAIError property.
Properties
- Class read-only
- The name of this class 'OAIError'
- Code read-only (default property)
- The standard OAI code for this error: cannotDisseminateFormat, idDoesNotExist, badArgument, badVerb,
noMetadataFormats, noItemsMatch, badGranularity, badResumptionToken, or noSetHierarchy. See the OAI 2.0 specification
for an explanation of these error codes.
- Reason read-only
- The optional, human-readable explanation of the error
OAIResumptionStream
This class is used internally by other classes to handle all of the OAI responses which represent a list of values:
OAIRecordListObj, OAIMetaDataFrmtListObj, and OAISetListObj. This is the class that allows the other classes to implement the forward-only
cursor and transparently handle resumptionTokens, flow control, and other nuances of the OAI protocol.
This is a private, internal class, and it is included for information only.
TO DO: Clean up the interface for this object. For example, the baseURL property isn't really needed.
Properties
- BaseURL read-only
- The BASE-URL used for the request
- Class read-only
- The name of this class 'OAIResumptionStream'
- CompleteListSize read-only (2.0)
- Returns the count of the total number of items in the list, or -1 if this value is unknown. If an OAI 2.0 resumptionToken
includes a completeListSize attribute, that value will always be used for the property. Otherwise, this value will be unknown (-1)
until the very last part of the list is retrieved from the repository (there is no resumptionToken or it is empty). Then this property
will return the actual number of items which have been retrieved.
- Index read-only
- Returns the index number of the current item in the list, ranging from 0 to CompleteListSize - 1.
- Item read-only (default property)
- Returns an IXMLDOMNode object for the current object in the list. The type of node returned will depend on the type of request
(the verb parameter)
- More read-only
- Returns True if there are more objects which can be returned; else False
- Params read-only
- Returns the query string parameters used for the request (minus the verb parameter)
- Repository read-only
- Returns the OAIRepositoryObj object from which this list was created
- RequestURL read-only
- The Request URL returned by the most recent request. If validation is loose and there is a missing requestURL,
an empty string will be returned; otherwise, an error will be raised.
- ResponseDate read-only
- The Response Date returned by the most recent request. If validation is loose and there is a missing responseDate,
an empty string will be returned; otherwise, an error will be raised.
- ResponseSize read-only
- Returns the number of items returned by the most recent response.
- ResumptionCursor read-only (2.0)
- Returns the cursor position (or Index) representing the beginning of the most response response. If an OAI 2.0 resumptionToken
includes a cursor attribute, that value will always be used for the property. Otherwise, the value is calculated based on the
total number of items retrieved thus far.
- ResumptionExpirationDate read-only (2.0)
- For OAI 2.0 resumptionTokens, returns the expiration date of the token. If there is no expirationDate or if the repository is
only OAI 1.x compliant, and empty string is returned.
- Verb read-only
- The verb parameter used for this request
Methods
- Initialize(repo, url, verb, [params])
- Initialize the OAIResumptionStream. The repo is the OAIRepositoryObj object which is initiating the request.
The url is the URL of the repository. The verb is the request verb parameter, and the optional params are the other
query string parameters to use for the request.
- IsResponseValid
- Returns True if the response appears to be valid (well-formed, and if the Validation if Very Strict also valid according
to the XML Schemas); if the Validation is Loose and the record is not well-formed, False is returned
- MoveNext
- Moves the cursor location to the next object in the list
- Requery
- This will reset the entire list to the beginning, redoing the query from scratch
Utilities
This class mostly contains methods for manipulating dates in various formats, and setting various dates associated with files.
This object may be created using the New operator. Its ProgID is 'OAIHarvesterObj.Utilities', and its VB Class Name is 'Utilities'.
Properties
- Class read-only
- The name of this class 'Utilities'
Methods
- DateToHTTPDate(date)
- Convert a VB Date object into an HTTP-Date string suitable for use in an HTTP header. The HTTP-Date format used is RFC1123.
- GetFileTimes(file_name, creation_date, access_date, modified_date, local_time)
- Returns all the various date/times associated with a file. For the given file_name: creation_date, access_date, and modified_date are all
returned. If the local_time param is True, then dates are local time, else they are UTC. The function returns True if it fails for any reason,
else it returns False.
- HTTPDateToDate(HTTPDate)
- Returns a VB Date object that corresponds the given HTTP-Date string, taken from an HTTP header field.
- ISO8601ToDate(ISODate, [EndOfDay])
- Returns a VB Date object that corresponds to the given ISO8601 Date string. The optional EndOfDay parameter indicates whether
the date should correspond to the beginning or end of the day, if the time component is omitted. The default is False, meaning that if the
time component is omitted, the time corrsponds the beginning of the day (...T00:00:00Z). If this parameter is True and the time component
is omitted, the time corresponds to the end of the day (...T23:59:59Z).
- NowUTC
- Returns the current date/time, the same as the VB Now() function, except the date/time is expressed as a UTC date/time.
- SetFileAccessedDate(file_name, accessed_date, local_times)
- Sets the last accessed date of the given file_name. If the local_time param is True, then dates are local time, else they are UTC.
The function returns True if it fails for any reason, else it returns False.
- SetFileAccessModifiedDate(file_name, accessed_date, local_times)
- Sets the last accessed date and the last modified date of the given file_name. If the local_time param is True, then dates are local time, else they are UTC.
The function returns True if it fails for any reason, else it returns False.
- SetFileCreatedDate(file_name, accessed_date, local_times)
- Sets the created date of the given file_name. If the local_time param is True, then dates are local time, else they are UTC.
The function returns True if it fails for any reason, else it returns False.
- SetFileModifiedDate(file_name, accessed_date, local_times)
- Sets the last modified date of the given file_name. If the local_time param is True, then dates are local time, else they are UTC.
The function returns True if it fails for any reason, else it returns False.
- SetFileTimes(file_name, creation_date, access_date, modified_date, local_time)
- Sets all the various date/times associated with a file. For the given file_name: creation_date, access_date, and modified_date are all
set to the given values. If the local_time param is True, then dates are local time, else they are UTC. The function returns True if it fails for any reason,
else it returns False.
- Touch(file_name, [date], [settime])
- Set the last accessed or modified dates on a given file_name. If the date parameter is given the file dates will be set to that date, else
the current date will be used. The settime parameter indicates which date is to be set. The default is both the accessed and modified dates.
However if settime is 'a' then only the accessed date is set, or if settime is 'm' then only the modified date is set. This function corresponds
to the 'touch' command which is available on many Unix systems. The function returns True if it fails for any reason,
else it returns False.
Errors
- No BaseURL [-2147219403]
- A property or method which depends on contacting an OAI Provider site is being accessed without first setting the BaseURL
property of the OAIRepositoryObj.
- XML parse error: number (line:linepos) description [-2147219402]
- The XML parser has detected an XML error. If Validation is Strict this will be a well-formedness error, possible an invalid
Unicode character. If Validation is Very Strict it could also be that the response does not validate against the XML Schema.
This error should never occur if Validation is Loose.
- The RepositoryIdentifier is unknown [-2147219401]
- The Identify request did not return an oai-identifier description, so this property is not available.
- No more sets [-2147219400]
- An attempt has been made to MoveNext past the end of a list of records.
- Invalid verb [-2147219399]
- An attempt to use a verb parameter value that is not supported by the OAI protocol has been made.
- Not initialized [-2147219398]
- An attempt to use an uninitialized OAIResumptionStream has been made.
- Element 'tag' is unknown [-2147219397]
- An OAIRecordListObj contains elements which are not legal according to the OAI protocol.
The only legal elements are <identifier> or <record>.
- HTTP status statusText [-2147219396]
- The OAI provider returned an unexpected HTTP status code, such as 400. The only HTTP status codes currently
expected are 200 OK, 30x (redirects), or 503 Unavailable.
- This is an identifier-only record [-2147219395]
- This error is currently unused. It would occur if an attempt is made to access a property of an identifier-only OAIRecordObj;
however, attempts to do this will currently automatically convert these types of records into complete records.
- The RetryLimit 'limit' has been exceeded (HTTP 503) [-2147219394]
- In the case of an HTTP 503 status, the maximum number of allowable retries has been exceeded.
- 'value' is not a valid retry-after header [-2147219393]
- An HTTP retry-after header is missing or has a value which cannot be interpreted.
- Record failed to refresh [-2147219392]
- A failed attempt has been made to Refresh an OAIRecordObj. This could be because the metadataPrefix is not supported or other reasons.
- Invalid protocol response: reason [-2147219391]
- The XML response returned by the OAI provider is not valid, usually because it is missing a key element such as <responseDate> or
<requestURL>.
- There is no Eprints description [-2147219390]
- An attempt has been made to access the eprints description of a repository, but the repository does not have an eprints description.
- Retry after has exceeded the limit of limit minutes [-2147219389]
- In the case of an HTTP 503 status, the maximum allowable retry-after value has been exceeded.
- The RetryLimit 'limit' has been exceeded (number:description) [-2147219388]
- In the case of an HTTP send error, the maximum number of allowable retries has been exceeded. The error number and description are
included at the end of the error message.
- OAI Error code: reason [-2147219387] (2.0)
- An OAI 2.0 repository has returned one or more error responses. Only the first error response will be represented by this error. To
access any additional error responses, use the OAIRepositoryObj.LastOAIErrorCount and OAIRepositoryObj.LastOAIError properties.
- 'property is not supported by OAI 1.x repositories [-2147219386] (2.0)
- An attempt was made to access an OAI 2.0 property or method which is not supported by OAI 1.x repositories. This only
occurrs for mandatory OAI 2.0 properties. Optional OAI 2.0 properties will just return a default or unknown value indicator.
- 'Date' is not a valid date format [-2147219385]
- A date has been encountered which does not conform to the expected format either HTTP-Date or ISO8601 used by the OAI protocol.
- Resumption token has expired [-2147219384] (2.0)
- A resumption token has expired, and the harvest must be restarted.