Provide our own copy of the default one state workflow. Not all Plone sites have this workflow installed.
svn path=/plone.app.discussion/trunk/; revision=33490
This commit is contained in:
		
							parent
							
								
									efc60b2620
								
							
						
					
					
						commit
						ece5e3c302
					
				@ -4,6 +4,7 @@ Changelog
 | 
			
		||||
1.0b3 (XXXX-XX-XX)
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
* Provide our own copy of the default one state workflow. Not all Plone sites have this workflow installed. [hannosch]
 | 
			
		||||
* Register the event subscribers for the correct interfaces in Plone 3. [hannosch]
 | 
			
		||||
* Factored out subscriber declarations into its own ZCML file. [hannosch]
 | 
			
		||||
* Bugfix for #2281226: Moderation View: Comments disappear when hitting the 'Apply' button without choosing a bulk action. [timo]
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
<?xml version="1.0"?>
 | 
			
		||||
<object name="portal_workflow">
 | 
			
		||||
 <object name="comment_review_workflow" meta_type="Workflow"/>
 | 
			
		||||
 <object name="one_state_workflow" meta_type="Workflow"/>
 | 
			
		||||
 <bindings>
 | 
			
		||||
  <type type_id="Discussion Item">
 | 
			
		||||
      <bound-workflow workflow_id="one_state_workflow" />
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<?xml version="1.0"?>
 | 
			
		||||
<dc-workflow xmlns:i18n="http://xml.zope.org/namespaces/i18n"
 | 
			
		||||
             i18n:domain="plone.app.discussion"
 | 
			
		||||
             i18n:domain="plone"
 | 
			
		||||
             workflow_id="comment_review_workflow"
 | 
			
		||||
             title="Comment Review Workflow"
 | 
			
		||||
             description="A simple workflow for comments"
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,107 @@
 | 
			
		||||
<?xml version="1.0"?>
 | 
			
		||||
<dc-workflow xmlns:i18n="http://xml.zope.org/namespaces/i18n"
 | 
			
		||||
             i18n:domain="plone"
 | 
			
		||||
             workflow_id="one_state_workflow"
 | 
			
		||||
             title="Single State Workflow"
 | 
			
		||||
             description="- Essentially a workflow with no transitions, but has a Published state, so portlets and applications that expect that state will continue to work."
 | 
			
		||||
             state_variable="review_state"
 | 
			
		||||
             initial_state="published"
 | 
			
		||||
             i18n:attributes="title; description">
 | 
			
		||||
 | 
			
		||||
 <permission>Access contents information</permission>
 | 
			
		||||
 <permission>Change portal events</permission>
 | 
			
		||||
 <permission>List folder contents</permission>
 | 
			
		||||
 <permission>Modify portal content</permission>
 | 
			
		||||
 <permission>View</permission>
 | 
			
		||||
 | 
			
		||||
 <state state_id="published" title="Published" i18n:attributes="title">
 | 
			
		||||
  <description i18n:translate="">
 | 
			
		||||
    Visible to everyone, editable by the owner.
 | 
			
		||||
  </description>
 | 
			
		||||
  <permission-map name="Access contents information"
 | 
			
		||||
                  acquired="False">
 | 
			
		||||
   <permission-role>Anonymous</permission-role>
 | 
			
		||||
  </permission-map>
 | 
			
		||||
  <permission-map name="Change portal events"
 | 
			
		||||
                  acquired="False">
 | 
			
		||||
   <permission-role>Manager</permission-role>
 | 
			
		||||
   <permission-role>Owner</permission-role>
 | 
			
		||||
   <permission-role>Editor</permission-role>
 | 
			
		||||
  </permission-map>
 | 
			
		||||
  <permission-map name="List folder contents"
 | 
			
		||||
                  acquired="False">
 | 
			
		||||
   <permission-role>Anonymous</permission-role>
 | 
			
		||||
  </permission-map>
 | 
			
		||||
  <permission-map name="Modify portal content"
 | 
			
		||||
                  acquired="False">
 | 
			
		||||
   <permission-role>Manager</permission-role>
 | 
			
		||||
   <permission-role>Owner</permission-role>
 | 
			
		||||
   <permission-role>Editor</permission-role>
 | 
			
		||||
  </permission-map>
 | 
			
		||||
  <permission-map name="View" acquired="False">
 | 
			
		||||
   <permission-role>Anonymous</permission-role>
 | 
			
		||||
  </permission-map>
 | 
			
		||||
 </state>
 | 
			
		||||
 | 
			
		||||
 <variable variable_id="action"         for_catalog="False"
 | 
			
		||||
           for_status="True" update_always="True">
 | 
			
		||||
  <description i18n:translate="">Previous transition</description>
 | 
			
		||||
  <default>
 | 
			
		||||
   
 | 
			
		||||
   <expression>transition/getId|nothing</expression>
 | 
			
		||||
  </default>
 | 
			
		||||
  <guard>
 | 
			
		||||
  </guard>
 | 
			
		||||
 </variable>
 | 
			
		||||
 <variable variable_id="actor"          for_catalog="False"
 | 
			
		||||
           for_status="True" update_always="True">
 | 
			
		||||
  <description i18n:translate="">
 | 
			
		||||
    The ID of the user who performed the previous transition
 | 
			
		||||
  </description>
 | 
			
		||||
  <default>
 | 
			
		||||
   
 | 
			
		||||
   <expression>user/getId</expression>
 | 
			
		||||
  </default>
 | 
			
		||||
  <guard>
 | 
			
		||||
  </guard>
 | 
			
		||||
 </variable>
 | 
			
		||||
 <variable variable_id="comments"       for_catalog="False"
 | 
			
		||||
           for_status="True" update_always="True">
 | 
			
		||||
  <description i18n:translate="">
 | 
			
		||||
    Comment about the last transition
 | 
			
		||||
  </description>
 | 
			
		||||
  <default>
 | 
			
		||||
   
 | 
			
		||||
   <expression>python:state_change.kwargs.get('comment', '')</expression>
 | 
			
		||||
  </default>
 | 
			
		||||
  <guard>
 | 
			
		||||
  </guard>
 | 
			
		||||
 </variable>
 | 
			
		||||
 <variable variable_id="review_history" for_catalog="False"
 | 
			
		||||
           for_status="False" update_always="False">
 | 
			
		||||
  <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 variable_id="time"           for_catalog="False"
 | 
			
		||||
           for_status="True" update_always="True">
 | 
			
		||||
  <description i18n:translate="">
 | 
			
		||||
    When the previous transition was performed
 | 
			
		||||
  </description>
 | 
			
		||||
  <default>
 | 
			
		||||
   
 | 
			
		||||
   <expression>state_change/getDateTime</expression>
 | 
			
		||||
  </default>
 | 
			
		||||
  <guard>
 | 
			
		||||
  </guard>
 | 
			
		||||
 </variable>
 | 
			
		||||
 | 
			
		||||
</dc-workflow>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user