Exemple #1
0
# this dictionary is updated at the end of the module
config = {
    'product': 'NaayaContent',
    'module': 'InfoFolder',
    'package_path': os.path.abspath(os.path.dirname(__file__)),
    'meta_type': 'Naaya InfoFolder',
    'label': 'InfoFolder',
    'permission': PERMISSION_ADD_INFOFOLDER,
    'forms': ['infofolder_add', 'infofolder_edit', 'infofolder_index'],
    'add_form': 'infofolder_add_html',
    'description': 'This is Naaya InfoFolder type.',
    'properties': {},  #TODO: REMOVE
    'default_schema': DEFAULT_SCHEMA,
    'schema_name': 'NyInfoFolder',
    '_module': sys.modules[__name__],
    'additional_style': AdditionalStyle('www/InfoFolder.css', globals()),
    'icon': os.path.join(os.path.dirname(__file__), 'www', 'NyInfoFolder.gif'),
    'on_install': setupContentType,
    '_misc': {
        'NyInfoFolder.gif':
        ImageFile('www/NyInfoFolder.gif', globals()),
        'NyInfoFolder_marked.gif':
        ImageFile('www/NyInfoFolder_marked.gif', globals()),
    },
}

#Portal portlets
NaayaPageTemplateFile('zpt/latest_uploads_portlet', globals(),
                      'naaya.content-sdo.infofolder.latest_uploads_portlet')
NaayaPageTemplateFile(
    'zpt/infofolder_search_portlet', globals(),
config = {'product': 'NaayaContent',
          'module': 'municipality_item',
          'package_path': os.path.abspath(os.path.dirname(__file__)),
          'meta_type': METATYPE_OBJECT,
          'label': LABEL_OBJECT,
          'permission': PERMISSION_ADD_MUNICIPALITY,
          'forms': OBJECT_FORMS,
          'add_form': OBJECT_ADD_FORM,
          'description': DESCRIPTION_OBJECT,
          'default_schema': DEFAULT_SCHEMA,
          'schema_name': 'NyMunicipality',
          '_module': sys.modules[__name__],
          'icon': os.path.join(os.path.dirname(__file__), 'www',
                               'NyMunicipality.gif'),
          'on_install': setupContentType,
          'additional_style': AdditionalStyle('www/municipality.css',
                                              globals()),
          '_misc': {
              'NyMunicipality.gif': ImageFile('www/NyMunicipality.gif',
                                              globals()),
              'NyMunicipality_marked.gif': ImageFile(
                  'www/NyMunicipality_marked.gif', globals()),
              },
          }

email_templates = {
    'email_when_unapproved_to_maintainer': EmailPageTemplateFile(
        'templates/email_when_unapproved_to_maintainer.zpt', globals()),
}


def municipality_add_html(self, REQUEST=None, RESPONSE=None):
Exemple #3
0
# this dictionary is updated at the end of the module
config = {
        'product': 'NaayaContent',
        'module': 'bfile_item',
        'package_path': os.path.abspath(os.path.dirname(__file__)),
        'meta_type': 'Naaya Blob File',
        'label': 'File',
        'permission': PERMISSION_ADD_BFILE,
        'forms': ['bfile_add', 'bfile_edit', 'bfile_index',
                  'bfile_quickview_zipfile'],
        'add_form': 'bfile_add_html',
        'description': 'File objects that store data using ZODB BLOBs',
        'default_schema': DEFAULT_SCHEMA,
        'schema_name': 'NyBFile',
        '_module': sys.modules[__name__],
        'additional_style': AdditionalStyle('www/style.css', globals()),
        'icon': os.path.join(os.path.dirname(__file__), 'www', 'bfile.gif'),
        '_misc': {
                'NyBFile.gif': ImageFile('www/bfile.gif', globals()),
                'NyBFile_marked.gif': ImageFile('www/bfile_marked.gif', globals()),
            },
    }

def bfile_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': config['meta_type'],
            'action': 'addNyBFile',
    PERMISSION_ADD_TALKBACK_CONSULTATION,
    'forms': [],
    'add_form':
    'talkbackconsultation_add_html',
    'description':
    'This is Naaya TalkBack Consultation type.',
    'default_schema':
    DEFAULT_SCHEMA,
    'schema_name':
    METATYPE_TALKBACKCONSULTATION,
    'import_string':
    '',
    '_module':
    sys.modules[__name__],
    'additional_style':
    AdditionalStyle('www/talkbackconsultation_style.css', globals()),
    'icon':
    os.path.join(os.path.dirname(__file__), 'www',
                 'NyTalkBackConsultation.gif'),
    '_misc': {
        'NyTalkBackConsultation.gif':
        ImageFile('www/NyTalkBackConsultation.gif', globals()),
        'NyTalkBackConsultation_marked.gif':
        ImageFile('www/NyTalkBackConsultation_marked.gif', globals()),
        'tb-editor.css':
        ImageFile('www/tb-editor.css', globals()),
    },
}

talkbackconsultation_add = NaayaPageTemplateFile(
    'zpt/talkbackconsultation_add', globals(), 'tbconsultation_add')
Exemple #5
0
config = {
    'product': 'NaayaContent',
    'module': 'expert_item',
    'package_path': os.path.abspath(os.path.dirname(__file__)),
    'meta_type': METATYPE_OBJECT,
    'label': LABEL_OBJECT,
    'permission': PERMISSION_ADD_EXPERT,
    'forms': OBJECT_FORMS,
    'add_form': OBJECT_ADD_FORM,
    'description': DESCRIPTION_OBJECT,
    'default_schema': DEFAULT_SCHEMA,
    'schema_name': 'NyExpert',
    '_module': sys.modules[__name__],
    'icon': os.path.join(os.path.dirname(__file__), 'www', 'NyExpert.gif'),
    'on_install': setupContentType,
    'additional_style': AdditionalStyle('www/expert.css', globals()),
    '_misc': {
        'NyExpert.gif': ImageFile('www/NyExpert.gif', globals()),
        'NyExpert_marked.gif': ImageFile('www/NyExpert_marked.gif', globals()),
        },
    }


def expert_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': 'addNyExpert',
         'form_helper': form_helper}, 'expert_add')
Exemple #6
0
# this dictionary is updated at the end of the module
config = {
    'product': 'NaayaCaseStudy',
    'module': 'case_study_item',
    'package_path': os.path.abspath(os.path.dirname(__file__)),
    'meta_type': 'Naaya Case Study',
    'label': 'Case Study',
    'permission': PERMISSION_ADD_CASE_STUDY,
    'forms': ['case_study_add', 'case_study_edit', 'case_study_index'],
    'add_form': 'case_study_add_html',
    'description': 'This is Naaya Case Study type.',
    'properties': PROPERTIES_OBJECT,
    'default_schema': DEFAULT_SCHEMA,
    'schema_name': 'NyCaseStudy',
    '_module': sys.modules[__name__],
    'additional_style': AdditionalStyle('www/case_study.css', globals()),
    'icon': os.path.join(os.path.dirname(__file__), 'www', 'case_study.png'),
    'on_install': setupContentType,
    'on_uninstall': uninstallContentType,
    '_misc': {
        'NyCaseStudy.png':
        ImageFile('www/case_study.png', globals()),
        'NyCaseStudy_marked.png':
        ImageFile('www/case_study_marked.png', globals()),
    },
}


def case_study_add_html(self, REQUEST=None, RESPONSE=None):
    """ """
    from Products.NaayaBase.NyContentType import get_schema_helper_for_metatype