Skip to main content

 API elements

Service API elements from <alias> to <workflow>

<discussion>

Summary

A discussion or comment thread.

The <discussion> element is a container for a list of <comment> elements that are part of the same discussion thread.

This model for the <discussion> element is used as a base for the <task> element.

Usage context

Permitted content<comment>, <group>, <locator>, <uri>
Permitted parent<discussions>

Attributes

This element defines the following attributes:

NameTypeRequiredDescription
idxs:longyesThe ID of the discussion
lastcommentdatexs:dateTimenoThe date of the last comment
lastcommentidxs:longnoThe ID of the last comment
replycountxs:intnoThe number of replies in the thread
titlexs:stringnoThe title of the discussion (250)
All the discussion attributes are generated from the comments in the discussion. With the exception of the @id attribute, they are susceptible to change every time a new comment (in other words, a reply) is made to the discussion thread.

@id

The PageSeeder database identifier for the discussion. It is always an immutable positive long value that is unique on a specific PageSeeder server within the set all members.

The discussion ID is the same as the ID of the first comment (which initiated the discussion) and is immutable in practice.

@lastcommentdate

The date the last comment was created. This value changes every time a reply is made to the discussion.

@lastcommentid

The ID of the last comment in the discussion. This value changes every time a reply is made to the discussion.

@replycount

This attribute indicates how many replies have been made to the discussion, which is the same as the total number of comments minus one. This value changes every time a reply is made to the discussion.

@title

The title of the discussion is the title of the last comment in the discussion. It does not usually change, but can be modified if a reply has a new title. It is limited to 250 characters.

Examples

Sample discussion (XML)

<discussion id="988696" title="Losing comments" replycount="2" 
            lastcommentid="988713" lastcommentdate="2026-02-13T10:58:14+11:00">
  <comment id="988696" contentrole="Comment" created="2026-02-12T09:56:37+11:00">
    <title>Losing comments</title>
    <author id="17" firstname="Bob" surname="Carr" 
            username="bcarr" status="activated">
      <fullname>Bob Carr</fullname>
    </author>
    <content type="application/xhtml+xml">
      <p>I just posted a comment and it evaporated. I tried to post a 
      test message and it did the same.</p>
      <p>I'll see what happens to this.</p>
    </content>
    <group id="724" name="dev-examples"/>
  </comment>

  <comment id="988704" contentrole="Comment" created="2026-02-12T12:17:37+11:00">
    <title>Losing comments</title>
    <author id="460" firstname="Rob" surname="Williams"
            username="rwilliams@example.com" status="activated">
      <fullname>Rob Williams</fullname>
    </author>
    <content type="application/xhtml+xml">
      <p>I received this via email.</p>
    </content>
    <group id="724" name="dev-examples"/>
  </comment>

  <comment id="988713" contentrole="Comment" created="2026-02-13T10:58:14+11:00">
    <title>Losing comments</title>
    <author id="1" firstname="Jane" surname="Eyre" 
            username="jeyre" status="activated">
      <fullname>Jane Eyre</fullname>
    </author>
    <content type="application/xhtml+xml">
      <p>Hey Bob,<br/>
      Comments seem to work OK for me. Which web browser were you using? 
      Is the problem repeatable in the same and different browsers?</p>
      <p>Thanks<br/>Jane</p>
    </content>
      <group id="724" name="dev-examples"/>
  </comment>
</discussion>

Sample discussion (JSON)

The same discussion as above in JSON format.

{
  "id":988696,
  "title":"Losing comments",
  "replycount":2,
  "lastcommentid":988713,
  "lastcommentdate":"2026-02-13T10:58:14+11:00",
  "comments":[{
     "id":988696,
     "contentrole":"Comment",
     "created":"2026-02-12T09:56:37+11:00",
     "title":"Losing comments",
     "author":{
        "id":17,
        "firstname":"Bob",
        "surname":"Carr",
        "username":"bcarr",
        "status":"activated",
        "fullname":"Bob Carr"
     },
     "content":[{
        "type":"application/xhtml+xml",
        "value":"<p>I just posted a comment from the Quick edit view and it evaporated. I tried to post a test message and it did the same.</p>\n<p>I&#39;ll see what happens to this.</p>"
     }],
     "groups":[{"id":724,"name":"dev-examples"}]
  },{
     "id":988704,
     "contentrole":"Comment",
     "created":"2026-02-12T12:17:37+11:00",
     "title":"losing comments",
     "author":{
        "id":460,
        "firstname":"Rob",
        "surname":"Williams",
        "username":"rwilliams@example.com",
        "status":"activated",
        "fullname":"Rob Williams"
     },
     "content":[{
        "type":"application/xhtml+xml",
        "value":"<p>I received this via email.</p>"
     }],
     "groups":[{"id":724,"name":"dev-examples"}]
  },{
     "id":988713,
     "contentrole":"Comment",
     "created":"2026-02-13T10:58:14+11:00",
     "title":"losing comments",
     "author":{
        "id":1,
        "firstname":"Jane",
        "surname":"Eyre",
        "username":"eyre",
        "status":"activated",
        "fullname":"Jane Eyre"
     },
     "content":[{
        "type":"application/xhtml+xml",
        "value":"<p>Hey Bob,<br />Comments seem to work OK for me. Which web browser were you using? Is the problem repeatable in the same and different browsers?</p>\n<p>Thanks<br />Jane</p>"
     }],
     "groups":[{"id":724,"name":"dev-examples"}]
  }]
}

Schema

XML Schema

<xs:element name="discussion" type="discussion"/>

<xs:complexType name="discussion">
  <xs:sequence>
    <xs:choice minOccurs="0">
      <xs:element name="group"     type="group-basic" />
      <xs:sequence>
        <xs:element name="uri"     type="uri" />
        <xs:element name="locator" type="locator"  minOccurs="0" />
      </xs:sequence>
    </xs:choice>
    <xs:element name="comment"     type="comment"  minOccurs="0"
                maxOccur="unbounded"/>
  </xs:sequence>
  <xs:attribute name="id"              type="id" use="required"/>
  <xs:attribute name="lastcommentdate" type="xs:dateTime"/>
  <xs:attribute name="lastcommentid"   type="id"/>
  <xs:attribute name="replycount"      type="xs:int"/>
  <xs:attribute name="title"           type="comment-title"/>
</xs:complexType>

<xs:simpleType name="comment-title">
  <xs:restriction base="xs:string">
    <xs:maxLength value="250"/>
  </xs:restriction>
</xs:simpleType>

Relax Schema

element discussion {
   attribute id              { xs:long },
   attribute lastcommentdate { xs:dateTime }?, 
   attribute lastcommentid   { xs:long }?, 
   attribute replycount      { xs:boolean }?,
   attribute title           {  text { maxLength = "250"} }?,
   group?
   uri?
   locator?
   comment*
}

Compatibility

No change since initial API release.

Created on , last edited on