SDRService Class Reference

Provide input/ouput service for the SDR metadata database. More...

Inheritance diagram for SDRService:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 getProjects ()
 INSERT BRIEF DESCRIPTION HERE.
 getProjectsForResource ($cserdId)
 Get an array of SDRProjects (collections) bound to a resource.
 init ()
 Initialize the SDRService and create the database interface.

Static Public Member Functions

static addMetadataEditor ($prm, $projectName='CSERD', $cserdId=null, $versionId=null)
 Get the xml for an xform that conatins all the fields associated with the given project. If a value is passed in for CSERD id, the form will be prefilled with metadata from the existing resource.
static approve ($version, $agent, $state=SDRVersion::STATE_LIVE)
 Make this metadata version the approved version for its resource Id.
static buildMetadataForm ($cserdId=null, $projectName, $versionId=null)
 Get the xml for an xform that conatins all the fields associated with the given project. If a value is passed in for CSERD id, the form will be prefilled with metadata from the existing resource.
static buildMetadataFormObject ($cserdId=null, $projectName, $versionId=null)
 Get the XForms object for an xform that conatins all the fields associated with the given project. If a value is passed in for CSERD id, the form will be prefilled with metadata from the existing resource.
static cserdIdExists ($id)
 Check to see whether a resource with a given ID exists in SDR.
static fieldsForProject ($project)
 INSERT BRIEF DESCRIPTION HERE.
static findResourcesByIdentifier ($identifier, $limit=null)
 INSERT BRIEF DESCRIPTION HERE.
static getCserdIdForURL ($url)
 Get the resource id (CSERD id) of an item given its URL.
static getDBI ()
 Get the DBI2 (database interface) object for SDR.
static getLastModifiedVersion ($identifier)
 Get the last SDRVersion for a cserdId.
static getMetadata ($identifier, $versionId=null)
 Get metadata for a given CSERD Id.
static getResource ($identifier)
 Get an SDRResource object based on a cserdId.
static getURLForCserdId ($id)
 Get the URL of an item given its resource id (CSERD id).
static getVersion ($identifier, $state=SDRVersion::STATE_LIVE)
 Get the live (or dev) SDRVersion for a cserdId.
static identifierToCserdId ($cserdId)
 Convert identifier (either URL or ID) to a resource Id. Return null if not found.
static identifierToURL ($cserdId)
 Convert identifier (either URL or ID) to a URL. Return null if not found.
static reject ($version, $agent)
 Reject this metadata version (move it to a rejected state).
static submit ($cserdId, $metadata, $agent, $comment, $projectName=null)
 Submit a new metadata version for a cserdId (id or URL). If the cserdId does not exist, create that resource now.
static updateReleaseFlag ($cserdId, $value, $agent)
 Update the release flag for a resource.
static URLExists ($url)
 Check to see whether a resource with a given URL exists in SDR.
static valuesForField ($field)
 INSERT BRIEF DESCRIPTION HERE.
static versionsForResource ($cserdId)
 INSERT BRIEF DESCRIPTION HERE.


Detailed Description

Provide input/ouput service for the SDR metadata database.

Member Function Documentation

static SDRService::addMetadataEditor ( prm,
projectName = 'CSERD',
cserdId = null,
versionId = null 
) [static]

Get the xml for an xform that conatins all the fields associated with the given project. If a value is passed in for CSERD id, the form will be prefilled with metadata from the existing resource.

Parameters:
$prm [PageRender2]: The instance of PageRender where this editor will be displayed.
$cserdId [int]: The id for this item if it already exists.
$projectName [string]: The name of the project the form you want to build is for (different fields for different projects).
Returns:
cserdId on success, -1 on failure

Build the xform

static SDRService::approve ( version,
agent,
state = SDRVersion::STATE_LIVE 
) [static]

Make this metadata version the approved version for its resource Id.

Parameters:
$version [SDRVersion]: The version to approve
$agent [SDRAgent]: The agent performing this action.
$state [string]: The state this version should become.
Returns:
[bool]: True on success, false on error.

static SDRService::buildMetadataForm ( cserdId = null,
projectName,
versionId = null 
) [static]

Get the xml for an xform that conatins all the fields associated with the given project. If a value is passed in for CSERD id, the form will be prefilled with metadata from the existing resource.

Parameters:
$cserdId [int]: The id for this item if it already exists.
$projectName [string]: The name of the project the form you want to build is for (different fields for different projects).
Returns:
[String] a string of XML for an XForm containing all the appropriate metadata fields

static SDRService::buildMetadataFormObject ( cserdId = null,
projectName,
versionId = null 
) [static]

