TNS Internal:NDR/API/2.0/specification/deleteContent

From NSDLWiki

Jump to: navigation, search


 NDR Project Documentation   Conceptual Framework   v1.0 NDR-API Index   v2.0 NDR-API Index   Model 

Under Construction
Proposed method for inclusion in NDR/API 2.x.

Please provide feedback and comments in the NSDL Data Repository (NDR) API 2.0 Forum of the NSDL Community Forums.


NDR API Documentation - deleteContent

Delete content stored in the NDR also removing the registration of the content and optionally cascading to any annotations related to the registered resource.



Request URL

http://ndr.nsdlib.org/api/deleteContent/[handle]?cascade=[cascade]&purge=[purge]
where [handle][cascade], and [purge] are defined in the Arguments section.
Must be an HTTP POST request.
WARNING: Use of purge=true will permanently and irrevocably remove from the NDR the stored content and all related metadata records and annotations.

NOTE: The agent making this request must have permissions sufficient to delete the stored content and, if cascading, all related metadata records and annotations for this request to complete successfully.
Arguments

Parameters on Request URL:

  • [handle] (optional) - the externally resolvable identifier of the stored content (returned by addContent)
  • [cascadeValue] (optional) - cascade deletes to annotations related to this stored content
    • cascade=true - cascade to annotations
    • cascade=false (default) - do not cascade NOTE: An error message will be returned if annotations exist related to the stored content.
  • [purgeValue] (optional) - determines whether objects are permanently purged from the repository or marked as deleted
    • purge=true - permanently and irrevocably remove the stored content and, if cascading, all annotations that are related to this stored content from the repository
    • purge=false (default) - mark as deleted the stored content and, if cascading, all annotations that are related to this stored content



Request URL Example

Below is an example of a request URL for deleting content from the NDR.

http://ndr.nsdlib.org/api/deleteContent/2200/20061212656/cascade=true



Behaviors

WARNING: Use of purge=true will permanently and irrevocably remove from the NDR the stored content and, if cascading, all related metadata records and annotations.


IMPORTANT NOTE: Deleting stored content can optionally cascade to deleting all metadata and annotations that are related to the stored content. If cascade=false and related metadata or annotations exist, the delete will fail.


By default, 'deleting' stored content in the NDR via deleteContent does not actually remove the stored content and related objects from the NDR; it changes the objects' states to 'Deleted'. In this case, deleteContent is a non-destructive operation. No data is lost upon delete, and any deleted object can be undeleted as desired. If purge=true parameter is part of the request, then the stored content and related objects are permanently and irrevocably removed from the NDR.

Any stored content and related objects that are marked as deleted are invisible to all API requests unless explicitly referenced by handle or state. For example:


Response

Structure of response:

  • handle - the externally resolvable identifier for the deleted Stored Content.


Response Example

Below is an example response for this request.

<?xml version="1.0" encoding="UTF-8"?>
<NSDLDataRepository schemaVersion="1.00.000" 
    xmlns="http://ns.nsdlib.org/ndr/response_v2.00/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ns.nsdlib.org/ndr/response_v2.00/ http://ns.nsdlib.org/schemas/ndr/response_v2.00.xsd">
  <responseTime>2006-04-10T18:07:53Z</responseTime>
  <requestURL>http://ndr.nsdlib.org/api/deleteContent/[handle]?cascade=[cascade]&purge=[purge]</requestURL>
  
  <resultData>
    <handle>2200/20061212656</handle>
  <resultData>
</NSDLDataRespository>



API Links:


Additional Links Related to This Call:

Personal tools