return self.getFormsTool().getForm('report_macro_objecttree') security.declareProtected(PERMISSION_EDIT_OBJECTS, 'sectioncomments_html') def sectioncomments_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self}, 'section_comments') InitializeClass(NyReportSection) manage_addNyReportSection_html = PageTemplateFile( 'zpt/reportsection_manage_add', globals()) manage_addNyReportSection_html.kind = METATYPE_OBJECT manage_addNyReportSection_html.action = 'addNyReportSection' config.update({ 'constructors': (manage_addNyReportSection_html, addNyReportSection), 'folder_constructors': [ # NyFolder.manage_addNyReportSection_html = manage_addNyReportSection_html ('manage_addNyReportSection_html', manage_addNyReportSection_html), ('reportsection_add_html', reportsection_add_html), ('addNyReportSection', addNyReportSection), (config['import_string'], importNyReportSection), ], 'add_method': addNyReportSection, 'validation': issubclass(NyReportSection, NyValidation), '_class':
""" """ return self.getFormsTool().getForm('report_macro_sec_objecttree') #path for AuthenticationTool def getUserEmail(self, user_str): """ """ auth_tool = self.getAuthenticationTool() user_obj = auth_tool.getUser(user_str) if user_obj is not None: return user_obj.email return '' InitializeClass(NyReport) manage_addNyReport_html = PageTemplateFile('zpt/report_manage_add', globals()) manage_addNyReport_html.kind = METATYPE_OBJECT manage_addNyReport_html.action = 'addNyReport' config.update({ 'constructors': (manage_addNyReport_html, addNyReport), 'folder_constructors': [ # NyFolder.manage_addNyReport_html = manage_addNyReport_html ('manage_addNyReport_html', manage_addNyReport_html), ('report_add_html', report_add_html), ('addNyReport', addNyReport), (config['import_string'], importNyReport), ], 'add_method': addNyReport, 'validation': issubclass(NyReport, NyValidation), '_class': NyReport, })
PROPERTIES_OBJECT = { 'id': (0, '', ''), 'title': (1, MUST_BE_NONEMPTY, 'The Title field must have a value.'), 'description': (0, '', ''), 'coverage': (0, '', ''), 'keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'locator': (0, '', ''), 'lang': (0, '', '') } manage_addNyURL_html = PageTemplateFile('zpt/url_manage_add', globals()) manage_addNyURL_html.kind = METATYPE_OBJECT manage_addNyURL_html.action = 'addNyURL' def url_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyURL'}, 'url_add') def addNyURL(self, id='', title='', description='', coverage='', keywords='', sortorder='', locator='', contributor=None, releasedate='', discussion='', lang=None, REQUEST=None, **kwargs): """ Create an URL type of object. """ #process parameters id = self.utCleanupId(id) if not id: id = self.utGenObjectId(title) try: sortorder = abs(int(sortorder))
#site pages security.declareProtected(view, 'index_html') index_html = PageTemplateFile('zpt/simpleconsultation_index', globals()) security.declareProtected(PERMISSION_MANAGE_SIMPLECONSULTATION, 'edit_html') edit_html = PageTemplateFile('zpt/simpleconsultation_edit', globals()) security.declareProtected(PERMISSION_REVIEW_SIMPLECONSULTATION, 'add_simpleconsultation_comment') add_simpleconsultation_comment = PageTemplateFile('zpt/simpleconsultation_comment_add', globals()) InitializeClass(NySimpleConsultation) manage_addNySimpleConsultation_html = PageTemplateFile('zpt/simpleconsultation_manage_add', globals()) manage_addNySimpleConsultation_html.kind = METATYPE_OBJECT manage_addNySimpleConsultation_html.action = 'addNySimpleConsultation' config.update({ 'constructors': (manage_addNySimpleConsultation_html, addNySimpleConsultation), 'folder_constructors': [ # NyFolder.manage_addNySimpleConsultation_html = manage_addNySimpleConsultation_html ('manage_addNySimpleConsultation_html', manage_addNySimpleConsultation_html), ('simpleconsultation_add_html', simpleconsultation_add_html), ('addNySimpleConsultation', addNySimpleConsultation), ], 'add_method': addNySimpleConsultation, 'validation': issubclass(NySimpleConsultation, NyValidation), '_class': NySimpleConsultation, }) def get_config(): return config
security.declareProtected(PERMISSION_EDIT_OBJECTS, 'edit_html') def edit_html(self, REQUEST=None, RESPONSE=None): """ """ if self.hasVersion(): obj = self.version else: obj = self return self.getFormsTool().getContent({'here': obj}, 'url_edit') InitializeClass(NyURL) manage_addNyURL_html = PageTemplateFile('zpt/url_manage_add', globals()) manage_addNyURL_html.kind = config['meta_type'] manage_addNyURL_html.action = 'addNyURL' config.update({ 'constructors': (manage_addNyURL_html, addNyURL), 'folder_constructors': [ # NyFolder.manage_addNyURL_html = manage_addNyURL_html ('manage_addNyURL_html', manage_addNyURL_html), ('url_add_html', url_add_html), ('addNyURL', addNyURL), ('import_url_item', importNyURL), ], 'add_method': addNyURL, 'validation': issubclass(NyURL, NyValidation), '_class': NyURL,
'description': (0, '', ''), 'coverage': (0, '', ''), 'keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'file': (0, '', ''), 'url': (0, '', ''), 'downloadfilename': (0, '', ''), 'content_type': (0, '', ''), 'lang': (0, '', '') } manage_addNyFile_html = PageTemplateFile('zpt/file_manage_add', globals()) manage_addNyFile_html.kind = METATYPE_OBJECT manage_addNyFile_html.action = 'addNyFile' def file_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyFile'}, 'file_add') def addNyFile(self, id='', title='', description='', coverage='', keywords='', sortorder='', source='file', file='', url='', precondition='', content_type='', downloadfilename='', contributor=None, releasedate='', discussion='', lang=None, REQUEST=None, **kwargs): """ Create a File type of object. """ #process parameters if source=='file': id = cookId(id, title, file)[0] #upload from a file id = self.utCleanupId(id) if id == '': id = PREFIX_OBJECT + self.utGenRandomId(6)
'flag_file': (0, '', ''), 'flag_url': (0, '', ''), 'del_smallflag': (0, '', ''), 'link_ins': (0, '', ''), 'link_doc': (0, '', ''), 'link_train': (0, '', ''), 'link_rd': (0, '', ''), 'link_data': (0, '', ''), 'legislation_feed_url': (0, '', ''), 'project_feed_url': (0, '', ''), 'lang': (0, '', '') } manage_addNyCountry_html = PageTemplateFile('zpt/country_manage_add', globals()) manage_addNyCountry_html.kind = METATYPE_OBJECT manage_addNyCountry_html.action = 'addNyCountry' def country_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyCountry'}, 'country_add') def addNyCountry(self, id='', title='', description='', coverage='', keywords='', sortorder='', nfp_label='', nfp_url='', source='file', flag_file='', flag_url='', link_ins='', link_doc='', link_train='', link_rd='', link_data='', legislation_feed_url='', project_feed_url='', publicinterface='', folder_meta_types='', contributor=None, releasedate='', discussion='', lang=None, load_default_data=1, REQUEST=None, **kwargs): """ Create an object of Country type. """ #process parameters id = self.utCleanupId(id)
'title': (0, '', ''), 'description': (0, '', ''), 'coverage': (0, '', ''), 'keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'qauthor': (0, '', ''), 'answers': (0, '', ''), 'lang': (0, '', ''), } manage_addNyReportQuestionnaire_html = PageTemplateFile('zpt/reportquestionnaire_manage_add', globals()) manage_addNyReportQuestionnaire_html.kind = METATYPE_OBJECT manage_addNyReportQuestionnaire_html.action = 'addNyReportQuestionnaire' def reportquestionnaire_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyReportQuestionnaire'}, 'reportquestionnaire_add') def addNyReportQuestionnaire(self, id='', title='', description='', coverage='', keywords='', sortorder='', contributor=None, releasedate='', discussion='', qauthor='', answers={}, files=None, file_title='', adt_comment=[], REQUEST=None, **kwargs): """ Create a Report Questionnaire type of object. """ #process parameters id = self.utCleanupId(id) if not id: id = self.generateItemId(PREFIX_OBJECT) try: sortorder = abs(int(sortorder)) except: sortorder = DEFAULT_SORTORDER
return self.getFormsTool().getContent({'here': self}, 'case_study_index') security.declareProtected(PERMISSION_EDIT_OBJECTS, 'edit_html') def edit_html(self, REQUEST=None, RESPONSE=None): """ """ if self.hasVersion(): obj = self.version else: obj = self return self.getFormsTool().getContent({'here': obj}, 'case_study_edit') InitializeClass(NyCaseStudy) manage_addNyCaseStudy_html = PageTemplateFile('zpt/case_study_manage_add', globals()) manage_addNyCaseStudy_html.kind = config['meta_type'] manage_addNyCaseStudy_html.action = 'addNyCaseStudy' config.update({ 'constructors': (manage_addNyCaseStudy_html, addNyCaseStudy), 'folder_constructors': [ # NyFolder.manage_addNyCaseStudy_html = manage_addNyCaseStudy_html ('manage_addNyCaseStudy_html', manage_addNyCaseStudy_html), ('case_study_add_html', case_study_add_html), ('addNyCaseStudy', addNyCaseStudy), ('import_case_study_item', importNyCaseStudy), ], 'add_method': addNyCaseStudy, 'validation': issubclass(NyCaseStudy, NyValidation), '_class': NyCaseStudy, })
'lon_ds': (0, '', ''), 'lon_ms': (0, '', ''), 'lon_ss': (0, '', ''), 'lat_cardinal': (0, '', ''), 'lat_ds': (0, '', ''), 'lat_ms': (0, '', ''), 'lat_ss': (0, '', ''), 'geo_type': (0, '', ''), 'url': (0, '', ''), 'pointer': (0, '', ''), 'lang': (0, '', '') } manage_addNyGeoPoint_html = PageTemplateFile('zpt/geopoint_manage_add', globals()) manage_addNyGeoPoint_html.kind = METATYPE_OBJECT manage_addNyGeoPoint_html.action = 'addNyGeoPoint' def geopoint_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyGeoPoint'}, 'geopoint_add') def addNyGeoPoint(self, id='', title='', description='', coverage='', keywords='', sortorder='', lon_cardinal='', lon_ds='', lon_ms='', lon_ss='', lat_cardinal='', lat_ds='', lat_ms='', lat_ss='', geo_type='', url='', pointer='', contributor=None, releasedate='', discussion='', lang=None, REQUEST=None, **kwargs): """ Create an Contact type of object. """ #process parameters id = self.utCleanupId(id) if not id: id = self.utGenObjectId(title) try: sortorder = abs(int(sortorder))
'keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'lang': (0, '', ''), 'comment': (0, '', ''), 'page': (0, '', ''), 'line': (0, '', '') } manage_addNyReportComment_html = PageTemplateFile( 'zpt/reportcomment_manage_add', globals()) manage_addNyReportComment_html.kind = METATYPE_OBJECT manage_addNyReportComment_html.action = 'addNyReportComment' def reportcomment_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyReportComment' }, 'reportcomment_add') def addNyReportComment(self, id='', title='',
'section_add_html') section_add_html = addSection_html __allow_groups__ = InvitationUsersTool() _View_Permission = ['InvitedReviewer'] _Naaya___Review_TalkBack_Consultation_Permission = ['InvitedReviewer'] __ac_roles__ = ['InvitedReviewer'] admin_comments = CommentsAdmin('admin_comments') InitializeClass(NyTalkBackConsultation) manage_addNyTalkBackConsultation_html = PageTemplateFile( 'zpt/talkbackconsultation_manage_add', globals()) manage_addNyTalkBackConsultation_html.kind = METATYPE_TALKBACKCONSULTATION manage_addNyTalkBackConsultation_html.action = 'addNyTalkBackConsultation' config.update({ 'constructors': (manage_addNyTalkBackConsultation_html, addNyTalkBackConsultation), 'folder_constructors': [ ('manage_addNyTalkBackConsultation_html', manage_addNyTalkBackConsultation_html), ('talkbackconsultation_add_html', talkbackconsultation_add_html), ('addNyTalkBackConsultation', addNyTalkBackConsultation), ], 'add_method': addNyTalkBackConsultation, 'validation': issubclass(NyTalkBackConsultation, NyValidation), '_class':
else: self.setSessionInfo(['Item(s) deleted.']) if REQUEST: REQUEST.RESPONSE.redirect('index_html') security.declareProtected(view, 'report_macro_objecttree_html') def report_macro_objecttree_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getForm('report_macro_objecttree') InitializeClass(NyReportAnswer) manage_addNyReportAnswer_html = PageTemplateFile('zpt/reportanswer_manage_add', globals()) manage_addNyReportAnswer_html.kind = METATYPE_OBJECT manage_addNyReportAnswer_html.action = 'addNyReportAnswer' config.update({ 'constructors': (manage_addNyReportAnswer_html, addNyReportAnswer), 'folder_constructors': [ # NyFolder.manage_addNyReportAnswer_html = manage_addNyReportAnswer_html ('manage_addNyReportAnswer_html', manage_addNyReportAnswer_html), ('reportanswer_add_html', reportanswer_add_html), ('addNyReportAnswer', addNyReportAnswer), (config['import_string'], importNyReportAnswer), ], 'add_method': addNyReportAnswer, 'validation': issubclass(NyReportAnswer, NyValidation), '_class':
'flag_url': (0, '', ''), 'del_smallflag': (0, '', ''), 'link_ins': (0, '', ''), 'link_doc': (0, '', ''), 'link_train': (0, '', ''), 'link_rd': (0, '', ''), 'link_data': (0, '', ''), 'legislation_feed_url': (0, '', ''), 'project_feed_url': (0, '', ''), 'lang': (0, '', '') } manage_addNyCountry_html = PageTemplateFile('zpt/country_manage_add', globals()) manage_addNyCountry_html.kind = METATYPE_OBJECT manage_addNyCountry_html.action = 'addNyCountry' def country_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyCountry' }, 'country_add') def addNyCountry(self, id='', title='',
if phone_location_m is None: continue phone_location = _phone_map.get(phone_location_m.group(1), None) if phone_location is not None: contact_data[phone_location] = phone_entry.value return contact_data def squash_list(data): if isinstance(data, list): return ' '.join(data) else: return data manage_addNyContact_html = PageTemplateFile('zpt/contact_manage_add', globals()) manage_addNyContact_html.kind = config['meta_type'] manage_addNyContact_html.action = 'addNyContact' config.update({ 'constructors': (manage_addNyContact_html, addNyContact), 'folder_constructors': [ # NyFolder.manage_addNyContact_html = manage_addNyContact_html ('manage_addNyContact_html', manage_addNyContact_html), ('contact_add_html', contact_add_html), ('addNyContact', addNyContact), ('import_contact_item', importNyContact), ], 'add_method': addNyContact, 'validation': issubclass(NyContact, NyValidation), '_class': NyContact, }) def get_config():
security.declareProtected(view, 'get_aspect_ratio') def get_aspect_ratio(self, aspect_ratio=1.5): video = self.getSingleMediaObject() return getattr(video, 'aspect_ratio', aspect_ratio) def is_audio(self): return '.mp3' == os.path.splitext(self.getSingleMediaId())[1] InitializeClass(NyMediaFile_extfile) manage_addNyMediaFile_html = PageTemplateFile('zpt/mediafile_manage_add', globals()) manage_addNyMediaFile_html.kind = config['meta_type'] manage_addNyMediaFile_html.action = 'addNyMediaFile' config.update({ 'constructors': (manage_addNyMediaFile_html, addNyMediaFile), 'folder_constructors': [ # NyFolder.manage_addNyMediaFile_html = manage_addNyMediaFile_html ('manage_addNyMediaFile_html', manage_addNyMediaFile_html), ('mediafile_add_html', mediafile_add_html), ('addNyMediaFile', addNyMediaFile), ('import_mediafile_item', importNyMediaFile), ], 'add_method': addNyMediaFile, 'validation': issubclass(NyMediaFile_extfile, NyValidation), '_class': NyMediaFile_extfile,
'add_form': OBJECT_ADD_FORM, 'description': DESCRIPTION_OBJECT, 'default_schema': DEFAULT_SCHEMA, 'properties': PROPERTIES_OBJECT, 'schema_name': 'NySemEvent', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemEvent.gif'), '_misc': { 'NySemEvent.gif': ImageFile('www/NySemEvent.gif', globals()), 'NySemEvent_marked.gif': ImageFile('www/NySemEvent_marked.gif', globals()), }, } manage_addNySemEvent_html = PageTemplateFile('zpt/semevent_manage_add', globals()) manage_addNySemEvent_html.kind = METATYPE_OBJECT manage_addNySemEvent_html.action = 'addNySemEvent' def semevent_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemEvent', 'form_helper': form_helper}, 'semevent_add') def _create_NySemEvent_object(parent, id, contributor): id = make_id(parent, id=id, prefix=PREFIX_OBJECT) ob = NySemEvent(id, contributor) parent.gl_add_languages(ob) parent._setObject(id, ob) ob = parent._getOb(id) ob.after_setObject() return ob
'add_form': OBJECT_ADD_FORM, 'description': DESCRIPTION_OBJECT, 'default_schema': DEFAULT_SCHEMA, 'properties': PROPERTIES_OBJECT, 'schema_name': 'NyEntry', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NyEntry.gif'), '_misc': { 'NyEntry.gif': ImageFile('www/NyEntry.gif', globals()), 'NyEntry_marked.gif': ImageFile('www/NyEntry_marked.gif', globals()), }, } manage_addNyEntry_html = PageTemplateFile('zpt/entry_manage_add', globals()) manage_addNyEntry_html.kind = METATYPE_OBJECT manage_addNyEntry_html.action = 'addNyEntry' def entry_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyEntry'}, 'entry_add') def _create_NyEntry_object(parent, id, contributor): id = make_id(parent, id=id, prefix=PREFIX_OBJECT) ob = NyEntry(id, contributor) parent.gl_add_languages(ob) parent._setObject(id, ob) ob = parent._getOb(id) ob.after_setObject() return ob def addNyEntry(self, id='', REQUEST=None, contributor=None, **kwargs):
'schema_name': 'NySemFieldSite', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemFieldSite.gif'), '_misc': { 'NySemFieldSite.gif': ImageFile('www/NySemFieldSite.gif', globals()), 'NySemFieldSite_marked.gif': ImageFile('www/NySemFieldSite_marked.gif', globals()), }, } manage_addNySemFieldSite_html = PageTemplateFile('zpt/semfieldsite_manage_add', globals()) manage_addNySemFieldSite_html.kind = METATYPE_OBJECT manage_addNySemFieldSite_html.action = 'addNySemFieldSite' def semfieldsite_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemFieldSite', 'form_helper': form_helper }, 'semfieldsite_add')
'coverage': (0, '', ''), 'keywords': (0, '', ''), 'criteria_keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'criteria_date': (0, MUST_BE_DATETIME, 'The Display objects released after field must contain a valid date.'), 'discussion': (0, '', ''), 'maintainer_email': (0, '', ''), 'themes': (0, '', ''), 'lang': (0, '', '') } manage_addNySemThematicDir_html = PageTemplateFile('zpt/semthematicdir_manage_add', globals()) manage_addNySemThematicDir_html.kind = METATYPE_OBJECT manage_addNySemThematicDir_html.action = 'addNySemThematicDir' def semthematicdir_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemThematicDir'}, 'semthematicdir_add') def addNySemThematicDir(self, id='', title='', description='', coverage='', keywords='', criteria_keywords='', sortorder='', publicinterface='', maintainer_email='', folder_meta_types=None, contributor=None, releasedate='', criteria_date='', discussion='', themes='', lang=None, REQUEST=None, **kwargs): """ Create an object of Thematic Folder type. """ #process parameters id = self.utCleanupId(id) if not id: id = self.generateItemId(PREFIX_OBJECT)
'schema_name': 'NySemMultimedia', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemMultimedia.gif'), '_misc': { 'NySemMultimedia.gif': ImageFile('www/NySemMultimedia.gif', globals()), 'NySemMultimedia_marked.gif': ImageFile('www/NySemMultimedia_marked.gif', globals()), }, } manage_addNySemMultimedia_html = PageTemplateFile( 'zpt/semmultimedia_manage_add', globals()) manage_addNySemMultimedia_html.kind = METATYPE_OBJECT manage_addNySemMultimedia_html.action = 'addNySemMultimedia' def semmultimedia_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemMultimedia', 'form_helper': form_helper }, 'semmultimedia_add')
'add_form': OBJECT_ADD_FORM, 'description': DESCRIPTION_OBJECT, 'default_schema': DEFAULT_SCHEMA, 'properties': PROPERTIES_OBJECT, 'schema_name': 'NyEntry', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NyEntry.gif'), '_misc': { 'NyEntry.gif': ImageFile('www/NyEntry.gif', globals()), 'NyEntry_marked.gif': ImageFile('www/NyEntry_marked.gif', globals()), }, } manage_addNyEntry_html = PageTemplateFile('zpt/entry_manage_add', globals()) manage_addNyEntry_html.kind = METATYPE_OBJECT manage_addNyEntry_html.action = 'addNyEntry' def entry_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyEntry' }, 'entry_add') def _create_NyEntry_object(parent, id, contributor): id = make_id(parent, id=id, prefix=PREFIX_OBJECT) ob = NyEntry(id, contributor)
id_list = self.utConvertToList(REQUEST.get('id', [])) try: self.manage_delObjects(id_list) except: self.setSessionErrors(['Error while delete data.']) else: self.setSessionInfo(['Item(s) deleted.']) if REQUEST: REQUEST.RESPONSE.redirect('index_html') security.declareProtected(view, 'report_macro_objecttree_html') def report_macro_objecttree_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getForm('report_macro_objecttree') InitializeClass(NySectionComment) manage_addNySectionComment_html = PageTemplateFile('zpt/sectioncomment_manage_add', globals()) manage_addNySectionComment_html.kind = METATYPE_OBJECT manage_addNySectionComment_html.action = 'addNySectionComment' config.update({ 'constructors': (manage_addNySectionComment_html, addNySectionComment), 'folder_constructors': [ # NyFolder.manage_addNySectionComment_html = manage_addNySectionComment_html ('manage_addNySectionComment_html', manage_addNySectionComment_html), ('sectioncomment_add_html', sectioncomment_add_html), ('addNySectionComment', addNySectionComment), (config['import_string'], importNySectionComment), ], 'add_method': addNySectionComment, 'validation': issubclass(NySectionComment, NyValidation), '_class': NySectionComment, })
elif not obj: params['missing'] = 1 return self.getFormsTool().getContent(params, 'pointer_index') else: return self.getFormsTool().getContent(params, 'pointer_index') security.declareProtected(PERMISSION_EDIT_OBJECTS, 'edit_html') def edit_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self}, 'pointer_edit') InitializeClass(NyPointer) manage_addNyPointer_html = PageTemplateFile('zpt/pointer_manage_add', globals()) manage_addNyPointer_html.kind = config['meta_type'] manage_addNyPointer_html.action = 'addNyPointer' config.update({ 'constructors': (manage_addNyPointer_html, addNyPointer), 'folder_constructors': [ # NyFolder.manage_addNyPointer_html = manage_addNyPointer_html ('manage_addNyPointer_html', manage_addNyPointer_html), ('pointer_add_html', pointer_add_html), ('addNyPointer', addNyPointer), ('import_pointer_item', importNyPointer), ], 'add_method': addNyPointer, 'validation': issubclass(NyPointer, NyValidation), '_class': NyPointer, }) def get_config():
PREFIX_OBJECT = "rep" PROPERTIES_OBJECT = { "id": (0, "", ""), "title": (1, MUST_BE_NONEMPTY, "The Title field must have a value."), "description": (0, "", ""), "coverage": (0, "", ""), "keywords": (0, "", ""), "sortorder": (0, MUST_BE_POSITIV_INT, "The Sort order field must contain a positive integer."), "releasedate": (0, MUST_BE_DATETIME, "The Release date field must contain a valid date."), "discussion": (0, "", ""), "lang": (0, "", ""), } manage_addNyReport_html = PageTemplateFile("zpt/report_manage_add", globals()) manage_addNyReport_html.kind = METATYPE_OBJECT manage_addNyReport_html.action = "addNyReport" def report_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( {"here": self, "kind": METATYPE_OBJECT, "action": "addNyReport"}, "report_add" ) def addNyReport( self, id="", title="", description="", coverage="",
security.declareProtected(view, 'report_macro_objecttree_html') def report_macro_objecttree_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getForm('report_macro_objecttree') security.declareProtected(PERMISSION_EDIT_OBJECTS, 'sectioncomments_html') def sectioncomments_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self}, 'section_comments') InitializeClass(NyReportSection) manage_addNyReportSection_html = PageTemplateFile('zpt/reportsection_manage_add', globals()) manage_addNyReportSection_html.kind = METATYPE_OBJECT manage_addNyReportSection_html.action = 'addNyReportSection' config.update({ 'constructors': (manage_addNyReportSection_html, addNyReportSection), 'folder_constructors': [ # NyFolder.manage_addNyReportSection_html = manage_addNyReportSection_html ('manage_addNyReportSection_html', manage_addNyReportSection_html), ('reportsection_add_html', reportsection_add_html), ('addNyReportSection', addNyReportSection), (config['import_string'], importNyReportSection), ], 'add_method': addNyReportSection, 'validation': issubclass(NyReportSection, NyValidation), '_class': NyReportSection, })
id_list = self.utConvertToList(REQUEST.get('id', [])) try: self.manage_delObjects(id_list) except: self.setSessionErrors(['Error while delete data.']) else: self.setSessionInfo(['Item(s) deleted.']) if REQUEST: REQUEST.RESPONSE.redirect('index_html') security.declareProtected(view, 'report_macro_objecttree_html') def report_macro_objecttree_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getForm('report_macro_objecttree') InitializeClass(NyReportReference) manage_addNyReportReference_html = PageTemplateFile('zpt/reportreference_manage_add', globals()) manage_addNyReportReference_html.kind = METATYPE_OBJECT manage_addNyReportReference_html.action = 'addNyReportReference' config.update({ 'constructors': (manage_addNyReportReference_html, addNyReportReference), 'folder_constructors': [ # NyFolder.manage_addNyReportReference_html = manage_addNyReportReference_html ('manage_addNyReportReference_html', manage_addNyReportReference_html), ('reportreference_add_html', reportreference_add_html), ('addNyReportReference', addNyReportReference), (config['import_string'], importNyReportReference), ], 'add_method': addNyReportReference, 'validation': issubclass(NyReportReference, NyValidation), '_class': NyReportReference, })
""" """ return self.getFormsTool().getContent({'here': self}, 'youtube_index') security.declareProtected(PERMISSION_EDIT_OBJECTS, 'edit_html') def edit_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self}, 'youtube_edit') InitializeClass(NyYoutube) manage_addNyYoutube_html = PageTemplateFile('zpt/youtube_manage_add', globals()) manage_addNyYoutube_html.kind = config['meta_type'] manage_addNyYoutube_html.action = 'addNyYoutube' config.update({ 'constructors': (manage_addNyYoutube_html, addNyYoutube), 'folder_constructors': [ ('manage_addNyYoutube_html', manage_addNyYoutube_html), ('youtube_add_html', youtube_add_html), ('addNyYoutube', addNyYoutube), ], 'add_method': addNyYoutube, 'validation': issubclass(NyYoutube, NyValidation), '_class': NyYoutube, })
'id': (0, '', ''), 'title': (1, MUST_BE_NONEMPTY, 'The Title field must have a value.'), 'description': (0, '', ''), 'coverage': (0, '', ''), 'keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'lang': (0, '', '') } manage_addNyReport_html = PageTemplateFile('zpt/report_manage_add', globals()) manage_addNyReport_html.kind = METATYPE_OBJECT manage_addNyReport_html.action = 'addNyReport' def report_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyReport' }, 'report_add') def addNyReport(self, id='', title='',
def edit_html(self, REQUEST=None, RESPONSE=None): """ """ if self.hasVersion(): obj = self.version else: obj = self return self.getFormsTool().getContent({'here': obj}, 'pointer_edit') InitializeClass(NyPointer) manage_addNyPointer_html = PageTemplateFile('zpt/pointer_manage_add', globals()) manage_addNyPointer_html.kind = config['meta_type'] manage_addNyPointer_html.action = 'addNyPointer' config.update({ 'constructors': (manage_addNyPointer_html, addNyPointer), 'folder_constructors': [ # NyFolder.manage_addNyPointer_html = manage_addNyPointer_html ('manage_addNyPointer_html', manage_addNyPointer_html), ('pointer_add_html', pointer_add_html), ('addNyPointer', addNyPointer), ('import_pointer_item', importNyPointer), ], 'add_method': addNyPointer, 'validation': issubclass(NyPointer, NyValidation), '_class': NyPointer,
PROPERTIES_OBJECT = { 'id': (0, '', ''), 'title': (1, MUST_BE_NONEMPTY, 'The Title field must have a value.'), 'description': (0, '', ''), 'coverage': (0, '', ''), 'keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'body': (0, '', ''), 'lang': (0, '', '') } manage_addNyDocument_html = PageTemplateFile('zpt/document_manage_add', globals()) manage_addNyDocument_html.kind = METATYPE_OBJECT manage_addNyDocument_html.action = 'addNyDocument' def document_add(self, REQUEST=None, RESPONSE=None): """ """ id = PREFIX_OBJECT + self.utGenRandomId(6) self.addNyDocument(id=id, title='', description='', coverage='', keywords='', sortorder='', body='', REQUEST=None) if REQUEST: REQUEST.RESPONSE.redirect('%s/add_html' % self._getOb(id).absolute_url()) def addNyDocument(self, id='', title='', description='', coverage='', keywords='', sortorder='', body='', contributor=None, releasedate='', discussion='', lang=None, REQUEST=None, **kwargs): """ Create a Document type og object. """ #process parameters
security.declareProtected(PERMISSION_EDIT_OBJECTS, 'edit_html') def edit_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self}, 'study_edit') security.declareProtected(PERMISSION_EDIT_OBJECTS, 'style_xsl') def style_xsl(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self}, 'study_style') InitializeClass(NyStudy) manage_addNyStudy_html = PageTemplateFile('zpt/study_manage_add', globals()) manage_addNyStudy_html.kind = METATYPE_OBJECT manage_addNyStudy_html.action = 'addNyStudy' config.update({ 'constructors': (manage_addNyStudy_html, addNyStudy), 'folder_constructors': [ # NyFolder.manage_addNyStudy_html = manage_addNyStudy_html ('manage_addNyStudy_html', manage_addNyStudy_html), ('study_add', study_add), ('addNyStudy', addNyStudy), (config['import_string'], importNyStudy), ], 'add_method': addNyStudy, 'validation': issubclass(NyStudy, NyValidation), '_class': NyStudy, }) def get_config():
def handleUpload(self, file): """ Upload a file from disk. """ filename = getattr(file, "filename", "") if not filename: return self.manage_delObjects(self.objectIds()) file_id = cookId("", "", file)[0] # cleanup id self.manage_addFile(id=file_id, file=file) InitializeClass(NySemDocument) manage_addNySemDocument_html = PageTemplateFile("zpt/semdocument_manage_add", globals()) manage_addNySemDocument_html.kind = METATYPE_OBJECT manage_addNySemDocument_html.action = "addNySemDocument" config.update( { "constructors": (manage_addNySemDocument_html, addNySemDocument), "folder_constructors": [ ("manage_addNySemDocument_html", manage_addNySemDocument_html), ("semdocument_add_html", semdocument_add_html), ("addNySemDocument", addNySemDocument), ("import_NySemDocument", importNySemDocument), ], "add_method": addNySemDocument, "validation": issubclass(NySemDocument, NyValidation), "_class": NySemDocument, } )
id_list = self.utConvertToList(REQUEST.get('id', [])) try: self.manage_delObjects(id_list) except: self.setSessionErrors(['Error while delete data.']) else: self.setSessionInfo(['Item(s) deleted.']) if REQUEST: REQUEST.RESPONSE.redirect('index_html') security.declareProtected(view, 'report_macro_objecttree_html') def report_macro_objecttree_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getForm('report_macro_objecttree') InitializeClass(NyReportQuestion) manage_addNyReportQuestion_html = PageTemplateFile('zpt/reportquestion_manage_add', globals()) manage_addNyReportQuestion_html.kind = METATYPE_OBJECT manage_addNyReportQuestion_html.action = 'addNyReportQuestion' config.update({ 'constructors': (manage_addNyReportQuestion_html, addNyReportQuestion), 'folder_constructors': [ # NyFolder.manage_addNyReportQuestion_html = manage_addNyReportQuestion_html ('manage_addNyReportQuestion_html', manage_addNyReportQuestion_html), ('reportquestion_add_html', reportquestion_add_html), ('addNyReportQuestion', addNyReportQuestion), (config['import_string'], importNyReportQuestion), ], 'add_method': addNyReportQuestion, 'validation': issubclass(NyReportQuestion, NyValidation), '_class': NyReportQuestion, })
'add_form': OBJECT_ADD_FORM, 'description': DESCRIPTION_OBJECT, 'default_schema': DEFAULT_SCHEMA, 'properties': PROPERTIES_OBJECT, 'schema_name': 'NySemFieldSite', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemFieldSite.gif'), '_misc': { 'NySemFieldSite.gif': ImageFile('www/NySemFieldSite.gif', globals()), 'NySemFieldSite_marked.gif': ImageFile('www/NySemFieldSite_marked.gif', globals()), }, } manage_addNySemFieldSite_html = PageTemplateFile('zpt/semfieldsite_manage_add', globals()) manage_addNySemFieldSite_html.kind = METATYPE_OBJECT manage_addNySemFieldSite_html.action = 'addNySemFieldSite' def semfieldsite_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemFieldSite', 'form_helper': form_helper}, 'semfieldsite_add') def _create_NySemFieldSite_object(parent, id, contributor): id = make_id(parent, id=id, prefix=PREFIX_OBJECT) ob = NySemFieldSite(id, contributor) parent.gl_add_languages(ob) parent._setObject(id, ob) ob = parent._getOb(id) ob.after_setObject() return ob
security.declareProtected(PERMISSION_EDIT_OBJECTS, "edit_html") def edit_html(self, REQUEST=None, RESPONSE=None): """ """ if self.hasVersion(): obj = self.version else: obj = self return self.getFormsTool().getContent({"here": obj}, "story_edit") InitializeClass(NyStory) manage_addNyStory_html = PageTemplateFile("zpt/story_manage_add", globals()) manage_addNyStory_html.kind = config["meta_type"] manage_addNyStory_html.action = "addNyStory" # Custom folder index for stories NaayaPageTemplateFile("zpt/story_folder_index", globals(), "story_folder_index") config.update( { "constructors": (manage_addNyStory_html, addNyStory), "folder_constructors": [ # NyFolder.manage_addNyStory_html = manage_addNyStory_html ("manage_addNyStory_html", manage_addNyStory_html), ("story_add", story_add), ("addNyStory", addNyStory), ("import_story_item", importNyStory), ], "add_method": addNyStory,
'links': (0, '', ''), 'organisation': (0, '', ''), 'location': (0, '', ''), 'main_issues': (0, '', ''), 'tools': (0, '', ''), 'budget': (0, '', ''), 'timeframe': (0, '', ''), 'priority_area': (0, '', ''), 'focus': (0, '', ''), 'lang': (0, '', '') } manage_addNySMAPProject_html = PageTemplateFile('zpt/project_manage_add', globals()) manage_addNySMAPProject_html.kind = METATYPE_OBJECT manage_addNySMAPProject_html.action = 'addNySMAPProject' def project_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySMAPProject' }, 'project_add') def addNySMAPProject(self, id='', title='',
'coverage': (0, '', ''), 'keywords': (0, '', ''), 'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'body': (0, '', ''), 'topitem': (0, '', ''), 'resourceurl': (0, '', ''), 'source': (0, '', ''), 'frontpicture': (0, '', ''), 'lang': (0, '', '') } manage_addNyStory_html = PageTemplateFile('zpt/story_manage_add', globals()) manage_addNyStory_html.kind = METATYPE_OBJECT manage_addNyStory_html.action = 'addNyStory' def story_add(self, REQUEST=None, RESPONSE=None): """ """ id = PREFIX_OBJECT + self.utGenRandomId(6) self.addNyStory(id) if REQUEST: REQUEST.RESPONSE.redirect('%s/add_html' % self._getOb(id).absolute_url()) def addNyStory(self, id='', title='', description='', coverage='', keywords='', sortorder='', body='', topitem='', resourceurl='', source='', frontpicture='', contributor=None, releasedate='', discussion='', lang=None, REQUEST=None, **kwargs): """ Create a Story type of object. """ #process parameters id = self.utCleanupId(id)
'properties': PROPERTIES_OBJECT, 'schema_name': 'NySemProject', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemProject.gif'), '_misc': { 'NySemProject.gif': ImageFile('www/NySemProject.gif', globals()), 'NySemProject_marked.gif': ImageFile('www/NySemProject_marked.gif', globals()), }, } manage_addNySemProject_html = PageTemplateFile('zpt/semproject_manage_add', globals()) manage_addNySemProject_html.kind = METATYPE_OBJECT manage_addNySemProject_html.action = 'addNySemProject' def semproject_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemProject', 'form_helper': form_helper }, 'semproject_add')
'schema_name': 'NySemOrganisation', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemOrganisation.gif'), '_misc': { 'NySemOrganisation.gif': ImageFile('www/NySemOrganisation.gif', globals()), 'NySemOrganisation_marked.gif': ImageFile('www/NySemOrganisation_marked.gif', globals()), }, } manage_addNySemOrganisation_html = PageTemplateFile( 'zpt/semorganisation_manage_add', globals()) manage_addNySemOrganisation_html.kind = METATYPE_OBJECT manage_addNySemOrganisation_html.action = 'addNySemOrganisation' def semorganisation_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemOrganisation', 'form_helper': form_helper }, 'semorganisation_add')
"country": (0, "", ""), "maintopics": (0, "", ""), "subtopics": (0, "", ""), "sortorder": (0, MUST_BE_POSITIV_INT, "The Sort order field must contain a positive integer."), "releasedate": (0, MUST_BE_DATETIME, "The Release date field must contain a valid date."), "discussion": (0, "", ""), "file": (0, "", ""), "downloadfilename": (0, "", ""), "content_type": (0, "", ""), "email": (0, "", ""), "lang": (0, "", ""), } manage_addNySMAPExpert_html = PageTemplateFile("zpt/expert_manage_add", globals()) manage_addNySMAPExpert_html.kind = METATYPE_OBJECT manage_addNySMAPExpert_html.action = "addNySMAPExpert" def expert_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( {"here": self, "kind": METATYPE_OBJECT, "action": "addNySMAPExpert"}, "expert_add" ) def addNySMAPExpert( self, id="", title="", description="", coverage="",
security.declareProtected(PERMISSION_MANAGE_CONSULTATION, 'view_statistics_html') view_statistics_html = PageTemplateFile('zpt/view_statistics', globals()) security.declareProtected(PERMISSION_MANAGE_CONSULTATION, 'instructions_html') instructions_html = PageTemplateFile('zpt/instructions', globals()) InitializeClass(NyConsultation) manage_addNyConsultation_html = PageTemplateFile('zpt/consultation_manage_add', globals()) manage_addNyConsultation_html.kind = METATYPE_OBJECT manage_addNyConsultation_html.action = 'addNyConsultation' config.update({ 'constructors': (manage_addNyConsultation_html, addNyConsultation), 'folder_constructors': [ # NyFolder.manage_addNyConsultation_html = manage_addNyConsultation_html ('manage_addNyConsultation_html', manage_addNyConsultation_html), ('consultation_add_html', consultation_add_html), ('addNyConsultation', addNyConsultation), ], 'add_method': addNyConsultation, 'validation': issubclass(NyConsultation, NyValidation), '_class': NyConsultation, })
'add_form': OBJECT_ADD_FORM, 'description': DESCRIPTION_OBJECT, 'default_schema': DEFAULT_SCHEMA, 'properties': PROPERTIES_OBJECT, 'schema_name': 'NySemPublication', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemPublication.gif'), '_misc': { 'NySemPublication.gif': ImageFile('www/NySemPublication.gif', globals()), 'NySemPublication_marked.gif': ImageFile('www/NySemPublication_marked.gif', globals()), }, } manage_addNySemPublication_html = PageTemplateFile('zpt/sempublication_manage_add', globals()) manage_addNySemPublication_html.kind = METATYPE_OBJECT manage_addNySemPublication_html.action = 'addNySemPublication' def sempublication_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemPublication', 'form_helper': form_helper}, 'sempublication_add') def addNySemPublication(self, id='', title='', description='', coverage='', keywords='', sortorder='', publication_url='', contributor=None, releasedate='', discussion='', lang=None, REQUEST=None, **kwargs): """ Create a Publication type of object. """
# if survey parameter is true, we want to know if this meeting # type requires an automatic survey if survey: if meeting_type in EIONET_SURVEYS: return True else: if meeting_type in EIONET_MEETINGS: return True return False InitializeClass(NyMeeting) manage_addNyMeeting_html = PageTemplateFile('zpt/meeting_manage_add', globals()) manage_addNyMeeting_html.kind = config['meta_type'] manage_addNyMeeting_html.action = 'addNyMeeting' # Custom page templates NaayaPageTemplateFile('zpt/meeting_menusubmissions', globals(), 'naaya.content.meeting.meeting_menusubmissions') config.update({ 'on_install': meeting_on_install, 'constructors': (manage_addNyMeeting_html, addNyMeeting), 'folder_constructors': [ # NyFolder.manage_addNyMeeting_html = manage_addNyMeeting_html ('manage_addNyMeeting', manage_addNyMeeting_html), ('meeting_add_html', meeting_add_html), ('addNyMeeting', addNyMeeting), ], 'add_method': addNyMeeting,
'lastname': (0, '', ''), 'jobtitle': (0, '', ''), 'department': (0, '', ''), 'organisation': (0, '', ''), 'postaladdress':(0, '', ''), 'phone': (0, '', ''), 'fax': (0, '', ''), 'cellphone': (0, '', ''), 'email': (0, '', ''), 'webpage': (0, '', ''), 'lang': (0, '', '') } manage_addNyContact_html = PageTemplateFile('zpt/contact_manage_add', globals()) manage_addNyContact_html.kind = METATYPE_OBJECT manage_addNyContact_html.action = 'addNyContact' def contact_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyContact'}, 'contact_add') def addNyContact(self, id='', title='', description='', coverage='', keywords='', sortorder='', personaltitle='', firstname='', lastname='', jobtitle='', department='', organisation='', postaladdress='', phone='', fax='', cellphone='', email='', webpage='', contributor=None, releasedate='', discussion='', contact_word='', lang=None, REQUEST=None, **kwargs): """ Create an Contact type of object. """ #process parameters id = self.utCleanupId(id) if not id: id = self.utGenObjectId(title)
return self.getFormsTool().getContent({'here': self}, 'geopoint_index') security.declareProtected(PERMISSION_EDIT_OBJECTS, 'edit_html') def edit_html(self, REQUEST=None, RESPONSE=None): """ """ if self.hasVersion(): obj = self.version else: obj = self return self.getFormsTool().getContent({'here': obj}, 'geopoint_edit') InitializeClass(NyGeoPoint) manage_addNyGeoPoint_html = PageTemplateFile('zpt/geopoint_manage_add', globals()) manage_addNyGeoPoint_html.kind = config['meta_type'] manage_addNyGeoPoint_html.action = 'addNyGeoPoint' config.update({ 'constructors': (manage_addNyGeoPoint_html, addNyGeoPoint), 'folder_constructors': [ # NyFolder.manage_addNyGeoPoint_html = manage_addNyGeoPoint_html ('manage_addNyGeoPoint_html', manage_addNyGeoPoint_html), ('geopoint_add_html', geopoint_add_html), ('addNyGeoPoint', addNyGeoPoint), ('import_geopoint_item', importNyGeoPoint), ], 'add_method': addNyGeoPoint, 'validation': issubclass(NyGeoPoint, NyValidation), '_class': NyGeoPoint, }) def get_config():
'sortorder': (0, MUST_BE_POSITIV_INT, 'The Sort order field must contain a positive integer.'), 'releasedate': (0, MUST_BE_DATETIME, 'The Release date field must contain a valid date.'), 'discussion': (0, '', ''), 'file': (0, '', ''), 'downloadfilename': (0, '', ''), 'content_type': (0, '', ''), 'email': (0, '', ''), 'lang': (0, '', '') } manage_addNySMAPExpert_html = PageTemplateFile('zpt/expert_manage_add', globals()) manage_addNySMAPExpert_html.kind = METATYPE_OBJECT manage_addNySMAPExpert_html.action = 'addNySMAPExpert' def expert_add_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySMAPExpert' }, 'expert_add') def addNySMAPExpert(self, id='', title='',
""" """ return self.absolute_url() + '/download' security.declarePublic('getEditDownloadUrl') def getEditDownloadUrl(self): """ """ return self.absolute_url() + '/download?version=1' InitializeClass(NyPublication) manage_addNyPublication_html = PageTemplateFile('zpt/publication_manage_add', globals()) manage_addNyPublication_html.kind = METATYPE_OBJECT manage_addNyPublication_html.action = 'addNyPublication' config.update({ 'constructors': (manage_addNyPublication_html, addNyPublication), 'folder_constructors': [ ('manage_addNyPublication_html', manage_addNyPublication_html), ('publication_add_html', publication_add_html), ('addNyPublication', addNyPublication), (config['import_string'], importNyPublication), ], 'add_method': addNyPublication, 'validation': issubclass(NyPublication, NyValidation), '_class': NyPublication, })
'default_schema': DEFAULT_SCHEMA, 'properties': PROPERTIES_OBJECT, 'schema_name': 'NySemNews', '_module': sys.modules[__name__], 'icon': os.path.join(os.path.dirname(__file__), 'www', 'NySemNews.gif'), '_misc': { 'NySemNews.gif': ImageFile('www/NySemNews.gif', globals()), 'NySemNews_marked.gif': ImageFile('www/NySemNews_marked.gif', globals()), }, } manage_addNySemNews_html = PageTemplateFile('zpt/semnews_manage_add', globals()) manage_addNySemNews_html.kind = METATYPE_OBJECT manage_addNySemNews_html.action = 'addNySemNews' def semnews_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, config['meta_type']) return self.getFormsTool().getContent( { 'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNySemNews', 'form_helper': form_helper }, 'semnews_add')
id_list = self.utConvertToList(REQUEST.get('id', [])) try: self.manage_delObjects(id_list) except: self.setSessionErrors(['Error while delete data.']) else: self.setSessionInfo(['Item(s) deleted.']) if REQUEST: REQUEST.RESPONSE.redirect('index_html') security.declareProtected(view, 'report_macro_objecttree_html') def report_macro_objecttree_html(self, REQUEST=None, RESPONSE=None): """ """ return self.getFormsTool().getForm('report_macro_objecttree') InitializeClass(NyReportQuestionnaire) manage_addNyReportQuestionnaire_html = PageTemplateFile('zpt/reportquestionnaire_manage_add', globals()) manage_addNyReportQuestionnaire_html.kind = METATYPE_OBJECT manage_addNyReportQuestionnaire_html.action = 'addNyReportQuestionnaire' config.update({ 'constructors': (manage_addNyReportQuestionnaire_html, addNyReportQuestionnaire), 'folder_constructors': [ # NyFolder.manage_addNyReportQuestionnaire_html = manage_addNyReportQuestionnaire_html ('manage_addNyReportQuestionnaire_html', manage_addNyReportQuestionnaire_html), ('reportquestionnaire_add_html', reportquestionnaire_add_html), ('addNyReportQuestionnaire', addNyReportQuestionnaire), (config['import_string'], importNyReportQuestionnaire), ], 'add_method': addNyReportQuestionnaire, 'validation': issubclass(NyReportQuestionnaire, NyValidation), '_class': NyReportQuestionnaire, })
'resourceurl': (0, '', ''), 'source': (0, '', ''), 'lang': (0, '', '') } DEFAULT_SCHEMA = { 'details': dict(sortorder=100, widget_type='TextArea', label='Details (HTML)', localized=True, tinymce=True), 'expirationdate': dict(sortorder=110, widget_type='Date', label='Expiration date', data_type='date'), 'topitem': dict(sortorder=120, widget_type='Checkbox', label='Top item', data_type='int'), 'resourceurl': dict(sortorder=130, widget_type='String', label='Concerned URL'), 'source': dict(sortorder=140, widget_type='String', label='Source', localized=True), } DEFAULT_SCHEMA.update(NY_CONTENT_BASE_SCHEMA) manage_addNyNews_html = PageTemplateFile('zpt/news_manage_add', globals()) manage_addNyNews_html.kind = METATYPE_OBJECT manage_addNyNews_html.action = 'addNyNews' def news_add_html(self, REQUEST=None, RESPONSE=None): """ """ from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype form_helper = get_schema_helper_for_metatype(self, METATYPE_OBJECT) return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyNews', 'form_helper': form_helper}, 'news_add') def _create_NyNews_object(parent, id, contributor): i = 0 while parent._getOb(id, None): i += 1 id = '%s-%u' % (id, i) ob = NyNews(id, contributor) parent.gl_add_languages(ob) parent._setObject(id, ob)
for tree_data in skel.ref_trees: tree_id = tree_data['id'] if tree_id in portal_portlets.objectIds(): continue tree_title = tree_data['title'] portal_portlets.manage_addRefTree(tree_id, tree_title) tree_ob = portal_portlets[tree_id] for tree_item in tree_data['items']: tree_ob.manage_addRefTreeNode(tree_item['id'], tree_item['title']) manage_addNyEduProduct_html = PageTemplateFile('zpt/eduproduct_manage_add', globals()) manage_addNyEduProduct_html.kind = config['meta_type'] manage_addNyEduProduct_html.action = 'addNyEduProduct' config.update({ 'constructors': (manage_addNyEduProduct_html, addNyEduProduct), 'folder_constructors': [ ('manage_addNyEduProduct_html', manage_addNyEduProduct_html), ('eduproduct_add_html', eduproduct_add_html), ('addNyEduProduct', addNyEduProduct), ], 'add_method': addNyEduProduct, 'validation': issubclass(NyEduProduct, NyValidation), '_class': NyEduProduct, 'on_install' : on_install_eduproduct, }) def get_config(): return config
fileitem = self.getFileItem(lang) if not fileitem: return self.absolute_url() + '/download?lang=%s&version=1' % lang file_path = fileitem._get_data_name() media_server = getattr(site, 'media_server', '').strip() if not (media_server and file_path): return self.absolute_url() + '/download?lang=%s&version=1' % lang file_path = (media_server, ) + tuple(file_path) return '/'.join(file_path) InitializeClass(NyExFile_extfile) manage_addNyExFile_html = PageTemplateFile('zpt/exfile_manage_add', globals()) manage_addNyExFile_html.kind = config['meta_type'] manage_addNyExFile_html.action = 'addNyExFile' config.update({ 'constructors': (manage_addNyExFile_html, addNyExFile), 'folder_constructors': [ # NyFolder.manage_addNyExFile_html = manage_addNyExFile_html ('manage_addNyExFile_html', manage_addNyExFile_html), ('exfile_add_html', exfile_add_html), ('addNyExFile', addNyExFile), ('import_exfile_item', importNyExFile), ], 'add_method': addNyExFile, 'validation': issubclass(NyExFile_extfile, NyValidation), '_class': NyExFile_extfile, }) def get_config():
""" """ parser = SubtitleParser(self.subtitle) return parser.parse() security.declareProtected(view, 'getSize') def getSize(self): video = self.getSingleMediaObject() if not (video and self.is_ext): return 0 return video.get_size() InitializeClass(NyMediaFile_extfile) manage_addNyMediaFile_html = PageTemplateFile('zpt/mediafile_manage_add', globals()) manage_addNyMediaFile_html.kind = config['meta_type'] manage_addNyMediaFile_html.action = 'addNyMediaFile' config.update({ 'constructors': (manage_addNyMediaFile_html, addNyMediaFile), 'folder_constructors': [ # NyFolder.manage_addNyMediaFile_html = manage_addNyMediaFile_html ('manage_addNyMediaFile_html', manage_addNyMediaFile_html), ('mediafile_add_html', mediafile_add_html), ('addNyMediaFile', addNyMediaFile), ('import_mediafile_item', importNyMediaFile), ], 'add_method': addNyMediaFile, 'validation': issubclass(NyMediaFile_extfile, NyValidation), '_class': NyMediaFile_extfile, }) def get_config():
security.declareProtected(PERMISSION_MANAGE_SIMPLECONSULTATION, 'edit_html') edit_html = PageTemplateFile('zpt/simpleconsultation_edit', globals()) security.declareProtected(PERMISSION_REVIEW_SIMPLECONSULTATION, 'add_simpleconsultation_comment') add_simpleconsultation_comment = PageTemplateFile( 'zpt/simpleconsultation_comment_add', globals()) InitializeClass(NySimpleConsultation) manage_addNySimpleConsultation_html = PageTemplateFile( 'zpt/simpleconsultation_manage_add', globals()) manage_addNySimpleConsultation_html.kind = METATYPE_OBJECT manage_addNySimpleConsultation_html.action = 'addNySimpleConsultation' config.update({ 'constructors': (manage_addNySimpleConsultation_html, addNySimpleConsultation), 'folder_constructors': [ # NyFolder.manage_addNySimpleConsultation_html = manage_addNySimpleConsultation_html ('manage_addNySimpleConsultation_html', manage_addNySimpleConsultation_html), ('simpleconsultation_add_html', simpleconsultation_add_html), ('addNySimpleConsultation', addNySimpleConsultation), ], 'add_method': addNySimpleConsultation, 'validation': issubclass(NySimpleConsultation, NyValidation), '_class':