Export_CSV not enabled

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

Export_CSV not enabled

Postby rhc » Sun May 22, 2011 12:11 pm

running 1.3rc3 What do I have to do to enable Export CSV on either the List or Edit tabs. I have yet to see it show up on the forms with or without using permissions. I can see export_xml and rss not to mention turn them on and off using permission overrides in the app permission.ini file. I do not have any kind of other override for export_csv in either an app action.ini or permissions.ini file. I have not messed with the default versions of these ini files. I have tried export_csv=1 explicitly in my app permissions.ini file. Nothing has worked. Help!
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm

Re: Export_CSV not enabled

Postby shannah » Tue May 24, 2011 11:24 am

The export XML and export RSS buttons in the view tab are actually different than the corresponding actions in list view. They return XML representations and RSS feeds for the single record only. In list view they produce feeds for the found set. The export CSV action is really only appropriate for found sets (i.e. list view).

However if you wanted to add CSV export to the view tab, you could do so by extending the export_csv action and setting the category to record_actions:

e.g. In your actions.ini file:
Code: Select all
[export_csv_viewtab > export_csv]
    category=record_actions


Don't really recommend this change though as it may be confusing to users getting a whole list export from a single record view.

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

Re: Export_CSV not enabled

Postby rhc » Thu May 26, 2011 1:07 pm

thanks for your response but the problem is im not seeing csv export option on the listview. Maybe im looking in the wrong place? Where should it show up?
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm

Re: Export_CSV not enabled

Postby shannah » Thu May 26, 2011 1:46 pm

Strange.

What version of Xataface are you using?
Any custom permissions?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Export_CSV not enabled

Postby rhc » Fri May 27, 2011 5:42 am

1.3rc3
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm

Re: Export_CSV not enabled

Postby shannah » Fri May 27, 2011 6:50 am

Any custom permissions?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Export_CSV not enabled

Postby rhc » Fri May 27, 2011 8:00 am

here is the app specific permissions.ini file I created. But I wasnt seeing it before I used these.

[GUEST]
view=1
list=1
select_rows=1
show all=1
find=1
export_csv=1
navigate=1
find_list=1
import=0


[EDITOR extends GUEST]
edit=1
new=1
post=1
copy=1


[MGR extends EDITOR]
delete found = 1
delete selected = 1
delete = 1
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm

Re: Export_CSV not enabled

Postby shannah » Fri May 27, 2011 8:19 am

How about your getPermissions() methods in your delegate classes?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Export_CSV not enabled

Postby rhc » Sat May 28, 2011 12:14 pm

I havent set those up or touched the existing ones (assuming there are defaults). Do I need to? Dont know anything about this? The permissions seem to be working as I expect them to.
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm

Re: Export_CSV not enabled

Postby shannah » Sat May 28, 2011 12:50 pm

Without delegate classes how did you assign your custom roles to your users?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Export_CSV not enabled

Postby rhc » Sat May 28, 2011 1:27 pm

i just have the override permissions.ini file in the home directory of my app. I have this in my application override conf.ini
[_auth]
users_table = Users
username_column = UserName
password_column = Password


The UserNames in the User table correspond to the permission roles I have set up. Seems to work.

Here is what is in the application /conf/ApplicationDelegate.php

/**
* A delegate class for the entire application to handle custom handling of
* some functions such as permissions and preferences.
*/
class conf_ApplicationDelegate {
/**
* Returns permissions array. This method is called every time an action is
* performed to make sure that the user has permission to perform the action.
* @param record A Dataface_Record object (may be null) against which we check
* permissions.
* @see Dataface_PermissionsTool
* @see Dataface_AuthenticationTool
*/
function getPermissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
// if the user is null then nobody is logged in... no access.
// This will force a login prompt.
$role = $user->val('Role');
return Dataface_PermissionsTool::getRolePermissions($role);
// Returns all of the permissions for the user's current role.
}
}
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm

Re: Export_CSV not enabled

Postby shannah » Sat May 28, 2011 1:44 pm

With just this setup, export csv should show up.

One note is that you should probably override the permissions in a delegate class for your users table, otherwise the users with edit permission can change their own role to anything they want.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Export_CSV not enabled

Postby rhc » Sun May 29, 2011 10:04 am

I will override permissions in the database class. Any other ideas as to why I might not be seeing csv export? Can I email you a screenshot of what I do see?
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 29 guests

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