# -*- 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"), ), )) class iCampTool(BaseContent): """ iCampTool object addable in the iCampFolio folder """ meta_type = "iCampTool" archetype_name = "iCampTool" global_allow = 0 exclude_from_nav = 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)