Guadalajara, Jalisco, Mexico 2 Mayo 2003, 27 Febrero 2004 I.Q. David Arturo Macias Corona Presentation of ClipNet-xNet Model OBJECTIVE: Presentation of ClipNet-xNet Model, oriented to clipxnet.exe program Is sugested to use monospaced font, consult in complete screen and use of search functions to locate quickly document segments IMPORTANT Due to lack of time for translating Spanish to English, this document cover only introduction and instructions for implement ClipNet-xNet in different Web Servers programs As samples are made using Clipper code, them and ClipNet-xNet application can be easily seen and applied Version en Espa¤ol CONTENT: 0. Introduction 16. Preparation for samples about use of clipxnet.exe 16a. Xitami Web Server 16b. Apache for Linux 16c. Apache for OS/2 16d. Apache for Win32 16e. Microsoft IIS:Internet Information Server version 5.0 17. Samples, samples and more samples 0. Introduction This work is an presentation of "Modelo ClipNet-xNet", oriented to an executable file which can be used as: "Clipper language interpreter", in two modes: # Command line, as Scripts language with Clipper code # Web Server, as: + CGI program + Interpreter of own Scripts or equivalent to ASP, PHP, Perl, ... but using Clipper code # Document "clipxnet.htm" is an general description of model elements, requirements for tests and an good amount of samples In addition, are exposed many ways for connect and use other new or current systems for generation of dinamic content, and are explained different techniques for modify current systems and apply them with ClipNet-xNet Model # ClipNet-xNet Model can manage and interpret differents format of files with Clipper code, as those used with extensions .fml, .sgs, .hs, .hrb and .prg In command line any extension can be used # ClipNet-xNet Model can be applied with different Web server programs, including: Xitami in Win32, OS/2 and Linux, Apache in Win32, OS/2 and Linux, IIS 5.0 in Win32 # Is posible too to apply generation of dinamic graphs using TGraph 3 Model with FiveWin or Citlalli Model with FiveWin # ClipNet-xNet let to access and modify databases in an Intra/Extra/Inter-Net environment, without need of any other module: - DBF type databases - MySQL type databases ClipNet-xNet Model is made with Harbour 43++ (February 2004) and can be used in Win32, OS/2 and Linux, using native RDD, and/or RDD for ADS Local or Remote, and/or MySQL servers 16. Preparation for samples about use of clipxnet.exe # You can choose desired platforms: Win32 (Win98/2000/XP/...), OS/2, Linux # Unpack clipxnet.zip file, preferently in c:\clipxnet directory in Win32, OS/2 and /clipxnet in Linux, and using directories included # Is included implementation description using different Web Server programs, which are necesary for tests AND USE of clipxnet.exe in your own Web systems, in local machine, local network, wide network or Internet # All tests and samples are functional in each one of environments described for each Web Server, but anyway, you can implement in different directories or configurations based in your preferences # Any other directories can be used for database files, for what is necessary to modify location references in samples files. Actually is using directory where clipxnet.exe is executed as directory of database files, in most cases 16a. Xitami Web Server # As Xitami Web Server is multiplatform, configuration is similar in any of them You can choose platforms: Win32 (Win98/2000/XP/...), OS/2, Linux I included Xitami programs I am using in each platform # Preferently use default directories structure, installing in: c:\xitami\ Win32 y OS/2 /xitami/ Linux Notes: - In Linux case, is necesary to "recompile", but it is not difficult Refer to documentation and use ./xibuild - In Linux case, I use "root" user. For other users, permissions, etc., refer to documentation and your Linux knowledge # If you have installed another Web Server using port 80, change Xitami port in any of this ways: + Edit xitami.cfg and apply: portbase=5000 # e.g. 5000 for port 5080 + or, use xitami -b 5000 for Xitami execution Later, navigator must be "oriented" to Xitami port http://address:5080 # After installing Xitami, you MUST define clipxnet.exe as the program/module/"interpreter" filter for .fml, .sgs, .hs type pages "Insertion 20030723" Were included .hrb and .prg extensions In section [Filter] of xitami.cfg or defaults.cfg you must add: .sgs=clipxnet.exe .hs=clipxnet.exe .fml=clipxnet.exe .hrb=clipxnet.exe .prg=clipxnet.exe In this simple way you have clipxnet.exe as pages "interpreter" with Clipper code Observation: In Linux you can use clipxnet.exe programs or rename them as clipxnet In Xitami I am using clipxnet.exe to keep same values with other platforms If you choose to use clipxnet, change references where is needed # Copy clipxnet.exe file of proper type to directories: \xitami\ \xitami\cgi-bin\ Proper type is refering to Win32, OS/2, Linux, with ADS, without ADS, etc. # Copy files of directory \clipxnet\webpages\ to directory: \xitami\webpages\ # Copy files of directory \clipxnet\dbf\ to directory \xitami\ Observation: Only are included .dbf files with .cdx index file type # Copy files inter_01.exe, inter_02.exe of proper type to directory: \xitami\ Proper type is refering to Win32, OS/2, Linux. They do not include ADS support # Copy files htg3xnet.exe, nconvert.exe to directory: \xitami\ "Insertion 20030723" # Copy file inter_01.hrb to directory: \xitami\ "Insertion 20030723" # Copy file inter_01.prg to directory: \xitami\ If it is needed, copy harbour.exe file to directory \xitami\ # If you want to use ADS: Observation: If this listed files are not copied, there will be an runtime error which will not be properly reported by Xitami + Must be copied clipxnet.exe file from proper ....\CONADS directory "Insertion 20040227" Due to inclusion of MySQL support, there are files with ADS support without and with MySQL support, which are in ....\conads and ....\conadsmysql, and if is choosed that with MySQL support, instructions for MySQL support must be applied + Must be copied additional ADS files: Win32: Copy to directories: \xitami \xitami\cgi-bin the files: ACE32.dll Functions AXCWS32.dll Communications to ADS Remote ADSLOC32.dll ADS Local - This files belong to ADS 5.7 version - Clipxnet.exe is created with ADS 5.7 libraries "Insertion 20040227" - Programs with ADS support has been created with ADS 6.2x libraries Linux: "Download" from http://www.advantagedatabase.com "Developer Zone" section, the file: adsapi-6.20.0.tar.gz and install it. Installation distribute libraries files needed in proper directories - Clipxnet.exe (clipxnet) are created with ADS 6.20 libraries + You can use ADS Local or ADS Remote + Is recommended to install ARC: Advantage Data Architect for review / testing of database files. I am using the files: http://www.advantagedatabase.com "Developer Zone" section, Win32: ARC6.11.06.exe, ARC32.6.20.0.7.exe Linux: arc-6.20.0.tar.gz "Insertion 20040227" # If you want to use MySQL: Observation: If this listed files are not copied, there will be an runtime error which will not be properly reported by Xitami + Must be copied clipxnet.exe file from ....\conmysql, without ADS support, or ....\conadsmysql with ADS support, for which instructions for ADS support must be applied + Must be copied additional MySQL files: Win32: Copy to directories: \xitami \xitami\cgi-bin the files: LibMySQL.dll Functions - Clipxnet.exe are created with MySQL 3.23.57 libraries for Win32 OS/2: Copy to directories: \xitami \xitami\cgi-bin the files: mysql.dll mysqlu.dll - Clipxnet.exe are created with MySQL 3.23.50 libraries for OS/2 Linux: Usually Linux have installed an MySQL Server, with needed libraries in proper directories - Clipxnet.exe (clipxnet) are created with MySQL 3.23.47 libraries for Linux + Can be used MySQL in local way (same computer) or remote way # And, finally, execute Xitami Web Server Xitami indicate which IP addresses and ports are "listening", both for http and ftp # Using the Navigator pointing to address http://address where: address is IP number or name of computer which is using Xitami, or 127.0.0.1 If port number was changed, use that indicated by Xitami: http://address:port When initial page is not specified, Xitami show the documentation, which is very adequate Is convenient and interesting to read this documentation # Use the Navigator pointing to address: http://address/clipxnet.htm http://address:port/clipxnet.htm if port was changed This page is shown 16b. Apache for Linux # Implementation tests were made in: + Linux Mandrake 8.2, 9 + Linux RedHat 7.3, 8 Note: Mandrake and RedHat are using different Apache versions: + Mandrake: Apache-AdvancedExtranetServer/1.3.26 (Mandrake Linux/6mdk) sxnet/1.2.4 mod_ssl/2.8.10 OpenSSL/0.9.6g PHP/4.2.3 + RedHat: Apache 2.0.40 # In Linux case, I use "root" user. For other users, permissions, etc., refer to documentation and your Linux knowledge # You MUST define clipxnet as the program/module/"interpreter" filter for .fml, .sgs, .hs type pages IMPORTANT observations: - For Apache is convenient to name executable as clipxnet, for what is enough to copy or rename clipxnet.exe as clipxnet - There are other executables files with n prefix, named nclipxnet.exe This are created with ncurses libraries for console management, and must be used in command line to make programs with user interface, containing input/output procceses with user interaction They can be used directly or renamed as clipxnet.exe or clipxnet They can not be used throught Web Server "Insertion 20030723" Were included .hrb and .prg extensions For Linux Mandrake, use file /etc/httpd/conf/commonhttpd.conf For Linux RedHat, use file /etc/httpd/conf/httpd.conf This file include httpd.conf and commonhttpd.conf files which are separate in Linux Mandrake + After this section: # # Action lets you define media types that will execute a script whenever # a matching file is called. This eliminates the need for repeated URL # pathnames for oft-used CGI file processors. # Format: Action media/type /cgi-script/location # Format: Action handler-name /cgi-script/location # apply the next section: # Files of a particular file extension # DAVID: Configuracion para los "Scripts" del Modelo ClipNet-xNet #Handler "clipxnet" y programa interpretador "cgi-bin/clipxnet": Action clipxnet /cgi-bin/clipxnet #Extensiones asociadas al Handler "clipxnet": AddHandler clipxnet .fml AddHandler clipxnet .sgs AddHandler clipxnet .hs AddHandler clipxnet .hrb AddHandler clipxnet .prg # Tipos MIME para las extensiones asociadas al Handler "clipxnet": AddType text/html .fml AddType text/html .sgs AddType text/html .hs AddType text/html .hrb AddType text/html .prg In this simple way you have clipxnet as pages "interpreter" with Clipper code Observation: In Apache for Linux should be used clipxnet file in place of clipxnet.exe, even both are identical. Is applied in this way because .exe extension is considered for an file download MIME type for .exe can be changed, but this require an additional modification low useful, when is enough to use clipxnet as executable program # In section: Directory /var/www/cgi-bin verify existance of next line: Allow from all Without this line, can not access and execute clipxnet program or others residing in same directory # Copy clipxnet file of proper type to directories: /var/www/cgi-bin/ Proper type is refering to Linux with ADS, without ADS, etc. # Copy files of directory /clipxnet/webpages/ to directory: /var/www/html/ # Copy files of directory /clipxnet/dbf/ to directory /var/www/cgi-bin/ Observation: + Only are included .dbf files with .cdx index file type + Is required to enable read/write permissions in order to access and modify database files You can apply it using: chmod 777 *.dbf chmod 777 *.cdx chmod 777 *.fpt # Copy files inter_01.exe, inter_02.exe of proper type to directory: /var/www/cgi-bin/ Proper type is refering to Win32, OS/2, Linux. They do not include ADS support # Copy files htg3xnet.exe, nconvert.exe to directory: /var/www/cgi-bin/ Observation: To use htg3xnet.exe and nconvert.exe is required to have WINE support "Insertion 20030723" # Copy file inter_01.hrb to directory: /var/www/cgi-bin/ "Insertion 20030723" # Copy file inter_01.prg to directory: /var/www/cgi-bin/ # Enable "Write" permissions for "Group" and "Others" users to directory: /var/www/cgi-bin/ Without this permissions can not create and use some temporary files needed # If you want to use ADS: Observation: If this listed files are not copied, there will be an runtime error which will not be properly reported by Web Server + Must be copied clipxnet file from proper ....\CONADS directory "Insertion 20040227" Due to inclusion of MySQL support, there are files with ADS support without and with MySQL support, which are in ....\conads and ....\conadsmysql, and if is choosed that with MySQL support, instructions for MySQL support must be applied + Must be copied additional ADS files: Linux: "Download" from http://www.advantagedatabase.com "Developer Zone" section, the file: adsapi-6.20.0.tar.gz and install it. Installation distribute libraries files needed in proper directories - Clipxnet.exe (clipxnet) are created with ADS 6.20 libraries + You can use ADS Local or ADS Remote + Is recommended to install ARC: Advantage Data Architect for review / testing of database files. I am using the files: http://www.advantagedatabase.com "Developer Zone" section, Linux: arc-6.20.0.tar.gz "Insertion 20040227" # If you want to use MySQL: Observation: If this listed files are not copied, there will be an runtime error which will not be properly reported by Web Server + Must be copied clipxnet file from ....\conmysql, without ADS support, or ....\conadsmysql with ADS support, for which instructions for ADS support must be applied + Must be copied additional MySQL files: Linux: Usually Linux have installed an MySQL Server, with needed libraries in proper directories - Clipxnet.exe (clipxnet) are created with MySQL 3.23.47 libraries for Linux + Can be used MySQL in local way (same computer) or remote way # And, finally, re-start "httpd" service (daemon) in order to apply new configurations # Using the Navigator pointing to address http://address where: address is IP number or name of computer which is using Apache, or 127.0.0.1 When initial page is not specified, Apache show the documentation, which is very adequate Is convenient and interesting to read this documentation # Use the Navigator pointing to address: http://address/clipxnet.htm This page is shown 16c. Apache for OS/2 # Implementation tests were made in: + eComStation 1.0, 1.1 and were used two versions of Apache for OS/2 a) Apache 1.3.26, directory f:\apache b) Apache 2.0.40, directory f:\Apps\apache2 Default directories were applied In next both directories will be refered in common as: "directory_apache" # You MUST define clipxnet.exe as the program/module/"interpreter" filter for .fml, .sgs, .hs type pages "Insertion 20030723" Were included .hrb and .prg extensions Use directory_apache\conf\httpd.conf file + After this section: # # Action lets you define media types that will execute a script whenever # a matching file is called. This eliminates the need for repeated URL # pathnames for oft-used CGI file processors. # Format: Action media/type /cgi-script/location # Format: Action handler-name /cgi-script/location # apply the next section: # Files of a particular file extension # DAVID: Configuracion para los "Scripts" del Modelo ClipNet-xNet #Handler "clipxnet" y programa interpretador "cgi-bin/clipxnet.exe": Action clipxnet /cgi-bin/clipxnet.exe #Extensiones asociadas al Handler "clipxnet": AddHandler clipxnet .fml AddHandler clipxnet .sgs AddHandler clipxnet .hs AddHandler clipxnet .hrb AddHandler clipxnet .prg # Tipos MIME para las extensiones asociadas al Handler "clipxnet": AddType text/html .fml AddType text/html .sgs AddType text/html .hs AddType text/html .hrb AddType text/html .prg In this simple way you have clipxnet.exe as pages "interpreter" with Clipper code # In section: Directory directory_apache/cgi-bin verify existance of next line: Allow from all Without this line, can not access and execute clipxnet.exe program or others residing in same directory # Copy clipxnet.exe file to directories: directory_apache\cgi-bin\ # Copy files of directory \clipxnet\webpages\ to directory: directory_apache\htdocs\ # Copy files of directory \clipxnet\dbf\ to directory directory_apache\cgi-bin\ Observation: + Only are included .dbf files with .cdx index file type # Copy files inter_01.exe, inter_02.exe to directory: directory_apache\cgi-bin\ # Copy files htg3xnet.exe, nconvert.exe to directory: directory_apache\cgi-bin\ Observation: To use htg3xnet.exe and nconvert.exe is required to have ODIN support, with PE "Insertion 20030723" # Copy file inter_01.hrb to directory: directory_apache\cgi-bin\ "Insertion 20030723" # Copy file inter_01.prg to directory: directory_apache\cgi-bin\ If it is needed, copy harbour.exe file to directory directory_apache\cgi-bin\ "Insertion 20040227" # If you want to use MySQL: Observation: If this listed files are not copied, there will be an runtime error which will not be properly reported by Web Server + Must be copied clipxnet.exe file from ....\conmysql + Must be copied additional MySQL files: OS/2: Copy to directories: directory_apache\cgi-bin\ the files: mysql.dll mysqlu.dll - Clipxnet.exe are created with MySQL 3.23.50 libraries for OS/2 + Can be used MySQL in local way (same computer) or remote way # And, finally, re-start Apache in order to apply new configurations Apache 1.3.26: directory_apache\httpd Apache 2.0.40: directory_apache\startup.cmd # Using the Navigator pointing to address http://address where: address is IP number or name of computer which is using Apache, or 127.0.0.1 When initial page is not specified, Apache show the documentation, which is very adequate Is convenient and interesting to read this documentation # Use the Navigator pointing to address: http://address/clipxnet.htm This page is shown 16d. Apache for Win32 # This implementation has not been tested for myself. But it is working fine # Based in information from Rafa R. Gaona (translated): "At 12:52 pm 08/14/03 +0200, you wrote: >Well David now you have system in Apache Windows >Just to tell you with changes refered for Linux/os2 are valid too >for windows (mine is 2000). >Everything is identical in directory conf\httpd.conf >There are not more things to do ;-)) " we can see as enough to follow similar instructions of Apache, preferently for OS/2, in order to have convenient configuration in Apache for Win32 # Obviously must be used executable files corresponding to Win32 If ADS support and/or MySQL support will be used, follow instructions in Xitami for Win32 or IIS 5.0 16e. Microsoft IIS:Internet Information Server version 5.0 # Implementation tests were made using root directory of IIS: c:\inetpub\wwwroot\ Others directories can be used defining virtual directories and making changes in references to directories # You MUST define clipxnet.exe as the program/module/"interpreter" filter for .fml, .sgs, .hs type pages "Insertion 20030723" Were included .hrb and .prg extensions Follow next sequence in Win2000 or apply that corresponding to your system: (Thanks to Luis Krause Mantilla) - Control Panel Administrative Tools Internet Services Manager Open the tree structure and look for "Default Web Site" branch Right Click and choose Properties Choose the "Home Directory" tab Click the "Configuration..." button Click the "Add" button Executable: c:\inetpub\wwwroot\clipxnet.exe Extension: fml Add Executable: c:\inetpub\wwwroot\clipxnet.exe Extension: sgs Add Executable: c:\inetpub\wwwroot\clipxnet.exe Extension: hs Add Executable: c:\inetpub\wwwroot\clipxnet.exe Extension: hrb Add Executable: c:\inetpub\wwwroot\clipxnet.exe Extension: prg # Additionally set properties: Control Panel Administrative Tools Personal Web Manager Advanced icon Then Right-click on the virtual directories on the right side and choose Properties... In the "Access permissions" section check "Read" and "Write"; leave "Script Source Access" unchecked In the "Application permissions" section select the "Scripts" radiobutton. ONLY choose "Execute (including scripts)" if you need to execute clipxnet.exe directly, or other CGI program. In this not simple way you have clipxnet.exe as pages "interpreter" with Clipper code # Copy clipxnet.exe file of proper type to directories: \inetpub\wwwroot\ Proper type is refering to Win32, with ADS, without ADS, etc. # Copy files of directory \clipxnet\webpages\ to directory: \inetpub\wwwroot\ # Copy files of directory \clipxnet\dbf\ to directory \inetpub\wwwroot\ Observation: Only are included .dbf files with .cdx index file type # Copy files inter_01.exe, inter_02.exe of proper type to directory: \inetpub\wwwroot\ Proper type is refering to Win32, OS/2, Linux. They do not include ADS support # Copy files htg3xnet.exe, nconvert.exe to directory: \inetpub\wwwroot\ "Insertion 20030723" # Copy file inter_01.hrb to directory: \inetpub\wwwroot\ "Insertion 20030723" # Copy file inter_01.prg to directory: \inetpub\wwwroot\ If it is needed, copy harbour.exe file to directory \inetpub\wwwroot\ # If you want to use ADS: Observation: If this listed files are not copied, there will be an runtime error which will not be properly reported by Web Server + Must be copied clipxnet.exe file from proper ....\CONADS directory "Insertion 20040227" Due to inclusion of MySQL support, there are files with ADS support without and with MySQL support, which are in ....\conads and ....\conadsmysql, and if is choosed that with MySQL support, instructions for MySQL support must be applied + Must be copied additional ADS files: Win32: Copy to directories: \inetpub\wwwroot\ the files: ACE32.dll Functions AXCWS32.dll Communications to ADS Remote ADSLOC32.dll ADS Local - This files belong to ADS 5.7 version - Clipxnet.exe is created with ADS 5.7 libraries "Insertion 20040227" - Programs with ADS support has been created with ADS 6.2x libraries + You can use ADS Local or ADS Remote + Is recommended to install ARC: Advantage Data Architect for review / testing of database files. I am using the files: http://www.advantagedatabase.com "Developer Zone" section, Win32: ARC6.11.06.exe, ARC32.6.20.0.7.exe "Insertion 20040227" # If you want to use MySQL: Observation: If this listed files are not copied, there will be an runtime error which will not be properly reported by Web Server + Must be copied clipxnet.exe file from ....\conmysql, without ADS support, or ....\conadsmysql with ADS support, for which instructions for ADS support must be applied + Must be copied additional MySQL files: Win32: Copy to directories: \inetpub\wwwroot\ the files: LibMySQL.dll Functions - Clipxnet.exe are created with MySQL 3.23.57 libraries for Win32 + Can be used MySQL in local way (same computer) or remote way # Use the Navigator pointing to address: http://address/clipxnet.htm where: address is IP number or name of computer which is using IIS, or 127.0.0.1 This page is shown 17. Samples, samples and more samples IMPORTANT: This is only an raw list of samples in clipxnet.htm Some of them will not work because they need some other process together described in clipxnet.htm in Spanish Link for clipxnet.exe as "interpreter" filter clipnet.sgs, SisGenScript file Multiply.hs, of Felipe Coury Hello.hs, of Felipe Coury Ugly.hs, of Felipe Coury Dir.hs, of Felipe Coury prgxnet.hrb, "Harbour Portable Object (.hrb)" file prgxnet.prg, "Source file (.prg)" file Search of strings in files: Strings to search, coma separated (example: cadena1, cadena2): Files specifications, coma separated (example: *.prg, *.fml): Search "Xitami" in all *.txt Files directory: Files specifications, coma separated (example: *.prg, *.fml): All files directory Browse an DBF database Mini-system Test 01 of Serial Model Interface Example 1 of Paralell Model Example 2 of Paralell Model Example 3 of Paralell Model Example 4 of Paralell Model Example 5 of Paralell Model Example 6 of Paralell Model Examples of TGraph 3 Model Examples of TGraph 3 Model in continuous refreshing Example 6 of Paralell Model with TGraph 3 Test 01 of Serial Model Interface Example with "Harbour Portable Object (.hrb)" Example with "Source files (.prg)" Cookies test Scholar Library Computers shop Browse and Edit an DBF database Specific conditions pre-defined Browse and Edit DBF or MySQL databases Copy of data DBF and/or MySQL types "Si no preguntas, yo no se que quieres saber y te quedas con la duda" I.Q. David Arturo Macias Corona dmacias at mail.udg.mx