Community:NDR/modifyAggregator

From NSDLWiki

Jump to: navigation, search

Contents

[hide]

NDR API Documentation

modifyAggregator

Modify an existing Aggregator object (see ObjectTypes) in the NDR.

Request URL

http://ndr.nsdl.org/api/modifyAggregator
Must be an HTTP POST request.

Arguments

  • inputXML (required) - while inputXML is required, no specific element is required for the modifyAggregator request. Only data desired to be added, deleted, or replaced should be included. The inputXML may lack or contain empty <properties>, <relationships> and/or <data> elements.

    • Relationships
      • [command] (strongly recommended, but optional) - best practice is to use only explicit "add" or "delete". The "replace" command will only succeed if the Aggregator object has less than two existing like relationships. See below.
        • aggregatorFor (optional) - the handle of the Agent object responsible for the aggregation. The NDR will ensure that Aggregator objects have exactly one aggregatorFor relationship.
        • associatedWith (optional) - the handle of the Resource object representing the actual aggregation (grouping) of objects. The NDR will ensure that Aggregator objects have no more than one associatedWith relationship.
        • memberOf (optional) - the handle of any Aggregator objects of which this Aggregator object is a member.

    • Datastreams
      • [command] (optional) - see below.
        • serviceDescription (optional) - If the command is "replace", the serviceDescription provided here will replace the existing serviceDescription in the Aggregator object. The NDR will ensure that Aggregator objects have exactly one serviceDescription datastream. If a serviceDescription is present in the request, the following elements are required or optional as indicated.
          • dc:title (required) - a short name for the Aggregator (a few words).
          • dc:description (required) - a description of the Aggregator.
          • dc:identifier (optional) - a URL appropriate to the Aggregator (e.g. the URL for a descriptive page about the aggregation).
          • image (optional) - a brand image to be associated with the Aggregator. If a brand image is included, all four fields below must be present.
            • brandURL - the URL from which the image can be uploaded. This should resolve to just the image itself, not to a page with a link to the image or to a page with the image as well as other information. The image must be of type jpg, gif or png. See http://metamanagement.comm.nsdlib.org/brandGuidelines.html.
            • title - text to be displayed if a web client doesn't display the image.
            • width - the width of the image, in pixels. Per the guidelines, the image must not be wider than 100 pixels.
            • height - the height of the image, in pixels. Per the guidelines, the image must not be taller than 30 pixels.
          • contacts (optional) - contact information to be associated with this Aggregator. While contact information is optional, it's very helpful to us if it is included.
            • contact - Each contact listed must include <name> and <email>, but the <info> element is optional.
              • name - the name of the person, entity or organization.
              • email - email address for the person, entity or organization
              • info - may contain additional information about the contact, such as "OAI administrator," "project lead," "technical", "metadata," etc.


where [command] is one of:

  • add - add the contained properties, relationships or datastreams to the object.
  • delete - remove the contained properties, relationships or datastreams from the object.
  • modify (default) - if the contained properties, relationships or datastreams already exist in the object, replace them with what is contained here. If the contained properties, relationships or datastreams do NOT exist in the object, add them.


Below is example inputXML for an Aggregator object to be modified. The object's existing associatedWith relationship (to object with handle 2200/999) will be deleted, and then a new associatedWith relationship, to object with handle 2200/666, will be added. A memberOf relationship (to object with handle 2200/NSDL_Collection_of_Collections_Aggregator) will also be added. The serviceDescription in the request below will replace the existing service description in this Aggregator object.
<?xml version="1.0" encoding="UTF-8"?>
<inputXML 
    xmlns="http://ns.nsdl.org/ndr/request_v1.00/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://ns.nsdl.org/ndr/request_v1.00/ http://ns.nsdl.org/schemas/ndr/request_v1.00.xsd" 
    schemaVersion="1.00.000">
  <aggregator>
    <properties />
    <relationships>
      <delete>
        <associatedWith>2200/999</associatedWith>
      </delete>
      <add>
        <associatedWith>2200/666</associatedWith>
        <memberOf>2200/NSDL_Collection_of_Collections_Aggregator</memberOf>
      </add>
    </relationships>
    <data>
      <serviceDescription xmlns:dc="http//purl.org/dc/elements/1.1/">
        <dc:title>Fred's Digital Classroom Math Resources Aggregation</dc:title>
        <dc:description>Collection of Fred's favorite Digital Classroom Math Resource items</dc:description>
        <dc:type>Aggregator</dc:type>
        <image>
          <brandURL>http://crs.nsdl.org/brands/1523829.jpg</brandURL>
          <title>Fred's Digital Classroom Math Resources</title>
          <width>100</width>
          <height>30</height>
        </image>
      </serviceDescription>
    </data>
  </aggregator>
</inputXML>
Note that an XML schema for the dc namespace (http://purl.org/dc/elements/1.1/) will be imported as part of the inputXML schema.
See also AddAggregator.

Response Fields

  • handle - the handle for the new Aggregator object

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<NSDLDataRepository 
    schemaVersion="1.00.000" 
    xmlns="http://ns.nsdl.org/ndr/response_v1.00/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http//ns.nsdl.org/ndr/response_v1.00/ http://ns.nsdl.org/schemas/ndr/response_v1.00.xsd">
  <responseTime>2006-04-10T18:07:53Z</responseTime>
  <requestURL>http://ndr.nsdl.org/api/modifyAggregator/2200/20061212666</requestURL>
  <resultData>
    <handle>2200/20061212666</handle>
  </resultData>
</NSDLDataRepository>

API Links:

Personal tools