[R] exclude workflow capabilities from this base cube
authorJulien Jehannet <julien.jehannet@logilab.fr>
Fri, 18 Sep 2009 12:35:04 +0200
changeset 61 6e358556dfea
parent 60 dfea5784bb9e
child 62 de70dc39d97f
[R] exclude workflow capabilities from this base cube Few instances need a worflow on the Keyword entity. All the related code was moved to upward cubes explicitly
__pkginfo__.py
debian/changelog
entities.py
hooks.py
i18n/en.po
i18n/fr.po
migration/postcreate.py
schema.py
test/unittest_classification.py
views.py
--- a/__pkginfo__.py	Mon Sep 07 20:58:59 2009 +0200
+++ b/__pkginfo__.py	Fri Sep 18 12:35:04 2009 +0200
@@ -52,6 +52,3 @@
 except OSError:
     # we are in an installed directory
     pass
-
-
-cube_eid = 20308
--- a/debian/changelog	Mon Sep 07 20:58:59 2009 +0200
+++ b/debian/changelog	Fri Sep 18 12:35:04 2009 +0200
@@ -4,7 +4,7 @@
 
  -- Sylvain Thénault <sylvain.thenault@logilab.fr>  Wed, 24 Jun 2009 15:29:01 +0200
 
-cubicweb-keyword (1.2.1-1) DISTRIBUTION; urgency=low
+cubicweb-keyword (1.2.1-1) unstable; urgency=low
 
   * first public release
 
--- a/entities.py	Mon Sep 07 20:58:59 2009 +0200
+++ b/entities.py	Fri Sep 18 12:35:04 2009 +0200
@@ -10,6 +10,7 @@
 from cubicweb.entities import AnyEntity, fetch_config
 from cubicweb.interfaces import ITree
 
+
 class Classification(AnyEntity):
     id = 'Classification'
     fetch_attrs, fetch_order = fetch_config(['name'])
@@ -56,13 +57,6 @@
             return self.subkeyword_of[0]
         return self.classification
 
-    def dc_long_title(self):
-        try:
-            return '%s (%s)' % (self.name, self.req._(self.state))
-        except IndexError:
-            # XXX no state yet, due to notification before state has been set
-            return self.name
-
 
 class CodeKeyword(Keyword):
     id = 'CodeKeyword'
@@ -71,4 +65,3 @@
 
     def dc_title(self):
         return u'%s - %s' % (self.code, self.name)
-    dc_long_title = dc_title # what about state ?
--- a/hooks.py	Mon Sep 07 20:58:59 2009 +0200
+++ b/hooks.py	Fri Sep 18 12:35:04 2009 +0200
@@ -4,15 +4,14 @@
 :copyright: 2007-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
-
 from logilab.common.decorators import cached
 
 from cubicweb import ValidationError
 from cubicweb.selectors import implements
 from cubicweb.server.hooksmanager import Hook
 from cubicweb.server.pool import PreCommitOperation
