commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue common/src/GTypecast.py common/src/dbdrive...


From: Jason Cater
Subject: gnue common/src/GTypecast.py common/src/dbdrive...
Date: Fri, 28 Jun 2002 00:03:39 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/06/28 00:03:38

Modified files:
        common/src     : GTypecast.py 
        common/src/dbdrivers/_pgsql: DBdriver.py 
        designer/src   : DataSourceEditor.py Designer.py Incubator.py 
                         Instance.py MenuBar.py PopupMenu.py 
                         PropertyEditor.py SchemaViewer.py 
                         TemplateBase.py TemplateChooser.py 
                         TemplateParser.py TreeView.py 
        designer/src/forms: Instance.py __init__.py 
        designer/src/forms/LayoutEditor: DisplayDropTarget.py 
                                         LayoutEditor.py 
        designer/src/schema: Instance.py 
        designer/src/schema/parser: GSParser.py Objects.py 
        designer/templates: __init__.py 
        designer/templates/forms: FormBuilder.py Simple.py 
                                  SimpleDetail.py __init__.py 
Added files:
        designer/src/forms: Incubator.py TemplateSupport.py TreeView.py 
        designer/src/navigator: Incubator.py TemplateSupport.py 
        designer/src/reports: Incubator.py TemplateSupport.py 
        designer/src/schema: Incubator.py TemplateSupport.py TreeView.py 

Log message:
        first implementation of Schema Designer support in GNUe Designer; 
further modularization of designer (removing forms-specific stuff from the main 
designer code); introduction of first Schema wizard

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/GTypecast.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/dbdrivers/_pgsql/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/DataSourceEditor.py.diff?cvsroot=OldCVS&tr1=1.23&tr2=1.24&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Designer.py.diff?cvsroot=OldCVS&tr1=1.41&tr2=1.42&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Incubator.py.diff?cvsroot=OldCVS&tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Instance.py.diff?cvsroot=OldCVS&tr1=1.51&tr2=1.52&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/MenuBar.py.diff?cvsroot=OldCVS&tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/PopupMenu.py.diff?cvsroot=OldCVS&tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/PropertyEditor.py.diff?cvsroot=OldCVS&tr1=1.23&tr2=1.24&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/SchemaViewer.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/TemplateBase.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/TemplateChooser.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/TemplateParser.py.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/TreeView.py.diff?cvsroot=OldCVS&tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/Incubator.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/TemplateSupport.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/TreeView.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/Instance.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/__init__.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/LayoutEditor/LayoutEditor.py.diff?cvsroot=OldCVS&tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/navigator/Incubator.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/navigator/TemplateSupport.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/reports/Incubator.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/reports/TemplateSupport.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/schema/Incubator.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/schema/TemplateSupport.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/schema/TreeView.py?cvsroot=OldCVS&rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/schema/Instance.py.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/schema/parser/GSParser.py.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/schema/parser/Objects.py.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/templates/__init__.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/templates/forms/FormBuilder.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/templates/forms/Simple.py.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/templates/forms/SimpleDetail.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/templates/forms/__init__.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: gnue/common/src/GTypecast.py
diff -c gnue/common/src/GTypecast.py:1.6 gnue/common/src/GTypecast.py:1.7
*** gnue/common/src/GTypecast.py:1.6    Thu Jun 27 21:29:19 2002
--- gnue/common/src/GTypecast.py        Fri Jun 28 00:03:37 2002
***************
*** 118,131 ****
  #
  # number
  #
! # This is for typecasting numbers (real) 
  #
  #######################################################
! def number (value): 
!   try: 
!     return float("%s" % value)  
!   except ValueError: 
!     raise TypecastError 
  
  
  #######################################################
--- 118,131 ----
  #
  # number
  #
! # This is for typecasting numbers (real)
  #
  #######################################################
! def number (value):
!   try:
!     return float("%s" % value)
!   except ValueError:
!     raise TypecastError
  
  
  #######################################################
Index: gnue/common/src/dbdrivers/_pgsql/DBdriver.py
diff -c gnue/common/src/dbdrivers/_pgsql/DBdriver.py:1.14 
gnue/common/src/dbdrivers/_pgsql/DBdriver.py:1.15
*** gnue/common/src/dbdrivers/_pgsql/DBdriver.py:1.14   Sun Mar 31 15:41:20 2002
--- gnue/common/src/dbdrivers/_pgsql/DBdriver.py        Fri Jun 28 00:03:37 2002
***************
*** 1,28 ****
  #
  # This file is part of GNU Enterprise.
  #
! # GNU Enterprise is free software; you can redistribute it 
! # and/or modify it under the terms of the GNU General Public 
! # License as published by the Free Software Foundation; either 
  # version 2, or(at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be 
! # useful, but WITHOUT ANY WARRANTY; without even the implied 
  # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  # PURPOSE. See the GNU General Public License for more details.
  #
! # You should have received a copy of the GNU General Public 
  # License along with program; see the file COPYING. If not,
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # Copyright 2000, 2001 Free Software Foundation
  #
  # FILE:
  # _pgsql/DBdriver.py
  #
  # DESCRIPTION:
! # A core Postgresql implementation of dbdriver the other
  # postgresql drivers can extend
  #
  # NOTES:
--- 1,28 ----
  #
  # This file is part of GNU Enterprise.
  #
! # GNU Enterprise is free software; you can redistribute it
! # and/or modify it under the terms of the GNU General Public
! # License as published by the Free Software Foundation; either
  # version 2, or(at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be
! # useful, but WITHOUT ANY WARRANTY; without even the implied
  # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  # PURPOSE. See the GNU General Public License for more details.
  #
! # You should have received a copy of the GNU General Public
  # License along with program; see the file COPYING. If not,
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # Copyright 2000-2002 Free Software Foundation
  #
  # FILE:
  # _pgsql/DBdriver.py
  #
  # DESCRIPTION:
! # A core Postgresql dbdriver that the other (specific)
  # postgresql drivers can extend
  #
  # NOTES:
***************
*** 61,77 ****
    def connect(self, connectData={}):
      GDebug.printMesg(1,"Postgresql database driver initializing")
      try:
- #
- #  Ugly dneighbo hack as no python studs to ask questions for
- # 
        try:
          port = connectData['port']
        except:
          port  = '5432'
  
- #
- #  End hack (note port variable used below and defined in __init above)
- #
        self._dataConnection = self._pgdriver.connect(self._connectString %
                                                      (connectData['host'],
                                                       connectData['dbname'],
--- 61,71 ----
Index: gnue/designer/src/DataSourceEditor.py
diff -c gnue/designer/src/DataSourceEditor.py:1.23 
gnue/designer/src/DataSourceEditor.py:1.24
*** gnue/designer/src/DataSourceEditor.py:1.23  Tue May 14 21:27:08 2002
--- gnue/designer/src/DataSourceEditor.py       Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can` redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # DataSourceEditor.py
  #
***************
*** 31,37 ****
  from wxPython.wx import *
  from gnue.common import GDebug, GDataSource, GConfig
  from gnue.common import RuntimeSettings
- import Incubator
  
  class DataSourceEditor(wxPanel):
    def __init__(self, instance, rootObject, parentWindow):
--- 31,36 ----
***************
*** 328,334 ****
        attributes['database'] = \
            hasattr(self.current,'database') and self.current.database or ''
  
!     Incubator.createObject(self.instance, self.rootObject, 'datasource',
                             parent=self.rootObject, attributes=attributes)
  
  
--- 327,333 ----
        attributes['database'] = \
            hasattr(self.current,'database') and self.current.database or ''
  
!     self.instance.incubator.createObject(self.instance, self.rootObject, 
'datasource',
                             parent=self.rootObject, attributes=attributes)
  
  
Index: gnue/designer/src/Designer.py
diff -c gnue/designer/src/Designer.py:1.41 gnue/designer/src/Designer.py:1.42
*** gnue/designer/src/Designer.py:1.41  Mon Jun  3 15:07:23 2002
--- gnue/designer/src/Designer.py       Fri Jun 28 00:03:37 2002
***************
*** 67,76 ****
  from gnue.forms.GFConfig import ConfigOptions
  from Config import ConfigOptions as DesignerConfigOptions
  
- # TODO: Must go!!
- from gnue.forms import GFForm
- 
- from gnue.designer import forms
  from gnue.forms.uidrivers.wx import UIdriver as UIwxpython
  
  
--- 67,72 ----
***************
*** 105,111 ****
        # TODO: jcater thinks of some task selector like kword uses,
        # TODO: or, restore the session to the way it was (same files, etc)
  
!       self.SetTopWindow(self.newInstance(forms))
  
      return 1
  
--- 101,107 ----
        # TODO: jcater thinks of some task selector like kword uses,
        # TODO: or, restore the session to the way it was (same files, etc)
  
!       self.SetTopWindow(self.newInstance('forms'))
  
      return 1
  
***************
*** 148,161 ****
      # TODO:        instance, not do away with having to
      # TODO:        create a new, final instance.)
  
  
!     instance = self.newInstance(forms)
!     form = GFForm.GFForm(app=instance)
  
!     if TemplateParser.TemplateParser(instance, form,
            instance, templateInformation).run():
  
!       self.newInstance(forms, buffer=StringIO(form.dumpXML()))
  
      instance.Close()
  
--- 144,159 ----
      # TODO:        instance, not do away with having to
      # TODO:        create a new, final instance.)
  
+     product = templateInformation['Product']
+     templateSupport = dyn_import('gnue.designer.%s.TemplateSupport' % product)
  
!     instance = self.newInstance(product)
!     root = templateSupport.createRootObject(instance)
  
!     if TemplateParser.TemplateParser(instance, root,
            instance, templateInformation).run():
  
!       self.newInstance(product, buffer=StringIO(root.dumpXML()))
  
      instance.Close()
  
***************
*** 290,313 ****
        print "I do not know what to do with a .%s file!" % extension
        return None
  
!     return self.newInstance(self.toolExtensionMapping[extension], file)
  
  
    #
    # Create a new instance
    #
    def newInstance(self, module, *args, **parms):
!     c = dyn_import("%s.%s" % (module.__name__,'Instance')).Instance
      return c(self, *args, **parms)
  
  
  #
  # Workaround for Python 2.2's big unicode bug!!!
  #
  if sys.version[:5] == "2.2.0":
    from cStringIO import StringIO
  
!   
  #
  #
  #
--- 288,313 ----
        print "I do not know what to do with a .%s file!" % extension
        return None
  
!     return self.newInstance(self.toolExtensionMapping[extension].__name__, 
file)
  
  
    #
    # Create a new instance
    #
    def newInstance(self, module, *args, **parms):
!     c = dyn_import("%s.%s" % (module, 'Instance')).Instance
      return c(self, *args, **parms)
  
  
  #
  # Workaround for Python 2.2's big unicode bug!!!
+ # TODO: I don't think this is working!
+ # TODO: Pop up a warning dialog
  #
  if sys.version[:5] == "2.2.0":
    from cStringIO import StringIO
  
! 
  #
  #
  #
Index: gnue/designer/src/Incubator.py
diff -c gnue/designer/src/Incubator.py:1.13 gnue/designer/src/Incubator.py:1.14
*** gnue/designer/src/Incubator.py:1.13 Wed Jan 16 14:12:51 2002
--- gnue/designer/src/Incubator.py      Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,143 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
  # FILE:
  # Incubator.py
  #
  # DESCRIPTION:
! # Creates objects to be added to the form
  #
  # NOTES:
  #
  
  from gnue.common import GDebug
- from gnue.forms import GFParser, GFForm
- 
- def createObject(instance, form, tag, type=None, parent=None,
-          parentHint=None, attributes={}):
- 
- 
-   GDebug.printMesg(3,'Creating a "%s" object' % tag)
-   GDebug.printMesg(6,"Object's parent is %s" % parentHint)
- 
-   try:
-     name = attributes['name']
-   except KeyError:
-     name = instance.getNextGenericName(tag)
- 
-   try:
-     objclass = elements[tag]['BaseClass']
-     if elements[tag].has_key('Attributes'):
-       attrs = elements[tag]['Attributes']
-     else:
-       attrs = {}
-   except KeyError:
-     GDebug.printMesg(1, "Attempted to create a '%s', "
-                         "but I don't know what to do!" % tag)
-     return
- 
- 
-   if tag == 'trigger':
-     if not attributes.has_key('type'):
-       attributes['type'] = 'NAMED'
-     if attributes['type'] == 'NAMED':
-       parent = form
-     else:
-       parent = parent or parentHint
-   elif tag in ('page','datasource','import'):
-     parent = form
- 
-   o = objclass(parent or parentHint)
- 
-   # Pull default values for any attributes not supplied
-   for attr in attrs.keys():
-     if not attributes.has_key(attr):
-       if attrs[attr].has_key('Default'):
-         attributes[attr] = attrs[attr]['Typecast'](attrs[attr]['Default'])
-       elif attr in ('x','y',):
-         attributes[attr] = 0
-       elif attr in ('height',):
-         if tag in ('box','scrollbar'):
-           attributes[attr] = 4
-         else:
-           attributes[attr] = 1
-       elif attr == 'width':
-         if tag in ('scrollbar',):
-           attributes[attr] = 1
-         else:
-           attributes[attr] = 10
-       elif attr in ('text','label'):
-         attributes[attr] = name
- 
-   for attr in attributes.keys():
-     if attrs.has_key(attr):
-       o.__dict__[attr] = attributes[attr]
-   o.name = name
-   instance.nameMappings[o.name] = o
-   o._buildObject()
-   instance.onCreateObject(o, __name__)
-   instance.onSetCurrentObject(o, __name__)
-   return o
- 
  
! def reparentObject(instance, form, object, newParent):
!   if object._parent == newParent:
!     return
  
-   # TODO
-   pass
- 
- 
- def deleteObject(instance, form, object, newCurrentObject=None, firstRun=1):
- 
-   if firstRun: 
-     newCurrentObject = object._parent
-     parent = object._parent
- 
-   for child in object._children: 
-     child.deleteObject(instance, form, child, firstRun=0)
- 
-   instance.onDeleteObject(object, __name__)
- 
-   if firstRun: 
-     o = parent
-     while not isinstance(o, GFForm.GFForm): 
-       o._buildObject()
-       o = o._parent
-       
-     if newCurrentObject: 
-       instance.onSetCurrentObject(newCurrentObject, __name__)
- 
- 
- 
- #
- # Figure out GFParser's dependencies
- #
- elements = None
- elementMapping = {}
- def calcDependencies():
- 
-   global elements
-   global elementMapping
- 
-   elements = GFParser.getXMLelements()
    for tag in elements.keys():
      t = elements[tag]
  
--- 16,36 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # Incubator.py
  #
  # DESCRIPTION:
! # Creates objects to be added to the object
  #
  # NOTES:
  #
  
  from gnue.common import GDebug
  
! def calcDependencies(elements, elementMapping):
  
    for tag in elements.keys():
      t = elements[tag]
  
***************
*** 157,163 ****
            elementMapping[parent].append(tag)
          else:
            elementMapping[parent] = [tag]
- 
- 
- calcDependencies()
  
--- 50,53 ----
Index: gnue/designer/src/Instance.py
diff -c gnue/designer/src/Instance.py:1.51 gnue/designer/src/Instance.py:1.52
*** gnue/designer/src/Instance.py:1.51  Sat May  4 12:45:08 2002
--- gnue/designer/src/Instance.py       Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001-2002 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # Instance.py
  #
***************
*** 389,395 ****
  
  
    def OnNew(self, event):
!     self._app.newInstance(self._fileNewMap[event.GetId()])
  
  
    def OnSave(self, event):
--- 389,395 ----
  
  
    def OnNew(self, event):
!     self._app.newInstance(self._fileNewMap[event.GetId()].__name__)
  
  
    def OnSave(self, event):
***************
*** 400,418 ****
  
  
    def OnSaveAs(self, event):
!     dlg = wxFileDialog(NULL, "Save GNUe Form As...", defaultDir=os.getcwd(),
!                            wildcard = "GNUe Form Definitions (*.gfd)|*.gfd|" 
+\
!                                       "GNUe Form Libraries (*.gfl)|*.gfl",
                             style=wxSAVE)
      if dlg.ShowModal() == wxID_OK:
        self._path = dlg.GetPath()
!       if len(self._path) < 4 or not self._path[-4:] in ('.gfd','.gfl'):
!         if dlg.GetFilterIndex():
!           self._path = self._path + '.gfl'
!         else:
!           self._path = self._path + '.gfd'
        self.SetTitle (TITLE + " - " + self._path)
        self.save()
      dlg.Destroy()
  
  
--- 400,431 ----
  
  
    def OnSaveAs(self, event):
!     wildcard = ""
!     # Make the "default" file extension for a tool
!     # appear before the other extensions.
!     filterIndex = [self.properties.defaultFileExtension]
!     wildcard += "%s (*.%s)|*.%s|" % \
!      ( self.properties.fileExtensions[self.properties.defaultFileExtension],
!        self.properties.defaultFileExtension,
!        self.properties.defaultFileExtension)
! 
!     for type in self.properties.fileExtensions.keys():
!       if type != self.properties.defaultFileExtension:
!         wildcard += "%s (*.%s)|*.%s|" % \
!            ( self.properties.fileExtensions[type], type, type)
!         filterIndex.append(type)
! 
!     dlg = wxFileDialog(NULL, "Save %s As..." % self.properties.description, 
defaultDir=os.getcwd(),
!                            wildcard = wildcard,
                             style=wxSAVE)
+ 
      if dlg.ShowModal() == wxID_OK:
        self._path = dlg.GetPath()
!       if len(self._path) < 4 or not (self._path[-4] == '.' and 
string.lower(self._path[-3:]) in self.properties.fileExtensions.keys()):
!         self._path += "." + filterIndex[dlg.GetFilterIndex()]
        self.SetTitle (TITLE + " - " + self._path)
        self.save()
+ 
      dlg.Destroy()
  
  
Index: gnue/designer/src/MenuBar.py
diff -c gnue/designer/src/MenuBar.py:1.20 gnue/designer/src/MenuBar.py:1.21
*** gnue/designer/src/MenuBar.py:1.20   Tue Jun  4 19:20:46 2002
--- gnue/designer/src/MenuBar.py        Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # MenuBar.py
  #
***************
*** 28,34 ****
  import sys, os, string
  from wxPython.wx import *
  from gnue.common import GDebug
! import Incubator, MRUManager
  from ToolSupport import SupportedTools
  
  # File menu
--- 28,34 ----
  import sys, os, string
  from wxPython.wx import *
  from gnue.common import GDebug
! import MRUManager
  from ToolSupport import SupportedTools
  
  # File menu
Index: gnue/designer/src/PopupMenu.py
diff -c gnue/designer/src/PopupMenu.py:1.11 gnue/designer/src/PopupMenu.py:1.12
*** gnue/designer/src/PopupMenu.py:1.11 Sat May  4 12:45:08 2002
--- gnue/designer/src/PopupMenu.py      Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # PopupMenu.py
  #
***************
*** 29,42 ****
  from wxPython.wx import *
  from gnue.common import GDebug, GObjects
  from gnue.forms import GFForm, GFObjects, GFTrigger, GFLibrary
- import Incubator
  
  
  
  class ActionMenu(wxMenu):
    def __init__(self, instance, object, parent=None, text=None, 
parentText=None):
      wxMenu.__init__(self, text)
!     self.__instance = instance
      self.__parent = parent
      self._object = object
      self._newMap = {}
--- 29,41 ----
  from wxPython.wx import *
  from gnue.common import GDebug, GObjects
  from gnue.forms import GFForm, GFObjects, GFTrigger, GFLibrary
  
  
  
  class ActionMenu(wxMenu):
    def __init__(self, instance, object, parent=None, text=None, 
parentText=None):
      wxMenu.__init__(self, text)
!     self._product_instance = instance
      self.__parent = parent
      self._object = object
      self._newMap = {}
***************
*** 59,89 ****
        id = wxNewId()
        self.Append(id, "&Properties...")
        EVT_MENU(self, id, self.OnEditProperties)
!   
!       if not isinstance (object, GFForm.GFForm): 
          # Delete
          id = wxNewId()
          self.Append(id, "&Delete %s" % object._type[2:])
          EVT_MENU(self, id, self.OnDeleteObject)
!   
        self.AppendSeparator()
!   
        # Events >
!       if isinstance (object, GFTrigger.GFTriggerAware): 
          menu = wxMenu("Events...")
          self._triggerMap = {}
          keys = GFTrigger.VALIDTRIGGERS.keys()
          keys.sort()
!         for trigger in (keys): 
            tid = wxNewId()
            self._triggerMap[tid] = trigger
!           menu.Append(tid, GFTrigger.VALIDTRIGGERS[trigger] + "...") 
            EVT_MENU(menu, tid, self.OnEditEvent)
          self.AppendMenu(wxNewId(), "&Events", menu)
!   
!   
        if isinstance(object, GFObjects.GFPage) or \
!          isinstance(object, GFObjects.GFBlock): 
          self.AppendSeparator()
          # Reorder
          id = wxNewId()
--- 58,88 ----
        id = wxNewId()
        self.Append(id, "&Properties...")
        EVT_MENU(self, id, self.OnEditProperties)
! 
!       if not isinstance (object, GFForm.GFForm):
          # Delete
          id = wxNewId()
          self.Append(id, "&Delete %s" % object._type[2:])
          EVT_MENU(self, id, self.OnDeleteObject)
! 
        self.AppendSeparator()
! 
        # Events >
!       if isinstance (object, GFTrigger.GFTriggerAware):
          menu = wxMenu("Events...")
          self._triggerMap = {}
          keys = GFTrigger.VALIDTRIGGERS.keys()
          keys.sort()
!         for trigger in (keys):
            tid = wxNewId()
            self._triggerMap[tid] = trigger
!           menu.Append(tid, GFTrigger.VALIDTRIGGERS[trigger] + "...")
            EVT_MENU(menu, tid, self.OnEditEvent)
          self.AppendMenu(wxNewId(), "&Events", menu)
! 
! 
        if isinstance(object, GFObjects.GFPage) or \
!          isinstance(object, GFObjects.GFBlock):
          self.AppendSeparator()
          # Reorder
          id = wxNewId()
***************
*** 91,144 ****
          EVT_MENU(self, id, self.OnReorderLayout)
  
  
!   def addChildObjectMenu(self): 
      object = self._object
!     if len(object._children): 
        self.AppendSeparator()
!       for child in object._children: 
!         if isinstance (child, GObjects.GObj): 
            self.AppendMenu(wxNewId(), hasattr(child,'name') and child.name or \
              string.upper(child._type[2]) + \
              string.lower(child._type[3:]),
!             PageMenu(self.__instance, child, self.x, self.y))
!           
!   
    def addCreateTag(self, tag, text):
      tid = wxNewId()
      self._newMap[tid] = tag
      self.Append(tid, text)
!     EVT_MENU(self.__instance, tid, self.OnCreateObject)
  
  
!   def OnEditProperties(self, event): 
!     self.__instance.propertyEditorWindow.Show(1)
!     self.__instance.propertyEditorWindow.Raise()
!     self.__instance.propertyEditorWindow.SetFocus()
  
!   def OnEditEvent(self, event): 
      pass
  
    def OnCreateObject(self, event):
      tag = self._newMap[event.GetId()]
      GDebug.printMesg(4,'Creating object %s with id %s'%(tag, event.GetId()))
!     Incubator.createObject(self.__instance, self.__instance.rootObject, tag,
!       parentHint=self._object, 
        attributes=hasattr(self,'x') and {'x': self.x, 'y': self.y} or {} )
  
    def OnCreateDataSource(self, event):
!     Incubator.createObject(self.__instance, self.__instance.rootObject, 
'datasource')
  
    def OnCreateNamedTrigger(self, event):
!     Incubator.createObject(self.__instance, self.__instance.rootObject, 
'trigger')
  
    def OnCreatePage(self, event):
!     Incubator.createObject(self.__instance, self.__instance.rootObject, 
'page')
  
    def OnDeleteObject(self, event):
!     Incubator.deleteObject(self.__instance, self.__instance.rootObject, 
self._object)
  
    def OnReorderLayout(self, event):
!     unqId = 0 
      triggerObjects = []
      hiddenObjects = []
      boxObjects = {}
--- 90,143 ----
          EVT_MENU(self, id, self.OnReorderLayout)
  
  
!   def addChildObjectMenu(self):
      object = self._object
!     if len(object._children):
        self.AppendSeparator()
!       for child in object._children:
!         if isinstance (child, GObjects.GObj):
            self.AppendMenu(wxNewId(), hasattr(child,'name') and child.name or \
              string.upper(child._type[2]) + \
              string.lower(child._type[3:]),
!             PageMenu(self._product_instance, child, self.x, self.y))
! 
! 
    def addCreateTag(self, tag, text):
      tid = wxNewId()
      self._newMap[tid] = tag
      self.Append(tid, text)
!     EVT_MENU(self._product_instance, tid, self.OnCreateObject)
  
  
!   def OnEditProperties(self, event):
!     self._product_instance.propertyEditorWindow.Show(1)
!     self._product_instance.propertyEditorWindow.Raise()
!     self._product_instance.propertyEditorWindow.SetFocus()
  
!   def OnEditEvent(self, event):
      pass
  
    def OnCreateObject(self, event):
      tag = self._newMap[event.GetId()]
      GDebug.printMesg(4,'Creating object %s with id %s'%(tag, event.GetId()))
!     self._product_instance.incubator.createObject(self._product_instance, 
self._product_instance.rootObject, tag,
!       parentHint=self._object,
        attributes=hasattr(self,'x') and {'x': self.x, 'y': self.y} or {} )
  
    def OnCreateDataSource(self, event):
!     self._product_instance.incubator.createObject(self._product_instance, 
self._product_instance.rootObject, 'datasource')
  
    def OnCreateNamedTrigger(self, event):
!     self._product_instance.incubator.createObject(self._product_instance, 
self._product_instance.rootObject, 'trigger')
  
    def OnCreatePage(self, event):
!     self._product_instance.incubator.createObject(self._product_instance, 
self._product_instance.rootObject, 'page')
  
    def OnDeleteObject(self, event):
!     self._product_instance.incubator.deleteObject(self._product_instance, 
self._product_instance.rootObject, self._object)
  
    def OnReorderLayout(self, event):
!     unqId = 0
      triggerObjects = []
      hiddenObjects = []
      boxObjects = {}
***************
*** 146,235 ****
      blockObjects = {}
      self._object._upperX = 99999
      self._object._upperY = 99999
!    
!     # Handle each child (note we are working from a copy 
      # because self.oject._children will be morphing
!     for object in self._object._children[:]: 
!       if hasattr(object, 'hidden') and object.hidden: 
          hiddenObjects.append(object)
!       elif object._type == 'GFTrigger': 
          triggerObjects.append(object)
!       elif object._type == 'GFBlock': 
          object._popupMenu.OnReorderLayout(event)
          object.__savedChildren = object._children[:]
          for o2 in object.__savedChildren:
!           self.__instance.onDeleteObject(o2, __name__)
!         
          oid = "%5d.%5d.%5d" % (object._upperY, object._upperX, unqId)
          unqId = unqId + 1
          blockObjects[oid] = object
  
!       else: 
!         if hasattr(object,'y') and object.y < self._object._upperY: 
            self._object._upperY = object.y
!         if hasattr(object,'x') and object.x < self._object._upperX: 
            self._object._upperX = object.x
  
!         oid = "%5d.%5d.%5d" % (object.y, object.x, unqId) 
          unqId  = unqId + 1
          if object._type == 'GFBox':
            boxObjects[oid] = object
!         else: 
            navObjects[oid] = object
!     
        # Notify everyone that this object was deleted
!       self.__instance.onDeleteObject(object, __name__)
  
      self._object._children = []
  
!     # First, add back triggers 
      for object in triggerObjects:
        self._object._children.append(object)
!       self.__instance.onCreateObject(object, __name__)
  
  
!     # Next, add back hidden objects 
      for object in hiddenObjects:
        self._object._children.append(object)
!       self.__instance.onCreateObject(object, __name__)
  
      # Now, add hidden objects
      boxes = boxObjects.keys()
      boxes.sort()
!     for box in boxes: 
        self._object._children.append(boxObjects[box])
!       self.__instance.onCreateObject(boxObjects[box], __name__)
!     
      # The rest of the objects (other than blocks) go here
      nav = navObjects.keys()
      nav.sort()
!     for n in nav: 
        self._object._children.append(navObjects[n])
!       self.__instance.onCreateObject(navObjects[n], __name__)
  
!     # And, finally, any child blocks 
      blocks = blockObjects.keys()
      blocks.sort()
!     for block in blocks: 
        children = blockObjects[block].__savedChildren[:]
        self._object._children.append(blockObjects[block])
!       self.__instance.onCreateObject(blockObjects[block], __name__)
!       for child in children: 
          blockObjects[block]._children.append(child)
!         self.__instance.onCreateObject(child,__name__)
  
  
! class CreateObjectMenu(ActionMenu): 
!   def __init__(self, instance, object, parent): 
      ActionMenu.__init__(self, instance, None, parent, 'New...','&New')
  
      self._object = object
!  
      self.AppendSeparator()
      tag = string.lower(object._type[2:])
!     if Incubator.elementMapping.has_key(tag): 
!       Incubator.elementMapping[tag].sort()
!       for element in Incubator.elementMapping[tag]: 
          descr = string.upper(element[0])+string.lower(element[1:])
          if descr == 'Import': 
            descr = 'Import Library'
--- 145,234 ----
      blockObjects = {}
      self._object._upperX = 99999
      self._object._upperY = 99999
! 
!     # Handle each child (note we are working from a copy
      # because self.oject._children will be morphing
!     for object in self._object._children[:]:
!       if hasattr(object, 'hidden') and object.hidden:
          hiddenObjects.append(object)
!       elif object._type == 'GFTrigger':
          triggerObjects.append(object)
!       elif object._type == 'GFBlock':
          object._popupMenu.OnReorderLayout(event)
          object.__savedChildren = object._children[:]
          for o2 in object.__savedChildren:
!           self._product_instance.onDeleteObject(o2, __name__)
! 
          oid = "%5d.%5d.%5d" % (object._upperY, object._upperX, unqId)
          unqId = unqId + 1
          blockObjects[oid] = object
  
!       else:
!         if hasattr(object,'y') and object.y < self._object._upperY:
            self._object._upperY = object.y
!         if hasattr(object,'x') and object.x < self._object._upperX:
            self._object._upperX = object.x
  
!         oid = "%5d.%5d.%5d" % (object.y, object.x, unqId)
          unqId  = unqId + 1
          if object._type == 'GFBox':
            boxObjects[oid] = object
!         else:
            navObjects[oid] = object
! 
        # Notify everyone that this object was deleted
!       self._product_instance.onDeleteObject(object, __name__)
  
      self._object._children = []
  
!     # First, add back triggers
      for object in triggerObjects:
        self._object._children.append(object)
!       self._product_instance.onCreateObject(object, __name__)
  
  
!     # Next, add back hidden objects
      for object in hiddenObjects:
        self._object._children.append(object)
!       self._product_instance.onCreateObject(object, __name__)
  
      # Now, add hidden objects
      boxes = boxObjects.keys()
      boxes.sort()
!     for box in boxes:
        self._object._children.append(boxObjects[box])
!       self._product_instance.onCreateObject(boxObjects[box], __name__)
! 
      # The rest of the objects (other than blocks) go here
      nav = navObjects.keys()
      nav.sort()
!     for n in nav:
        self._object._children.append(navObjects[n])
!       self._product_instance.onCreateObject(navObjects[n], __name__)
  
!     # And, finally, any child blocks
      blocks = blockObjects.keys()
      blocks.sort()
!     for block in blocks:
        children = blockObjects[block].__savedChildren[:]
        self._object._children.append(blockObjects[block])
!       self._product_instance.onCreateObject(blockObjects[block], __name__)
!       for child in children:
          blockObjects[block]._children.append(child)
!         self._product_instance.onCreateObject(child,__name__)
  
  
! class CreateObjectMenu(ActionMenu):
!   def __init__(self, instance, object, parent):
      ActionMenu.__init__(self, instance, None, parent, 'New...','&New')
  
      self._object = object
! 
      self.AppendSeparator()
      tag = string.lower(object._type[2:])
!     if self._product_instance.incubator.elementMapping.has_key(tag):
!       self._product_instance.incubator.elementMapping[tag].sort()
!       for element in self._product_instance.incubator.elementMapping[tag]:
          descr = string.upper(element[0])+string.lower(element[1:])
          if descr == 'Import': 
            descr = 'Import Library'
Index: gnue/designer/src/PropertyEditor.py
diff -c gnue/designer/src/PropertyEditor.py:1.23 
gnue/designer/src/PropertyEditor.py:1.24
*** gnue/designer/src/PropertyEditor.py:1.23    Sat May  4 12:45:08 2002
--- gnue/designer/src/PropertyEditor.py Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # PropertyEditor.py
  #
***************
*** 32,38 ****
  from wxPython.grid import *
  from gnue.common import GDebug, GTypecast
  from ToolFrame import ToolFrame
- from Incubator import elements
  
  class PropertyEditor (wxPanel):
    def __init__(self, instance, root, parent):
--- 32,37 ----
***************
*** 61,67 ****
        return
      if handler != __name__:
        self.object = object
! 
        try:
          self.attributes = 
elements[string.lower(object._type[2:])]['Attributes']
        except KeyError:
--- 60,66 ----
        return
      if handler != __name__:
        self.object = object
!       elements = self.instance.incubator.elements
        try:
          self.attributes = 
elements[string.lower(object._type[2:])]['Attributes']
        except KeyError:
***************
*** 76,82 ****
  
        # Delete any old rows from a previous object
        nr = self.grid.GetNumberRows()
!       if nr: 
          self.grid.DeleteRows(0,nr)
  
  
--- 75,81 ----
  
        # Delete any old rows from a previous object
        nr = self.grid.GetNumberRows()
!       if nr:
          self.grid.DeleteRows(0,nr)
  
  
***************
*** 491,500 ****
        return
      if handler != __name__:
        self.object = object
! 
        try:
          self.attributes = 
elements[string.lower(object._type[2:])]['Attributes']
!       except KeyError: 
          self.attributes = {}
  
        self.elements = elements[string.lower(object._type[2:])]
--- 490,499 ----
        return
      if handler != __name__:
        self.object = object
!       elements = self.instance.incubator.elements
        try:
          self.attributes = 
elements[string.lower(object._type[2:])]['Attributes']
!       except KeyError:
          self.attributes = {}
  
        self.elements = elements[string.lower(object._type[2:])]
Index: gnue/designer/src/SchemaViewer.py
diff -c gnue/designer/src/SchemaViewer.py:1.4 
gnue/designer/src/SchemaViewer.py:1.5
*** gnue/designer/src/SchemaViewer.py:1.4       Sat May  4 12:45:08 2002
--- gnue/designer/src/SchemaViewer.py   Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can` redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # SchemaViewer.py
  #
***************
*** 31,37 ****
  from wxPython.wx import *
  from gnue.common import GDebug, GDataSource
  from gnue.common import RuntimeSettings
- import Incubator
  
  class SchemaViewer(wxPanel):
    def __init__(self, instance, rootObject, parentWindow):
--- 31,36 ----
Index: gnue/designer/src/TemplateBase.py
diff -c gnue/designer/src/TemplateBase.py:1.9 
gnue/designer/src/TemplateBase.py:1.10
*** gnue/designer/src/TemplateBase.py:1.9       Mon Sep 17 22:08:40 2001
--- gnue/designer/src/TemplateBase.py   Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # TemplateBase.py
  #
***************
*** 46,53 ****
  #   been trademarked. (No, I'm not kidding :)
  
  from gnue.common import GTypecast
- from gnue.forms import GFParser
- import Incubator
  
  #
  # These Identify the types of templates. A template
--- 46,51 ----
***************
*** 77,84 ****
  class TemplateBase:
  
    ##########################################
!   # 
!   #  The following few methods should be 
    #  subclassed by the template developer.
  
    # The first step in our wizard
--- 75,82 ----
  class TemplateBase:
  
    ##########################################
!   #
!   #  The following few methods should be
    #  subclassed by the template developer.
  
    # The first step in our wizard
***************
*** 189,224 ****
  
  ###########################################################
  #
- # Base class for a form template
- #
- ###########################################################
- class FormTemplate(TemplateBase):
- 
-   # Initialize user code
-   def Start(self, form):
-     pass
- 
- 
- ###########################################################
- #
- # Base class for a report template
- #
- ###########################################################
- class ReportTemplate(TemplateBase):
- 
-   # Initialize user code
-   def Start(self, report):
-     pass
- 
- 
- ###########################################################
- #
  # Wizard elements
  #
  ###########################################################
  class WizardPage:
  
!   _ELEMENTS = GFParser.getXMLelements()
  
    def __init__(self, variables):
      self.variables = variables
--- 187,198 ----
  
  ###########################################################
  #
  # Wizard elements
  #
  ###########################################################
  class WizardPage:
  
! ##  _ELEMENTS = GFParser.getXMLelements()
  
    def __init__(self, variables):
      self.variables = variables
Index: gnue/designer/src/TemplateChooser.py
diff -c gnue/designer/src/TemplateChooser.py:1.10 
gnue/designer/src/TemplateChooser.py:1.11
*** gnue/designer/src/TemplateChooser.py:1.10   Tue Jan  8 16:57:04 2002
--- gnue/designer/src/TemplateChooser.py        Fri Jun 28 00:03:37 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # TemplateChooser.py
  #
***************
*** 95,100 ****
--- 95,101 ----
  #          self.panel.GetBackgroundColour().Blue() + 32) )
  
      GDebug.printMesg(2,"Packages=%s" % self.packages)
+     notebookIndex = 0
      lookupIndex = 0
      self.lookup = {}
      for package in self.packages:
***************
*** 116,121 ****
--- 117,124 ----
  
  #      self.notebook.AddPage(page, package.PACKAGE)
        self.notebook.AddPage(ctrl, package.PACKAGE)
+       self.lookup[notebookIndex] = {}
+ 
  
        i = 0
        for template in GetAvailableTemplates(package):
***************
*** 141,160 ****
            ctrl.SetStringItem(i, 4, 'Unknown')
          ctrl.SetItemData(i, lookupIndex)
  
!         self.lookup[lookupIndex] = template
  
          i += 1
          lookupIndex += 1
!  
        if i:
          ctrl.SetColumnWidth(0,wxLIST_AUTOSIZE)
  
      self.selection = 0
      completed = self.chooser.ShowModal()
      results = None
  
      if completed:
!       results = self.lookup[self.selection]
  
      self.chooser.Destroy()
      return results
--- 144,167 ----
            ctrl.SetStringItem(i, 4, 'Unknown')
          ctrl.SetItemData(i, lookupIndex)
  
!         self.lookup[notebookIndex][lookupIndex] = template
  
          i += 1
          lookupIndex += 1
! 
        if i:
          ctrl.SetColumnWidth(0,wxLIST_AUTOSIZE)
  
+       lookupIndex = 0
+       notebookIndex += 1
+ 
+ 
      self.selection = 0
      completed = self.chooser.ShowModal()
      results = None
  
      if completed:
!       results = self.lookup[self.notebook.GetSelection()][self.selection]
  
      self.chooser.Destroy()
      return results
Index: gnue/designer/src/TemplateParser.py
diff -c gnue/designer/src/TemplateParser.py:1.12 
gnue/designer/src/TemplateParser.py:1.13
*** gnue/designer/src/TemplateParser.py:1.12    Tue May 14 21:27:08 2002
--- gnue/designer/src/TemplateParser.py Fri Jun 28 00:03:38 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # TemplateParser.py
  #
***************
*** 28,33 ****
--- 28,34 ----
  
  from wxPython.wx import *
  from gnue.designer import TemplateBase
+ from gnue.common import dyn_import
  
  class TemplateParser:
    def __init__(self, instance, rootObject, parent, templateInformation):
***************
*** 36,47 ****
      self.templateInformation = templateInformation
      self.rootObject = rootObject
  
!     if templateInformation['Product'] == 'forms':
!       from gnue.forms import GFParser
!       self.elements = GFParser.getXMLelements()
!     elif templateInformation['Product'] == 'reports':
!       from gnue.reports import GRParser
!       self.elements = GRParser.getXMLelements()
  
  
    def run(self):
--- 37,43 ----
      self.templateInformation = templateInformation
      self.rootObject = rootObject
  
!     self.elements = 
dyn_import('gnue.designer.%s.Incubator'%templateInformation['Product']).elements
  
  
    def run(self):
Index: gnue/designer/src/TreeView.py
diff -c gnue/designer/src/TreeView.py:1.20 gnue/designer/src/TreeView.py:1.21
*** gnue/designer/src/TreeView.py:1.20  Sat May  4 12:45:08 2002
--- gnue/designer/src/TreeView.py       Fri Jun 28 00:03:38 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # TreeView.py
  #
***************
*** 39,46 ****
      wxTreeCtrl.__init__(self, parent, wxNewId(),
         style=wxTR_HAS_BUTTONS|wxTR_EDIT_LABELS|wxTR_HAS_VARIABLE_ROW_HEIGHT)
      self.instance = instance
!     self.form = form
!     self.__handler = None
  
      self.SetImageList(treeIconList)
  
--- 39,46 ----
      wxTreeCtrl.__init__(self, parent, wxNewId(),
         style=wxTR_HAS_BUTTONS|wxTR_EDIT_LABELS|wxTR_HAS_VARIABLE_ROW_HEIGHT)
      self.instance = instance
!     self.rootObject = form
!     self._handler = None
  
      self.SetImageList(treeIconList)
  
***************
*** 48,195 ****
      EVT_TREE_END_LABEL_EDIT(self, self.GetId(), self.OnTreeLabelEditEnd)
      EVT_TREE_SEL_CHANGED(self, self.GetId(), self.OnTreeItemSelected)
  
!     self.form._treeItem = self.AddRoot("Form")
!     self.form._treeItemFormProperties = \
!         self.AppendItem(self.form._treeItem, "Properties")
!     self.SetItemImage(self.form._treeItemFormProperties, 
treeIconMap['properties'])
!     self.form._treeItemImportedLibraries = \
!         self.AppendItem(self.form._treeItem, "Imported Libraries")
!     self.SetItemImage(self.form._treeItemImportedLibraries, 
treeIconMap['import'])
!     self.form._treeItemDataSources = \
!         self.AppendItem(self.form._treeItem, "Data Sources")
!     self.SetItemImage(self.form._treeItemDataSources, 
treeIconMap['datasource'])
!     self.form._treeItemNamedTriggers = \
!         self.AppendItem(self.form._treeItem, "Shared Triggers")
!     self.SetItemImage(self.form._treeItemNamedTriggers, 
treeIconMap['trigger'])
!     self.form._treeItemPageLayout = \
!         self.AppendItem(self.form._treeItem, "Page Layout")
!     self.SetItemImage(self.form._treeItemPageLayout, treeIconMap['page'])
! 
!     self.SetPyData(self.form._treeItem, self.form)
!     self.SetPyData(self.form._treeItemFormProperties, 
ObjectMenu(self.instance,None))
!     self.SetPyData(self.form._treeItemDataSources, 
ObjectMenu(self.instance,None))
!     self.SetPyData(self.form._treeItemNamedTriggers, 
ObjectMenu(self.instance,None))
!     self.SetPyData(self.form._treeItemPageLayout, 
ObjectMenu(self.instance,None))
! 
!     form.walk(self.inventoryObject)
  
      EVT_RIGHT_DOWN(self, self.OnRightDown)
      EVT_LEFT_DCLICK(self, self.OnEditProperties)
  
! 
!   def inventoryObject (self, object): 
!     if object != self.form: 
!       icon = 'properties'
!       if isinstance(object, GFObjects.GFOptions) and \
!          object._parent == self.form: 
!         object._treeItem = self.form._treeItemFormProperties
!         icon = 'properties'
!       else: 
!         parentTreeItem = object._parent._treeItem
!         if isinstance(object, GFTrigger.GFTrigger) and \
!            object.type == 'NAMED': 
!           parentTreeItem = self.form._treeItemNamedTriggers
!           icon = 'trigger'
!         elif isinstance(object, GFTrigger.GFTrigger):
! 
!           if not hasattr(object._parent,'_treeItemTrigger'): 
!             object._parent._treeItemTrigger = \
!               self.AppendItem(object._parent._treeItem, "Events")
!             #self.SetItemImage(object._parent._treeItemTrigger, 
treeIconMap['trigger'])
! 
! 
!           parentTreeItem = object._parent._treeItemTrigger
!           icon = 'trigger'
!         elif isinstance(object, GFObjects.GFDataSource) or \
!            isinstance(object, GFObjects.GFDatabase): 
!           parentTreeItem = self.form._treeItemDataSources
!           icon = 'datasource'
!         elif isinstance(object, GFObjects.GFPage) and \
!              object._parent == self.form: 
!           parentTreeItem = self.form._treeItemPageLayout
!           icon = 'page'
!         elif object._type in ('GFBlock',): 
!           icon = 'block'
!         elif object._type in ('GFOption',): 
!           icon = 'properties'
!         elif object._type in ('GFEntry',): 
!           icon = 'entry'
!         elif len(object._type) >= 8 and \
!              object._type[:8] == 'GFImport': 
!           icon = 'import'
!         elif object.findParentOfType('GFPage') != None: 
!           icon = 'pagewidget'
!  
!          
!         object._treeItem = self.AppendItem(parentTreeItem, 
!             "%s" % object.getDescription())
!         self.SetPyData(object._treeItem, object)
!         #self.SetItemImage(object._treeItem, treeIconMap[icon])
! 
! 
!   def AppendItem(self, parent, description): 
      rv = wxTreeCtrl.AppendItem(self, parent, description)
      return rv
!    
    def onSetCurrentObject (self, object, handler):
!     if object == None: 
        return
      if handler != __name__:
        self.EnsureVisible(object._treeItem)
!       self.__handler = handler
        self.SelectItem(object._treeItem)
!       self.__handler = None
  
    def onCreateObject (self, object, handler):
!     if object == None: 
        return
      if handler != __name__:
        GDebug.printMesg(4,"Adding %s (%s)" % (object.name, object._type))
        self.inventoryObject(object)
  
    def onModifyObject (self, object, handler, modifications):
!     if object == None: 
        return
      if handler != __name__:
!       for modification in modifications: 
          attribute, value = modification
!         if attribute == 'name' and object != self.form: 
            self.SetItemText(object._treeItem, object.getDescription())
  
    def onDeleteObject (self, object, handler):
!     if object == None: 
        return
      if hasattr(object, '_treeItemTrigger'):
        self.Delete(object._treeItemTrigger)
      if hasattr(object, '_treeItem'):
!       if self.GetSelection() == object._treeItem: 
          self.SelectItem(self.GetItemParent(object._treeItem))
        self.Delete(object._treeItem)
      self.Refresh()
  
!   def OnTreeLabelEdit(self, event): 
      event.Veto()
  
!   def OnTreeLabelEditEnd(self, event): 
      pass
  
!   def OnTreeItemSelected(self, event): 
!     if self.__handler == None: 
        object = self.GetPyData(event.GetItem())
!       if object != None and not isinstance(object, ObjectMenu): 
          self.instance.onSetCurrentObject(object, __name__)
!       else: 
          self.instance.onSetCurrentObject(None, __name__)
!    
  
    def OnRightDown(self, event):
      id, flags = self.HitTest(event.GetPosition())
      object = self.GetPyData(id)
      self.EnsureVisible(id)
      self.SelectItem(id)
!     if isinstance(object, ObjectMenu): 
        self.PopupMenu(object, event.GetPosition())
!     elif object != None: 
        self.PopupMenu(object._popupMenu, event.GetPosition())
        
  
--- 48,121 ----
      EVT_TREE_END_LABEL_EDIT(self, self.GetId(), self.OnTreeLabelEditEnd)
      EVT_TREE_SEL_CHANGED(self, self.GetId(), self.OnTreeItemSelected)
  
!     self.rootObject._treeItem = self.AddRoot(self.rootDescr)
  
      EVT_RIGHT_DOWN(self, self.OnRightDown)
      EVT_LEFT_DCLICK(self, self.OnEditProperties)
  
!   def AppendItem(self, parent, description):
      rv = wxTreeCtrl.AppendItem(self, parent, description)
      return rv
! 
    def onSetCurrentObject (self, object, handler):
!     if object == None:
        return
      if handler != __name__:
        self.EnsureVisible(object._treeItem)
!       self._handler = handler
        self.SelectItem(object._treeItem)
!       self._handler = None
  
    def onCreateObject (self, object, handler):
!     if object == None:
        return
      if handler != __name__:
        GDebug.printMesg(4,"Adding %s (%s)" % (object.name, object._type))
        self.inventoryObject(object)
  
    def onModifyObject (self, object, handler, modifications):
!     if object == None:
        return
      if handler != __name__:
!       for modification in modifications:
          attribute, value = modification
!         if attribute == 'name' and object != self.rootObject:
            self.SetItemText(object._treeItem, object.getDescription())
  
    def onDeleteObject (self, object, handler):
!     if object == None:
        return
      if hasattr(object, '_treeItemTrigger'):
        self.Delete(object._treeItemTrigger)
      if hasattr(object, '_treeItem'):
!       if self.GetSelection() == object._treeItem:
          self.SelectItem(self.GetItemParent(object._treeItem))
        self.Delete(object._treeItem)
      self.Refresh()
  
!   def OnTreeLabelEdit(self, event):
      event.Veto()
  
!   def OnTreeLabelEditEnd(self, event):
      pass
  
!   def OnTreeItemSelected(self, event):
!     if self._handler == None:
        object = self.GetPyData(event.GetItem())
!       if object != None and not isinstance(object, ObjectMenu):
          self.instance.onSetCurrentObject(object, __name__)
!       else:
          self.instance.onSetCurrentObject(None, __name__)
! 
  
    def OnRightDown(self, event):
      id, flags = self.HitTest(event.GetPosition())
      object = self.GetPyData(id)
      self.EnsureVisible(id)
      self.SelectItem(id)
!     if isinstance(object, ObjectMenu):
        self.PopupMenu(object, event.GetPosition())
!     elif object != None:
        self.PopupMenu(object._popupMenu, event.GetPosition())
        
  
Index: gnue/designer/src/forms/Instance.py
diff -c gnue/designer/src/forms/Instance.py:1.6 
gnue/designer/src/forms/Instance.py:1.7
*** gnue/designer/src/forms/Instance.py:1.6     Mon Feb 18 00:24:08 2002
--- gnue/designer/src/forms/Instance.py Fri Jun 28 00:03:38 2002
***************
*** 30,39 ****
  from gnue.designer.forms import properties as formProperties
  from gnue.designer.Instance import BaseInstance
  from gnue.designer import PopupMenu
  
  # Tool support...
  from LayoutEditor import LayoutEditor
! from gnue.designer.TreeView import TreeView
  from gnue.designer.PropertyEditor import PropertyEditor
  from gnue.designer.TriggerEditor import TriggerEditor
  from gnue.designer.DataSourceEditor import DataSourceEditor
--- 30,40 ----
  from gnue.designer.forms import properties as formProperties
  from gnue.designer.Instance import BaseInstance
  from gnue.designer import PopupMenu
+ import Incubator
  
  # Tool support...
  from LayoutEditor import LayoutEditor
! from TreeView import TreeView
  from gnue.designer.PropertyEditor import PropertyEditor
  from gnue.designer.TriggerEditor import TriggerEditor
  from gnue.designer.DataSourceEditor import DataSourceEditor
***************
*** 49,54 ****
--- 50,56 ----
  
    def __init__(self, app, *args, **params):
  
+     self.incubator = Incubator
      self.properties = formProperties
  
      # TODO: Can we make it so the GFInstance is not
Index: gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py
diff -c gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py:1.4 
gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py:1.5
*** gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py:1.4       Thu May 
30 11:18:35 2002
--- gnue/designer/src/forms/LayoutEditor/DisplayDropTarget.py   Fri Jun 28 
00:03:38 2002
***************
*** 29,35 ****
  import sys, string
  from Utils import *
  from gnue.common import GDebug
! from gnue.designer import Incubator
  
  import cPickle
  
--- 29,35 ----
  import sys, string
  from Utils import *
  from gnue.common import GDebug
! from gnue.designer.forms import Incubator
  
  import cPickle
  
Index: gnue/designer/src/forms/LayoutEditor/LayoutEditor.py
diff -c gnue/designer/src/forms/LayoutEditor/LayoutEditor.py:1.25 
gnue/designer/src/forms/LayoutEditor/LayoutEditor.py:1.26
*** gnue/designer/src/forms/LayoutEditor/LayoutEditor.py:1.25   Thu Jun 27 
20:58:12 2002
--- gnue/designer/src/forms/LayoutEditor/LayoutEditor.py        Fri Jun 28 
00:03:38 2002
***************
*** 32,38 ****
  from gnue.forms import GFObjects, GFEvent
  from gnue.forms.uidrivers.wx import UIdriver as UIwxpython
  from gnue.designer.PopupMenu import PageMenu
! from gnue.designer import Incubator
  
  # My support files
  from Utils import *
--- 32,38 ----
  from gnue.forms import GFObjects, GFEvent
  from gnue.forms.uidrivers.wx import UIdriver as UIwxpython
  from gnue.designer.PopupMenu import PageMenu
! from gnue.designer.forms import Incubator
  
  # My support files
  from Utils import *
***************
*** 331,337 ****
                     widgetWidth=self.widgetWidth,
                     widgetHeight=self.widgetHeight,
                     interface=self,
!                    eventHandler=None, 
                     initialize=0)
  
        object._widget = self.widgets[object._type](cevent)
