diff --git a/knowledge/README.txt b/knowledge/README.txt index 994b7ae..b0407d4 100644 --- a/knowledge/README.txt +++ b/knowledge/README.txt @@ -171,9 +171,9 @@ Competence and Certification Management ======================================= >>> from cybertools.stateful.interfaces import IStatesDefinition - >>> from loops.knowledge.qualification import qualificationStates - >>> from loops.knowledge.interfaces import IQualificationRecords - >>> from loops.knowledge.qualification import QualificationRecords + >>> from loops.knowledge.qualification.base import qualificationStates + >>> from loops.knowledge.qualification.interfaces import IQualificationRecords + >>> from loops.knowledge.qualification.base import QualificationRecords >>> component.provideUtility(qualificationStates, ... provides=IStatesDefinition, ... name='knowledge.qualification') @@ -190,8 +190,8 @@ We first create a training that provides knowledge in Python specials. Then we record the need for John to acquire this knowledge. - >>> from loops.knowledge.browser import CreateQualificationRecordForm - >>> from loops.knowledge.browser import CreateQualificationRecord + >>> from loops.knowledge.qualification.browser import CreateQualificationRecordForm + >>> from loops.knowledge.qualification.browser import CreateQualificationRecord Glossaries @@ -205,6 +205,12 @@ Glossary items are topic-like concepts that may be edited by end users. >>> from loops.knowledge.glossary.browser import EditGlossaryItem +Survey +====== + + >>> from loops.knowledge.survey.base import Questionnaire + + Fin de partie ============= diff --git a/knowledge/browser.py b/knowledge/browser.py index c749f23..6126661 100644 --- a/knowledge/browser.py +++ b/knowledge/browser.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2012 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,10 +30,7 @@ from cybertools.typology.interfaces import IType from loops.browser.action import DialogAction from loops.browser.common import BaseView from loops.browser.concept import ConceptView -from loops.expert.browser.report import ResultsConceptView from loops.knowledge.interfaces import IPerson, ITask -from loops.knowledge.qualification import QualificationRecord -from loops.organize.work.browser import CreateWorkItemForm, CreateWorkItem from loops.organize.party import getPersonForUser from loops.util import _ @@ -114,25 +111,3 @@ class Candidates(ConceptView): return self.template.macros['requirement_candidates'] -# qualification stuff - -class PersonQualificationView(ResultsConceptView): - - pass - - -class CreateQualificationRecordForm(CreateWorkItemForm): - - macros = knowledge_macros - recordManagerName = 'qualification' - trackFactory = QualificationRecord - - @Lazy - def macro(self): - return self.macros['create_qualification'] - - -class CreateQualificationRecord(CreateWorkItem): - - pass - diff --git a/knowledge/configure.zcml b/knowledge/configure.zcml index da2bb30..50d67c4 100644 --- a/knowledge/configure.zcml +++ b/knowledge/configure.zcml @@ -1,5 +1,3 @@ - - - - - - - - - - - - - - - - - @@ -120,5 +89,7 @@ + + diff --git a/knowledge/data/loops_knowledge_de.dmp b/knowledge/data/loops_knowledge_de.dmp index 3b2ce7b..2d3995c 100644 --- a/knowledge/data/loops_knowledge_de.dmp +++ b/knowledge/data/loops_knowledge_de.dmp @@ -41,4 +41,4 @@ child(u'system', u'issubtype', u'standard') child(u'competence', u'training', u'issubtype', usePredicate=u'provides') # records -records(u'qualification', u'loops.knowledge.qualification.QualificationRecord') +records(u'qualification', u'loops.knowledge.qualification.base.QualificationRecord') diff --git a/knowledge/data/loops_knowledge_update_de.dmp b/knowledge/data/loops_knowledge_update_de.dmp index 4080f43..693b49c 100644 --- a/knowledge/data/loops_knowledge_update_de.dmp +++ b/knowledge/data/loops_knowledge_update_de.dmp @@ -41,4 +41,4 @@ child(u'system', u'issubtype', u'standard') child(u'competence', u'training', u'issubtype', usePredicate=u'provides') # records -records(u'qualification', u'loops.knowledge.qualification.QualificationRecord') +records(u'qualification', u'loops.knowledge.qualification.base.QualificationRecord') diff --git a/knowledge/interfaces.py b/knowledge/interfaces.py index f1aef6b..5233653 100644 --- a/knowledge/interfaces.py +++ b/knowledge/interfaces.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2012 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,18 +22,14 @@ Interfaces for knowledge management and elearning with loops. from zope.interface import Interface, Attribute from zope import interface, component, schema -from zope.i18nmessageid import MessageFactory -from zope.security.proxy import removeSecurityProxy from cybertools.knowledge.interfaces import IKnowing, IRequirementProfile from cybertools.knowledge.interfaces import IKnowledgeElement -from cybertools.organize.interfaces import IWorkItem, IWorkItems from loops.interfaces import IConceptSchema, ILoopsAdapter from loops.organize.interfaces import IPerson as IBasePerson from loops.organize.interfaces import ITask as IBaseTask from loops.schema.base import Relation, RelationSet - -_ = MessageFactory('loops') +from loops.util import _ class IPerson(IBasePerson, IKnowing): @@ -62,13 +58,3 @@ class ITopic(IConceptSchema, IKnowledgeElement, ILoopsAdapter): """ Just a topic, some general classification concept. """ - -class IQualificationRecord(IWorkItem): - """ Records needs for qualification (acqusition of competence) - and corresponding participations in training events etc. - """ - - -class IQualificationRecords(IWorkItems): - """ Container for qualification records. - """ diff --git a/knowledge/qualification/__init__.py b/knowledge/qualification/__init__.py new file mode 100644 index 0000000..36a440f --- /dev/null +++ b/knowledge/qualification/__init__.py @@ -0,0 +1 @@ +'''package loops.knowledge.qualification''' \ No newline at end of file diff --git a/knowledge/qualification/base.py b/knowledge/qualification/base.py new file mode 100644 index 0000000..41be4ea --- /dev/null +++ b/knowledge/qualification/base.py @@ -0,0 +1,103 @@ +# +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Controlling qualification activities of persons. + +Central part of CCM competence and certification management framework. +""" + +from zope.component import adapts +from zope.interface import implementer, implements + +from cybertools.stateful.base import Stateful +from cybertools.stateful.definition import StatesDefinition +from cybertools.stateful.definition import State, Transition +from cybertools.stateful.interfaces import IStatesDefinition +from cybertools.tracking.interfaces import ITrackingStorage +from loops.knowledge.qualification.interfaces import IQualificationRecord, \ + IQualificationRecords +from loops.organize.work.base import WorkItem, WorkItems + + +@implementer(IStatesDefinition) +def qualificationStates(): + return StatesDefinition('qualification', + State('new', 'new', ('assign',), + color='grey'), + State('open', 'open', + ('register', + #'pass', 'fail', + 'cancel', 'modify'), + color='red'), + State('registered', 'registered', + ('register', 'pass', 'fail', 'unregister', 'cancel', 'modify'), + color='yellow'), + State('passed', 'passed', + ('cancel', 'close', 'modify', 'open', 'expire'), + color='green'), + State('failed', 'failed', + ('register', 'cancel', 'modify', 'open'), + color='green'), + State('expired', 'expired', + ('register', 'cancel', 'modify', 'open'), + color='red'), + State('cancelled', 'cancelled', ('modify', 'open'), + color='grey'), + State('closed', 'closed', ('modify', 'open'), + color='lightblue'), + # not directly reachable states: + State('open_x', 'open', ('modify',), color='red'), + State('registered_x', 'registered', ('modify',), color='yellow'), + # transitions: + Transition('assign', 'assign', 'open'), + Transition('register', 'register', 'registered'), + Transition('pass', 'pass', 'passed'), + Transition('fail', 'fail', 'failed'), + Transition('unregister', 'unregister', 'open'), + Transition('cancel', 'cancel', 'cancelled'), + Transition('modify', 'modify', 'open'), + Transition('close', 'close', 'closed'), + Transition('open', 'open', 'open'), + #initialState='open') + initialState='new') # TODO: handle assignment to competence + + +class QualificationRecord(WorkItem): + + implements(IQualificationRecord) + + typeName = 'QualificationRecord' + typeInterface = IQualificationRecord + statesDefinition = 'knowledge.qualification' + + def doAction(self, action, userName, **kw): + new = self.createNew(action, userName, **kw) + new.userName = self.userName + new.doTransition(action) + new.reindex() + return new + + +class QualificationRecords(WorkItems): + """ A tracking storage adapter managing qualification records. + """ + + implements(IQualificationRecords) + adapts(ITrackingStorage) + diff --git a/knowledge/qualification/browser.py b/knowledge/qualification/browser.py new file mode 100644 index 0000000..f749a59 --- /dev/null +++ b/knowledge/qualification/browser.py @@ -0,0 +1,53 @@ +# +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Definition of view classes and other browser related stuff for the +loops.knowledge package. +""" + +from zope import interface, component +from zope.app.pagetemplate import ViewPageTemplateFile +from zope.cachedescriptors.property import Lazy + +from loops.expert.browser.report import ResultsConceptView +from loops.knowledge.browser import template, knowledge_macros +from loops.knowledge.qualification.base import QualificationRecord +from loops.organize.work.browser import CreateWorkItemForm, CreateWorkItem + + +class PersonQualificationView(ResultsConceptView): + + pass + + +class CreateQualificationRecordForm(CreateWorkItemForm): + + macros = knowledge_macros + recordManagerName = 'qualification' + trackFactory = QualificationRecord + + @Lazy + def macro(self): + return self.macros['create_qualification'] + + +class CreateQualificationRecord(CreateWorkItem): + + pass + diff --git a/knowledge/qualification/configure.zcml b/knowledge/qualification/configure.zcml new file mode 100644 index 0000000..fedf4fd --- /dev/null +++ b/knowledge/qualification/configure.zcml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/knowledge/qualification/interfaces.py b/knowledge/qualification/interfaces.py new file mode 100644 index 0000000..6bb9a63 --- /dev/null +++ b/knowledge/qualification/interfaces.py @@ -0,0 +1,37 @@ +# +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Interfaces for knowledge management and elearning with loops. +""" + +from zope.interface import Interface, Attribute +from zope import interface, component, schema + +from cybertools.organize.interfaces import IWorkItem, IWorkItems + + +class IQualificationRecord(IWorkItem): + """ Records needs for qualification (acqusition of competence) + and corresponding participations in training events etc. + """ + + +class IQualificationRecords(IWorkItems): + """ Container for qualification records. + """ diff --git a/knowledge/survey/__init__.py b/knowledge/survey/__init__.py new file mode 100644 index 0000000..d227614 --- /dev/null +++ b/knowledge/survey/__init__.py @@ -0,0 +1 @@ +'''package loops.knowledge.survey''' diff --git a/knowledge/survey/base.py b/knowledge/survey/base.py new file mode 100644 index 0000000..86cddc4 --- /dev/null +++ b/knowledge/survey/base.py @@ -0,0 +1,33 @@ +# +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Surveys used in knowledge management. +""" + +from zope.component import adapts +from zope.interface import implementer, implements + +from cybertools.knowledge.survey.questionnaire import Questionnaire \ + as BaseQuestionnaire + + +class Questionnaire(BaseQuestionnaire): + + pass + diff --git a/knowledge/survey/configure.zcml b/knowledge/survey/configure.zcml new file mode 100644 index 0000000..98b51db --- /dev/null +++ b/knowledge/survey/configure.zcml @@ -0,0 +1,6 @@ + + + diff --git a/knowledge/survey/interfaces.py b/knowledge/survey/interfaces.py new file mode 100644 index 0000000..198ad77 --- /dev/null +++ b/knowledge/survey/interfaces.py @@ -0,0 +1,24 @@ +# +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Interfaces for surveys used in knowledge management. +""" + +from zope.interface import Interface, Attribute +from zope import interface, component, schema