clean up CCM definitions for minimal implementation with work items of type 'checkup'
This commit is contained in:
parent
c76a9d9798
commit
4e50bd2c61
7 changed files with 13 additions and 169 deletions
|
@ -170,28 +170,7 @@ For testing, we first have to provide the needed utilities and settings
|
|||
Competence and Certification Management
|
||||
=======================================
|
||||
|
||||
>>> from cybertools.stateful.interfaces import IStatesDefinition
|
||||
>>> 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')
|
||||
>>> component.provideAdapter(QualificationRecords,
|
||||
... provides=IQualificationRecords)
|
||||
|
||||
>>> qurecs = loopsRoot.getRecordManager()['qualification']
|
||||
|
||||
We first create a training that provides knowledge in Python specials.
|
||||
|
||||
>>> trainingPySpecC = concepts['trpyspec'] = Concept(
|
||||
... u'Python Specials Training')
|
||||
>>> trainingPySpecC.assignParent(pySpecialsC)
|
||||
|
||||
Then we record the need for John to acquire this knowledge.
|
||||
|
||||
>>> from loops.knowledge.qualification.browser import CreateQualificationRecordForm
|
||||
>>> from loops.knowledge.qualification.browser import CreateQualificationRecord
|
||||
>>> tCompetence = concepts['competence']
|
||||
|
||||
|
||||
Glossaries
|
||||
|
|
|
@ -9,9 +9,9 @@ type(u'task', u'Aufgabe', viewName=u'',
|
|||
type(u'topic', u'Thema', viewName=u'',
|
||||
typeInterface=u'loops.knowledge.interfaces.ITopic',
|
||||
options=u'action.portlet:createTask,createTopic,editTopic')
|
||||
type(u'training', u'Schulung', viewName=u'',
|
||||
typeInterface=u'loops.organize.interfaces.ITask',
|
||||
options=u'action.portlet:edit_concept')
|
||||
#type(u'training', u'Schulung', viewName=u'',
|
||||
# typeInterface=u'loops.organize.interfaces.ITask',
|
||||
# options=u'action.portlet:edit_concept')
|
||||
|
||||
concept(u'general', u'Allgemein', u'domain')
|
||||
concept(u'system', u'System', u'domain')
|
||||
|
@ -34,11 +34,11 @@ child(u'general', u'provides', u'standard')
|
|||
child(u'general', u'requires', u'standard')
|
||||
child(u'general', u'task', u'standard')
|
||||
child(u'general', u'topic', u'standard')
|
||||
child(u'general', u'training', u'standard')
|
||||
#child(u'general', u'training', u'standard')
|
||||
|
||||
child(u'system', u'issubtype', u'standard')
|
||||
|
||||
child(u'competence', u'training', u'issubtype', usePredicate=u'provides')
|
||||
#child(u'competence', u'training', u'issubtype', usePredicate=u'provides')
|
||||
|
||||
# records
|
||||
records(u'qualification', u'loops.knowledge.qualification.base.QualificationRecord')
|
||||
#records(u'qualification', u'loops.knowledge.qualification.base.QualificationRecord')
|
||||
|
|
|
@ -9,9 +9,9 @@ type(u'competence', u'Kompetenz', viewName=u'',
|
|||
# type(u'topic', u'Thema', viewName=u'',
|
||||
# typeInterface=u'loops.knowledge.interfaces.ITopic',
|
||||
# options=u'action.portlet:createTask,createTopic,editTopic')
|
||||
type(u'training', u'Schulung', viewName=u'',
|
||||
typeInterface=u'loops.organize.interfaces.ITask',
|
||||
options=u'action.portlet:edit_concept')
|
||||
#type(u'training', u'Schulung', viewName=u'',
|
||||
# typeInterface=u'loops.organize.interfaces.ITask',
|
||||
# options=u'action.portlet:edit_concept')
|
||||
|
||||
concept(u'general', u'Allgemein', u'domain')
|
||||
concept(u'system', u'System', u'domain')
|
||||
|
@ -34,11 +34,11 @@ child(u'general', u'provides', u'standard')
|
|||
child(u'general', u'requires', u'standard')
|
||||
#child(u'general', u'task', u'standard')
|
||||
#child(u'general', u'topic', u'standard')
|
||||
child(u'general', u'training', u'standard')
|
||||
#child(u'general', u'training', u'standard')
|
||||
|
||||
child(u'system', u'issubtype', u'standard')
|
||||
|
||||
child(u'competence', u'training', u'issubtype', usePredicate=u'provides')
|
||||
#child(u'competence', u'training', u'issubtype', usePredicate=u'provides')
|
||||
|
||||
# records
|
||||
records(u'qualification', u'loops.knowledge.qualification.base.QualificationRecord')
|
||||
#records(u'qualification', u'loops.knowledge.qualification.base.QualificationRecord')
|
||||
|
|
|
@ -25,79 +25,4 @@ 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)
|
||||
|
||||
|
|
|
@ -28,26 +28,9 @@ 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
|
||||
|
||||
|
|
|
@ -3,37 +3,6 @@
|
|||
xmlns:browser="http://namespaces.zope.org/browser"
|
||||
i18n_domain="loops">
|
||||
|
||||
<!-- records -->
|
||||
|
||||
<zope:class class="loops.knowledge.qualification.base.QualificationRecord">
|
||||
<require permission="zope.View"
|
||||
interface="loops.knowledge.qualification.interfaces.IQualificationRecord" />
|
||||
<require permission="zope.ManageContent"
|
||||
set_schema="loops.knowledge.qualification.interfaces.IQualificationRecord" />
|
||||
</zope:class>
|
||||
|
||||
<zope:adapter
|
||||
factory="loops.knowledge.qualification.base.QualificationRecords"
|
||||
provides="loops.knowledge.qualification.interfaces.IQualificationRecords" />
|
||||
|
||||
<zope:utility
|
||||
factory="loops.knowledge.qualification.base.qualificationStates"
|
||||
provides="cybertools.stateful.interfaces.IStatesDefinition"
|
||||
name="knowledge.qualification" />
|
||||
|
||||
<!-- views -->
|
||||
|
||||
<browser:page
|
||||
name="create_qualification.html"
|
||||
for="loops.interfaces.INode"
|
||||
class="loops.knowledge.qualification.browser.CreateQualificationRecordForm"
|
||||
permission="zope.View" />
|
||||
|
||||
<zope:adapter
|
||||
name="create_qualification"
|
||||
for="loops.browser.node.NodeView
|
||||
zope.publisher.interfaces.browser.IBrowserRequest"
|
||||
factory="loops.knowledge.qualification.browser.CreateQualificationRecord"
|
||||
permission="zope.View" />
|
||||
|
||||
</configure>
|
||||
|
|
|
@ -23,15 +23,3 @@ 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.
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue