/[gnue]/gnue-common/src/datasources/drivers/appserver/Schema/Discovery/Introspection.py
ViewVC logotype

Diff of /gnue-common/src/datasources/drivers/appserver/Schema/Discovery/Introspection.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.2 by jcater, Fri Nov 7 16:14:20 2003 UTC revision 1.1.2.3 by jcater, Wed Nov 19 03:00:24 2003 UTC
# Line 68  class Introspection(GIntrospection.Intro Line 68  class Introspection(GIntrospection.Intro
68          return []          return []
69    
70        try:        try:
71          listcursor = self._dataConnection.request('gnue_class',[],['gnue_module'],['gnue_name','gnue_comment','gnue_module'])          listcursor = self._connection.native.request('gnue_class',[],['gnue_module'],['gnue_name','gnue_comment','gnue_module'])
72        except Exception, msg:        except Exception, msg:
73          print "error %s" %msg          print "error %s" %msg
74          GDebug.printMesg(1,_("Error creating introspection module list \n\n --- %s ---)") % msg)          GDebug.printMesg(1,_("Error creating introspection module list \n\n --- %s ---)") % msg)
# Line 80  class Introspection(GIntrospection.Intro Line 80  class Introspection(GIntrospection.Intro
80          data = listcursor.fetch()          data = listcursor.fetch()
81          for classdef in data:          for classdef in data:
82            print classdef            print classdef
83            schema = GDataObjects.Schema(attrs={'id':string.lower(classdef['gnue_name']),            schema = GIntrospection.Schema(attrs={'id':string.lower(classdef['gnue_name']),
84                                                'name':classdef['gnue_name'],                                                'name':classdef['gnue_name'],
85                                                'type':'object',                                                'type':'object',
86                                                'gnue_id':classdef['gnue_id']},                                                'gnue_id':classdef['gnue_id']},
# Line 99  class Introspection(GIntrospection.Intro Line 99  class Introspection(GIntrospection.Intro
99        
100    def getSchemaByName(self, name, type=None):    def getSchemaByName(self, name, type=None):
101        try:        try:
102          listcursor = self._dataConnection.request('gnue_class', [["eq", ""], ["field", "gnue_name"], ["const", name]],          listcursor = self._connection.native.request('gnue_class', [["eq", ""], ["field", "gnue_name"], ["const", name]],
103                                                    ['gnue_module'],['gnue_name','gnue_comment','gnue_module'])                                                    ['gnue_module'],['gnue_name','gnue_comment','gnue_module'])
104        except Exception, msg:        except Exception, msg:
105          print "error %s" %msg          print "error %s" %msg
# Line 110  class Introspection(GIntrospection.Intro Line 110  class Introspection(GIntrospection.Intro
110        if len(data):        if len(data):
111          classdef = data[0]          classdef = data[0]
112          print classdef          print classdef
113          schema = GDataObjects.Schema(attrs={'id':string.lower(classdef['gnue_name']),          schema = GIntrospection.Schema(attrs={'id':string.lower(classdef['gnue_name']),
114                                              'name':classdef['gnue_name'],                                              'name':classdef['gnue_name'],
115                                              'type':'object',                                              'type':'object',
116                                              'gnue_id':classdef['gnue_id']},                                              'gnue_id':classdef['gnue_id']},
# Line 127  class Introspection(GIntrospection.Intro Line 127  class Introspection(GIntrospection.Intro
127    def __getChildSchema(self, parent):    def __getChildSchema(self, parent):
128        try:        try:
129          # fetch all properties used by class "parent"          # fetch all properties used by class "parent"
130          listcursor = self._dataConnection.request('gnue_property',  # class          listcursor = self._connection.native.request('gnue_property',  # class
131                                                    [["eq", ""], ["field", "gnue_class"],                                                    [["eq", ""], ["field", "gnue_class"],
132                                                                 ["const", parent.gnue_id]], # condition                                                                 ["const", parent.gnue_id]], # condition
133                                                    ['gnue_module'],  # sort                                                    ['gnue_module'],  # sort
# Line 159  class Introspection(GIntrospection.Intro Line 159  class Introspection(GIntrospection.Intro
159            else:            else:
160              attrs['length'] =  propdef['gnue_length']              attrs['length'] =  propdef['gnue_length']
161    
162            list.append(GDataObjects.Schema(attrs=attrs))            list.append(GIntrospection.Schema(attrs=attrs))
163    
164        listcursor.close()        listcursor.close()
165    

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26