-from cubicweb.sobjects.notification import (ContentAddedView, NotificationView,
-                                            StatusChangeMixIn)
+from cubicweb.sobjects.notification import NotificationView
+
 
 class BeforeKeywordApplicationHook(Hook):
     """
@@ -80,7 +79,6 @@
                                 fromeid=fromeid, toeid=toeid)
 
 
-
 class KeywordNotificationView(NotificationView):
     __select__ = implements('Keyword')
     msgid_timestamp = True
@@ -99,17 +97,6 @@
         return context
 
 
-class KeywordStatusChanged(StatusChangeMixIn, KeywordNotificationView):
-    content = _("""
-The state of keyword %(kw)s is now %(current_state)s
-""")
-
-    def subject(self):
-        entity = self.entity(0)
-        return self.req._('keyword %s is now in state %s') % (
-            entity.name, self._kwargs['current_state'])
-
-
 class KeywordNameChanged(KeywordNotificationView):
     id = 'notif_after_update_entity'
 
@@ -134,41 +121,3 @@
         entity = self.entity(0)
         return self.req._('keyword name changed from %s to %s') % (
             self.get_oldname(entity), entity.name)
-
-
-class KeywordAddedView(ContentAddedView):
-    """get notified from new keywords"""
-    __select__ = implements('Keyword')
-    content_attr = 'name'
-    msgid_timestamp = True
-    # XXX use a proper recipients finder
-    def recipients(self):
-        dests = [add for add, in self.req.execute(
-            'Any A WHERE X is CWUser, X in_group G,'
-            'G name "managers", X in_state S, S name "activated",'
-            'X primary_email E, E address A')]
-        if not dests:
-            dests = self.config['default-dest-addrs']
-        return [(add, 'fr') for add in dests]
-
-
-class SetKeywordInitialStateOp(PreCommitOperation):
-    """make initial state be a default state"""
-
-    def precommit_event(self):
-        session = self.session
-        entity = self.entity
-        rql = 'SET X in_state ST WHERE ST name %(name)s, X is ET, ST state_of ET, X eid %(x)s'
-        if session.user.is_in_group('managers'):
-            session.execute(rql, {'x': entity.eid, 'name': "keyword validated"}, 'x')
-        else:
-            session.unsafe_execute(rql, {'x': entity.eid, 'name': "validation pending"}, 'x')
-
-
-class AfterAddAnyEntity(Hook):
-    """make initial state be a default state"""
-    events = ('after_add_entity',)
-    accepts = ('Keyword',)
-
-    def call(self, session, entity):
-        SetKeywordInitialStateOp(session, entity=entity)
--- a/i18n/en.po	Mon Sep 07 20:58:59 2009 +0200
+++ b/i18n/en.po	Fri Sep 18 12:35:04 2009 +0200
@@ -6,14 +6,7 @@
 "Generated-By: cubicweb-devtools\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
-#, python-format
-msgid ""
-"\n"
-"The state of keyword %(kw)s is now %(current_state)s\n"
-msgstr ""
-
-#, python-format
-msgid " but keywords %s must be validated"
+msgid "A CodeKeyword is a keyword with a code and a name"
 msgstr ""
 
 msgid ""
@@ -21,9 +14,6 @@
 "classification scheme"
 msgstr ""
 
-msgid "A problem occured while applying keywords"
-msgstr ""
-
 # schema pot file, generated on 2007-10-18 15:50:10
 #
 # singular and plural forms for each entity type
@@ -33,6 +23,12 @@
 msgid "Classification_plural"
 msgstr "Classifications"
 
+msgid "CodeKeyword"
+msgstr ""
+
+msgid "CodeKeyword_plural"
+msgstr ""
+
 msgid "Keyword"
 msgstr "Keyword"
 
@@ -42,6 +38,9 @@
 msgid "New Classification"
 msgstr "New classification"
 
+msgid "New CodeKeyword"
+msgstr ""
+
 msgid "New Keyword"
 msgstr "New keyword"
 
@@ -51,6 +50,9 @@
 msgid "This Classification"
 msgstr "This classification"
 
+msgid "This CodeKeyword"
+msgstr ""
+
 msgid "This Keyword"
 msgstr "This keyword"
 
@@ -60,6 +62,12 @@
 msgid "a keyword is included in a classification scheme"
 msgstr ""
 
+msgid "add CodeKeyword included_in Classification object"
+msgstr ""
+
+msgid "add CodeKeyword subkeyword_of CodeKeyword object"
+msgstr ""
+
 # add related box generated message
 msgid "add Keyword included_in Classification object"
 msgstr "keyword"
@@ -70,6 +78,9 @@
 msgid "add a Classification"
 msgstr "add a classification"
 
+msgid "add a CodeKeyword"
+msgstr ""
+
 msgid "add a Keyword"
 msgstr "add a keyword"
 
@@ -93,6 +104,9 @@
 msgid "classifies_object"
 msgstr "classified by"
 
+msgid "code"
+msgstr ""
+
 msgid "contentnavigation_addkeywords"
 msgstr "add keywords"
 
@@ -105,14 +119,20 @@
 msgid "contentnavigation_keywordsbar_description"
 msgstr "component to display keywords of an entity"
 
+msgid ""
+"creating CodeKeyword (CodeKeyword included_in Classification %(linkto)s)"
+msgstr ""
+
+msgid "creating CodeKeyword (CodeKeyword subkeyword_of CodeKeyword %(linkto)s)"
+msgstr ""
+
 msgid "creating Keyword (Keyword included_in Classification %(linkto)s)"
 msgstr "creating keyword for classification scheme %(linkto)s"
 
 msgid "creating Keyword (Keyword subkeyword_of Keyword %(linkto)s)"
 msgstr "creating subkeyword of %(linkto)s"
 
-#, python-format
-msgid "detected subkeyword cycle for keyword %(kw)s"
+msgid "detected subkeyword cycle"
 msgstr ""
 
 msgid ""
@@ -120,18 +140,19 @@
 "the applied_to relation can be selectioned"
 msgstr ""
 
+msgid "facets_applied-to-facet"
+msgstr ""
+
+msgid "facets_applied-to-facet_description"
+msgstr ""
+
 msgid "included_in"
 msgstr "included in"
 
 msgid "included_in_object"
 msgstr "includes"
 
-#, python-format
-msgid "keyword %(kw)s cannot be subkeyword of himself"
-msgstr ""
-
-#, python-format
-msgid "keyword %s is not in state %s"
+msgid "keyword cannot be subkeyword of himself"
 msgstr ""
 
 #, python-format
@@ -142,30 +163,18 @@
 msgid "keyword name changed from %s to %s"
 msgstr ""
 
-msgid "keyword rejected"
-msgstr ""
-
-msgid "keyword status"
-msgstr ""
-
-msgid "keyword validated"
-msgstr ""
-
 msgid "keywords applied"
 msgstr ""
 
 msgid "keywords:"
 msgstr ""
 
-msgid "no tagged object"
-msgstr ""
-
-msgid "reject keyword"
-msgstr ""
-
 msgid "remove this Classification"
 msgstr "remove this classification"
 
+msgid "remove this CodeKeyword"
+msgstr ""
+
 msgid "remove this Keyword"
 msgstr "remove this keyword"
 
@@ -181,11 +190,5 @@
 msgid "this keyword can't be applied to this kind of entity"
 msgstr ""
 
-msgid "validate keyword"
-msgstr ""
-
-msgid "validation pending"
-msgstr ""
-
 msgid "which keyword (if any) this keyword specializes"
 msgstr ""
--- a/i18n/fr.po	Mon Sep 07 20:58:59 2009 +0200
+++ b/i18n/fr.po	Fri Sep 18 12:35:04 2009 +0200
@@ -5,24 +5,15 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: cubicweb-classification-schemes 0.11.0\n"
-"PO-Revision-Date: 2008-03-28 18:21+0100\n"
+"PO-Revision-Date: 2009-09-17 10:31+0200\n"
 "Last-Translator: Logilab Team <contact@logilab.fr>\n"
 "Language-Team: fr <contact@logilab.fr>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#, python-format
-msgid ""
-"\n"
-"The state of keyword %(kw)s is now %(current_state)s\n"
-msgstr ""
-"\n"
-"L'état du mot-clé %(kw)s est maintenant %(current_state)s\n"
-
-#, python-format
-msgid " but keywords %s must be validated"
-msgstr " mais les mots-clés %s sont en attente de validation"
+msgid "A CodeKeyword is a keyword with a code and a name"
+msgstr "Un code de mot-clé est un mot-clé avec un code et un nom"
 
 msgid ""
 "A keyword is like a tag but is application specific and used to define a "
@@ -31,9 +22,6 @@
 "Un mot-clé est similaire à une étiquette mais il fait parti d'un plan de "
 "classement hiérarchisé"
 
-msgid "A problem occured while applying keywords"
-msgstr "un problème est survenu pendant la spécification des mots-clé"
-
 # schema pot file, generated on 2007-10-18 15:50:10
 #
 # singular and plural forms for each entity type
@@ -43,6 +31,12 @@
 msgid "Classification_plural"
 msgstr "Plans de classement"
 
+msgid "CodeKeyword"
+msgstr "Code de mot-clé"
+
+msgid "CodeKeyword_plural"
+msgstr "Codes de mots-clé"
+
 msgid "Keyword"
 msgstr "Mot-clé"
 
@@ -52,6 +46,9 @@
 msgid "New Classification"
 msgstr "Nouveau plan de classement"
 
+msgid "New CodeKeyword"
+msgstr "Nouveau code de mot-clé"
+
 msgid "New Keyword"
 msgstr "Nouveau mot-clé"
 
@@ -61,6 +58,9 @@
 msgid "This Classification"
 msgstr "Ce plan de classement"
 
+msgid "This CodeKeyword"
+msgstr "Ce code de mot-clé"
+
 msgid "This Keyword"
 msgstr "Ce mot-clé"
 
@@ -70,6 +70,12 @@
 msgid "a keyword is included in a classification scheme"
 msgstr "un mot-clé est inclus dans un plan de classement"
 
+msgid "add CodeKeyword included_in Classification object"
+msgstr "ajouter un code de mot-clé"
+
+msgid "add CodeKeyword subkeyword_of CodeKeyword object"
+msgstr "ajouter un sous-code de mot-clé"
+
 # add related box generated message
 msgid "add Keyword included_in Classification object"
 msgstr "ajouter un mot-clé"
@@ -80,6 +86,9 @@
 msgid "add a Classification"
 msgstr "ajouter un plan de classement"
 
+msgid "add a CodeKeyword"
+msgstr "ajouter un code de mot-clé"
+
 msgid "add a Keyword"
 msgstr "ajouter un mot-clé"
 
@@ -103,6 +112,9 @@
 msgid "classifies_object"
 msgstr "classifié par"
 
+msgid "code"
+msgstr ""
+
 msgid "contentnavigation_addkeywords"
 msgstr "ajout de mots-clés"
 
@@ -115,34 +127,41 @@
 msgid "contentnavigation_keywordsbar_description"
 msgstr "composant de navigation affichant les mots-clés associés à une entité"
 
+msgid ""
+"creating CodeKeyword (CodeKeyword included_in Classification %(linkto)s)"
+msgstr "création d'un code de mot-clé pour le plan de classement %(linkto)s"
+
+msgid "creating CodeKeyword (CodeKeyword subkeyword_of CodeKeyword %(linkto)s)"
+msgstr "création d'un sous code de mot-clé de %(linkto)s"
+
 msgid "creating Keyword (Keyword included_in Classification %(linkto)s)"
 msgstr "création d'un mot-clé pour le plan de classement %(linkto)s"
 
 msgid "creating Keyword (Keyword subkeyword_of Keyword %(linkto)s)"
 msgstr "création d'un sous mot-clé de %(linkto)s"
 
-#, python-format
-msgid "detected subkeyword cycle for keyword %(kw)s"
-msgstr "un cycle de sous mot-clé a été détecté pour le mot-clé %(kw)s"
+msgid "detected subkeyword cycle"
+msgstr "un cycle de mots-clé a été détecté"
 
 msgid ""
 "entity types classified by the classification. Only entity type supporting "
 "the applied_to relation can be selectioned"
 msgstr ""
 
+msgid "facets_applied-to-facet"
+msgstr ""
+
+msgid "facets_applied-to-facet_description"
+msgstr ""
+
 msgid "included_in"
 msgstr "inclus dans"
 
 msgid "included_in_object"
 msgstr "inclus"
 
-#, python-format
-msgid "keyword %(kw)s cannot be subkeyword of himself"
-msgstr "le mot-clé %(kw)s ne peut être un sous mot-clé de lui même"
-
-#, python-format
-msgid "keyword %s is not in state %s"
-msgstr "le mot clé %s n'est pas dans l'état %s"
+msgid "keyword cannot be subkeyword of himself"
+msgstr "un mot-clé ne peut être un sous mot-clé de lui-même"
 
 #, python-format
 msgid "keyword name changed from %(oldname)s to %(kw)s"
@@ -152,30 +171,18 @@
 msgid "keyword name changed from %s to %s"
 msgstr "le mot-clé %s a été renommé en %s"
 
-msgid "keyword rejected"
-msgstr "mot-clé rejeté"
-
-msgid "keyword status"
-msgstr "état du mot-clé"
-
-msgid "keyword validated"
-msgstr "mot-clé validé"
-
 msgid "keywords applied"
 msgstr "mot-clé(s) appliqué(s)"
 
 msgid "keywords:"
 msgstr "mot-clés :"
 
-msgid "no tagged object"
-msgstr "pas d'objets classifiés"
-
-msgid "reject keyword"
-msgstr "rejeter le mot-clé"
-
 msgid "remove this Classification"
 msgstr "supprimer ce plan de classement"
 
+msgid "remove this CodeKeyword"
+msgstr "supprimer ce code de mot-clé"
+
 msgid "remove this Keyword"
 msgstr "supprimer ce mot-clé"
 
@@ -191,32 +198,5 @@
 msgid "this keyword can't be applied to this kind of entity"
 msgstr "ce mot-clé ne peut être appliqué à ce type d'entité"
 
-msgid "validate keyword"
-msgstr "valider le mot-clé"
-
-msgid "validation pending"
-msgstr "en attente de validation"
-
 msgid "which keyword (if any) this keyword specializes"
-msgstr "le mot-clé que celui-ci spécialise (le cas écheént)"
-
-#~ msgid ""
-#~ "\n"
-#~ "The state of keyword %(kw)s is now %(newstate)s\n"
-#~ msgstr ""
-#~ "\n"
-#~ "L'état du mot-clé %(kw)s et maintenant %(newstate)s\n"
-
-#~ msgid "classified objects"
-#~ msgstr "entités classifiées"
-
-#~ msgid "indicates that an entity can be classified under the given scheme"
-#~ msgstr ""
-#~ "indique qu'une entité peut être classifier sous le plan de classement "
-#~ "donné"
-
-#~ msgid "keyword %(keywords)s doesn't exist"
-#~ msgstr "le mot-clé %(keyword)s n'existe pas"
-
-#~ msgid "keywords %(keywords)s don't exist"
-#~ msgstr "les mots-clé %(keyword)s n'existent pas"
+msgstr "le mot-clé que celui-ci spécialise (le cas échéant)"
--- a/migration/postcreate.py	Mon Sep 07 20:58:59 2009 +0200
+++ b/migration/postcreate.py	Fri Sep 18 12:35:04 2009 +0200
@@ -1,11 +1,2 @@
 # postcreate script. You could setup a workflow here for example
 # no explicit initial state for Keywords since it depends on the user's groups
-
-pending = add_state(_('validation pending'), ('Keyword', 'CodeKeyword'), initial=True)
-validated = add_state(_('keyword validated'), ('Keyword', 'CodeKeyword'))
-rejected = add_state(_('keyword rejected'), ('Keyword', 'CodeKeyword'))
-add_transition(_('validate keyword'), ('Keyword', 'CodeKeyword'), (pending,), validated,
-               requiredgroups=('managers',))
-add_transition(_('reject keyword'), ('Keyword', 'CodeKeyword'), (pending,), rejected,
-               requiredgroups=('managers',))
-
--- a/schema.py	Mon Sep 07 20:58:59 2009 +0200
+++ b/schema.py	Fri Sep 18 12:35:04 2009 +0200
@@ -4,13 +4,12 @@
 :copyright: 2007-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
-
 from yams.buildobjs import (EntityType, RelationType,
-                            SubjectRelation, ObjectRelation,
-                            String)
+                            SubjectRelation, String)
 
 from cubicweb.schema import RQLConstraint, ERQLExpression
 
+
 class Classification(EntityType):
     """classification schemes are used by users to classify entities.
     """
@@ -38,10 +37,7 @@
     and used to define a classification scheme
     """
     permissions = {
-        #'read' : ('managers', 'users', 'guests'),
-        'read' : ('managers',
-                  ERQLExpression('X in_state ST, ST name "keyword validated"'),
-                  ERQLExpression('X owned_by U')),
+        'read' : ('managers', 'users', 'guests'),
         'add' : ('managers', 'users'),
         'delete' : ('managers',),
         'update' : ('managers',),
@@ -54,11 +50,6 @@
                                     constraints=[RQLConstraint('NOT S included_in CS1 OR EXISTS(S included_in CS2, O included_in CS2)')])
     included_in = SubjectRelation('Classification', cardinality='1*')
 
