source: publico/ILSAAP/branches/2.0/Extensions/InstallWorkflows.py @ 4618

Última Alteração nesse arquivo desde 4618 foi 4618, incluída por sesostris, 10 anos atrás

Corrigidos os tickets #470 #448 #450 #449 #474 #460 #454 #468 #451 #452 #456 #458 #455 #457 #459 #461 #469 #473 #247 do SAAP 2.0

File size: 2.8 KB
Linha 
1# -*- coding: utf-8 -*-
2#
3# File: ILSAAP.py
4#
5# Copyright (c) 2008 by Interlegis
6# Generator: ArchGenXML Version 1.5.2
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__ = """SCT Interlegis <admin-stc@interlegis.gov.br>"""
28__docformat__ = 'plaintext'
29
30
31from Products.CMFCore.utils import getToolByName
32from Products.ExternalMethod.ExternalMethod import ExternalMethod
33
34##code-section module-header #fill in your manual code here
35##/code-section module-header
36
37def installWorkflows(self, package, out):
38    """Install the custom workflows for this product."""
39
40    productname = 'ILSAAP'
41    workflowTool = getToolByName(self, 'portal_workflow')
42
43    ourProductWorkflow = ExternalMethod('temp', 'temp',
44                                        productname+'.'+'saap_workflow',
45                                        'create_saap_workflow')
46    workflow = ourProductWorkflow(self, 'saap_workflow')
47    if 'saap_workflow' in workflowTool.listWorkflows():
48        print >> out, 'saap_workflow already in workflows.'
49    else:
50        workflowTool._setObject('saap_workflow', workflow)
51    workflowTool.setChainForPortalTypes(['LabelModel'], workflow.getId())
52    workflowTool.setChainForPortalTypes(['Letter'], workflow.getId())
53    workflowTool.setChainForPortalTypes(['Editorial'], workflow.getId())
54    workflowTool.setChainForPortalTypes(['Entity'], workflow.getId())
55    workflowTool.setChainForPortalTypes(['PhysicalPerson'], workflow.getId())
56    workflowTool.setChainForPortalTypes(['LabelModel'], workflow.getId())
57    workflowTool.setChainForPortalTypes(['ContactCollection'], workflow.getId())
58 
59
60    ##code-section after-workflow-install #fill in your manual code here
61    ##/code-section after-workflow-install
62
63    return workflowTool
64
65def uninstallWorkflows(self, package, out):
66    """Deinstall the workflows.
67
68    This code doesn't really do anything, but you can place custom
69    code here in the protected section.
70    """
71
72    ##code-section workflow-uninstall #fill in your manual code here
73    ##/code-section workflow-uninstall
74
75    pass
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.