Utilisation de REST avec des actions de flux de travaux

Vous pouvez utiliser le service REST de Web Content Manager pour créer, lire, mettre à jour et supprimer des actions de flux de travaux d'e-mail.

Créer

Vous pouvez créer une action d'e-mail en envoyant une demande POST à l'URI suivant :
/EmailAction
Par exemple:


HTTP/1.1 POST /wps/mycontenthandler/wcmrest/EmailAction
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">
    <wcm:name>My Email Action</wcm:name>
    <link rel="library" href="/wps/mycontenthandler/wcmrest/Library/1f5955c8-38e7-41f9-9029-5c4c0b151976" xml:lang="fr-fr" label="Library"/>
    <content type="application/vnd.ibm.wcm+xml">
        <wcm:emailAction xmlns="http://www.ibm.com/xmlns/wcm/8.0" xmlns:atom="http://www.w3.org/2005/Atom">
            <dateType>GENERAL_DATE_ONE</dateType>
            <offset unit="MONTH" amount="1" direction="AFTER">
                <time-of-day>11:53:00</time-of-day>
            </offset>
            <recipients>
                <stageApprovers>true</stageApprovers>
                <authors of-item="true" of-referencing-items="true"/>
                <owners of-item="true" of-referencing-items="true"/>
                <additional>
                    <distinguishedName>uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm</distinguishedName>
                    <atom:name>uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm</atom:name>
                </additional>
            </recipients>
            <emailText>this is some email text</emailText>
        </wcm:emailAction>
    </content>
</entry>

HTTP/1.1 201 Created

<?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">
    ... some content elided ...
    <wcm:name>My Email Action</wcm:name>
    ... some content elided ...
    <content type="application/vnd.ibm.wcm+xml">
        <wcm:emailAction xmlns="http://www.ibm.com/xmlns/wcm/8.0" xmlns:atom="http://www.w3.org/2005/Atom">
            <dateType>GENERAL_DATE_ONE</dateType>
            <offset unit="MONTH" amount="1" direction="AFTER">
                <time-of-day>11:53:00</time-of-day>
            </offset>
            <recipients>
                <stageApprovers>true</stageApprovers>
                <authors of-item="true" of-referencing-items="true"/>
                <owners of-item="true" of-referencing-items="true"/>
                <additional>
                    <distinguishedName>uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm</distinguishedName>
                    <atom:uri>/wps/mycontenthandler/!ut/p/digest!TPAVlKazgS66elu1F8nIzA/um/users/profiles/Z9eAe5RO8JOCCKHP4MMOCNPOAMMG6M9O6JM07I9CCMMC64BP8JOOCK1C4MGLCI1</atom:uri>
                    <atom:name>WCMUT_Editor_A WCMUT_Editor_A</atom:name>
                </additional>
            </recipients>
            <emailText>this is some email text</emailText>
        </wcm:emailAction>
    </content>
</entry>

Mettre à jour

Vous pouvez mettre à jour une action d'e-mail en envoyant une demande PUT à l'URI suivant :
/EmailAction/action-id
Par exemple:


HTTP/1.1 PUT /wps/mycontenthandler/wcmrest/EmailAction/abc4c24a-3540-4ae3-8ba6-f2f82a977046
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">
    ... some content elided ...
    <content type="application/vnd.ibm.wcm+xml">
        <wcm:emailAction xmlns="http://www.ibm.com/xmlns/wcm/8.0" xmlns:atom="http://www.w3.org/2005/Atom">
            <dateType>DATE_ENTERED</dateType>
            <recipients>
                <stageApprovers>false</stageApprovers>
                <authors of-item="false" of-referencing-items="false"/>
                <owners of-item="false" of-referencing-items="false"/>
                <additional>
                    <distinguishedName>uid=WCMUT_Contributor_A,o=defaultWIMFileBasedRealm</distinguishedName>
                    <atom:uri>/wps/mycontenthandler/um/users/profiles/Z9eAeJHPGJP86M9EAMMG6K9PAMMG62RDGJM4C1JP0JM06IHP4JPK61RDCMIP6K1</atom:uri>
                    <atom:name>WCMUT_Contributor_A WCMUT_Contributor_A</atom:name>
                </additional>
                <additional>
                    <distinguishedName>uid=WCMUT_Contributor_B,o=defaultWIMFileBasedRealm</distinguishedName>
                    <atom:uri>/wps/mycontenthandler/um/users/profiles/Z9eAeKPD83H16JHC2JM47KPOCJMG6IHC6MM8C3JCIJMOC4BEAMR06N9E8MQKC63</atom:uri>
                    <atom:name>WCMUT_Contributor_B WCMUT_Contributor_B</atom:name>
                </additional>
            </recipients>
        </wcm:emailAction>
    </content>
</entry>

HTTP/1.1 200 OK

Lire

Vous pouvez lire une action d'e-mail en envoyant une demande GET à l'URI suivant :
/EmailAction/action-id
Par exemple:


HTTP/1.1 GET /wps/mycontenthandler/wcmrest/EmailAction/64c1a38f-54e9-4852-b1e0-a52dbf40d494
Accept: application/atom+xml

HTTP/1.1 200 OK


<?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:64c1a38f-54e9-4852-b1e0-a52dbf40d494</id>
    <title xml:lang="fr-fr">My Email Action</title>
    <summary xml:lang="fr-fr"></summary>
    <wcm:name>My Email Action</wcm:name>
    <wcm:type>EmailAction</wcm:type>
    <updated>2014-06-24T01:54:38.593Z</updated>
    <wcm:created>2014-06-24T01:54:38.593Z</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/EmailAction/64c1a38f-54e9-4852-b1e0-a52dbf40d494" xml:lang="fr-fr" label="Read"/>
    <link rel="edit" href="/wps/mycontenthandler/wcmrest/EmailAction/64c1a38f-54e9-4852-b1e0-a52dbf40d494" xml:lang="fr-fr" label="Edit"/>
    <link rel="delete" href="/wps/mycontenthandler/wcmrest/EmailAction/64c1a38f-54e9-4852-b1e0-a52dbf40d494" xml:lang="fr-fr" label="Delete"/>
    <link rel="change-to-draft" href="/wps/mycontenthandler/wcmrest/item/64c1a38f-54e9-4852-b1e0-a52dbf40d494/change-to-draft" xml:lang="fr-fr" label="Change To Draft"/>
    <link rel="create-draft" href="/wps/mycontenthandler/wcmrest/item/64c1a38f-54e9-4852-b1e0-a52dbf40d494/create-draft" xml:lang="fr-fr" label="Create Draft"/>
    <link rel="access-control" href="/wps/mycontenthandler/ac/access:oid:Z6QReDeM1D6MO4CJ1ECMMK6K9PIJMG6O9D4JM8CH9P0JM4CLHC86HPCK1C86Q47K1" xml:lang="fr-fr" label="Access Control"/>
    <link rel="library" href="/wps/mycontenthandler/wcmrest/Library/790b8ca6-5d89-4f37-9052-783dd580f860" xml:lang="fr-fr" label="Library"/>
    <link rel="versions" href="/wps/mycontenthandler/wcmrest/item/64c1a38f-54e9-4852-b1e0-a52dbf40d494/versions" xml:lang="fr-fr" label="Versions"/>
    <link rel="edit-media" href="/wps/mycontenthandler/wcmrest/EmailAction/64c1a38f-54e9-4852-b1e0-a52dbf40d494" type="application/vnd.ibm.wcm+xml" xml:lang="fr-fr" label="Edit Media"/>
    <category scheme="wcmrest:workflowState" term="PUBLISHED" label="Published" xml:lang="fr-fr"/>
    <category scheme="wcmrest:favorite" term="false" xml:lang="fr-fr"/>
    <content type="application/vnd.ibm.wcm+xml">
        <wcm:emailAction xmlns="http://www.ibm.com/xmlns/wcm/8.0" xmlns:atom="http://www.w3.org/2005/Atom">
            <dateType>GENERAL_DATE_ONE</dateType>
            <offset unit="MONTH" amount="1" direction="AFTER">
                <time-of-day>11:53:00</time-of-day>
            </offset>
            <recipients>
                <stageApprovers>true</stageApprovers>
                <authors of-item="true" of-referencing-items="true"/>
                <owners of-item="true" of-referencing-items="true"/>
                <additional>
                    <distinguishedName>uid=WCMUT_Contributor_A,o=defaultWIMFileBasedRealm</distinguishedName>
                    <atom:uri>/wps/mycontenthandler/um/users/profiles/Z9eAeJHPGJP86M9EAMMG6K9PAMMG62RDGJM4C1JP0JM06IHP4JPK61RDCMIP6K1</atom:uri>
                    <atom:name>WCMUT_Contributor_A WCMUT_Contributor_A</atom:name>
                </additional>
                <additional>
                    <distinguishedName>uid=WCMUT_Contributor_B,o=defaultWIMFileBasedRealm</distinguishedName>
                    <atom:uri>/wps/mycontenthandler/um/users/profiles/Z9eAeKPD83H16JHC2JM47KPOCJMG6IHC6MM8C3JCIJMOC4BEAMR06N9E8MQKC63</atom:uri>
                    <atom:name>WCMUT_Contributor_B WCMUT_Contributor_B</atom:name>
                </additional>
            </recipients>
        </wcm:emailAction>
    </content>
</entry>

Supprimer

Vous pouvez supprimer une action d'e-mail en envoyant une demande DELETE à l'URI suivant :
/EmailAction/action-id
Par exemple:
HTTP/1.1 DELETE /wps/mycontenthandler/wcmrest/ScheduledMoveAction/abc4c24a-3540-4ae3-8ba6-f2f82a977046

HTTP/1.1 200 OK