-    in_state = SubjectRelation('State', cardinality='1*',
-                               constraints=[RQLConstraint('O state_of ET, S is ET')],
-                               description=_('keyword status'))
-    wf_info_for = ObjectRelation('TrInfo', cardinality='1*', composite='object')
-
 
 class CodeKeyword(Keyword):
     """A CodeKeyword is a keyword with a code and a name
@@ -66,6 +57,7 @@
     __specializes_schema__ = True
     code = String(required=True, fulltextindexed=True, indexed=True, maxsize=128)
 
+
 class subkeyword_of(RelationType):
     """a keyword can specialize another keyword"""
 
--- a/test/unittest_classification.py	Mon Sep 07 20:58:59 2009 +0200
+++ b/test/unittest_classification.py	Fri Sep 18 12:35:04 2009 +0200
@@ -42,67 +42,6 @@
         self.assertRaises(ValidationError, self.commit)
 
 
-    def test_keyword_workflow_and_permissions(self):
-        user = self.create_user('toto')
-        cnx = self.login('toto')
-
-        kw1 = self.execute('INSERT Keyword K: K name "xyz"')[0][0]
-        self.execute('SET K included_in C WHERE K eid %(x)s, C name "classif1"',
-                     {'x' : kw1})
-        # no validation error
-        self.commit()
-        self.assertEquals(self.execute('Any N WHERE K included_in C, C name N, K eid %(x)s',
-                                       {'x' : kw1})[0][0], "classif1")
-        keywords = self.execute('Any K WHERE K included_in C, C name "classif1"')
-        # 'xyz' should be  visible to 'owner'
-        self.assertEquals(len(keywords), 2)
-        self.restore_connection()
-        user = self.create_user("zoubidou")
-        self.login("zoubidou")
-        keywords = self.execute('Any K WHERE K included_in C, C name "classif1"')
-        # 'xyz' should not visible
-        self.assertEquals(len(keywords), 1)
-        self.restore_connection()
-        keywords = self.execute('Any K WHERE K included_in C, C name "classif1"')
-        # 'xyz' should be  visible to 'managers'
-        self.assertEquals(len(keywords), 2)
-        self.execute('SET X in_state S WHERE S name "keyword validated", X eid %(x)s',
-                     {'x' : kw1})
-        self.commit()
-        self.login("zoubidou")
-        keywords = self.execute('Any K WHERE K included_in C, C name "classif1"')
-        # 'xyz' should now be visible
-        self.assertEquals(len(keywords), 2)
-
-
-class KeywordTC(EnvBasedTC):
-    def setup_database(self):
-        self.classif = self.add_entity(u'Classification', name=u'theclassif')
-        self.execute('SET C classifies ET WHERE C eid %(c)s, ET name "CWUser"',
-                     {'c' : self.classif.eid})
-
-
-    def test_initial_state_for_admins(self):
-        kweid = self.execute('INSERT Keyword K: K name "kw1", K included_in C WHERE C eid %(c)s',
-                             {'c' : self.classif.eid})[0][0]
-        self.commit()
-        state = self.execute('Any SN WHERE K in_state S, S name SN, K eid %(k)s',
-                             {'k' : kweid})[0][0]
-        self.assertEquals(state, u'keyword validated')
-
-    def test_initial_state_for_users(self):
-        user = self.create_user('john')
-        self.login('john')
-        kweid = self.execute('INSERT Keyword K: K name "kw1", K included_in C WHERE C eid %(c)s',
-                             {'c' : self.classif.eid})[0][0]
-        self.commit()
-        state = self.execute('Any SN WHERE K in_state S, S name SN, K eid %(k)s',
-                             {'k' : kweid})[0][0]
-        self.assertEquals(state, u'validation pending')
-
-
-
-
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main
     unittest_main()
--- a/views.py	Mon Sep 07 20:58:59 2009 +0200
+++ b/views.py	Fri Sep 18 12:35:04 2009 +0200
@@ -6,8 +6,6 @@
 """
 __docformat__ = "restructuredtext en"
 
