From: Andrey C. <sku...@us...> - 2006-11-03 16:12:21
|
Update of /cvsroot/eas-dev/eas/libeas In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv30821/libeas Modified Files: componentmanager.prg dbmanager.prg execmanager.prg functions.prg uimanager.prg Log Message: Add localization and documentation, small fixes. Index: componentmanager.prg =================================================================== RCS file: /cvsroot/eas-dev/eas/libeas/componentmanager.prg,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- componentmanager.prg 5 Jun 2006 14:12:19 -0000 1.2 +++ componentmanager.prg 3 Nov 2006 16:12:08 -0000 1.3 @@ -43,7 +43,7 @@ return obj /** Open tables */ -static function c_open( self, params ) // TODO +static function c_open( self, params ) local cfg eDebug(15, "Component manager (CM): open") @@ -65,9 +65,9 @@ component := params:receiver method := params:command -// eDebug(5, "COMPONENT LOOKUP","DB" $ params:args, params:args) + eDebug(15, "COMPONENT LOOKUP", component, iif("ARGS" $ params, '<'+valtype(params:args)+'>', '<no arguments>') ) if .not. "ARGS" $ params .or. valtype(params:args)!="O" - return NIL + params:args := map() endif eDebug(15, "CM lookup:", component, method) Index: dbmanager.prg =================================================================== RCS file: /cvsroot/eas-dev/eas/libeas/dbmanager.prg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- dbmanager.prg 2 Jun 2006 14:32:45 -0000 1.1 +++ dbmanager.prg 3 Nov 2006 16:12:08 -0000 1.2 @@ -68,11 +68,14 @@ /** Execute query (return object instead array as in execute()) */ static function c_executeExt( self, params ) local res - if assertParameters( params, { 'query:C', 'db:C' } ) + if assertParameters( params, { 'query:C' } ) return res endif + if .not. "DB" $ params .or. params:db == NIL + params:db := '' + endif - //eDebug(15, "sys.db.executeExt.db", params:db ) + eDebug(15, "sys.db.executeExt.db", params:db ) res := codb_execute( self:db, params:query, params:db ) if codb_get_error( res ) != NIL @@ -80,6 +83,10 @@ sendMessage(,,'sys.db.failed', res ) return array(0) endif + if "FORMAT" $ params .and. params:format + fmt := CODB_Formatter() + res := fmt:show( res ) + endif return res /** Get object from database */ Index: execmanager.prg =================================================================== RCS file: /cvsroot/eas-dev/eas/libeas/execmanager.prg,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- execmanager.prg 16 Jun 2006 15:22:20 -0000 1.2 +++ execmanager.prg 3 Nov 2006 16:12:08 -0000 1.3 @@ -78,7 +78,7 @@ eDebug(2, self:lastError) return NIL endif - elseif .not. empty (id:=self:cManager:lookup( params )) + elseif ascan( self:commands, {|e| e[1]=='sys.db' } ) > 0 .and. .not. empty (id:=self:cManager:lookup( params )) eDebug(15, "EXEC COMPONENT COMMAND:",params:receiver,params:command,"...") params:__id := id vRet := self:cManager:execute( params ) Index: functions.prg =================================================================== RCS file: /cvsroot/eas-dev/eas/libeas/functions.prg,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- functions.prg 20 Jun 2006 10:25:53 -0000 1.2 +++ functions.prg 3 Nov 2006 16:12:08 -0000 1.3 @@ -50,7 +50,7 @@ /* Send message to local component */ function lcomponent() - local ret, args, pc:=pcount(), i + local ret, args:=map(), pc:=pcount(), i //eDebug(7, "lcomponent() call") if pc < 2 @@ -108,13 +108,17 @@ return .F. /*===========================================================================*/ -/* PREDEFINED COMPONENT CALL */ +/* PREDEFINED COMPONENT CALL */ /*===========================================================================*/ /* Execute local database query */ function lquery(params, query) return lcomponent('sys.db', 'execute', 'db', iif(valtype(params)=='O' .and. 'DB' $ params, params:db,''), 'query', query) +/* Execute local database query (extended mode) */ +function lqueryExt(params, query) +return lcomponent('sys.db', 'executeExt', 'db', iif(valtype(params)=='O' .and. 'DB' $ params, params:db,''), 'query', query) + /* Opens form from server */ function openForm(name, type, id) return lcomponent('sys.ui', 'openForm', 'name', name, 'type', type, "id", id) @@ -215,3 +219,14 @@ dep := left( s, i-1 ) class := substr( s, i+1 ) return { dep, class } + +/* Return XML-safe string */ +function safeXML( string ) + //eDebug( 25, "Before XMLization:", string ) + string := strtran( string, '&', '&' ) + string := strtran( string, '<', '<' ) + string := strtran( string, '>', '>' ) + string := strtran( string, '"', '"' ) + string := strtran( string, "'", ''' ) + //eDebug( 25, "After XMLization:", string ) +return string Index: uimanager.prg =================================================================== RCS file: /cvsroot/eas-dev/eas/libeas/uimanager.prg,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- uimanager.prg 16 Jun 2006 15:22:20 -0000 1.2 +++ uimanager.prg 3 Nov 2006 16:12:08 -0000 1.3 @@ -129,13 +129,14 @@ oErr := errorBlock({|e| break(e) }) begin sequence - //eDebug(10, "UI parent:", self:main) if valtype(self:main) == 'O' .and. self:main:className != "UIMainWindow" .and. "PARENT" $ self:main parent := self:main:parent else parent := self:main endif + eDebug( 16, "UI: form parsing..." ) + // Process and show form form := UIForm( name, parent ) if SHOW_FORMS @@ -143,6 +144,7 @@ endif win := form:parseString(vRet) + eDebug( 16, "UI: window is created...", valtype(win) ) if win == NIL eDebug(3, "UI: Error parse form") |