Get the XForms object for an xform that conatins all the fields associated with the given project. If a value is passed in for CSERD id, the form will be prefilled with metadata from the existing resource.

Parameters:
$cserdId [int]: The id for this item if it already exists.
$projectName [string]: The name of the project the form you want to build is for (different fields for different projects).
Returns:
[Form] an XForm object containing all the appropriate metadata fields

static SDRService::cserdIdExists ( id  )  [static]

Check to see whether a resource with a given ID exists in SDR.

Parameters:
$id [string]: The ResourceId (CSERD id) in question
Returns:
[bool]: True if the resource exists, false if not

static SDRService::fieldsForProject ( project  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$project [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static SDRService::findResourcesByIdentifier ( identifier,
limit = null 
) [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$identifier [TYPE]: DESCRIPTION
$limit [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static SDRService::getCserdIdForURL ( url  )  [static]

Get the resource id (CSERD id) of an item given its URL.

Parameters:
$url [string]: The URL of the item
Returns:
[mixed]: The resource id of the item if it exists; false if it is not found

static SDRService::getLastModifiedVersion ( identifier  )  [static]

Get the last SDRVersion for a cserdId.

Parameters:
$identifier [mixed]: Catalog ID number or URL
Returns:
[SDRVersion]: The current approved version object of the metadata (which includes its submission information), null if not found, or false on error

static SDRService::getMetadata ( identifier,
versionId = null 
) [static]

Get metadata for a given CSERD Id.

Parameters:
$identifier [mixed]: Catalog ID number or URL
Returns:
[SDRMetadataObj]: The metadata; null if none is live/found

SDRService::getProjects (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRService::getProjectsForResource ( cserdId  ) 

Get an array of SDRProjects (collections) bound to a resource.

Parameters:
$cserdId [mixed]: id number or URL for a resource
Returns:
[array]: An array of SDRProject objects

static SDRService::getResource ( identifier  )  [static]

Get an SDRResource object based on a cserdId.

Parameters:
$identifier [mixed]: Catalog ID number or URL
Returns:
[SDRResource]: The resource for this ID, null if not found, or false on error.

static SDRService::getURLForCserdId ( id  )  [static]

Get the URL of an item given its resource id (CSERD id).

Parameters:
$id [int]: The resource id of the item
Returns:
[mixed]: The URL of the item if it exists; false if it is not found

static SDRService::getVersion ( identifier,
state = SDRVersion::STATE_LIVE 
) [static]

Get the live (or dev) SDRVersion for a cserdId.

Parameters:
$identifier [mixed]: Catalog ID number or URL
$state [mixed]: String or array containing possible states
Returns:
[SDRVersion]: The current approved version object of the metadata (which includes its submission information), null if not found, or false on error

static SDRService::identifierToCserdId ( cserdId  )  [static]

Convert identifier (either URL or ID) to a resource Id. Return null if not found.

Parameters:
$cserdId [mixed]: The URL or ID of the item
Returns:
[int]: The id number (cserdId) of the item

static SDRService::reject ( version,
agent 
) [static]

Reject this metadata version (move it to a rejected state).

Parameters:
$version [SDRVersion]: The version to reject
$agent [SDRAgent]: The agent performing this action.
Returns:
[bool]: True on success, false on error.

static SDRService::submit ( cserdId,
metadata,
agent,
comment,
projectName = null 
) [static]

Submit a new metadata version for a cserdId (id or URL). If the cserdId does not exist, create that resource now.

Parameters:
$cserdId [mixed]: Catalog ID number or URL
$metadata [SDRMetadataObj]: The metadata record
$agent [SDRAgent]: The agent performing this action.
$comment [string]: A comment about why this metadata was submitted.
$project [string]: project to submit to (will become the primary project for new items)
Returns:
[SDRVersion]; The version created by this submission. False if error.

static SDRService::updateReleaseFlag ( cserdId,
value,
agent 
) [static]

Update the release flag for a resource.

Parameters:
$cserdId [mixed]: Catalog ID number or URL
$value [mixed]: 1/true (for release) or 0/false (for not released)
$agent [SDRAgent]: The agent performing the action
Returns:
[bool]: True on success; false on failure

static SDRService::URLExists ( url  )  [static]

Check to see whether a resource with a given URL exists in SDR.

Parameters:
$url [string]: The URL in question
Returns:
[bool]: True if the resource exists, false if not

static SDRService::valuesForField ( field  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$field [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static SDRService::versionsForResource ( cserdId  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$cserdId [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:02:52 2010 for Common by  doxygen 1.5.6