Commits

Anonymous committed 573bb3a

add 0.5 code

Comments (0)

Files changed (12)

 --------
 
 Ed Crewe, `ILRT
-<http://www.ilrt.bris.ac.uk/>`_ at University of Bristol, April 5th 2009
+<http://www.ilrt.bris.ac.uk/>`_ at University of Bristol, June 10th 2009
 
 Formal workflow is designed for sites where there may be many editors
 for whom unmoderated access to change live published content on the 
 skin should be added near the top of the editing layer's skins listing in the 
 portal_skins tool.
 
-If this workflow is applied to an existing site ... then you may require the 
+If this workflow is applied to an existing site you may require the 
 `ilrt.migrationtool 
 <http://pypi.python.org/pypi/ilrt.migrationtool>`_ to use its utility for mapping  
-existing content states from the old workflow to formalworkflow
+existing content states from one workflow to another. Otherwise changing 
+workflow reverts objects to the new workflow's default state.
 
 If you wish to use custom types with this workflow you will need to make them versionable 
 via the 
 `portal_repository tool
 <http://plone.org/documentation/how-to/enabling-versioning-on-your-custom-content-types>`_ or 
 plone.app.iterate will not be available for them. 
+
+If formal workflow is applied to folders (as is the default profile setting) then types 
+without workflow such as images and files cannot be added or deleted by editors.  
+To fix this a slightly adapted version of one_state_workflow is also included for these 
+content types that allows for editors to modify this content unrestricted. 
+
+You can customize which types use formal_worflow, and hence enforce a review process, 
+via the the portal_workflow tool. You could also choose to only apply formal workflow 
+to the high profile parts of your site, via `placeful workflow
+<http://pypi.python.org/pypi/Products.CMFPlacefulWorkflow>`_.
 
     (name of developer listed in brackets)
 
+ilrt.formalworkflow - 0.5 Released - 10th June 2009
+
+    - Added a subclass of the iterate info viewlet to redeclare the security so that 
+      editors can see it and find existing checkouts.
+
+    [Dave Mote, Washtenaw County Government]
+
+ilrt.formalworkflow - 0.4 Released - 20th May 2009
+
+    - Added an adapted version of one_state_workflow to allow editors to add 
+      and delete images and files. Since the default formalworkflow profile adds 
+      formal_workflow to folders - blocking editor modification of unworkflowed types.
+
+    [Ed Crewe, ILRT - University of Bristol]
+
 ilrt.formalworkflow - 0.3 Released - 5th April 2009
 
     - Changed action names and templates to be less versioning orientated
 To Do list
 ----------
 
-Find a different way to allow permissions of objects to be used rather 
+Find a better way to allow permissions of objects to be used rather 
 than those of their containers for delete, copy and paste.
 Currently it uses a workaround that needs proxy manager then does a
 manual permission check, within the skins.

ilrt.formalworkflow.egg-info/PKG-INFO

 Metadata-Version: 1.0
 Name: ilrt.formalworkflow
-Version: 0.3
+Version: 0.5
 Summary: Formal workflow is designed to prevent editing, deletion or reversion of published content from skipping review
 Home-page: https://svn.ilrt.bris.ac.uk/repos/pypi/ilrt.formalworkflow
 Author: Internet Development, ILRT, University of Bristol
         --------
         
         Ed Crewe, `ILRT
-        <http://www.ilrt.bris.ac.uk/>`_ at University of Bristol, April 5th 2009
+        <http://www.ilrt.bris.ac.uk/>`_ at University of Bristol, June 10th 2009
         
         Formal workflow is designed for sites where there may be many editors
         for whom unmoderated access to change live published content on the
         skin should be added near the top of the editing layer's skins listing in the
         portal_skins tool.
         
-        If this workflow is applied to an existing site ... then you may require the
+        If this workflow is applied to an existing site you may require the
         `ilrt.migrationtool
         <http://pypi.python.org/pypi/ilrt.migrationtool>`_ to use its utility for mapping