--- 331,337 ----
                     widgetWidth=self.widgetWidth,
                     widgetHeight=self.widgetHeight,
                     interface=self,
!                    eventHandler=None,
                     initialize=0)
  
        object._widget = self.widgets[object._type](cevent)
Index: gnue/designer/src/forms/__init__.py
diff -c gnue/designer/src/forms/__init__.py:1.6 
gnue/designer/src/forms/__init__.py:1.7
*** gnue/designer/src/forms/__init__.py:1.6     Tue Jan 22 14:19:15 2002
--- gnue/designer/src/forms/__init__.py Fri Jun 28 00:03:38 2002
***************
*** 29,36 ****
  # the Instance class plus a properties object.
  #
  
- #from gnue.designer import Instance as _BaseInstance
- 
  # See if forms is installed
  import gnue.forms as _test
  
--- 29,34 ----
***************
*** 48,52 ****
  
  properties = FormToolProperties()
  
- 
- ##import Instance
--- 46,48 ----
Index: gnue/designer/src/schema/Instance.py
diff -c gnue/designer/src/schema/Instance.py:1.1 
gnue/designer/src/schema/Instance.py:1.2
*** gnue/designer/src/schema/Instance.py:1.1    Thu Jun 27 18:48:18 2002
--- gnue/designer/src/schema/Instance.py        Fri Jun 28 00:03:38 2002
***************
*** 29,78 ****
  
  from gnue.designer.schema import properties as schemaProperties
  from gnue.designer.Instance import BaseInstance
