Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • arviman 71 posts 92 karma points
    May 28, 2010 @ 03:02
    arviman
    0

    Workflow management through the API

    Hi,

    I was wondering if it is possible for developers to setup an approval workflow using the umbraco API. For eg. let's say that site users can add comments to an article. These comments are obviously of document type "comment" whose nodes that will appear as children article.

    I know it is quite easy to set an approval workflow on the backend where a user(such as a writer) can be allowed to only create and send a node for approval but not be able to publish a node.

    Would this be possible through the API?

    I was looking for something like

    //Get the document type of comment
    DocumentType dt = DocumentType.GetByAlias("Comment");
    User author = User.GetUser(0);
    //get id of parent node
    int parentId = getArticleID();
    //create a new document
    Document doc = Document.MakeNew("New comment", dt, author, pareentID);
    //send for approval
    //??What do I do here, something like doc.sendForApproval() ?
  • Simon Dingley 1474 posts 3431 karma points c-trib
    May 28, 2010 @ 07:50
    Simon Dingley
    0

    You could try

    doc.SendToPublication

    and have you users register for notifications using the built-in notification system. I've not tried it but see no reason why it would not work.

  • arviman 71 posts 92 karma points
    May 28, 2010 @ 18:30
    arviman
    0

    Thanks, will check it out a bit more on the API.

Please Sign in or register to post replies

Write your reply to:

Draft