コード例 #1
0
ファイル: NyReportSection.py プロジェクト: eaudeweb/naaya
        if REQUEST: REQUEST.RESPONSE.redirect('reportquestionnaires_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')

    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,
})
コード例 #2
0
DESCRIPTION_OBJECT = 'This is Naaya Report Chapter type.'
PREFIX_OBJECT = 'chp'
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_addNyReportChapter_html = PageTemplateFile('zpt/reportchapter_manage_add', globals())
manage_addNyReportChapter_html.kind = METATYPE_OBJECT
manage_addNyReportChapter_html.action = 'addNyReportChapter'

def reportchapter_add_html(self, REQUEST=None, RESPONSE=None):
    """ """
    return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyReportChapter'}, 'reportchapter_add')

def addNyReportChapter(self, id='', title='', description='', coverage='', keywords='',
    sortorder='', contributor=None, releasedate='', discussion='', lang=None, REQUEST=None, **kwargs):
    """
    Create a Report Chapter type of object.
    """
    #process parameters
    id = self.utCleanupId(id)
    if not id: id = self.generateItemId(PREFIX_OBJECT)
    try: sortorder = abs(int(sortorder))
コード例 #3
0
    'forms': OBJECT_FORMS,
    '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)
コード例 #4
0
ファイル: pointer_item.py プロジェクト: mihneasim/Naaya
                return self.getFormsTool().getContent(params, 'pointer_index')
        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,
})
コード例 #5
0
ファイル: story_item.py プロジェクト: bogtan/Naaya
        """ """
        return self.getFormsTool().getContent({'here': self}, 'story_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}, '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'
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,
    'validation': issubclass(NyStory, NyValidation),
    '_class': NyStory,
})
コード例 #6
0
ファイル: NySemThematicDir.py プロジェクト: eaudeweb/naaya
    'description':          (0, '', ''),
    '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)
コード例 #7
0
    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),
    ],
コード例 #8
0
        """ """
        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,
})
コード例 #9
0
    'lon_cardinal': (0, '', ''),
    '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)
コード例 #10
0
ファイル: event_item.py プロジェクト: eaudeweb/trunk-eggs
        if loc:
            cal.vevent.add('location').value = ', '.join(loc)

        ics_data = cal.serialize()

        #RESPONSE.setHeader('Content-Type', 'text/plain')
        RESPONSE.setHeader('Content-Type', 'text/calendar')
        RESPONSE.setHeader('Content-Disposition',
                           'attachment;filename=%s.ics' % self.getId())
        RESPONSE.write(ics_data)

InitializeClass(NyEvent)

manage_addNyEvent_html = PageTemplateFile('zpt/event_manage_add', globals())
manage_addNyEvent_html.kind = config['meta_type']
manage_addNyEvent_html.action = 'addNyEvent'

#Custom folder index for events
NaayaPageTemplateFile('zpt/event_folder_index', globals(), 'event_folder_index')

config.update({
    'constructors': (manage_addNyEvent_html, addNyEvent),
    'folder_constructors': [
            # NyFolder.manage_addNyEvent_html = manage_addNyEvent_html
            ('manage_addNyEvent_html', manage_addNyEvent_html),
            ('event_add_html', event_add_html),
            ('addNyEvent', addNyEvent),
            ('import_event_item', importNyEvent),
        ],
    'add_method': addNyEvent,
コード例 #11
0
    security.declareProtected(PERMISSION_MANAGE_TALKBACKCONSULTATION,
                              '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),
コード例 #12
0
    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':
コード例 #13
0
ファイル: youtube_item.py プロジェクト: eaudeweb/trunk-eggs
    def index_html(self, REQUEST=None, RESPONSE=None):
        """ """
        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,
})
コード例 #14
0
ファイル: mediafile_item.py プロジェクト: eaudeweb/naaya
    def getSubtitle(self, REQUEST=None, RESPONSE=None):
        """ """
        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,
})
コード例 #15
0
ファイル: contact_item.py プロジェクト: eaudeweb/trunk-eggs
        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':
コード例 #16
0
ファイル: contact_item.py プロジェクト: mihneasim/Naaya
        phone_location_m = _phone_pattern.match(raw_line)
        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,
})
コード例 #17
0
    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':
コード例 #18
0
ファイル: NyFile.py プロジェクト: eaudeweb/naaya
    '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, '', ''),
    '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)
コード例 #19
0
    'description':          (0, '', ''),
    '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)
コード例 #20
0
ファイル: NyCountry.py プロジェクト: eaudeweb/naaya
    'source':               (0, '', ''),
    '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
コード例 #21
0
ファイル: exfile_item.py プロジェクト: eaudeweb/trunk-eggs
            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':
    #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():