! from gnue.designer import PopupMenu
  
  # Tool support...
  from LayoutEditor import LayoutEditor
! from gnue.designer.TreeView import TreeView
  from gnue.designer.PropertyEditor import PropertyEditor
- from gnue.designer.TriggerEditor import TriggerEditor
  from gnue.designer.DataSourceEditor import DataSourceEditor
  from gnue.designer.SchemaViewer import SchemaViewer
  
- from gnue.designer.PopupMenu import ObjectMenu
- 
  
  
  class Instance(BaseInstance):
  
    def __init__(self, app, *args, **params):
      self.properties = schemaProperties
      BaseInstance.__init__(self, app, *args, **params)
  
  
    def loadBuffer(self, buffer):
!     schema = GFParser.loadschema (buffer, self, initialize=0)
      schema.name = 'schema'
      return schema
  
  
    def loadEmpty(self):
!     schema = GFschema.GFschema()
!     options = GFObjects.GFOptions(schema)
      schema.title = "Untitled schema"
-     schema.height = 12
      schema.name = 'schema'
-     schema.width = 40
-     GFObjects.GFPage(schema)
      return schema
  
  
    def inventoryObject(self, object):
!     if isinstance(object, GFObjects.GFPage) and \
!         object._parent == self.rootObject:
!       self._pages.append(object)
  
