Page 1 of 3

PostPosted: Fri Sep 15, 2006 11:20 am
by compudude86
ok, i need help here, i want my dataface to work like an online mysql query browser of sorts, i want the entire base to be displayed, not just one line a page. how do i do this, or is there a tutorial that would point me in the right direction, ive already done the "create your first application" so thats where im at.

PostPosted: Fri Sep 15, 2006 12:41 pm
by shannah
Hi Joe,

I'm glad to help.. i'm not sure I fully understand the request yet though. Is it that you want to display all of the records in the table as a list? How would this be different than the "list" tab view?

Best regards

Steve

PostPosted: Sat Sep 16, 2006 4:00 pm
by compudude86
hi steve,
ok, right now, its displaying just a single line from my table until i hit "next", then it displays the next item on my table, i want it in a list format, but im not sure how to program my app to do this. thanks

PostPosted: Sat Sep 16, 2006 4:11 pm
by Aoirthoir
Can you post your table structure here? (In mysql type show create table tablename;)

I had this problem when I tried running dataface at first. It turned out I did not have a Primary Key field. Do you have a primary key field? Usually you want it to be autoincrement. I use the following code to add an auto increment to a table that does not have one...you may have to change it to suit your needs. For instance if you have more than about 16 million records in any table that you are trying to add this to, you need to change mediumint in the code below to int (4 billion records) or bigint (9 quintillion records). Usually mediumint is enough though.

Here is the code:
ALTER TABLE `TABLENAME` ADD `ID` MEDIUMINT( 8 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;

Don't know if dataface still requires something like this though. I think mysql technically does, though you can add tables and records without it anyhow.

PostPosted: Sat Sep 16, 2006 10:31 pm
by shannah
Is this in the "list" tab that you are seeing this. You are describing what sounds like the "Details" tab. Correct me if I'm wrong.

Certainly Dataface supports both list and details view, so I'm not sure I fully understand the situation.


-STeve

PostPosted: Mon Sep 18, 2006 6:47 am
by compudude86
yep, it was because there was no primary key, it all works now, but how would i hide this key from view?

PostPosted: Mon Sep 18, 2006 7:24 am
by compudude86
also, my dataface is showing up as text only, its not showing any of the tabs or styles or anything...any possibility as to what is wrong?

PostPosted: Mon Sep 18, 2006 7:50 am
by Aoirthoir
For the first request, two things you have to do to hide a field

In your apps directory add a directory called tables then add a directory for each tablename like so:

myapp/tables/TableName
myapp/tables/OtherTableName

If you are running your app in windows the capitalization does not matter. But in OSX and Linux it will matter. So if your table name has caps in MySQL make sure they are the same in the folders. Even in windows I do this, just in case I move the structure to a Linux system.

Then in each table directory create a file called fields.ini. In fields ini to hide your ID field do this:

[ID]
widget:type = hidden
visibility:list = hidden

This must be done for each table you have. We've discussed a global fields.ini in the past. Hopefully it can be implemented soon. Then you would only need it in your apps folder.

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

Next the issue with it showing up as text and no tabs or styles is a CSS issue. Make sure that your index.php has the following code:

require_once '/FILESYSTEM_path_to_dataface/dataface/dataface-public-api.php';

ON WINDOWS THIS MIGHT LOOK LIKE 'C:\Program Files\XAMPP\htdocs\dataface.0.6.3r2\dataface-public-api.php';

ON LINUX THIS MIGHT LOOK LIKE '/home/yourusername/somedirectory/dataface.0.6.3r2/dataface-public-api.php';
// include the initialization file

df_init(__FILE__, 'DOMAIN/dataface/');
// initialize the site

This might be as simple as 'somedomain/dataface.0.6.3r2/');

or even better if dataface is stored directly in a folder on root in your server '/dataface/');

or lets say you store all your libraries in a lib folder then it would be '/lib/dataface/')

The key here is to understand that you want to give a RELATIVE path if at all possible to dataface. This is relative from your apps URL. Thus if your app is www.mygreatdatafaceapp.com/rolodex/ then the dataface might be www.mygreatdatafaceapp.com/dataface/ or just /dataface/ or something similar. Whatever the name of your dataface folder is.

However, let us say you were storing your dataface on another domain such as www.mygreatlibraries.com... And your app was still on www.mygreatdatafaceapp.com. Well you could still access dataface from 'www.mygreatlibraries.com/dataface/'); but some parts of it like the FCKeditor and CSS would probably be broken.

So try that first..make sure your dataface app and your dataface directory are on the same domain. Then make sure you point to it that way...and lastly make sure that you give the exact SYSTEM folder to dataface.

Hope that helps

PostPosted: Mon Sep 18, 2006 7:58 am
by compudude86
ok, to the file paths, my web is set up like this


/www/
|
|---dataface
|
|
|----book
|
|-index.php

so how would my path go?

PostPosted: Mon Sep 18, 2006 8:05 am
by compudude86
i shouldve mentioned thats (filesystem root)/var/www

PostPosted: Mon Sep 18, 2006 9:06 am
by Aoirthoir
Ok this is probably what you need:

require_once '(filesystem root)/var/www/dataface/dataface-public-api.php';
// include the initialization file
df_init(__FILE__, '/dataface');
// initialize the site

Which would become I believe:
require_once '/var/www/dataface/dataface-public-api.php';
// include the initialization file
df_init(__FILE__, '/dataface');
// initialize the site

Now the df_init line I am mostly sure on....but not 100% sure. I am making the assumption here that /var/www is your web server root...where documents are served from. If that is indeed the case it should probably be listed as above. Then you do not have to worry about pointing to the actual domain of dataface. Give that a try and let us know.

PostPosted: Mon Sep 18, 2006 9:16 am
by shannah
Just want to emphasize that the only line that will need to be changed to solve this problem is the df_init() line. If you change your df_init() call to look like Joseph's example above, it shoud pick up the stylesheet.

-Steve

PostPosted: Mon Sep 18, 2006 9:19 am
by Aoirthoir
That's right. I should have realized if dataface was running, then the first line didnt need to be changed. Sorry bro.

PostPosted: Mon Sep 18, 2006 10:03 am
by compudude86
ah, got it!!! thanks for your help, and trust me, youll be seeing a lot more of me around here!! :)

PostPosted: Mon Sep 18, 2006 10:14 am
by Aoirthoir
Oh no! not another joe:)

Look forward to it bro. Glad we could help.