Create an activity node from a template 

You can create activity nodes of type entry from an entry template. To do so, retrieve the Atom document of the entry template that you want to use, edit the document to contain your new entry content, and then post the edited Atom document to the activity's node list.

Table 1. Atom API entry request details

Method Resource URI Input representation
POST activity node list Value of the href attribute of the <app:collection> element of the activity. entry Atom document based on the entry template Atom document


To create an entry from an entry template:

  1. Retrieve the Atom document of the entry template that you want to use. See Retrieve entry templates for more details.

  2. Replace the category element that defines the template:

      <category 
         scheme="http://www.ibm.com/xmlns/prod/sn/type" 
         term="entrytemplate" 
         label="Entry Template">
        </category>

      with the following category element:

      <category 
       xmlns:snx="http://www.ibm.com/xmlns/prod/sn" 
       scheme="http://www.ibm.com/xmlns/prod/sn/type" 
       term="entry" 
       snx:template-id="794G09219C73CC5C30A4F106B852AD000136">
      </category>

  3. Post the updated Atom document to the activity using a request with the following syntax:

      POST /atom2/activity?activityUuid=793G09219C73CC5C30A4F106B852AD00012F 
       HTTP/1.1
      Host: activities.dulcinea.enterprise.com
      Content-Type: application/atom+xml
      Authorization: Basic xxx
      Content-Length: nnn 

Input

Provide an edited entry template Atom document as the new entry content. The content type of the Atom entry document must be application/atom+xml.


Output

None.

Returned HTTP headers

HTTP/1.1 201 Created

Location: url

Error codes

This is a sample of an entry template Atom document that has been retrieved to use as the basis for a new entry:

<entry 
 xmlns="http://www.w3.org/2005/Atom"   
 xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
  <id>urn:lsid:ibm.com:oa:794G09219C73CC5C30A4F106B852AD000136</id>
  <title type="text">New entry from entry template test</title>
  <updated>2009-01-02T20:45:07Z</updated>
  <published>2009-01-02T20:45:07Z</published>
  <author>
    <name>donquixote@dulcinea.com</name>
    <email>donquixote@dulcinea.com</email>
    <snx:userid 
     xmlns:snx="http://www.ibm.com/xmlns/prod/sn">donquixote@dulcinea.com
    </snx:userid>
    <snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
       177G09219C7341D31A078B4D3F1552000000
    </snx:ldapid>
  </author>
  <contributor>
    <name>donquixote@dulcinea.com</name>
    <email>donquixote@dulcinea.com</email>
    <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
     donquixote@dulcinea.com
    </snx:userid>
    <snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
     177G09219C7341D31A078B4D3F1552000000
    </snx:ldapid>
  </contributor>
      
  <category 
   scheme="http://www.ibm.com/xmlns/prod/sn/type" 
   term="entrytemplate" 
   label="Entry Template">
  </category>
  <thr:in-reply-to 
   xmlns:thr="http://purl.org/syndication/thread/1.0" 
   ref="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F" 
   type="application/atom+xml" 
   href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?
         activityNodeUuid=793G09219C73CC5C30A4F106B852AD00012F" 
   source="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F">
  </thr:in-reply-to>
  <snx:activity xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
   793G09219C73CC5C30A4F106B852AD00012F
  </snx:activity>
 
  <link 
   rel="edit" 
   type="application/atom+xml" 
   href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?
         activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >
  </link>
  <link 
   rel="self" 
   type="application/atom+xml" 
   href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?
         activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >
  </link>
  <link 
   rel="alternate" 
   type="application/xhtml+xml" 
   href="http://activities.dulcinea.enterprise.com/service/html/activityentry?
         uuid=794G09219C73CC5C30A4F106B852AD000136" >
  </link>
  <link 
   rel="alternate" 
   type="text/html" 
   href="http://activities.dulcinea.enterprise.com/service/html/activityentry?
         uuid=794G09219C73CC5C30A4F106B852AD000136" ></link>
  <snx:position xmlns:snx="http://www.ibm.com/xmlns/prod/sn">2000</snx:position>
  <snx:depth xmlns:snx="http://www.ibm.com/xmlns/prod/sn">1</snx:depth>  
 
  <snx:permissions 
   xmlns:snx="http://www.ibm.com/xmlns/prod/sn">none, create_activity, 
   view_activity, edit_activity, delete_activity, activity_owner, 
   edit_activity_tags, design_activity, edit_statements, delete_statements, 
   add_members, delete_members, create_entries, edit_personal_entries, 
   edit_all_entries, delete_personal_entries, delete_all_entries, 
   edit_personal_entry_tags, edit_all_entry_tags, view_members
  </snx:permissions>
  <summary type="text">
  </summary>
  <snx:field 
   xmlns:snx="http://www.ibm.com/xmlns/prod/sn" 
   name="new link" 
   fid="423G09219C73CC5C30A4F106B852AD000137" 
   position="1000" 
   type="link">
    <link href="" title=" "></link>
  </snx:field>
  <snx:field 
   xmlns:snx="http://www.ibm.com/xmlns/prod/sn" 
   name="$nodeType" 
   fid="4D9G09219C73CC5C30A4F106B852AD000138" 
   position="2000" 
   type="text" 
   hidden="true">
    <summary type="text">activities/entry</summary>
  </snx:field>
  <snx:field 
   xmlns:snx="http://www.ibm.com/xmlns/prod/sn" 
   name="$icon" 
   fid="7E2G09219C73CC5C30A4F106B852AD00013A" 
   position="3000" 
   type="file" 
   hidden="true">
    <link 
     rel="enclosure" 
     type="image/jpeg" 
     href="http://activities.dulcinea.enterprise.com/service/download/
           782G09219C73CC5C30A4F106B852AD00013B/icon_Don+Quixote+Image.jpg" 
     size="739"></link>
    <link 
     rel="edit-media" 
     type="image/jpeg" 
     href="http://activities.dulcinea.enterprise.com/service/download/
           782G09219C73CC5C30A4F106B852AD00013B/icon_Don+Quixote+Image.jpg" 
     size="739">
    </link>
  </snx:field>