!     object._popupMenu = ObjectMenu(self, object)
  
  
    def createVisualEditor(self):
--- 29,74 ----
  
  from gnue.designer.schema import properties as schemaProperties
  from gnue.designer.Instance import BaseInstance
! from parser import GSParser, Objects
! import Incubator
  
  # Tool support...
  from LayoutEditor import LayoutEditor
! from TreeView import TreeView
  from gnue.designer.PropertyEditor import PropertyEditor
  from gnue.designer.DataSourceEditor import DataSourceEditor
  from gnue.designer.SchemaViewer import SchemaViewer
  
  
  
  class Instance(BaseInstance):
  
    def __init__(self, app, *args, **params):
+     self.incubator = Incubator
      self.properties = schemaProperties
+     self._tableMappings = {}
      BaseInstance.__init__(self, app, *args, **params)
  
  
    def loadBuffer(self, buffer):
!     schema = GSParser.loadSchema (buffer, self, initialize=0)
      schema.name = 'schema'
      return schema
  
  
    def loadEmpty(self):
!     schema = Objects.GSSchema()
      schema.title = "Untitled schema"
      schema.name = 'schema'
      return schema
  
  
    def inventoryObject(self, object):
!     if isinstance(object, Objects.GSTables):
!       self.tables = object
  
