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

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