~hardware-certification/zope3/certify-staging-2.5

« back to all changes in this revision

Viewing changes to src/zope/app/workflow/browser/definition.py

  • Committer: Marc Tardif
  • Date: 2008-04-26 19:03:34 UTC
  • Revision ID: cr3@lime-20080426190334-u16xo4llz56vliqf
Initial import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##############################################################################
 
2
#
 
3
# Copyright (c) 2002 Zope Corporation and Contributors.
 
4
# All Rights Reserved.
 
5
#
 
6
# This software is subject to the provisions of the Zope Public License,
 
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 
11
# FOR A PARTICULAR PURPOSE.
 
12
#
 
13
##############################################################################
 
14
"""ProcessDefinition registration adding view
 
15
 
 
16
$Id: definition.py 67630 2006-04-27 00:54:03Z jim $
 
17
"""
 
18
from zope.traversing.api import traverse
 
19
# registration path changed
 
20
from zope.app.workflow.interfaces import IProcessDefinitionImportHandler
 
21
from zope.app.workflow.interfaces import IProcessDefinitionExportHandler
 
22
 
 
23
 
 
24
class ProcessDefinitionView(object):
 
25
 
 
26
    def getName(self):
 
27
        return """I'm a dummy ProcessInstance"""
 
28
 
 
29
 
 
30
class ImportExportView(object):
 
31
 
 
32
    def importDefinition(self):
 
33
        xml = str(self.request.get('definition'))
 
34
        if xml:
 
35
            IProcessDefinitionImportHandler(self.context).doImport(xml)
 
36
        self.request.response.redirect('@@importexport.html?success=1')
 
37
 
 
38
    def exportDefinition(self):
 
39
        return IProcessDefinitionExportHandler(self.context).doExport()