-import simplejson
-
 from logilab.common.decorators import monkeypatch
 from logilab.mtconverter import xml_escape
 
@@ -28,9 +26,6 @@
 _abaa.tag_object_of(('CodeKeyword', 'subkeyword_of', 'CodeKeyword'), True)
 _abaa.tag_object_of(('Keyword', 'subkeyword_of', 'Keyword'), True)
 
-_afs = uicfg.autoform_section
-_afs.tag_object_of(('Keyword', 'in_state', '*'), 'generated')
-
 
 # classification views ########################################################
 
@@ -60,19 +55,6 @@
         self.wview('treeview', rset, 'null')
 
 
-class KeywordOneLineView(baseviews.InContextView):
-    __select__ = implements('Keyword')
-
-    def cell_call(self, row, col):
-        entity = self.entity(row, col)
-        if entity.state == 'validation pending':
-            cssclass = u'class="needsvalidation"'
-        else:
-            cssclass = u''
-        self.w(u'<a href="%s" %s>%s</a>' % (xml_escape(entity.absolute_url()),
-                                            cssclass,
-                                            xml_escape(entity.name)))
-
 class KeywordComboBoxView(TreePathMixIn, EntityView):
     """display keyword in edition's combobox"""
     id = 'combobox'
@@ -86,22 +68,19 @@
 class KeywordBarVComponent(component.EntityVComponent):
     """the keywords path bar: display keywords of a tagged entity"""
     id = 'keywordsbar'
