From: Andrey C. <sku...@us...> - 2006-11-15 11:16:22
|
Update of /cvsroot/eas-dev/ocmng/EAS/admin In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv2772/EAS/admin Modified Files: dbconsole.prg dbconsole.xml Added Files: errorlog.prg errorlog.xml sendmessage.prg sendmessage.xfl sendmessage.xml Log Message: Add new components. Fix log policy for forms. --- NEW FILE: errorlog.prg --- /*-------------------------------------------------------------------------*/ /* E/AS Component (part of E/AS project) */ /* */ /* Copyright (C) 2006 by E/AS Software Foundation */ /* Author: Andrey Cherepanov <sk...@ea...> */ /* */ /* This program 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 of the */ /* License, or (at your option) any later version. */ /*-------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------/ / / / Name: Error Log / / System name: errorlog / / Description: Log for error / / Version: 0.1 / / Author: Andrey Cherepanov <sk...@ea...> / / / / Available commands: / / ADD Add message to error log / / <error> Error description / / / /--------------------------------------------------------------------------*/ /** Component: errorlog */ #define ERRORLOG_DB "ETC0101" #define ERRORLOG_CLASS "admin_errorlog" parameters cMethod, params local oErr, obj, res, i, err local componentName:='errorlog' oErr := ErrorBlock({|e| break(e) }) begin sequence /*=========================================================================*/ // ADD() if lower(cMethod) == 'add' if assertParameters( params, { 'error:C' } ) return NIL endif // Create object obj := map() obj:time := date() + ' ' + time() obj:error := params:error // Put to the database res := lcomponent( 'sys.db', 'put', ; 'obj', obj, ; 'class', ERRORLOG_CLASS, ; 'db', ERRORLOG_DB ) eDebug( 39, componentName + " execute():", res ) return NIL else eDebug( 9, componentName + " has not method '"+cMethod+"'" ) endif recover using oErr i := 1 while ( !empty(ProcName(i)) ) err += "Called from "+allTrim(ProcName(i)) + ; componentName + ":" + alltrim(str(ProcLine(i))) + chr(10) i++ end eDebug( 19, componentName + " internal error:", errorMessage(oErr) ) return NIL end sequence return NIL --- NEW FILE: errorlog.xml --- <?xml version="1.0" encoding="koi8-r" standalone="no" ?> <component> <name>errorlog</name> <category>Core/Administration</category> <version>0.1</version> <description>Log for error</description> <license>GNU/GPL</license> <created>2006-11-13</created> <modified>2006-11-13</modified> <requires> <dependence type="component">../../ocmng/ETC01.xml</dependence> </requires> <author>Skull</author> <meta dictionary="ETC01"> <attribute name="time" type="string" len="17" lenType="rtrim" /> <attribute name="error" type="text" lenType="rtrim" /> <index name="time" expression="time"/> <class name="admin_errorlog" extent="admin" essence="time + error" uniqueKey="time" attributes="time,error" indices="time" mainIdx="time" findAttrs="time" /> </meta> <data> <objects depository="ETC0101" class="mng_form"> <object> <attr name="name">errorlog.po</attr> <attr name="type">application/x-clip-plugin</attr> <attr name="description">Error log plugin</attr> <attr name="content">errorlog.po</attr> </object> </objects> <objects depository="ETC0101" class="mng_command"> <object> <attr name="name">add</attr> <attr name="component_name">errorlog</attr> <attr name="form" refTo="ETC0101:mng_form">errorlog.po</attr> <attr name="description"><![CDATA[Add message to error log. Arguments: error - String. Error description. Returns: None.]]> </attr> </object> </objects> <objects depository="ETC0101" class="form_menu"> <object> <attr name="menu_node">errorlog</attr> <attr name="menu_type">A</attr> <attr name="menu_parent">service</attr> <attr name="menu_order">15</attr> </object> </objects> <objects depository="ETC0101" class="form_action"> <object> <attr name="name">errorlog</attr> <attr name="menu_name">&Error log...</attr> <attr name="action"><![CDATA[ <call method="openForm"> <param value="ETC01:admin_errorlog" /> <param value="list" /> </call>]]></attr> </object> </objects> <objects depository="ETC0101" class="form_localization"> <object> <attr name="lang">ru</attr> <attr name="context">menu_name</attr> <attr name="msgid">&Error log...</attr> <attr name="msgstr">&öÕÒÎÁÌ ÏÛÉÂÏË...</attr> </object> </objects> </data> <locale lang="ru"> <name>errorlog</name> <description>öÕÒÎÁÌ ÏÛÉÂÏË</description> </locale> </component> --- NEW FILE: sendmessage.prg --- /*-------------------------------------------------------------------------*/ /* E/AS Component (part of E/AS project) */ /* */ /* Copyright (C) 2006 by E/AS Software Foundation */ /* Author: Andrey Cherepanov <sk...@ea...> */ /* */ /* This program 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 of the */ /* License, or (at your option) any later version. */ /*-------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------/ / / / Name: Send message / / System name: sendmessage / / Description: Send message / / Version: 0.1 / / Author: Andrey Cherepanov <sk...@ea...> / / / / Available commands: / / SEND Send message to all clients / / <text> Message text / / / /--------------------------------------------------------------------------*/ /** Component: errorlog */ parameters cMethod, params local oErr, obj, res, i, err local componentName:='sendmessage' oErr := ErrorBlock({|e| break(e) }) begin sequence /*=========================================================================*/ // ADD() if lower(cMethod) == 'send' if assertParameters( params, { 'text:C' } ) return NIL endif // TODO: real send eDebug( 29, componentName + " send broadcast:", params:text ) return NIL else eDebug( 9, componentName + " has not method '"+cMethod+"'" ) endif recover using oErr i := 1 while ( !empty(ProcName(i)) ) err += "Called from "+allTrim(ProcName(i)) + ; componentName + ":" + alltrim(str(ProcLine(i))) + chr(10) i++ end eDebug( 19, componentName + " internal error:", errorMessage(oErr) ) return NIL end sequence return NIL --- NEW FILE: sendmessage.xfl --- <?xml version="1.0" encoding="koi8-r" standalone="no" ?> <!-- dbconsole.xfl - Database console window --> <form> <head> </head> <interface> <widget class="childWindow" name=".window" label="Message"> <widget class="editText" name="text" /> <widget class="buttonBar"> <widget class="button" name=".send" label="&Send" /> <widget class="button" name=".clear" label="Cl&ear" /> <widget class="button" name=".close" label="&Close" /> </widget> </widget> </interface> <style> </style> <actions> <rule> <event widget=".send" signal="clicked"/> <action> <call method="component"> <param value="sendmessage" /> <param value="send" /> <param value="text" /> <param><call widget="text" method="getValue" /></param> </call> <call widget=".window" method="close"/> </action> </rule> <rule> <event widget=".clear" signal="clicked"/> <action> <call widget="text" method="setValue"><param value="" /></call> </action> </rule> <rule> <event widget=".close" signal="clicked"/> <action><call widget=".window" method="close"/></action> </rule> </actions> <locale lang="ru"> <string id="Message" value="óÏÏÂÝÅÎÉÅ" /> <string id="&Send" value="ïÔ&ÐÒÁ×ÉÔØ" /> <string id="Cl&ear" value="&ïÞÉÓÔÉÔØ" /> <string id="&Close" value="&úÁËÒÙÔØ" /> </locale> </form> --- NEW FILE: sendmessage.xml --- <?xml version="1.0" encoding="koi8-r" standalone="no" ?> <component> <name>sendmessage</name> <category>Core/Administration</category> <version>0.1</version> <description>Send message to all working clients</description> <license>GNU/GPL</license> <created>2006-11-13</created> <modified>2006-11-13</modified> <requires> <dependence type="component">../menu/form_service.xml</dependence> </requires> <author>Skull</author> <data> <objects depository="ETC0101" class="mng_form"> <object> <attr name="name">sendmessage.po</attr> <attr name="type">application/x-clip-plugin</attr> <attr name="description">Send message plugin</attr> <attr name="content">sendmessage.po</attr> </object> <object> <attr name="name">sendmessage.xfl</attr> <attr name="type">application/x-xfl</attr> <attr name="description">Send message window</attr> <attr name="content">sendmessage.xfl</attr> </object> </objects> <objects depository="ETC0101" class="mng_command"> <object> <attr name="name">send</attr> <attr name="component_name">sendmessage</attr> <attr name="form" refTo="ETC0101:mng_form">sendmessage.po</attr> <attr name="description"><![CDATA[Send message to all client. Arguments: text - String. Message text. Returns: None.]]> </attr> </object> </objects> <objects depository="ETC0101" class="form_menu"> <object> <attr name="menu_node">-sendmessage</attr> <attr name="menu_type">S</attr> <attr name="menu_parent">service</attr> <attr name="menu_order">20</attr> </object> <object> <attr name="menu_node">sendmessage</attr> <attr name="menu_type">A</attr> <attr name="menu_parent">service</attr> <attr name="menu_order">21</attr> </object> </objects> <objects depository="ETC0101" class="form_action"> <object> <attr name="name">sendmessage</attr> <attr name="menu_name">Send &message to all clients...</attr> <attr name="action"><![CDATA[ <call method="openForm"> <param value="sendmessage.xfl"/> </call>]]></attr> </object> </objects> <objects depository="ETC0101" class="form_localization"> <object> <attr name="lang">ru</attr> <attr name="context">menu_name</attr> <attr name="msgid">Send &message to all clients...</attr> <attr name="msgstr">&ïÔÐÒÁ×ÉÔØ ÓÏÏÂÝÅÎÉÅ ×ÓÅÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ...</attr> </object> </objects> </data> <locale lang="ru"> <name>sendmessage</name> <description>ïÔÐÒÁ×ÉÔØ ÓÏÏÂÝÅÎÉÅ ×ÓÅÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ</description> </locale> </component> Index: dbconsole.prg =================================================================== RCS file: /cvsroot/eas-dev/ocmng/EAS/admin/dbconsole.prg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- dbconsole.prg 3 Nov 2006 16:31:57 -0000 1.1 +++ dbconsole.prg 15 Nov 2006 11:16:17 -0000 1.2 @@ -12,15 +12,15 @@ /*--------------------------------------------------------------------------/ / / -/ Name: Database console / +/ Name: Database console / / System name: dbconsole / / Description: Database console / -/ Version: 0.1 / -/ Author: Andrey Cherepanov <sk...@ea...> / +/ Version: 0.1 / +/ Author: Andrey Cherepanov <sk...@ea...> / / / / Available commands: / / EXECUTE Execute query / -/ <query> database query / +/ <query> database query / / GETDATABASES Show available database names / / / / / @@ -40,12 +40,12 @@ /*=========================================================================*/ // EXECUTE() if lower(cMethod) == 'execute' - eDebug(15, componentName + " args:", params) + eDebug( 29, componentName + " args:", params ) if assertParameters( params, { 'query:C' } ) return NIL endif m := lcomponent('sys.db', 'executeExt', 'db', iif('DB' $ params, params:db,''), 'query', params:query, 'format', .T.) - eDebug( 17, componentName + ".execute:", m ) + eDebug( 39, componentName + " execute():", m ) return m /*=========================================================================*/ @@ -55,11 +55,11 @@ for i in res aadd( a, i[1] ) next - eDebug( 17, componentName + ".getDatabases:", a ) + eDebug( 39, componentName + " getDatabases():", a ) return a else - eDebug(3, componentName + " has not method '"+cMethod+"'") + eDebug( 9, componentName + " has not method '"+cMethod+"'" ) endif recover using oErr i := 1 @@ -69,7 +69,7 @@ i++ end - eDebug(5, " internal error:", errorMessage(oErr)) + eDebug( 19, componentName + " internal error:", errorMessage(oErr) ) return NIL end sequence Index: dbconsole.xml =================================================================== RCS file: /cvsroot/eas-dev/ocmng/EAS/admin/dbconsole.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- dbconsole.xml 3 Nov 2006 16:31:57 -0000 1.1 +++ dbconsole.xml 15 Nov 2006 11:16:17 -0000 1.2 @@ -7,10 +7,10 @@ <description>Database console</description> <license>GNU/GPL</license> <created>2006-10-23</created> - <modified>2006-10-23</modified> + <modified>2006-11-13</modified> <requires> - <dependence type="component">../forms/form_service.xml</dependence> + <dependence type="component">../menu/form_service.xml</dependence> </requires> <author>Skull</author> |