Global configuration parameters

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

Global configuration parameters

Postby hhkilis » Mon May 07, 2012 2:25 am

Hi,

How to make a configuration variable global?

For example, I want to make number of related records to be shown in the view tab of a record 10. I can do this by adding the line below into related relationships.ini file.

Code: Select all
[relationX]
section:limit=10


How can this setting be enabled for all relations?
hhkilis
 
Posts: 15
Joined: Mon Feb 27, 2012 5:49 am

Re: Global configuration parameters

Postby shannah » Mon May 07, 2012 12:06 pm

Right now there is no perfect solution. This setting's default is hardcoded (this should be changed) inside the Dataface/RecordView.php file.
You can add a global relationships.ini file that can be used to inherit directives from - but it isn't ideal.

It works as follows:

1. Create a relationships.ini file in the root directory or your app.
2. Add a base relationship configuration:

Code: Select all
[default_rel]
    section:limit=10
    action:condition="false"  ;;   Need to hide this relationship.
    visibility:find="hidden"   ;;  Need to hide this relationship from find form.
    __sql__ = "select * from dashboard" ;;  A dummy query that must be valid


Then in your table's relationships.ini file you could extend this relationship as follows:

Code: Select all
[my_relationship extends default_rel]
    __sql__ = "select .... etc...."
    action:condition="true"
    visibility:find="visible"


This "extends" functionality was originally developed for, and is most useful in actions but it works for any type of INI file since they all use the same config tool. In this case it isn't helpful because it doesn't have a notion of an "abstract" relationship so we need to expend some directives to hide the base relationship from the find form etc..., then make each relationship that extends it visible. Only if there are lots of directives that you can reuse, is this tremendously helpful.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Global configuration parameters

Postby hhkilis » Tue May 08, 2012 3:48 am

Thanks Steve
hhkilis
 
Posts: 15
Joined: Mon Feb 27, 2012 5:49 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 10 guests

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