-        existing content states from the old workflow to formalworkflow
+        existing content states from one workflow to another. Otherwise changing
+        workflow reverts objects to the new workflow's default state.
         
         If you wish to use custom types with this workflow you will need to make them versionable
         via the
         <http://plone.org/documentation/how-to/enabling-versioning-on-your-custom-content-types>`_ or
         plone.app.iterate will not be available for them.
         
+        If formal workflow is applied to folders (as is the default profile setting) then types
+        without workflow such as images and files cannot be added or deleted by editors.
+        To fix this a slightly adapted version of one_state_workflow is also included for these
+        content types that allows for editors to modify this content unrestricted.
+        
+        You can customize which types use formal_worflow, and hence enforce a review process,
+        via the the portal_workflow tool. You could also choose to only apply formal workflow
+        to the high profile parts of your site, via `placeful workflow
+        <http://pypi.python.org/pypi/Products.CMFPlacefulWorkflow>`_.
+        
         Changelog for ilrt.formalworkflow
         ---------------------------------
         
         (name of developer listed in brackets)
         
+        ilrt.formalworkflow - 0.5 Released - 10th June 2009
+        
+        - Added a subclass of the iterate info viewlet to redeclare the security so that
+        editors can see it and find existing checkouts.
+        
+        [Dave Mote, Washtenaw County Government]
+        
+        ilrt.formalworkflow - 0.4 Released - 20th May 2009
+        
+        - Added an adapted version of one_state_workflow to allow editors to add
+        and delete images and files. Since the default formalworkflow profile adds
+        formal_workflow to folders - blocking editor modification of unworkflowed types.
+        
+        [Ed Crewe, ILRT - University of Bristol]
+        
         ilrt.formalworkflow - 0.3 Released - 5th April 2009
         
         - Changed action names and templates to be less versioning orientated
         To Do list
         ----------
         
-        Find a different way to allow permissions of objects to be used rather
+        Find a better way to allow permissions of objects to be used rather
         than those of their containers for delete, copy and paste.
         Currently it uses a workaround that needs proxy manager then does a
         manual permission check, within the skins.
 Classifier: Intended Audience :: Other Audience
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable

ilrt.formalworkflow.egg-info/SOURCES.txt

 ilrt/formalworkflow/browser/checkout.pt
 ilrt/formalworkflow/browser/checkout.py
 ilrt/formalworkflow/browser/configure.zcml
+ilrt/formalworkflow/browser/info.py
 ilrt/formalworkflow/profiles/default/actions.xml
 ilrt/formalworkflow/profiles/default/ilrt.formalworkflow_various.txt
 ilrt/formalworkflow/profiles/default/import_steps.xml
 ilrt/formalworkflow/profiles/default/skins.xml
 ilrt/formalworkflow/profiles/default/workflows.xml
 ilrt/formalworkflow/profiles/default/workflows/formal_workflow/definition.xml
+ilrt/formalworkflow/profiles/default/workflows/one_state_workflow/definition.xml
 ilrt/formalworkflow/skins/formalworkflow/check_obj_permission.py
 ilrt/formalworkflow/skins/formalworkflow/delete_confirmation.cpy
 ilrt/formalworkflow/skins/formalworkflow/delete_confirmation.cpy.metadata

ilrt/formalworkflow/browser/configure.zcml

         permission="zope2.DeleteObjects"
         />
 
+    <browser:viewlet
+        name="formalworkflow.baseline_info"
+        manager="plone.app.layout.viewlets.interfaces.IAboveContent"
+        class=".info.BaselineInfoViewlet"
+        permission="zope2.View"
+        for="plone.app.iterate.interfaces.IBaseline"
+        view="plone.app.layout.globals.interfaces.IViewView"
+        />   
+
 </configure>

ilrt/formalworkflow/browser/info.py

+from plone.app.iterate.browser.info import BaselineInfoViewlet
+from AccessControl import getSecurityManager
+
+class BaselineInfoViewlet(BaselineInfoViewlet):
+    """ Added to alter security declaration to allow editors
+        to see info viewlet """
+    
+    def render(self):
+        if self.working_copy() is not None and \
+          getSecurityManager().checkPermission('Copy or Move', self.context):
+            return self.template()
+        else:
+            return ""