!     if isinstance(object, Objects.GSTable):
!       self._tableMappings[object.name] = object
  
  
    def createVisualEditor(self):
***************
*** 82,139 ****
    def createTools(self):
      self.addTool('propertyEditor','Property Inspector', PropertyEditor)
      self.addTool('treeEditor','Object Navigator', TreeView)
-     self.addTool('triggerEditor','Event Editor', TriggerEditor)
-     self.addTool('datasourceEditor','Data Source Editor', DataSourceEditor)
      self.addTool('schemaViewer','Schema Navigator', SchemaViewer)
  
  
    def preSave(self):
! 
!     # Do a little rearranging of objects
! 
!     options = []
!     imports = []
!     datasources = []
!     triggers = []
!     pages = []
!     other = []
! 
!     for child in self.rootObject._children:
!       if isinstance(child, GFObjects.GFOptions):
!         options.append(child)
!       elif isinstance(child, GFLibrary.GFImport):
!         imports.append(child)
!       elif isinstance(child, GFObjects.GFDataSource) or \
!         (isinstance(child, GFLibrary.GFImportItem) and
!          child._type == 'GFimport-datasource'):
!         datasources.append(child)
!       elif isinstance(child, GFTrigger.GFTrigger) or \
!         (isinstance(child, GFLibrary.GFImportItem) and
!          child._type == 'GFimport-trigger'):
!         triggers.append(child)
!       elif isinstance(child, GFObjects.GFPage) or \
!         (isinstance(child, GFLibrary.GFImportItem) and
!          child._type == 'GFimport-page'):
!         pages.append(child)
!       else:
!         other.append(child)
! 
! 
!     # Reorder the children so items of same class are grouped
!     self.rootObject._children = []
!     for child in options:
!       self.rootObject._children.append(child)
!     for child in imports:
!       self.rootObject._children.append(child)
!     for child in datasources:
!       self.rootObject._children.append(child)
!     for child in triggers:
!       self.rootObject._children.append(child)
!     for child in pages:
!       self.rootObject._children.append(child)
!     for child in other:
!       self.rootObject._children.append(child)
! 
  
    # Hack having to do with UIwxpython import
    def uiEventTrap(self, event):
