Utilisation de REST avec des actions de publication, d'expiration ou de version d'un flux de travaux
Les propriétés des actions de publication, d'expiration et de version sont identiques. Seul l'URI utilisé pour exécuter les actions diffère.
Créer
Vous pouvez créer une action de publication en envoyant une demande POST à l'URI suivant avec une entrée Atom représentant l'action :
/PublishAction
Vous pouvez créer une action d'expiration en envoyant une demande POST à l'URI suivant avec une entrée Atom représentant l'action :
/ExpireAction
Vous pouvez créer une action de version en envoyant une demande POST à l'URI suivant avec une entrée Atom représentant l'action :
/VersionAction
Dans cet exemple, le type
PublishAction peut être remplacé par ExpireAction ou VersionAction, le cas échéant.
HTTP/1.1 POST /wps/mycontenthandler/wcmrest/PublishAction
Content-Type: application/atom+xml
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:wcm="http://www.ibm.com/xmlns/wcm/8.0">
<title>My Publish Action</title>
<summary>This action publishes content to the live site</summary>
<wcm:name>My Publish Action</wcm:name>
<link rel="library" href="/wps/mycontenthandler/!ut/p/digest!muAe8T8GIzS4EJeiF9a_sw/wcmrest/Library/03da7ddc-1bc9-47cd-ab69-b06f23a3f284" />
</entry>
HTTP/1.1 201 Created
Content-Type: application/atom+xml
Content-Location: /wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:wcm="http://www.ibm.com/xmlns/wcm/8.0">
<id>wcmrest:9c1d8e5b-0e0d-467b-8f1d-58ed550f4236</id>
<title xml:lang="fr-fr">My Publish Action</title>
<summary xml:lang="fr-fr">This action publishes content to the live site</summary>
<wcm:name>My Publish Action</wcm:name>
<wcm:type>PublishAction</wcm:type>
<updated>2014-06-24T02:19:42.060Z</updated>
<wcm:created>2014-06-24T02:19:42.060Z</wcm:created>
<author>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</author>
<wcm:owner>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:owner>
<wcm:lastModifier>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:lastModifier>
<wcm:creator>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:creator>
<link rel="self" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Read"/>
<link rel="edit" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Edit"/>
<link rel="delete" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Delete"/>
<link rel="change-to-draft" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/change-to-draft" xml:lang="fr-fr" label="Change To Draft"/>
<link rel="create-draft" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/create-draft" xml:lang="fr-fr" label="Create Draft"/>
<link rel="access-control" href="/wps/mycontenthandler/ac/access:oid:Z6QReDePPO23I175BD4MM0653C8MMG6MPD4MM076BC8MMK6O9P8MQK6GHP83PC6M1" xml:lang="fr-fr" label="Access Control"/>
<link rel="library" href="/wps/mycontenthandler/wcmrest/Library/03da7ddc-1bc9-47cd-ab69-b06f23a3f284" xml:lang="fr-fr" label="Library"/>
<link rel="versions" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/versions" xml:lang="fr-fr" label="Versions"/>
<category scheme="wcmrest:workflowState" term="PUBLISHED" label="Published" xml:lang="fr-fr"/>
<category scheme="wcmrest:favorite" term="false" xml:lang="fr-fr"/>
</entry>
Mettre à jour
Vous pouvez mettre à jour une action de publication en envoyant une demande PUT à l'URI suivant avec une entrée Atom incluant les zones de l'objet qui doivent être modifiées.
/PublishAction/action-id
Vous pouvez mettre à jour une action d'expiration en envoyant une demande PUT à l'URI suivant avec une entrée Atom incluant les zones de l'objet qui doivent être modifiées.
/ExpireAction/action-id
Vous pouvez mettre à jour une action de version en envoyant une demande PUT à l'URI suivant avec une entrée Atom incluant les zones de l'objet qui doivent être modifiées.
/VersionAction/action-id
Dans cet exemple, le type
PublishAction peut être remplacé par ExpireAction ou VersionAction, le cas échéant.
HTTP/1.1 PUT /wps/mycontenthandler/wcmrest/WorkflowStage/141793eb-afa7-428e-bb7b-070a25ee3d7c
Content-Type: application/atom+xml
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:wcm="http://www.ibm.com/xmlns/wcm/8.0">
<id>wcmrest:9c1d8e5b-0e0d-467b-8f1d-58ed550f4236</id>
<title xml:lang="fr-fr">My Publish Action</title>
<summary xml:lang="fr-fr">This action publishes content to the live site</summary>
<wcm:name>My Publish Action - now with a different name</wcm:name>
<wcm:type>PublishAction</wcm:type>
<updated>2014-06-24T02:19:42.060Z</updated>
<wcm:created>2014-06-24T02:19:42.060Z</wcm:created>
<author>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</author>
<wcm:owner>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:owner>
<wcm:lastModifier>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:lastModifier>
<wcm:creator>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:creator>
<link rel="self" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Read"/>
<link rel="edit" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Edit"/>
<link rel="delete" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Delete"/>
<link rel="change-to-draft" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/change-to-draft" xml:lang="fr-fr" label="Change To Draft"/>
<link rel="create-draft" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/create-draft" xml:lang="fr-fr" label="Create Draft"/>
<link rel="access-control" href="/wps/mycontenthandler/ac/access:oid:Z6QReDePPO23I175BD4MM0653C8MMG6MPD4MM076BC8MMK6O9P8MQK6GHP83PC6M1" xml:lang="fr-fr" label="Access Control"/>
<link rel="library" href="/wps/mycontenthandler/wcmrest/Library/03da7ddc-1bc9-47cd-ab69-b06f23a3f284" xml:lang="fr-fr" label="Library"/>
<link rel="versions" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/versions" xml:lang="fr-fr" label="Versions"/>
<category scheme="wcmrest:workflowState" term="PUBLISHED" label="Published" xml:lang="fr-fr"/>
<category scheme="wcmrest:favorite" term="false" xml:lang="fr-fr"/>
</entry>
HTTP/1.1 200 OK
Lire
Vous pouvez lire une action de publication en envoyant une demande GET à l'URI suivant :
/PublishAction/action-id
Vous pouvez lire une action d'expiration en envoyant une demande GET à l'URI suivant :
/ExpireAction/action-id
Vous pouvez lire une action de version en envoyant une demande GET à l'URI suivant :
/VersionAction/action-id
Dans cet exemple, le type
PublishAction peut être remplacé par ExpireAction ou VersionAction, le cas échéant.
HTTP/1.1 GET /wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236
Accept: application/atom+xml
HTTP/1.1 200 OK
Content-Type: application/atom+xml
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:wcm="http://www.ibm.com/xmlns/wcm/8.0">
<id>wcmrest:9c1d8e5b-0e0d-467b-8f1d-58ed550f4236</id>
<title xml:lang="fr-fr">My Publish Action</title>
<summary xml:lang="fr-fr">This action publishes content to the live site</summary>
<wcm:name>My Publish Action</wcm:name>
<wcm:type>PublishAction</wcm:type>
<updated>2014-06-24T02:19:42.060Z</updated>
<wcm:created>2014-06-24T02:19:42.060Z</wcm:created>
<author>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</author>
<wcm:owner>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:owner>
<wcm:lastModifier>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:lastModifier>
<wcm:creator>
<wcm:distinguishedName>uid=wpsadmin,o=defaultWIMFileBasedRealm</wcm:distinguishedName>
<uri>/wps/mycontenthandler/um/users/profiles/Z9eAe5JOE3O46N1P0JM06J9OCJMG64BC6MM472RCCJMK62JD66J57OHDC3OC6N1</uri>
<name>wpsadmin</name>
</wcm:creator>
<link rel="self" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Read"/>
<link rel="edit" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Edit"/>
<link rel="delete" href="/wps/mycontenthandler/wcmrest/PublishAction/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236" xml:lang="fr-fr" label="Delete"/>
<link rel="change-to-draft" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/change-to-draft" xml:lang="fr-fr" label="Change To Draft"/>
<link rel="create-draft" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/create-draft" xml:lang="fr-fr" label="Create Draft"/>
<link rel="access-control" href="/wps/mycontenthandler/ac/access:oid:Z6QReDePPO23I175BD4MM0653C8MMG6MPD4MM076BC8MMK6O9P8MQK6GHP83PC6M1" xml:lang="fr-fr" label="Access Control"/>
<link rel="library" href="/wps/mycontenthandler/wcmrest/Library/03da7ddc-1bc9-47cd-ab69-b06f23a3f284" xml:lang="fr-fr" label="Library"/>
<link rel="versions" href="/wps/mycontenthandler/wcmrest/item/9c1d8e5b-0e0d-467b-8f1d-58ed550f4236/versions" xml:lang="fr-fr" label="Versions"/>
<category scheme="wcmrest:workflowState" term="PUBLISHED" label="Published" xml:lang="fr-fr"/>
<category scheme="wcmrest:favorite" term="false" xml:lang="fr-fr"/>
</entry>
Supprimer
Vous pouvez supprimer une action de publication en envoyant une demande DELETE à l'URI suivant :
/PublishAction/action-id
Vous pouvez supprimer une action d'expiration en envoyant une demande DELETE à l'URI suivant :
/ExpireAction/action-id
Vous pouvez supprimer une action de version en envoyant une demande DELETE à l'URI suivant :
/VersionAction/action-id
Dans cet exemple, le type
PublishAction peut être remplacé par ExpireAction ou VersionAction, le cas échéant.HTTP/1.1 DELETE /wps/mycontenthandler/wcmrest/PublishAction/7b40f5b6-bf52-4b9e-8062-b0755aaf1f80 HTTP/1.1 200 OK