This assumes you have installed Apache, Witango Application Server, Witango Dev 
Server, FileMaker Pro and FileMaker Pro Server on the same Mac. You must also 
have placed the file 'fmjdbc.jar' in the folder /Library/Java/Extensions of the 
Mac.

Step 1 - Build a FileMaker database

Open FileMaker Pro (single user)
Create a new FileMaker file. Mine is called 'emails.fp7'.
Add a couple of fields to it. In this example I am using two text fields, 
'contactname' and 'contactemail'. No spaces.

I suspect the default table names might not be allowed by Witango so I select 
File:Manage:Database and rename the table to something descriptive (no spaces}. 
In this example I rename the default table 'emailstable'.

I now go to File:Manage:Security. Here I set up and Account named 'witango'  
with Password 'password' and assign it Full Access.

Then go to File:Sharing:FileMaker Network. Turn on sharing, select the 
'emails.fp7' db, select the 'Specify users by privilege set' radio button and 
click specify. A dialog box appears with a list of privilege sets. [Full 
access] includes the account 'witango'. Check this box.

Repeat the above for File:Sharing:ODBC/JDBC.

Now close the database file. You are now ready to upload the file to FileMaker 
Pro Server.

Step 2 - Upload the database to FileMaker Pro Server.

Copy the database file to the Mac running FileMaker Pro Server.

Open the admin app. This will have been created on your desktop during 
installation. It will be called 'FMS11-<name of server>.app'. On the left hand 
side should be a list containing Administration and Configuration and sub 
categories. The last option in Configuration is 'ODBC/JDBC'. Click this and 
ensure it is enabled.

Across the top of the window are 8 icons. The fifth icon looks like a FileMaker 
Pro file with an up arrow. This is the upload database icon. Click it.

The first dialog asks where you would like to place the database. Select 
'Default Folder' and click 'Add Database' on the right. Now locate the FMP file 
you copied over and click Select. You will see the same folder structure with 
your database under Default Folder and a tick next to it. Click Next. A dialog 
appears with 'Automatically open databases after upload' already checked. Click 
Next. you will see a progress bar as your database is uploaded. When it is done 
click Next. An then click Finish.

In Administration:Databases you will see your database hosted with a tick in 
the Pro column and the ODBC/JDBC column.

Step 3 - Configure jdbc.ini

On the Mac running the web server and Witango Application Server you need to 
edit the following file:
/Applications/Witango Application Server 6/Configuration/jdbc.ini.

Replace the contents with these:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE JDBCINI SYSTEM "jdbcini.dtd">
<JDBCINI Version="0x00010000">
        <DataSources>
                <DataSource ID="emails">
                        <DSN>emails</DSN>
                        <DriverClass>com.filemaker.jdbc.Driver</DriverClass>
                        <URL>jdbc:filemaker://127.0.0.1/emails.fp7</URL>
                        <Properties>
                                <Property ID="">
                                        <Name></Name>
                                        <Value></Value>
                                </Property>
                        </Properties>
                </DataSource>
        </DataSources>
</JDBCINI>




The first important lines are these:
                <DataSource ID="emails">
                        <DSN>emails</DSN>

Both lines contain the name of the datasource. This is the filename without the 
‘.fp7’ extension.

The driver class for file maker is:
<DriverClass>com.filemaker.jdbc.Driver</DriverClass>

Notice the following line:
<URL>jdbc:filemaker://127.0.0.1/emails.fp7</URL>

The IP address is the IP address of the host server. 127.0.0.1 means 'this 
host'. This can be as above, the actual IP address of the server, or a domain 
name that resolves to the server:

127.0.0.1
a.b.c.d  <actual IP address
my.server.com <domain name that resolves to server’s IP

Save and close.

You will now need to restart Witango. Open Terminal 
(/Applications/Utilities/Terminal.app) and enter the following:

sudo launchctl unload /Library/LaunchDaemons/witango.plist

and press return. It will ask you for the administrators password. Once entered 
it will think for quite a long while then return you the terminal prompt. That 
quits witango.

Now type:

sudo launchctl load /Library/LaunchDaemons/witango.plist

and return. That restarts witango.

Theoretically Witango is all set up to talk to your database.

Step 4 - Configure Dev Studio

Launch Witango Development Studio.

The first thing to do is to configure the JDBC drivers. Go to Data Sources:JDBC 
Drivers. A dialog will come up listing four driver types. We are only 
interested in the last one, FileMaker v11.3. On the right hand side click the 
corresponding Browse button and locate the jdbc.jar file you copied during 
installation. It should be in sudo launchctl unload 
/Library/Java/Extensions/fmjdbc.jar. Select it and click Open. Close the dialog 
box.

Step 5 - Load the datasource

In the Dev Studio window, running up the left hand side are four buttons. Click 
on Database. You will see two options: JDBC and ODBC. Right click on JDBC and 
select New Datasource from the menu. A dialog appears.

In the first cell enter a suitable name. I used 'emailsDSN'.
The next cell is a drop down with only one options. Select 'FileMaker v11.3'.
Next is URL. Enter 'jdbc:filemaker://127.0.0.1/emails.fp7' without the quotes. 
Once again, the IP address is the IP address of the server.
Careful not to TAB to Properties. The software will hang and you will have to 
force quit and start again.
Ignore the Properties.
In the Username field enter 'witango'. No quotes.
In Password enter 'password'. No quotes.

The check box for 'Ask each time' becomes active. Uncheck this.

Click 'OK'.

A new item should appear below JDBC called 'emails'. Double click on it. It 
might ask you to enter the Username and Password.

A dialog should appear asking which table from the database should be used. 
Under the list of available table should only be one: emailstable. Click on 
this and then click the 'To >>' button. It will be moved across to the 'Tables 
to Use:' column. Click 'OK'.

A new item should appear below the datasource 'emailsDSN'. It should be a table 
called 'emailstable'. Next to it is an arrow. If you click the arrow it expands 
and shows the fields in the table emails. These should be ROWID (the index 
field) and the two fields you defined so many steps ago; contactname and 
contactemail.

You are no ready to start coding!

Step 6 - Creating a TAF.

Select File:New:New Application File.
Drag the New Record Builder from the Actions Palette.
Drag the fields: contactname and contactemail across.
Click the Build Actions button.
Save the file to your webserver.

Step 7 - Try it out

Open a web browser and enter the address of your TAF in the address bar. Press 
return,
You see a form with two fields; contactname and contactemail. Put a name in the 
first field and an email in the second one. Press return.

With any luck you will get a message stating the Record Added and a new record 
will appear in your database.

----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe witango-talk" in the body.

Reply via email to