--- 78,88 ----
    def createTools(self):
      self.addTool('propertyEditor','Property Inspector', PropertyEditor)
      self.addTool('treeEditor','Object Navigator', TreeView)
      self.addTool('schemaViewer','Schema Navigator', SchemaViewer)
  
  
    def preSave(self):
!     pass
  
    # Hack having to do with UIwxpython import
    def uiEventTrap(self, event):
Index: gnue/designer/src/schema/parser/GSParser.py
diff -c gnue/designer/src/schema/parser/GSParser.py:1.1 
gnue/designer/src/schema/parser/GSParser.py:1.2
*** gnue/designer/src/schema/parser/GSParser.py:1.1     Thu Jun 27 18:48:19 2002
--- gnue/designer/src/schema/parser/GSParser.py Fri Jun 28 00:03:38 2002
***************
*** 22,29 ****
  # GSParser.py
  #
  # DESCRIPTION:
! # GParser interface for GNUe Schema Definitions
  #
  # NOTES:
  #
  
--- 22,193 ----
  # GSParser.py
  #
  # DESCRIPTION:
! # Class that contains a SAX-based xml processor for GNUe Schema Definitions
  #
  # NOTES:
  #
+ 
+ import Objects
+ from gnue.common import GTypecast, GParser
+ import copy, types
+ 
+ 
+ 
+ 
+ 
+ 
+ ########
+ ########  Please keep this file neat !!!
+ ########
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ #######################################################
+ # This method loads a report from an XML file and returns
+ # a GSSchema object.
+ #######################################################
+ 
+ def loadSchema(buffer, connections, initialize=1):
+   return GParser.loadXMLObject (buffer, xmlSchemaHandler, 'GSSchema', 
'schema',
+            initialize, attributes={"_connections": connections})
+ 
+ 
+ 
+ xmlElements = None
+ 
+ 
+ def getXMLelements():
+ 
+   global xmlElements
+ 
+   if xmlElements == None:
+ 
+     #
+     #
+     xmlElements = {
+       'schema':       {
+          'BaseClass': Objects.GSSchema,
+          'Required': 1,
+          'SingleInstance': 1,
+          'Attributes':  {
+             'title':       {
+                'Typecast': GTypecast.text },
+             'author':       {
+                'Typecast': GTypecast.text },
+             'version':       {
+                'Typecast': GTypecast.text },
+             'description':       {
+                'Typecast': GTypecast.text } } ,
+          'ParentTags':  None },
+ 
+       'tables':  {
+          'BaseClass': Objects.GSTables,
+          'SingleInstance': 1,
+          'ParentTags':  ('schema',) },
+ 
+       'table':    {
+          'BaseClass': Objects.GSTable,
+          'Attributes': {
+             'name': {
+                'Required': 1,
+                'Unique': 1,
+                'Typecast': GTypecast.name },
+             'description': {
+                'Typecast': GTypecast.text } },
+          'ParentTags':  ('tables',) },
+ 
+       'fields':  {
+          'BaseClass': Objects.GSFields,
+          'SingleInstance': 1,
+          'ParentTags':  ('table',) },
+ 
+       'field':   {
+          'BaseClass': Objects.GSField,
+          'Attributes': {
+             'name':          {
+                'Required': 1,
+                'Unique': 1,
+                'Typecast': GTypecast.name },
+             'description': {
+                'Typecast': GTypecast.text },
+             'type': {
+                'Required': 1,
+                'Typecast': GTypecast.name },
+             'size': {
+                'Typecast': GTypecast.whole },
+             'nullable':     {
+                'Typecast': GTypecast.boolean,
+                'Default': 1 },
+             'default':     {
+                'Typecast': GTypecast.text } },
+          'ParentTags':  ('fields',) },
+ 
+       'primarykey':   {
+          'BaseClass': Objects.GSPrimaryKey,
+          'SingleInstance': 1,
+          'Attributes': {
+             'name':        {
+                'Required': 1,
+                'Typecast': GTypecast.name } },
+          'ParentTags':  ('table',) },
+ 
+       'pkfield':   {
+          'BaseClass': Objects.GSPKField,
+          'Attributes': {
+             'name':        {
+                'Required': 1,
+                'Typecast': GTypecast.name } },
+          'ParentTags':  ('table',) },
+ 
+       'constraints':   {
+          'BaseClass': Objects.GSConstraints,
+          'SingleInstance': 1,
+          'ParentTags':  ('table',) },
+ 
+       'constraint':    {
+          'BaseClass': Objects.GSConstraint,
+          'Attributes': {
+             'name': {
+                'Required': 1,
+                'Typecast': GTypecast.name },
+             'type': {
+                'Typecast': GTypecast.name } },
+          'ParentTags':  ('constraints',) },
+ 
+       'constraintfield':   {
+          'BaseClass': Objects.GSConstraintField,
+          'Attributes': {
+             'name':        {
+                'Required': 1,
+                'Typecast': GTypecast.name } },
+          'ParentTags':  ('constraint',) },
+ 
+       'indexes':   {
+          'BaseClass': Objects.GSIndexes,
+          'SingleInstance': 1,
+          'ParentTags':  ('table',) },
+ 
+     }
+ 
+   return xmlElements
+ 
+ 
+ #######################################################
+ #
+ # xmlSchemaHandler
+ #
+ # This class is called by the XML parser to
+ # process the xml file.
+ #
+ #######################################################
+ 
+ class xmlSchemaHandler (GParser.xmlHandler):
+   def __init__(self):
+     GParser.xmlHandler.__init__(self)
+ 
+     self.xmlElements = getXMLelements()
  
