# -*- coding: utf-8 # Copyright 2006 by Pjotr Savitski from Products.Archetypes.public import BaseSchema, Schema from Products.Archetypes.public import StringField, LinesField, DateTimeField, TextField, FileField from Products.Archetypes.public import LinesWidget, TextAreaWidget, IdWidget, StringWidget, SelectionWidget, CalendarWidget, MultiSelectionWidget, RichWidget, FileWidget, LabelWidget from Products.Archetypes.public import BaseContent, registerType from Globals import InitializeClass from Products.CMFCore.utils import getToolByName from AccessControl import ClassSecurityInfo, Unauthorized from config import PROJECT_NAME schema = BaseSchema + Schema(( TextField('iOpsys', required=0, accessor="getiOpsys", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Operating system platform", label_msgid='label_iopsys', i18n_domain="plone"), ), TextField('iDevelplatform', required=0, accessor="getiDevelplatform", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Development platform (programming language)", label_msgid='label_idevelplatform', i18n_domain="plone"), ), TextField('iLicense', required=0, accessor="getiLicense", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="License", label_msgid='label_ilicense', i18n_domain="plone"), ), TextField('iDatamansys', required=0, accessor="getiDatamansys", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Data management system (database)", label_msgid='label_idatamansys', i18n_domain="plone"), ), TextField('iAppserv', required=0, accessor="getiAppserv", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Application server", label_msgid='label_iappserv', i18n_domain="plone"), ), TextField('iSsidewebtec', required=0, accessor="getiSsidewebtec", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Server-side web technologies", label_msgid='label_issidewebtec', i18n_domain="plone"), ), TextField('iCsidewebtec', required=0, accessor="getiCsidewebtec", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Client-side web technologies (browser)", label_msgid='label_icsidewebtec', i18n_domain="plone"), ), TextField('iPortplat', required=0, accessor="getiPortplat", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Portal platform", label_msgid='label_iportplat', i18n_domain="plone"), ), TextField('iDataex', required=0, accessor="getiDataex", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Data exchange / syndication standards", label_msgid='label_idataex', i18n_domain="plone"), ), TextField('iMetadatastand', required=0, accessor="getiMetadatastand", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Metadata standards", label_msgid='label_imetadatastand', i18n_domain="plone"), ), TextField('iSecuritymod', required=0, accessor="getiSecuritymod", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Security model", label_msgid='label_isecuritymod', i18n_domain="plone"), ), TextField('iExtendabl', required=0, accessor="getiExtendabl", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Extendability / modularity", label_msgid='label_iextendabl', i18n_domain="plone"), ), TextField('iLoc', required=0, accessor="getiLoc", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="Localisation", label_msgid='label_iloc', i18n_domain="plone"), ), TextField('iExtacc', required=0, accessor="getiExtacc", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="External access to functionality", label_msgid='label_iextacc', i18n_domain="plone"), ), TextField('iUserbase', required=0, accessor="getiUserbase", searchable=0, isMetadata=0, default='', default_output_type='text/html', widget=TextAreaWidget( cols=40, rows=3, label="User base (who is using)", label_msgid='label_iuserbase', i18n_domain="plone"), ), # StringField('iSqival', # required=0, # accessor="getiSqival", # searchable=0, # isMetadata=0, # vocabulary='getValuesForLists', # widget=SelectionWidget( # format="select", # label="SQI implementation status", # label_msgid='label_isqival', # i18n_domain="plone"), # ), # # TextField('iSqitext', # required=0, # accessor="getiSqitext", # searchable=0, # isMetadata=0, # default='', # default_output_type='text/html', # widget=TextAreaWidget( # cols=40, # rows=3, # label="Explanation", # label_msgid='label_iexplanation', # i18n_domain="plone"), # ), # # StringField('iSelfdirect', # required=0, # accessor="getiSelfdirect", # searchable=0, # isMetadata=0, # vocabulary='getValuesForLists', # widget=SelectionWidget( # format="select", # label="Self-directing and self-organising international change (or learning) projects", # label_msgid='label_iselfdirect', # i18n_domain="plone"), # ), # # TextField('iSelfdirecttext', # required=0, # accessor="getiSelfdirecttext", # searchable=0, # isMetadata=0, # default='', # default_output_type='text/html', # widget=TextAreaWidget( # cols=40, # rows=3, # label="Explanation", # label_msgid='label_iexplanation', # i18n_domain="plone"), # ), # # StringField('iCollaborating', # required=0, # accessor="getiCollaborating", # searchable=0, # isMetadata=0, # vocabulary='getValuesForLists', # widget=SelectionWidget( # format="select", # label="Collaborating", # label_msgid='label_icollaborating', # i18n_domain="plone"), # ), # # TextField('iCollaboratingtext', # required=0, # accessor="getiCollaboratingtext", # searchable=0, # isMetadata=0, # default='', # default_output_type='text/html', # widget=TextAreaWidget( # cols=40, # rows=3, # label="Explanation", # label_msgid='label_iexplanation', # i18n_domain="plone"), # ), # # StringField('iSocialnet', # required=0, # accessor="getiSocialnet", # searchable=0, # isMetadata=0, # vocabulary='getValuesForLists', # widget=SelectionWidget( # format="select", # label="Social Networking", # label_msgid='label_isocialnet', # i18n_domain="plone"), # ), # # TextField('iSocialnettext', # required=0, # accessor="getiSocialnettext", # searchable=0, # isMetadata=0, # default='', # default_output_type='text/html', # widget=TextAreaWidget( # cols=40, # rows=3, # label="Explanation", # label_msgid='label_iexplanation', # i18n_domain="plone"), # ), # lisatud StringField('iLearningDev', required=0, accessor="getiLearningDev", searchable=0, isMetadata=0, vocabulary='getValuesForLists', schemata='numeric', widget=SelectionWidget( format="select", label="Learning material development", label_msgid='label_imaterialdevelopment', i18n_domain="plone"), ), TextField('iLearningDevtext', required=0, accessor="getiLearningDevtext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iIndividualAssignment', required=0, accessor="getiIndividualAssignment", searchable=0, isMetadata=0, vocabulary='getValuesForLists', schemata='numeric', widget=SelectionWidget( format="select", label="Individual assignment", label_msgid='label_iindividualassignment', i18n_domain="plone"), ), TextField('iIndividualAssignmenttext', required=0, accessor="getiIndividualAssignmenttext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iGroupAssignment', required=0, accessor="getiGroupAssignment", searchable=0, isMetadata=0, vocabulary='getValuesForLists', schemata='numeric', widget=SelectionWidget( format="select", label="Group assignment", label_msgid='label_isocialnet', i18n_domain="plone"), ), TextField('iGroupAssignmenttext', required=0, accessor="getiGroupAssignmenttext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iSelfStudy', required=0, accessor="getiSelfStudy", searchable=0, isMetadata=0, vocabulary='getValuesForLists', schemata='numeric', widget=SelectionWidget( format="select", label="Self-study", label_msgid='label_isocialnet', i18n_domain="plone"), ), TextField('iSelfStudytext', required=0, accessor="getiSelfStudytext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iAdministration', required=0, accessor="getiAdministration", searchable=0, isMetadata=0, schemata='numeric', vocabulary='getValuesForLists', widget=SelectionWidget( format="select", label="Administration", label_msgid='label_iadministration', i18n_domain="plone"), ), TextField('iAdministrationtext', required=0, accessor="getiAdministrationtext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iAssessment', required=0, accessor="getiAssessment", searchable=0, isMetadata=0, vocabulary='getValuesForLists', schemata='numeric', widget=SelectionWidget( format="select", label="Assessment", label_msgid='label_assessment', i18n_domain="plone"), ), TextField('iAssessmenttext', required=0, accessor="getiAssessmenttext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iGuidance', required=0, accessor="getiGuidance", searchable=0, isMetadata=0, vocabulary='getValuesForLists', schemata='numeric', widget=SelectionWidget( format="select", label="Guidance", label_msgid='label_iguidance', i18n_domain="plone"), ), TextField('iGuidancetext', required=0, accessor="getiGuidancetext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iPresentation', required=0, accessor="getiPresentation", searchable=0, isMetadata=0, schemata='numeric', vocabulary='getValuesForLists', widget=SelectionWidget( format="select", label="Presentation", label_msgid='label_isocialnet', i18n_domain="plone"), ), TextField('iPresentationtext', required=0, accessor="getiPresentationtext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), StringField('iGroupDiscussion', required=0, accessor="getiGroupDiscussion", searchable=0, isMetadata=0, schemata='numeric', vocabulary='getValuesForLists', widget=SelectionWidget( format="select", label="Group discussion", label_msgid='label_isocialnet', i18n_domain="plone"), ), TextField('iGroupDiscussiontext', required=0, accessor="getiGroupDiscussiontext", searchable=0, isMetadata=0, default='', default_output_type='text/html', schemata='explanatory', widget=TextAreaWidget( cols=40, rows=3, label="Explanation", label_msgid='label_iexplanation', i18n_domain="plone"), ), )) class iCampTool(BaseContent): """ iCampTool object addable in the iCampFolio folder """ meta_type = "iCampTool" archetype_name = "iCampTool" global_allow = 0 exclude_from_nav = True allow_discussion = True allowed_content_types = [] security = ClassSecurityInfo() _at_rename_after_creation = True schema = schema content_icon='icamptool_icon.gif' actions = ( { 'id':'view', 'name':'View', 'action':'string:${object_url}/tool_view', 'permissions': ('View',), }, { 'id':'edit', 'name':'Edit', 'action':'string:${object_url}/tool_edit', 'permissions': ('Manage Portal',) }, ) def getValuesForLists(self): """ get values for lists """ valuesForLists = self.getiListObjectValues() if len(valuesForLists)>1: valuesForLists = valuesForLists.replace(" ","") valuesForLists = valuesForLists.split(",") else: valuesForLists = ['0','1','2','3','4','5','6','7','8','9','10'] return valuesForLists registerType(iCampTool, PROJECT_NAME)