Skip to main content

 Web service API

How to use PageSeeder's Web service API

compare fragment edits

/groups/{group}/uris/{uri}/fragments/{+fragment}/compare [GET]

com.pageseeder.psml.CompareFragmentEdits

Description

Compare Fragment's Edits.

Compares contents of two or more edits using Diff-X. The diff shows what the changes are to get from the start edit to the end edit. If start-editid is greater than end-editid, the order is reverse chronological. The @skipped in the response shows how many intermediate edits where not displayed.

If the request has taken more than 10 seconds, then the remaining edits are listed containing the element <diff error="This diff was not generated because the previous diffs took too long."/>.

Parameters

NameDescriptionRequiredTypeDefault value
end-editidThe edit ID to end the compare (-1 = original edit ID).nolong[current edit ID]
intermediatesWhat edits to include between the old and new (all|members|none), where members omits adjacent edits from the same member.noenumnone
start-editidThe edit ID to start the compare (-1 = current edit ID).nolong[original edit ID]

Permission

This service is restricted to guest and higher unless the group is accessible to public.

Response

The output has the following format:

<edits>
  <edit|draft id="123"
              created="[date/time]"
              [shared="true"]
              [deleted="true"]
              [original="true"]>

    <author id="12" ... >
      <fullname>John Jones</fullname>
    </author>
    <content>
      <fragment id="2">
        <para>The quick</para>
        <para>brown</para>
        <para indent="1">fox</para>
      </fragment>
    </content>
    <notes>
      <note id="456"
            modified="[date/time]"
            title="[title]">
        <content> ... </content>
        <labels> ... </labels>
      </note>
    </notes>
  </edit|draft>
  <edit|draft id="234"
              created="[date/time]"
              [skipped="[number]"] ... >
    <author id="12" ... >
      <fullname>Linda Brown</fullname>
    </author>
    <content>
      <fragment id="2">
        <para>The slow</para>
        <para indent="1">brown</para>
        <para>fox</para>
        <para>jumps</para>
      </fragment>
    </content>
    <diff [error="[error message]"]>
      <fragment 
             xmlns:dfx="http://www.topologi.com/2005/Diff-X"
             xmlns:del="http://www.topologi.com/2005/Diff-X/Delete"
             xmlns:ins="http://www.topologi.com/2005/Diff-X/Insert"
             id="2">
        <para>The
          <dfx:del>quick</dfx:del>
            <dfx:ins>slow</dfx:ins>
        </para>
        <para indent="1" ins:indent="true">brown</para>
        <para del:indent="1">fox</para>
        <para dfx:insert="true">
          <dfx:ins>jumps</dfx:ins>
        </para>
      </fragment>
    </diff>
    <notes>
      <note id="567" ... > ... </note>
    </notes>
  </edit|draft>
</edits>

Error Handling

0x1218 Fragment not found
Created on , last edited on