ilrt/formalworkflow/profiles/default/workflows.xml

   <type type_id="ATSimpleIntCriterion"/>
   <type type_id="ATSimpleStringCriterion"/>
   <type type_id="ATSortCriterion"/>
-  <type type_id="Discussion Item"/>
-  <type type_id="File"/>
-  <type type_id="Image"/>
+  <type type_id="Discussion Item">
+   <bound-workflow workflow_id="one_state_workflow"/>
+  </type>
+  <type type_id="File">
+   <bound-workflow workflow_id="one_state_workflow"/>
+  </type>
+  <type type_id="Image">
+   <bound-workflow workflow_id="one_state_workflow"/>
+  </type>
   <type type_id="Plone Site"/>
  </bindings>
 </object>

ilrt/formalworkflow/profiles/default/workflows/one_state_workflow/definition.xml

+<?xml version="1.0"?>
+<dc-workflow 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. Adapted by ilrt.formalworkflow to add delete permission for owner, editor and manager."
+             state_variable="review_state"
+             initial_state="published">
+ <permission>Access contents information</permission>
+ <permission>Change portal events</permission>
+ <permission>List folder contents</permission>
+ <permission>Modify portal content</permission>
+ <permission>View</permission>
+ <permission>Delete objects</permission>
+ <state state_id="published" title="Published">
+  <description>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>Editor</permission-role>
+   <permission-role>Manager</permission-role>
+   <permission-role>Owner</permission-role>
+  </permission-map>
+  <permission-map name="Delete objects" acquired="False">
+   <permission-role>Editor</permission-role>
+   <permission-role>Manager</permission-role>
+   <permission-role>Owner</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>Editor</permission-role>
+   <permission-role>Manager</permission-role>
+   <permission-role>Owner</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>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>The ID of the user who performed the previous transition
+</description>
+  <default>
+   
+   <expression>user/getUserName</expression>
+  </default>
+  <guard>
+  </guard>
+ </variable>
+ <variable variable_id="comments" for_catalog="False"
+           for_status="True" update_always="True">
+  <description>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>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>When the previous transition was performed
+</description>
+  <default>
+   
+   <expression>state_change/getDateTime</expression>
+  </default>
+  <guard>
+  </guard>
+ </variable>
+</dc-workflow>

ilrt/formalworkflow/tests/workflowprocess.txt

     >>> iteration_url + '/@@accept-changes' not in browser.contents
     True
 
+Test that if an editor goes to the published page they get the 'checked out' message
+====================================================================================
+
+Open the original doc again
+
+    >>> browser.open(doc_url)
+
+Now we shouldnt have a checkout link anymore since its already checked out
+
+    >>> try:
+    ...    checkoutlink = browser.getLink(url=checkout_url)
+    ... except LinkNotFoundError:
+    ...    checkoutlink = None
+    >>> checkoutlink == None
+    True
+
+Can we see can see the checked out already message and follow it to a working copy
+
+    >>> 'a working copy' in browser.contents
+    True
+    >>> try:
+    ...    iterationlink = browser.getLink(url=iteration_url)
+    ... except LinkNotFoundError:
+    ...    iterationlink = None
+    >>> iterationlink != None
+    True
+
+
 Log in as manager and checkin the change
 ========================================
 

ilrt/formalworkflow/version.txt

-0.3
+0.5
 from setuptools import setup, find_packages
 import os
 
-version = '0.3'
+version = '0.5'
 
 setup(name='ilrt.formalworkflow',
       version=version,
         "Intended Audience :: Other Audience",
         "License :: OSI Approved :: BSD License",
         "Operating System :: OS Independent",
-        "Development Status :: 4 - Beta"
+        "Development Status :: 5 - Production/Stable"
         ],
       keywords='web zope plone workflow',
       author='Internet Development, ILRT, University of Bristol',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.