コード例 #23
0
    'properties': PROPERTIES_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')
コード例 #24
0
    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':
コード例 #25
0
ファイル: NySectionComment.py プロジェクト: eaudeweb/naaya
        """ """
        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,
})
コード例 #26
0
ファイル: NyReport.py プロジェクト: eaudeweb/naaya
    def report_macro_sec_objecttree_html(self, REQUEST=None, RESPONSE=None):
        """ """
        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,
})
コード例 #27
0
ファイル: NyReportReference.py プロジェクト: eaudeweb/naaya
        """ """
        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,
})
コード例 #28
0
ファイル: NyURL.py プロジェクト: eaudeweb/naaya
PREFIX_OBJECT = 'url'
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)
コード例 #29
0
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='',
コード例 #30
0
    portal_portlets = site.getPortletsTool()

    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():
コード例 #31
0
        return self.getFormsTool().getContent({'here': self}, 'document_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}, 'document_edit')

InitializeClass(NyDocument)

manage_addNyDocument_html = PageTemplateFile('zpt/document_manage_add',
                                                globals())
manage_addNyDocument_html.kind = config['meta_type']
manage_addNyDocument_html.action = 'addNyDocument'
config.update({
    'constructors': (manage_addNyDocument_html, addNyDocument),
    'folder_constructors': [
            # NyFolder.manage_addNyDocument_html = manage_addNyDocument_html
            ('manage_addNyDocument_html', manage_addNyDocument_html),
            ('document_add', document_add),
            ('addNyDocument', addNyDocument),
            ('import_document_item', importNyDocument),
        ],
    'add_method': addNyDocument,
    'validation': issubclass(NyDocument, NyValidation),
    '_class': NyDocument,
})
コード例 #32
0
    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}, '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':
コード例 #33
0
ファイル: news_item.py プロジェクト: eaudeweb/naaya
    security.declareProtected(view, 'picture_html')
    def picture_html(self, REQUEST=None, RESPONSE=None):
        """ """
        REQUEST.RESPONSE.setHeader('content-type', 'text/html')
        return '<img src="getBigPicture" alt="" />'

    security.declareProtected(PERMISSION_EDIT_OBJECTS, 'edit_html')
    def edit_html(self, REQUEST=None, RESPONSE=None):
        """ """
        return self.getFormsTool().getContent({'here': self}, 'news_edit')

InitializeClass(NyNews)

manage_addNyNews_html = PageTemplateFile('zpt/news_manage_add', globals())
manage_addNyNews_html.kind = config['meta_type']
manage_addNyNews_html.action = 'addNyNews'
config.update({
    'constructors': (manage_addNyNews_html, addNyNews),
    'folder_constructors': [
            # NyFolder.manage_addNyNews_html = manage_addNyNews_html
            ('manage_addNyNews_html', manage_addNyNews_html),
            ('news_add_html', news_add_html),
            ('addNyNews', addNyNews),
            ('import_news_item', importNyNews),
        ],
    'add_method': addNyNews,
    'validation': issubclass(NyNews, NyValidation),
    '_class': NyNews,
})
コード例 #34
0
ファイル: semevent_item.py プロジェクト: eaudeweb/trunk-eggs
    'forms': OBJECT_FORMS,
    '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()
コード例 #35
0
    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,
    }
コード例 #36
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, '', ''),
    '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)
コード例 #37
0
    'forms': OBJECT_FORMS,
    '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()
コード例 #38
0
    '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')
コード例 #39
0
    'default_schema': DEFAULT_SCHEMA,
    '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')
コード例 #40
0
ファイル: NyStory.py プロジェクト: eaudeweb/naaya
    '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, '', ''),
    '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
コード例 #41
0
ファイル: NySMAPExpert.py プロジェクト: eaudeweb/naaya
    "ref_lang": (0, "", ""),
    "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="",
コード例 #42
0
    'properties': PROPERTIES_OBJECT,
    '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')
コード例 #43
0
    'forms': OBJECT_FORMS,
    '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.
コード例 #44
0
    edit_html = PageTemplateFile('zpt/consultation_edit', globals())

    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,
コード例 #45
0
ファイル: url_item.py プロジェクト: eaudeweb/Products.Naaya
        return self.getFormsTool().getContent({'here': self}, 'url_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}, '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,
})
コード例 #46
0
        meeting_type = portal_map.getSymbolTitle(self.geo_type)
        # 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),
        ],
コード例 #47
0
ファイル: NyContact.py プロジェクト: Hamzahashmi4444/Salman-
    'firstname':    (0, '', ''),
    '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)
