source: publico/ILPortal/trunk/TextoPasta.py @ 2461

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

alteração no modelo e geração de código

File size: 4.8 KB
Linha 
1# -*- coding: utf-8 -*-
2#
3# File: TextoPasta.py
4#
5# Copyright (c) 2006 by Interlegis
6# Generator: ArchGenXML Version 1.5.0 svn/devel
7#            http://plone.org/products/archgenxml
8#
9# GNU General Public License (GPL)
10#
11# This program is free software; you can redistribute it and/or
12# modify it under the terms of the GNU General Public License
13# as published by the Free Software Foundation; either version 2
14# of the License, or (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24# 02110-1301, USA.
25#
26
27__author__ = """STC Interlegis <admin-stc@interlegis.gov.br>"""
28__docformat__ = 'plaintext'
29
30from AccessControl import ClassSecurityInfo
31from Products.Archetypes.atapi import *
32from Products.Archetypes.SQLStorage import *
33from Products.ILPortal.config import *
34
35# additional imports from tagged value 'import'
36from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin
37from Products.CMFCore import CMFCorePermissions
38
39##code-section module-header #fill in your manual code here
40##/code-section module-header
41
42schema = Schema((
43
44    StringField(
45        name='title',
46        widget=StringWidget(
47            label="Título",
48            description=' ',
49            visible={'view':'hidden','edit':'hidden'},
50            label_msgid='ILPortal_label_title',
51            description_msgid='ILPortal_help_title',
52            i18n_domain='ILPortal',
53        ),
54        required=0,
55        accessor="Title",
56        searchable=0
57    ),
58
59    TextField(
60        name='description',
61        widget=TextAreaWidget(
62            label="Descrição",
63            description="Informe uma descrição para esse Item",
64            visible={'view':'visible','edit':'visible'},
65            label_msgid='ILPortal_label_description',
66            description_msgid='ILPortal_help_description',
67            i18n_domain='ILPortal',
68        ),
69        required=0,
70        accessor="Description",
71        searchable=1
72    ),
73
74    TextField(
75        name='textoPasta',
76        widget=RichWidget
77        (
78            label="Texto da Pasta",
79            description="Informe o Texto que será apresentado na visualização da pasta",
80            label_msgid='ILPortal_label_textoPasta',
81            description_msgid='ILPortal_help_textoPasta',
82            i18n_domain='ILPortal',
83        ),
84        default_output_type='text/html',
85        default_content_type='text/html',
86        searchable=1,
87        required=1
88    ),
89
90),
91)
92
93##code-section after-local-schema #fill in your manual code here
94##/code-section after-local-schema
95
96TextoPasta_schema = BaseSchema.copy() + \
97    schema.copy()
98
99##code-section after-schema #fill in your manual code here
100##/code-section after-schema
101
102class TextoPasta(BrowserDefaultMixin, BaseContent):
103    """
104    """
105    security = ClassSecurityInfo()
106    __implements__ = (getattr(BrowserDefaultMixin,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)
107
108    # This name appears in the 'add' box
109    archetype_name = 'Texto da Pasta'
110
111    meta_type = 'TextoPasta'
112    portal_type = 'TextoPasta'
113    allowed_content_types = []
114    filter_content_types = 0
115    global_allow = 1
116    #content_icon = 'TextoPasta.gif'
117    immediate_view = 'base_view'
118    default_view = 'textopasta_view'
119    suppl_views = ('textopasta_view',)
120    typeDescription = "Texto que aparecerá quando esse tipo for selecionado como visualizão padrão da Pasta"
121    typeDescMsgId = 'description_edit_textopasta'
122
123
124    actions =  (
125
126
127       {'action': "string:${object_url}/view",
128        'category': "object",
129        'id': 'view',
130        'name': 'View',
131        'permissions': ("View",),
132        'condition': 'python:1'
133       },
134
135
136       {'action': "string:${object/aq_parent/absolute_url}/base_edit",
137        'category': "object",
138        'id': 'edit_pasta',
139        'name': 'Editar Pasta',
140        'permissions': ("Modify portal content",),
141        'condition': 'python:1'
142       },
143
144
145    )
146
147    _at_rename_after_creation = True
148
149    schema = TextoPasta_schema
150
151    ##code-section class-header #fill in your manual code here
152    ##/code-section class-header
153
154    # Methods
155
156    security.declareProtected(CMFCorePermissions.ModifyPortalContent, 'setTitle')
157    def setTitle(self,valor):
158        """seta o titulo do objeto """
159        titulo = self.aq_parent.Title()
160        self.getField('title').set(self, titulo)
161
162
163registerType(TextoPasta, PROJECTNAME)
164# end of class TextoPasta
165
166##code-section module-footer #fill in your manual code here
167##/code-section module-footer
168
169
170
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.