diff --git a/organize/stateful/README.txt b/organize/stateful/README.txt index 384eefd..cca4427 100644 --- a/organize/stateful/README.txt +++ b/organize/stateful/README.txt @@ -23,14 +23,16 @@ First we set up a loops site with basic and example concepts and resources. Stateful Objects ================ +A simple publishing workflow +---------------------------- + Let's start with registering the states definitions and adapters needed. The states definition (aka 'workflow') is registered as a utility; for making an object statful we'll use an adapter. >>> from cybertools.stateful.interfaces import IStatesDefinition, IStateful >>> from cybertools.stateful.publishing import simplePublishing - >>> component.provideUtility(simplePublishing, IStatesDefinition, - ... name='loops.simple_publishing') + >>> component.provideUtility(simplePublishing(), name='loops.simple_publishing') >>> from loops.organize.stateful.base import SimplePublishable >>> component.provideAdapter(SimplePublishable, name='loops.simple_publishing') @@ -59,6 +61,23 @@ not just kept in the adapter. 'published' +Controlling classification quality +---------------------------------- + + >>> from loops.organize.stateful.quality import classificationQuality + >>> component.provideUtility(classificationQuality(), + ... name='loops.classification_quality') + >>> from loops.organize.stateful.quality import ClassificationQualityCheckable + >>> component.provideAdapter(ClassificationQualityCheckable, + ... name='loops.classification_quality') + + >>> qcheckedDoc01 = component.getAdapter(doc01, IStateful, + ... name='loops.classification_quality') + >>> qcheckedDoc01.state + 'unclassified' + + + Fin de partie ============= diff --git a/organize/stateful/base.py b/organize/stateful/base.py index 25a3e74..a81284c 100644 --- a/organize/stateful/base.py +++ b/organize/stateful/base.py @@ -45,3 +45,4 @@ class StatefulLoopsObject(Stateful, StatefulAdapter): class SimplePublishable(StatefulLoopsObject): statesDefinition = 'loops.simple_publishing' + diff --git a/organize/stateful/configure.zcml b/organize/stateful/configure.zcml index 37923c9..f7732d6 100644 --- a/organize/stateful/configure.zcml +++ b/organize/stateful/configure.zcml @@ -6,7 +6,7 @@ i18n_domain="loops">