コード例 #48
0
        """ """
        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,
})
コード例 #49
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='',
コード例 #50
0
    def getDownloadUrl(self):
        """ """
        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,
コード例 #51
0
ファイル: NyStory.py プロジェクト: Hamzahashmi4444/Salman-
    '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, '', ''),
    '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
コード例 #52
0
ファイル: semnews_item.py プロジェクト: eaudeweb/trunk-eggs
    'description': DESCRIPTION_OBJECT,
    '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')
コード例 #53
0
        """ """
        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,
})
コード例 #54
0
ファイル: NyNews.py プロジェクト: eaudeweb/naaya
    'del_bigpicture':   (0, '', ''),
    '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)
コード例 #55
0
ファイル: NyPointer.py プロジェクト: eaudeweb/naaya
PREFIX_OBJECT = 'pnt'
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, '', ''),
    'pointer':      (0, '', ''),
    'lang':         (0, '', '')
}

manage_addNyPointer_html = PageTemplateFile('zpt/pointer_manage_add', globals())
manage_addNyPointer_html.kind = METATYPE_OBJECT
manage_addNyPointer_html.action = 'addNyPointer'

def pointer_add_html(self, REQUEST=None, RESPONSE=None):
    """ """
    return self.getFormsTool().getContent({'here': self, 'kind': METATYPE_OBJECT, 'action': 'addNyPointer'}, 'pointer_add')

def addNyPointer(self, id='', title='', description='', coverage='', keywords='',
    sortorder='', pointer='', contributor=None, releasedate='', discussion='',
    lang=None, REQUEST=None, **kwargs):
    """
    Create a Pointer type of object.
    """
    #process parameters
    id = self.utCleanupId(id)
    if not id: id = self.utGenObjectId(title)
コード例 #56
0
ファイル: exfile_item.py プロジェクト: pombredanne/trunk-eggs
        lang = lang or self.gl_get_selected_language()
        fileitem = self.getFileItem(lang)
        if not fileitem:
            return self.absolute_url() + '/download?lang=%s&amp;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&amp;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,
})
コード例 #57
0
ファイル: NyContact.py プロジェクト: eaudeweb/naaya
    'firstname':        dict(sortorder=110, widget_type='String', label='First name', localized=True),
    'lastname':         dict(sortorder=120, widget_type='String', label='Last name', localized=True),
    'jobtitle':         dict(sortorder=130, widget_type='String', label='Job title', localized=True),
    'department':       dict(sortorder=140, widget_type='String', label='Department', localized=True),
    'organisation':     dict(sortorder=150, widget_type='String', label='Organisation', localized=True),
    'postaladdress':    dict(sortorder=160, widget_type='String', label='Postal address', localized=True),
    'phone':            dict(sortorder=170, widget_type='String', label='Phone'),
    'fax':              dict(sortorder=180, widget_type='String', label='Fax'),
    'cellphone':        dict(sortorder=190, widget_type='String', label='Cell phone'),
    'email':            dict(sortorder=200, widget_type='String', label='Email'),
    'webpage':          dict(sortorder=210, widget_type='String', label='Webpage'),
}
DEFAULT_SCHEMA.update(NY_CONTENT_BASE_SCHEMA)

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):
    """ """
    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': 'addNyContact', 'form_helper': form_helper}, 'contact_add')

def _create_NyContact_object(parent, id, contributor):
    i = 0
    while parent._getOb(id, None):
        i += 1
        id = '%s-%u' % (id, i)
    ob = NyContact(id, contributor)
    parent.gl_add_languages(ob)
コード例 #58
0
PREFIX_OBJECT = 'doc'
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.
    """
コード例 #59
0
    'source_link': (0, '', ''),
    'subject': (0, '', ''),
    'relation': (0, '', ''),
    'geozone': (0, '', ''),
    'file_link': (0, '', ''),
    'file_link_local': (0, '', ''),
    'official_journal_ref': (0, '', ''),
    'type_law': (0, '', ''),
    'original_language': (0, '', ''),
    'statute': (0, '', ''),
    'lang': (0, '', '')
}

manage_addNySemTextLaws_html = PageTemplateFile('zpt/semtextlaws_manage_add',
                                                globals())
manage_addNySemTextLaws_html.kind = METATYPE_OBJECT
manage_addNySemTextLaws_html.action = 'addNySemTextLaws'


def semtextlaws_add_html(self, REQUEST=None, RESPONSE=None):
    """ """
    return self.getFormsTool().getContent(
        {
            'here': self,
            'kind': METATYPE_OBJECT,
            'action': 'addNySemTextLaws'
        }, 'semtextlaws_add')


def addNySemTextLaws(self,
                     id='',