source: publico/ILPortal/trunk/Pasta.py @ 517

Última Alteração nesse arquivo desde 517 foi 517, incluída por paulovieira, 15 anos atrás

Altecao no modelo ILPortal, adicionando as classes Parlamentar, Telefone e Mesa Diretora

File size: 4.2 KB
Linha 
1# File: Pasta.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-beta2 devel
5#            http://plone.org/products/archgenxml
6#
7# GNU General Public Licence (GPL)
8#
9# This program is free software; you can redistribute it and/or modify it under
10# the terms of the GNU General Public License as published by the Free Software
11# Foundation; either version 2 of the License, or (at your option) any later
12# version.
13# This program is distributed in the hope that it will be useful, but WITHOUT
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16# details.
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19# Place, Suite 330, Boston, MA  02111-1307  USA
20#
21__author__  = '''Equipe STC <admin-stc@interlegis.gov.br>'''
22__docformat__ = 'plaintext'
23
24from AccessControl import ClassSecurityInfo
25from Products.Archetypes.atapi import *
26
27from Products.CMFPlone.PloneFolder import PloneFolder
28
29
30from Products.Archetypes.SQLStorage import *
31from Products.ILPortal.config import *
32##code-section module-header #fill in your manual code here
33a=2
34##/code-section module-header
35
36schema=Schema((
37    TextField('description',
38        widget=TextAreaWidget(
39            label='Descricao',
40            description='Informe uma breve descricao para esse item.',
41            label_msgid='ILPortal_label_description',
42            description_msgid='ILPortal_help_description',
43            i18n_domain='ILPortal',
44        ),
45        accessor="Description",
46        searchable=1
47    ),
48   
49    TextField('texto',
50        widget=RichWidget
51        (
52            description='Descreva o texto que sera mostrado no topo da lista de conteudos.',
53            label='Texto',
54            label_msgid='ILPortal_label_texto',
55            description_msgid='ILPortal_help_texto',
56            i18n_domain='ILPortal',
57        ),
58        required=1,
59        default_content_type='text/html',
60        searchable=1,
61        default_output_type='text/html',
62        primary=1
63    ),
64   
65),
66)
67
68
69##code-section after-schema #fill in your manual code here
70##/code-section after-schema
71
72class Pasta(PloneFolder,BaseFolder):
73    """
74    Pasta padrao para o Portal Interlegis.
75    Possui um campo texto que eh mostrado no topo do folder_listing.
76    """
77    security = ClassSecurityInfo()
78    __implements__ = (getattr(PloneFolder,'__implements__',()),) + (getattr(BaseFolder,'__implements__',()),)
79
80
81    # This name appears in the 'add' box
82    archetype_name             = 'Pasta'
83
84    meta_type                  = 'Pasta'
85    portal_type                = 'Pasta'
86    allowed_content_types      = [] + list(getattr(PloneFolder, 'allowed_content_types', []))
87    filter_content_types       = 0
88    global_allow               = 1
89    allow_discussion           = 0
90    content_icon               = 'folder_icon.gif'
91    immediate_view             = 'folder_listing'
92    default_view               = 'folder_listing'
93    suppl_views                = ()
94    typeDescription            = "Pasta"
95    typeDescMsgId              = 'description_edit_pasta'
96
97    actions =  (
98
99
100       {'action':      "string:$object_url/folder_listing",
101        'category':    "object",
102        'id':          'view',
103        'name':        'folder_listing',
104        'permissions': ("View",),
105        'condition'  : 'python:1'
106       },
107       
108
109       {'action':      "string:$object_url/folder_localrole_form",
110        'category':    "object",
111        'id':          'local_roles',
112        'name':        'Sharing',
113        'permissions': ("View",),
114        'condition'  : 'python:1'
115       },
116       
117
118    )
119
120    schema = BaseSchema + \
121             getattr(PloneFolder,'schema',Schema(())) + \
122             schema
123
124    ##code-section class-header #fill in your manual code here
125    ##/code-section class-header
126
127
128    #Methods
129def modify_fti(fti):
130    # hide unnecessary tabs (usability enhancement)
131    for a in fti['actions']:
132        if a['id'] in ['references']:
133            a['visible'] = 0
134    return fti
135
136registerType(Pasta,PROJECTNAME)
137# end of class Pasta
138
139##code-section module-footer #fill in your manual code here
140##/code-section module-footer
141
142
143
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.