-    __select__ = component.EntityVComponent.__select__ & \
-                 relation_possible('applied_to', 'object', 'Keyword')
+    __select__ = (component.EntityVComponent.__select__ &
+                  relation_possible('applied_to', 'object', 'Keyword'))
     context = 'header'
     order = 152
     htmlclass = 'navigation'
 
-    def call(self, **kwargs):
+    def get_keywords(self):
+        """helper method for subclasses redefinition"""
         entity = self.entity(0)
-        # managers can see all applied keyword, other users will only see validated
-        # keywords or their own ones
-        if self.req.user.is_in_group('managers'):
-            rset = entity.related('applied_to', 'object')
-        else:
-            rset = self.cursor.execute('DISTINCT Any K,N WHERE K name N, K applied_to X, X eid %(x)s, '
-                                       '(K owned_by U, U eid %(u)s) or (K in_state ST, ST name "keyword validated")',
-                                       {'x' : entity.eid, 'u' : self.req.user.eid}, 'x')
+        return entity.related('applied_to', 'object')
+
+    def call(self, **kwargs):
+        rset = self.get_keywords()
         if rset:
             self.w(u'<div class="%s" id="%s">\n' % (self.div_class(), self.div_id()))
             self.w(u'<span>%s</span>&nbsp;' % self.req._('keywords:'))
@@ -184,8 +163,6 @@
             neweid = self.cursor.execute('INSERT Keyword K: K name %(name)s, K included_in C WHERE C eid %(c)s',
                                          {'name' : keyword, 'c' : classification}, 'c')[0][0]
             kweids[keyword] = str(neweid)
-        if not self.req.user.is_in_group('managers'):
-            msg += self.req._(' but keywords %s must be validated') % u', '.join(invalid_keywords)
     if kweids:
         self.cursor.execute('SET KW applied_to X WHERE X eid %%(x)s, KW eid IN (%s)'
                             % ','.join(kweids.values()), {'x' : eid}, 'x')