<?xml version="1.0" encoding="utf-8"?>
<dc-workflow xmlns:i18n="http://xml.zope.org/namespaces/i18n"
             description=" - Quaive default workflow. - Based on simple_publication_workflow but does not allow access to Anonymous or even Authenticated at all: replaces Anonymous with 'Member'. - All users are 'Member' by default, until you remove them from the 'intranet' workgroup. - Things start out as private, and can either be submitted for review, or published directly."
             initial_state="private"
             manager_bypass="False"
             state_variable="review_state"
             title="Simple Intranet Workflow"
             workflow_id="simple_intranet_workflow"
             i18n:attributes="title; description"
             i18n:domain="ploneintranet"
>
  <permission>Access contents information</permission>
  <permission>Modify portal content</permission>
  <permission>View</permission>
  <state state_id="pending"
         title="Pending review"
         i18n:attributes="title"
  >
    <description i18n:translate="">Waiting to be reviewed, not editable by the owner.</description>
    <exit-transition transition_id="publish" />
    <exit-transition transition_id="reject" />
    <exit-transition transition_id="retract" />
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Owner</permission-role>
      <permission-role>Editor</permission-role>
      <permission-role>Reviewer</permission-role>
      <permission-role>Reader</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Reviewer</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Owner</permission-role>
      <permission-role>Editor</permission-role>
      <permission-role>Reviewer</permission-role>
      <permission-role>Reader</permission-role>
    </permission-map>


  </state>
  <state state_id="private"
         title="Private"
         i18n:attributes="title"
  >
    <description i18n:translate="">Can only be seen and edited by the owner.</description>
    <exit-transition transition_id="publish" />
    <exit-transition transition_id="submit" />
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Owner</permission-role>
      <permission-role>Editor</permission-role>
      <permission-role>Reader</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Owner</permission-role>
      <permission-role>Editor</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Owner</permission-role>
      <permission-role>Editor</permission-role>
      <permission-role>Reader</permission-role>
    </permission-map>


  </state>
  <state state_id="published"
         title="Published"
         i18n:attributes="title"
  >
    <description i18n:translate="">Visible to members, editable by the owner.</description>
    <exit-transition transition_id="retract" />
    <exit-transition transition_id="reject" />
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Owner</permission-role>
      <permission-role>Editor</permission-role>
      <permission-role>Reader</permission-role>
      <permission-role>Member</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Editor</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Site Administrator</permission-role>
      <permission-role>Manager</permission-role>
      <permission-role>Owner</permission-role>
      <permission-role>Editor</permission-role>
      <permission-role>Reader</permission-role>
      <permission-role>Member</permission-role>
    </permission-map>


  </state>
  <transition after_script=""
              before_script=""
              new_state="published"
              title="Reviewer publishes content"
              transition_id="publish"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Publishing the item makes it visible to other intranet members.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=publish"
            i18n:translate=""
    >Publish</action>
    <guard>
      <guard-permission>Review portal content</guard-permission>
    </guard>

  </transition>
  <transition after_script=""
              before_script=""
              new_state="private"
              title="Reviewer sends content back for re-drafting"
              transition_id="reject"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Sending the item back will return the item to the original author instead of publishing it. You should preferably include a reason for why it was not published.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=reject"
            i18n:translate=""
    >Send back</action>
    <guard>
      <guard-permission>Review portal content</guard-permission>
    </guard>

  </transition>
  <transition after_script=""
              before_script=""
              new_state="private"
              title="Member retracts submission"
              transition_id="retract"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">If you submitted the item by mistake or want to perform additional edits, this will take it back.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=retract"
            i18n:translate=""
    >Retract</action>
    <guard>
      <guard-permission>Request review</guard-permission>
    </guard>

  </transition>
  <transition after_script=""
              before_script=""
              new_state="pending"
              title="Member submits content for publication"
              transition_id="submit"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Puts your item in a review queue, so it can be published on the site.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=submit"
            i18n:translate=""
    >Submit for publication</action>
    <guard>
      <guard-permission>Request review</guard-permission>
    </guard>

  </transition>
  <worklist title=""
            worklist_id="reviewer_queue"
  >
    <description i18n:translate="">Reviewer tasks</description>
    <action category="global"
            icon=""
            url="%(portal_url)s/search?review_state=pending"
            i18n:translate=""
    >Pending (%(count)d)</action>
    <guard>
      <guard-permission>Review portal content</guard-permission>
    </guard>
    <match name="review_state"
           values="pending"
    />
  </worklist>
  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="action"
  >
    <description i18n:translate="">Previous transition</description>
    <default>

      <expression>transition/getId|nothing</expression>
    </default>
    <guard>
</guard>
  </variable>
  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="actor"
  >
    <description i18n:translate="">The ID of the user who performed the previous transition</description>
    <default>

      <expression>user/getId</expression>
    </default>
    <guard>
</guard>
  </variable>
  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="comments"
  >
    <description i18n:translate="">Comment about the last transition</description>
    <default>

      <expression>python:state_change.kwargs.get('comment', '')</expression>
    </default>
    <guard>
</guard>
  </variable>
  <variable for_catalog="False"
            for_status="False"
            update_always="False"
            variable_id="review_history"
  >
    <description i18n:translate="">Provides access to workflow history</description>
    <default>

      <expression>state_change/getHistory</expression>
    </default>
    <guard>
      <guard-permission>Request review</guard-permission>
      <guard-permission>Review portal content</guard-permission>
    </guard>
  </variable>
  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="time"
  >
    <description i18n:translate="">When the previous transition was performed</description>
    <default>

      <expression>state_change/getDateTime</expression>
    </default>
    <guard>
</guard>
  </variable>

</dc-workflow>
