I've created the widgets, now where are they?

A place for users and developers of the Xataface to discuss and receive support.

I've created the widgets, now where are they?

Postby Monty51 » Fri Nov 02, 2012 6:19 am

Following the tutorial, I've created a couple of select widgets based on an SQL query and placed them in the appropriate table directory.

They don't show up when I point my bowser to the site. Everything else shows up as it should, but not the widget. What am I missing?

Thanks
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: I've created the widgets, now where are they?

Postby shannah » Fri Nov 02, 2012 3:41 pm

Check to make sure that your fields.ini file is being picked up at all. Try making other settings in there to confirm that they are picked up. If they are not picked up at all, then either your fields.ini file name named incorrectly, or your table directory is named incorrectly. Remember case sensitive.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: I've created the widgets, now where are they?

Postby Monty51 » Mon Nov 05, 2012 8:24 am

I don't know how to check and make sure that my fields.ini file is begin picked up. Is there a log file somewhere that would tell me that? The http log files don't show any anomolies.

I see all the associated MySQL tables have an associated directory withing the 'tables' directory of my website, and within the tables/main directory, here are the contents of my fields.ini and valuelists.ini files:

fields.ini:
[JVMs]
widget:label = "JVM Name"
widget:type = select
vocabulary = JVM_Name

[Servers]
widget:label = "Server Name"
widget:type = select
vocabulary = Server_Name

valuelists.ini:
[JVM_Name]
__sql__ = "SELECT jvm FROM main ORDER BY jvm"

[Server_Name]
__sql__ = "SELECT admin_server FROM main ORDER BY admin_server"

The files are readable by everyone. I hope that's enough permissions.

If there was any other prep work I needed to do to get these widgets to show up, I missed it. Also, where would I expect them (the widgest) to be: on the 'details', 'list', or 'find' tabs of my 'main' database view. I'd like them to show up on the 'find' tabs, if possible.

Seems like a nice product, Xataface, but a comprehensive book on how to use it would be nice. Is it really necessary to have a high level of web programming skills to use this product?

Thanks
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: I've created the widgets, now where are they?

Postby shannah » Mon Nov 05, 2012 9:04 am

Generally I try making a simple change to one of the fields, e.g. set widget:label="Foo", and see if it gets picked up. If not, then it's not picking up your fields.ini at all.

Most likely problem is that your table directory is misnamed. Remember it is case sensitive. If your table is called "People", and you place your fields.ini file in tables/people/fields.ini , it won't get picked up. (correct would be tables/People/fields.ini).
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: I've created the widgets, now where are they?

Postby Monty51 » Mon Nov 05, 2012 9:26 am

Everything in the database is named lower case, specifically for the intent of avoid case sensitivity issues. Here's my conf.ini file:

[_database]
host = "localhost"
user = "************"
password = "***************"
name = "tier3"

[_tables]
main = "main"
resolutions = "resolutions"

[_disallowed_tables]
instances = instances
states = states
jvms = jvms
hosts = hosts

There doesn't seem to be any problem picking up the database and displaying the information.

Again, is there a log file that would tell me where or when the fields.ini and valuelists.ini files are accessed, and possbily what's wrong with them?
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: I've created the widgets, now where are they?

Postby Monty51 » Mon Nov 05, 2012 9:41 am

Additionally, here are the contents of the 'tables' directory:

./ dataface__users/ instances/ main/ states/
../ hosts/ jvms/ resolutions/

...and also here's the output from MySQL 'show tables' for the tier3 database:

mysql> show tables;
+-------------------------+
| Tables_in_tier3 |
+-------------------------+
| dataface__failed_logins |
| dataface__mtimes |
| dataface__preferences |
| dataface__users |
| dataface__version |
| hosts |
| instances |
| jvms |
| main |
| resolutions |
| states |
+-------------------------+
11 rows in set (0.00 sec)

mysql> exit
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: I've created the widgets, now where are they?

Postby shannah » Mon Nov 05, 2012 9:42 am

The PHP error log will report if there is a problem with the fields.ini file. But if it is mis-named, it won't report it because it will just assume you don't have one.

What does your fields.ini file look like and what is the path to it?
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: I've created the widgets, now where are they?

Postby shannah » Mon Nov 05, 2012 9:50 am

All that looks good so far. One thing I don't see yet, is the column listing in the main table. Is the column named "JVMs" or is it all lower case?
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: I've created the widgets, now where are they?

Postby Monty51 » Mon Nov 05, 2012 10:09 am

/var/www/html/tier3db/tables/main/fields.ini contains the following information:

fields.ini:
[JVMs]
widget:label = "JVM Name"
widget:type = select
vocabulary = JVM_Name

The php error_logs show no errors.
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: I've created the widgets, now where are they?

Postby shannah » Mon Nov 05, 2012 10:22 am

What are the actual column definitions of the main table in the DB?
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: I've created the widgets, now where are they?

Postby Monty51 » Mon Nov 05, 2012 10:48 am

mysql> describe main;
+--------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| jvm | varchar(255) | NO | PRI | | |
| admin_server | varchar(25) | NO | PRI | | |
| app_server | varchar(25) | YES | | NULL | |
| res_id | int(11) | YES | | NULL | |
+--------------+--------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: I've created the widgets, now where are they?

Postby shannah » Mon Nov 05, 2012 10:54 am

There's the problem. You're adding attributes in your fields.ini file to a field named "JVMs" that doesn't exist. Did you mean for this to be the "jvm" column?
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: I've created the widgets, now where are they?

Postby Monty51 » Mon Nov 05, 2012 11:22 am

Ok...now I get you. Somewhere I missed that in the documentation. With all the new info, that doesn't surprise me much.

So the head of each section, the name surrounded by [], should reflect the name of column in the table associated with the fields.ini file, and "vocabulary = " should name a section heading in the associated valuelists.ini

I'll make the corrections and try it out.
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: I've created the widgets, now where are they?

Postby Monty51 » Mon Nov 05, 2012 11:27 am

That did it. So they show up on the 'find' tab...makes sense to me.

Thank you for your help. I'll be pressing on with the documentation and, probably, have more question.
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 9 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved