Database development tools - for the 4D programming environment

Jens Blomster:

Through more than 20 years, my various jobs have generated quite a lot of reusable tools, especially 4D plugins. I looked at my oldest plugin code and found that it was dated november 1987.

Sometimes I feel it is a pity all these resources lie unused. I don't mind giving them away ... BUT I can't put a lot of unpaid work into making externally useable documentation etcetera to raise the products up to an acceptable level for external publishing.

I have, together with cooperators and customers that have helped testing, made 2 of the 4D plugins/utilities/libraries into commercially available products which are presented below.

Other things that have not been pushed that far: I'll put all plugins and other tools that are reasonably documented in the "Free stuff" section below. These can be downloaded and used as they are, the enclosed documentation should be enough. Since the tools are free, I won't promise any support or changes/fixes, but it's not forbidden to discuss it with me... I'm a decent person (in my own opinion) and answers when talked to.

As for the rest, the many solutions and plugins that are today internal tools, and may be incomplete and/or lack externally readable documentation, I will list them with short descriptions of what they are. If you find something there that you have a burning interest in, you can always email me to discuss if we can do anything. If you need a plugin with a 10-line email about how to use it, that may be free, but if it means work hours for me to document, modify or re-code something then I probably will want to charge for it. Anyway it's free to ask, in principle I'm willing to put all the stuff at your disposal.



Free stuff

Product

Description

Download OS X

Download Win

Robot Watchdog

Standalone c++ application; will act as a supervisor of your 4D app. I use it to keep webservers always up (the watchdog restarts it if it fails), to keep 4D Client always logged on to 4D Server (the watchdog restarts and auto-logs in 4D Client if 4D Server is restarted), and more. New version validated with 6.8 and 2003 uploaded 2003-10-06..


watchdog.zip

Webviewer

Plugin/DLL - will let you display webpages, html or pdf documents under control of your application. The page will be displayed in an own, topmost, modal window with the Internet Explorer ActiveX control in it. It won't let you integrate the area on a 4D form, but it will still give much tighter control than if you just launch the web browser and leaves the rest to the user. Uploaded dec 2005.


webviewer.zip

Embedded Applescript

Plugin. Write an applescript, compile it, use ResEdit to stuff it into the resource fork of the CallAS.4DX plugin. You will then be able to call it in a simple way from your 4D code, transfer parameters from the 4D code to the applescript, and receive a return value. It's like calling a subroutine written in applescript code. Sample scripts to set/get current default printer of OS X included. New version uploaded 2005-05-24.
2009: CallAS still works with 4D2004, and with v11 on PPC mac, however NOT with v11 on an Intel mac.

CallAS.zip


PictPdf

Pdf production plugin for MacOS X. Uses the built-in pdf engine of OS X Quartz drawing, to save any 4D picture variable as a page of a pdf document. 4D Chart, 4D Write and 4D Draw all can output their pages as picture variables, so all Chart/Write/Draw documents can be saved as pdf with one button click. There are also other 3:rd party plugins and components that can build picts.
New .bundle version for 4D2004 and v11 uploaded 2009-11-29. Universal, also for v11 on Intel mac.

Old: pictpdf.sit.hqx

New: pictpdf2009.zip


Phpbridge

Fetch 4D data and call 4D methods from a php script. For MacOS X only. Consists of a 3 4D methods, a php class for access, and a 4D plugin for fast communication via unix local sockets.

phpbridge.zip


Unix sockets for 4D

The sockets plugin used in the phpbridge is open source. The XCode project can be downloaded here. Note this is only source - the compiled and ready-to-use plugin is in the phpbridge download.

sockets.zip






(no longer) Available for licensing


Update 2008-12-04: These products will from today no longer be sold. This is to secure a reasonably long time of supported life before I retire from work.



SimpleSQL

Plugin for Windows. In production since January 2002. SQL connectivity via Microsoft ADO. Written to fill the need for a non-blocking database connectivity that can be run also on 4D server or webserving 4D. Native threaded in Windows so that it does not hang up the 4D application while waiting for the data source. Has a 4D ODBC compatibility package, written in 4D code, so that it can replace the simplest aspects of 4DODBC: all kinds of queries, and updates via text in sql statements.

SimpleSQL has an own webpage here.

COM4D

The first product ever that allows a 4D-based application to appear as an OLE Automation server. The 4D application can be scripted from any COM-compliant Windows environment: ASP (Javascript, VBScript), Visual Basic, PHP, Perl ... almost anything. The package also allows the 4D application to execute scripts (multithreaded/non-blocking), and let the scripts have access to process variables and methods from the 4D process that launched it. For Windows only.

More information on an own webpage here.







Internal tools & solutions

CGIPack

Plugin for Windows. CGIpack can run a windows script or executable in the same way that a webserver runs a cgi. This means the standard input and output files of the windows script is connected to your code, so that you can give indata to the script/program, and capture its output. You can launch a .bat file from 4D and receive what it should have written in the black DOS window, in a 4D text variable. It also opens up the possibility to run PERL from 4D, in the same way as PERL scripts are run as a cgi.


Note: this plugin still has a value even though 4D2004 LAUNCH EXTERNAL PROCESS can do about the same thing. The built-in 4D command is "blocking" - it hangs up 4D entirely while the external process is waiting to capture the text of STDOUT. Cgipack does not, and therefor can be used on servers.

Page layout optimization engine

Native 4D code to solve the following problem: Given a (large; 100 or so) number of advertisements of different sizes, find the optimal placement on journal pages of a given size, so that the advertisement section requires as few pages as possible. Displays the result graphically, and allows drag-and-drop modifications.

A fairly advanced mathematical algorithm. It is not possible to find the best solution - this is an almost impossible-to-solve combinatoric problem; "the knapsack problem"; "an n-p complete problem". But it will suggest a decent solution, which can be manually refined. If you're interested in licensing this code, discuss it with me.

SmtpDirect

Plugin for Windows. Can send e-mail directly to the recipient's smtp server, instead of (like eg 4D Internetcommands) sending them to your organization's or your ISP's smtp server, to be sent further from there. You become independent of access to an own smtp server, independent of its password protection, firewall configuration, or whatever. You will also know if the recipient's server got the mail or not. No "undeliverable" emails back. Multi-threaded, high capacity, would make a powerful spam machine for those interested in that.

This code is not our own, it is a 4D interface to a Delphi component. I can help you set up this for your own use but I'd probably want to charge for a few hours' work to make you a version an help you get going.