commit/galaxy-central: smcmanus: WIP: /api/folders/{folder_id}. The url_for call needs to be fixed.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/7bd38888e04b/ changeset: 7bd38888e04b user: smcmanus date: 2012-10-16 05:48:30 summary: WIP: /api/folders/{folder_id}. The url_for call needs to be fixed. affected #: 2 files diff -r fc394a686d61920b17db1226b7c702612e747015 -r 7bd38888e04befd09bde273bc4fc11921483b941 lib/galaxy/webapps/galaxy/api/library_contents.py --- a/lib/galaxy/webapps/galaxy/api/library_contents.py +++ b/lib/galaxy/webapps/galaxy/api/library_contents.py @@ -36,6 +36,9 @@ if not admin: can_access = trans.app.security_agent.can_access_dataset( current_user_roles, ld.library_dataset_dataset_association.dataset ) if (admin or can_access) and not ld.deleted: + log.debug( "type(folder): %s" % type( folder ) ) + log.debug( "type(api_path): %s; folder.api_path: %s" % ( type(folder.api_path), folder.api_path ) ) + #log.debug( "attributes of folder: %s" % str(dir(folder)) ) ld.api_path = folder.api_path + '/' + ld.name ld.api_type = 'file' rval.append( ld ) @@ -52,11 +55,13 @@ if not library or not ( trans.user_is_admin() or trans.app.security_agent.can_access_library( current_user_roles, library ) ): trans.response.status = 400 return "Invalid library id ( %s ) specified." % str( library_id ) + log.debug( "Root folder type: %s" % type( library.root_folder ) ) encoded_id = 'F' + trans.security.encode_id( library.root_folder.id ) rval.append( dict( id = encoded_id, type = 'folder', name = '/', url = url_for( 'library_content', library_id=library_id, id=encoded_id ) ) ) + log.debug( "Root folder attributes: %s" % str(dir(library.root_folder)) ) library.root_folder.api_path = '' for content in traverse( library.root_folder ): encoded_id = trans.security.encode_id( content.id ) diff -r fc394a686d61920b17db1226b7c702612e747015 -r 7bd38888e04befd09bde273bc4fc11921483b941 lib/galaxy/webapps/galaxy/buildapp.py --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -63,7 +63,12 @@ # The /folders section is experimental at this point: log.debug( "app.config.api_folders: %s" % app.config.api_folders ) if app.config.api_folders: - webapp.api_mapper.resource( 'folder', 'folders', path_prefix='/api' ) + #webapp.api_mapper.resource( 'folder', 'folders', path_prefix='/api' ) + webapp.api_mapper.resource( 'content', 'contents', + controller='folder_contents', + name_prefix='folder_', + path_prefix='/api/folders/:folder_id', + parent_resources=dict( member_name='folder', collection_name='folders' ) ) webapp.api_mapper.resource( 'content', 'contents', controller='library_contents', @@ -79,7 +84,7 @@ webapp.api_mapper.resource( 'permission', 'permissions', path_prefix='/api/libraries/:library_id', - parent_resources=dict( member_name='library', collection_name='libraries' ) ) + parent_resources=dict( member_name='library', collection_name='libraries' ) ) webapp.api_mapper.resource( 'user', 'users', controller='group_users', Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket