[Zope3-checkins] CVS: zopeproducts/bugtracker/browser - exportimport.pt:1.1 exportimport.py:1.1 exportimport.pyc:1.1 configure.zcml:1.3

Stephan Richter srichter@cosmos.phy.tufts.edu
Sat, 26 Jul 2003 09:41:22 -0400


Update of /cvs-repository/zopeproducts/bugtracker/browser
In directory cvs.zope.org:/tmp/cvs-serv13760/browser

Modified Files:
	configure.zcml 
Added Files:
	exportimport.pt exportimport.py exportimport.pyc 
Log Message:
- Added XML Export/Import capabilities

- User Vocabularies now only store informational data about the principal,
  since exposing the entire principal is just too dangerous.

- Made Bug Tracker title the same attribute at the DC title and corrected
  permissions.


=== Added File zopeproducts/bugtracker/browser/exportimport.pt ===
<html metal:use-macro="views/standard_macros/page">
  <head>
    <style metal:fill-slot="style_slot" 
        type="text/css" media="all"
        tal:content=
            "string: @import url(${context/++resource++tracker.css});">
      @import url(tracker.css);>
    </style>
  </head>
  <body i18n:domain="bugtracker">

    <div metal:fill-slot="body">

      <h3>Export XML</h3>

      <p> Simply click <a href="./tracker.xml">here</a>.</p>

      <h3>Import XML</h3>

      <form action="import.html" method="post" enctype="multipart/form-data">

        <div class="row">
          <div class="label">XML File</div>
          <div class="field">
            <input class="fileType" name="xmlfile" size="20" type="file"/>
          </div>
        </div>
        <div class="row">
          <input type="submit" name="import" value="Import" 
                 i18n:attributes="value import-button" />
        </div>

      </form>

    </div>
  </body>
</html>


=== Added File zopeproducts/bugtracker/browser/exportimport.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""XML Import/Export views

$Id: exportimport.py,v 1.1 2003/07/26 13:40:47 srichter Exp $
"""
from zopeproducts.bugtracker.exportimport import XMLExport, XMLImport

class XMLExportImport(object):

    def exportXML(self):
        return XMLExport(self.context).getXML()

    def importXML(self, xmlfile):
        XMLImport(self.context).processXML(xmlfile)
        return self.request.response.redirect('.')


=== Added File zopeproducts/bugtracker/browser/exportimport.pyc ===
  <Binary-ish file>

=== zopeproducts/bugtracker/browser/configure.zcml 1.2 => 1.3 ===
--- zopeproducts/bugtracker/browser/configure.zcml:1.2	Thu Jul 24 17:39:10 2003
+++ zopeproducts/bugtracker/browser/configure.zcml	Sat Jul 26 09:40:47 2003
@@ -88,6 +88,16 @@
       <browser:page name="changeSubscriptions.html" attribute="change" />
   </browser:pages>
 
+  <browser:pages
+      for="zopeproducts.bugtracker.interfaces.IBugTracker"
+      class=".exportimport.XMLExportImport"
+      permission="bugtracker.ManageBugTracker">
+      <browser:page name="xmlexportimport.html" template="exportimport.pt"
+          menu="zmi_views" title="XML Export/Import" />
+      <browser:page name="tracker.xml" attribute="exportXML" />
+      <browser:page name="import.html" attribute="importXML" />
+  </browser:pages>
+
   <browser:defaultView
       name="overview.html"
       for="zopeproducts.bugtracker.interfaces.IBugTracker"/>