Index: gnue/designer/src/schema/parser/Objects.py
diff -c gnue/designer/src/schema/parser/Objects.py:1.1 
gnue/designer/src/schema/parser/Objects.py:1.2
*** gnue/designer/src/schema/parser/Objects.py:1.1      Thu Jun 27 18:48:19 2002
--- gnue/designer/src/schema/parser/Objects.py  Fri Jun 28 00:03:38 2002
***************
*** 26,28 ****
--- 26,83 ----
  #
  # NOTES:
  #
+ 
+ from gnue.common.GObjects import GObj
+ import GSParser
+ 
+ class GSObject(GObj):
+   pass
+ 
+ class GSSchema(GSObject):
+   def __init__(self, parent=None):
+     GSObject.__init__(self, parent, type='GSSchema')
+ 
+   def dumpXML(self, treeDump=1, gap="  "):
+     return GSObject.dumpXML(self,
+         GSParser.getXMLelements(), treeDump, gap, xmlnamespaces={})
+ 
+ class GSTables(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSTables')
+ 
+ class GSTable(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSTable')
+ 
+ class GSFields(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSFields')
+ 
+ class GSField(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSField')
+ 
+ class GSPrimaryKey(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSPrimaryKey')
+ 
+ class GSPKField(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSPKField')
+ 
+ class GSConstraints(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSConstraints')
+ 
+ class GSConstraint(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSConstraint')
+ 
+ class GSConstraintField(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSConstraintField')
+ 
+ class GSIndexes(GSObject):
+   def __init__(self, parent):
+     GSObject.__init__(self, parent, type='GSIndexes')
+ 
Index: gnue/designer/templates/__init__.py
diff -c gnue/designer/templates/__init__.py:1.4 
gnue/designer/templates/__init__.py:1.5
*** gnue/designer/templates/__init__.py:1.4     Mon Nov  5 14:32:53 2001
--- gnue/designer/templates/__init__.py Fri Jun 28 00:03:38 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 17,22 ****
--- 15,22 ----
  # License along with program; see the file COPYING. If not,
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
+ #
+ # Copyright 2001-2002 Free Software Foundation
  #
  # FILE:
  # templates/__init__.py
Index: gnue/designer/templates/forms/FormBuilder.py
diff -c gnue/designer/templates/forms/FormBuilder.py:1.4 
gnue/designer/templates/forms/FormBuilder.py:1.5
*** gnue/designer/templates/forms/FormBuilder.py:1.4    Mon Apr  1 21:31:54 2002
--- gnue/designer/templates/forms/FormBuilder.py        Fri Jun 28 00:03:38 2002
***************
*** 29,35 ****
  # as a "learning-by-example" tool.
  
  
! from gnue.designer.TemplateBase import *
  import string
  
  #
--- 29,35 ----
  # as a "learning-by-example" tool.
  
  
! from gnue.designer.forms.TemplateSupport import *
  import string
  
  #
Index: gnue/designer/templates/forms/Simple.py
diff -c gnue/designer/templates/forms/Simple.py:1.8 
gnue/designer/templates/forms/Simple.py:1.9
*** gnue/designer/templates/forms/Simple.py:1.8 Sun Sep 16 19:43:53 2001
--- gnue/designer/templates/forms/Simple.py     Fri Jun 28 00:03:38 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # Simple.py
  #
***************
*** 29,35 ****
  # as a "learning-by-example" tool.
  
  
! from gnue.designer.TemplateBase import *
  import string
  
  # NOTE: It is VERY important that in any references to a
--- 29,35 ----
  # as a "learning-by-example" tool.
  
  
! from gnue.designer.forms.TemplateSupport import *
  import string
  
  # NOTE: It is VERY important that in any references to a
Index: gnue/designer/templates/forms/SimpleDetail.py
diff -c gnue/designer/templates/forms/SimpleDetail.py:1.2 
gnue/designer/templates/forms/SimpleDetail.py:1.3
*** gnue/designer/templates/forms/SimpleDetail.py:1.2   Wed Feb 27 17:22:23 2002
--- gnue/designer/templates/forms/SimpleDetail.py       Fri Jun 28 00:03:38 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
+ # Copyright 2001-2002 Free Software Foundation
+ #
  # FILE:
  # Simple.py
  #
***************
*** 29,35 ****
  # as a "learning-by-example" tool.
  
  
! from gnue.designer.TemplateBase import *
  import string
  
  
--- 29,35 ----
  # as a "learning-by-example" tool.
  
  
! from gnue.designer.forms.TemplateSupport import *
  import string
  
  
Index: gnue/designer/templates/forms/__init__.py
diff -c gnue/designer/templates/forms/__init__.py:1.3 
gnue/designer/templates/forms/__init__.py:1.4
*** gnue/designer/templates/forms/__init__.py:1.3       Sun Oct  7 15:07:24 2001
--- gnue/designer/templates/forms/__init__.py   Fri Jun 28 00:03:38 2002
***************
*** 1,6 ****
  #
- # Copyright 2001 Free Software Foundation
- #
  # This file is part of GNU Enterprise.
  #
  # GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 17,22 ****
--- 15,22 ----
  # License along with program; see the file COPYING. If not,
  # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
+ #
+ # Copyright 2001-2002 Free Software Foundation
  #
  # FILE:
  # templates/forms/__init__.py



reply via email to

[Prev in Thread] Current Thread [Next in Thread]