</entry>

HTTP Request:

POST /atom2/activity?activityUuid=793G09219C73CC5C30A4F106B852AD00012F HTTP/1.1
Host: activities.dulcinea.enterprise.com
Content-Type: application/atom+xml
Authorization: Basic xxx
Content-Length: nnn 

The following sample is an entry based on the entry template:

<entry 
 xmlns="http://www.w3.org/2005/Atom"   
 xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
  <id>urn:lsid:ibm.com:oa:794G09219C73CC5C30A4F106B852AD000136</id>
  <title type="text">New entry from entry template test</title>
  <updated>2009-01-02T20:45:07Z</updated>
  <published>2009-01-02T20:45:07Z</published>
  <author>
    <name>donquixote@dulcinea.com</name>
    <email>donquixote@dulcinea.com</email>
    <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
     donquixote@dulcinea.com
    </snx:userid>
    <snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
       177G09219C7341D31A078B4D3F1552000000
    </snx:ldapid>
  </author>
  <contributor>
    <name>donquixote@dulcinea.com</name>
    <email>donquixote@dulcinea.com</email>
    <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
     donquixote@dulcinea.com
    </snx:userid>
    <snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
     177G09219C7341D31A078B4D3F1552000000
    </snx:ldapid>
  </contributor>
      
  <category 
   scheme="http://www.ibm.com/xmlns/prod/sn/type" 
   term="entry" 
   label="Entry">
   snx:template-id="794G09219C73CC5C30A4F106B852AD000136" />
  </category>
  <thr:in-reply-to 
   xmlns:thr="http://purl.org/syndication/thread/1.0" 
   ref="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F" 
   type="application/atom+xml" 
   href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?
         activityNodeUuid=793G09219C73CC5C30A4F106B852AD00012F" 
   source="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F">
  </thr:in-reply-to>
  <snx:activity xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
   793G09219C73CC5C30A4F106B852AD00012F
  </snx:activity>
 
  <link 
   rel="edit" 
   type="application/atom+xml" 
   href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?
         activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >
  </link>
  <link 
   rel="self" 
   type="application/atom+xml" 
   href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?
         activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >
  </link>
  <link 
   rel="alternate" 
   type="application/xhtml+xml" 
   href="http://activities.dulcinea.enterprise.com/service/html/activityentry?
         uuid=794G09219C73CC5C30A4F106B852AD000136" >
  </link>
  <link 
   rel="alternate" 
   type="text/html" 
   href="http://activities.dulcinea.enterprise.com/service/html/activityentry?
         uuid=794G09219C73CC5C30A4F106B852AD000136" ></link>
  <snx:position xmlns:snx="http://www.ibm.com/xmlns/prod/sn">2000</snx:position>
  <snx:depth xmlns:snx="http://www.ibm.com/xmlns/prod/sn">1</snx:depth>  
 
  <snx:permissions 
   xmlns:snx="http://www.ibm.com/xmlns/prod/sn">none, create_activity, 
   view_activity, edit_activity, delete_activity, activity_owner, 
   edit_activity_tags, design_activity, edit_statements, delete_statements, 
   add_members, delete_members, create_entries, edit_personal_entries, 
   edit_all_entries, delete_personal_entries, delete_all_entries, 
   edit_personal_entry_tags, edit_all_entry_tags, view_members
  </snx:permissions>
  <summary type="text">
  </summary>
  <snx:field 
   xmlns:snx="http://www.ibm.com/xmlns/prod/sn" 
   name="new link" 
   fid="423G09219C73CC5C30A4F106B852AD000137" 
   position="1000" 
   type="link">
    <link href="" title=" "></link>
  </snx:field>
  <snx:field 
   xmlns:snx="http://www.ibm.com/xmlns/prod/sn" 
   name="$nodeType" 
   fid="4D9G09219C73CC5C30A4F106B852AD000138" 
   position="2000" 
   type="text" 
   hidden="true">
    <summary type="text">activities/entry</summary>
  </snx:field>
  <snx:field 
   name="BPEntry" 
   fid="241G09219577106BB17CF5E127B282000795" 
   position="4000" 
   type="person">
    <name /> 
    <email /> 
    <snx:userid /> 
  </snx:field>
</entry>


Parent topic

Work with activity nodes

Related reference
Retrieve entry templates


   

 

});

+

Search Tips   |   Advanced Search