galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/1a3bc21d3a8e
changeset: 3694:1a3bc21d3a8e
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Mon Apr 26 09:58:21 2010 -0400
description:
Add missing job_id substitutions to jobs/runners/pbs.py.
diffstat:
lib/galaxy/jobs/runners/pbs.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r df8fc06fdac9 -r 1a3bc21d3a8e lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py Sun Apr 25 16:18:15 2010 -0400
+++ b/lib/galaxy/jobs/runners/pbs.py Mon Apr 26 09:58:21 2010 -0400
@@ -378,7 +378,7 @@
try:
# recheck to make sure it wasn't a communication problem
self.check_single_job( pbs_server_name, job_id )
- log.warning( "(%s/%s) job was not in state check list, but was found with individual state check" )
+ log.warning( "(%s/%s) job was not in state check list, but was found with individual state check" % ( galaxy_job_id, job_id ) )
new_watched.append( pbs_job_state )
except:
errno, text = pbs.error()
1
0
10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/df8fc06fdac9
changeset: 3693:df8fc06fdac9
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Sun Apr 25 16:18:15 2010 -0400
description:
Fix multiple issues for history display. Fixes include: (a) empty annotations hidden; (b) text 'import XXX' added next to import icon; (c) fix dataset display links; (d) fix dataset view links; and (e) fix peek placement.
diffstat:
lib/galaxy/datatypes/interval.py | 2 +-
lib/galaxy/web/controllers/history.py | 2 --
templates/dataset/display.mako | 5 ++++-
templates/display_base.mako | 2 +-
templates/history/display.mako | 15 ++++++++++++---
templates/history/view.mako | 12 +-----------
templates/page/history_annotation_table.mako | 2 +-
templates/root/history.mako | 2 +-
templates/root/history_common.mako | 28 ++++++++++++++++++++++------
templates/workflow/display.mako | 7 ++++++-
10 files changed, 49 insertions(+), 28 deletions(-)
diffs (237 lines):
diff -r 7151ae06bf7a -r df8fc06fdac9 lib/galaxy/datatypes/interval.py
--- a/lib/galaxy/datatypes/interval.py Sat Apr 24 15:03:22 2010 -0400
+++ b/lib/galaxy/datatypes/interval.py Sun Apr 25 16:18:15 2010 -0400
@@ -235,7 +235,7 @@
# if our URL scheme is https. Making this work
# requires additional hackery in your upstream proxy.
# If UCSC ever supports https, remove this hack.
- internal_url = "%s" % url_for( controller='dataset', dataset_id=dataset.id, action='display_at', filename='ucsc_' + site_name )
+ internal_url = "%s" % url_for( controller='/dataset', dataset_id=dataset.id, action='display_at', filename='ucsc_' + site_name )
if base_url.startswith( 'https://' ):
base_url = base_url.replace( 'https', 'http', 1 )
display_url = urllib.quote_plus( "%s%s/display_as?id=%i&display_app=%s&authz_method=display_at" % (base_url, url_for( controller='root' ), dataset.id, type) )
diff -r 7151ae06bf7a -r df8fc06fdac9 lib/galaxy/web/controllers/history.py
--- a/lib/galaxy/web/controllers/history.py Sat Apr 24 15:03:22 2010 -0400
+++ b/lib/galaxy/web/controllers/history.py Sun Apr 25 16:18:15 2010 -0400
@@ -590,11 +590,9 @@
error( "Either you are not allowed to view this history or the owner of this history has not made it accessible." )
# View history.
datasets = self.get_history_datasets( trans, history_to_view )
- user_owns_history = ( trans.get_user() == history_to_view.user )
return trans.stream_template_mako( "history/view.mako",
history = history_to_view,
datasets = datasets,
- user_owns_history = user_owns_history,
show_deleted = False )
@web.expose
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/dataset/display.mako
--- a/templates/dataset/display.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/dataset/display.mako Sun Apr 25 16:18:15 2010 -0400
@@ -24,7 +24,10 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk tooltip" title="Save dataset"></a>
- <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}" class="icon-button import tooltip" title="Import dataset"></a>
+ <a
+ href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
+ class="icon-button import tooltip"
+ title="Import dataset"></a>
</%def>
<%def name="render_item( data, data_to_render )">
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/display_base.mako
--- a/templates/display_base.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/display_base.mako Sun Apr 25 16:18:15 2010 -0400
@@ -114,7 +114,7 @@
<%def name="render_item_header( item )">
<h3>Galaxy ${get_class_display_name( item.__class__ )} '${get_item_name( item )| h}'</h3>
- %if hasattr( item, "annotation"):
+ %if hasattr( item, "annotation") and item.annotation is not None:
<div class="annotation">Annotation: ${item.annotation}</div>
%endif
<hr/>
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/history/display.mako
--- a/templates/history/display.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/history/display.mako Sun Apr 25 16:18:15 2010 -0400
@@ -38,7 +38,12 @@
</%def>
<%def name="render_item_links( history )">
- <a href="${h.url_for( controller='/history', action='imp', id=trans.security.encode_id(history.id) )}" class="icon-button import tooltip" title="Import history"></a>
+ <a
+ href="${h.url_for( controller='/history', action='imp', id=trans.security.encode_id(history.id) )}"
+ class="icon-button import"
+ ## Needed to overwide initial width so that link is floated left appropriately.
+ style="width: 100%"
+ title="Import history">Import history</a>
</%def>
<%def name="render_item( history, datasets )">
@@ -60,10 +65,14 @@
%if data.visible:
<td>
<div class="historyItemContainer visible-right-border" id="historyItemContainer-${data.id}">
- ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, user_owns_dataset=user_owns_history )}
+ ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing=False )}
</div>
</td>
- <td class="annotation">${data.annotation}</td>
+ <td class="annotation">
+ %if hasattr( data, "annotation") and data.annotation is not None:
+ ${data.annotation}
+ %endif
+ </td>
%endif
</tr>
%endfor
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/history/view.mako
--- a/templates/history/view.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/history/view.mako Sun Apr 25 16:18:15 2010 -0400
@@ -64,11 +64,6 @@
</%def>
<%def name="center_panel()">
- ## For now, turn off inline editing so that view is external only.
- <%
- user_owns_history = False
- %>
-
## Get URL to other histories owned by user that owns this history.
<%
##TODO: is there a better way to create this URL? Can't use 'f-username' as a key b/c it's not a valid identifier.
@@ -84,9 +79,7 @@
<div style="overflow: auto; height: 100%;">
## Render view of history.
<div id="top-links" class="historyLinks" style="padding: 0px 0px 5px 0px">
- %if not user_owns_history:
<a href="${h.url_for( action='imp', id=trans.security.encode_id(history.id) )}">import and start using history</a> |
- %endif
<a href="${get_history_link( history )}">${_('refresh')}</a>
%if show_deleted:
| <a href="${h.url_for('history', show_deleted=False)}">${_('hide deleted')}</a>
@@ -95,9 +88,6 @@
</div>
<div id="history-name-area" class="historyLinks" style="color: gray; font-weight: bold; padding: 0px 0px 5px 0px">
- %if user_owns_history:
- <div style="float: right"><a id="history-rename" title="Rename" class="icon-button edit" target="galaxy_main" href="${h.url_for( controller='history', action='rename' )}"></a></div>
- %endif
<div id="history-name">${history.get_display_name()}</div>
</div>
@@ -118,7 +108,7 @@
%for data in datasets:
%if data.visible:
<div class="historyItemContainer visible-right-border" id="historyItemContainer-${data.id}">
- ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, user_owns_dataset=user_owns_history )}
+ ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing=False )}
</div>
%endif
%endfor
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/page/history_annotation_table.mako
--- a/templates/page/history_annotation_table.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/page/history_annotation_table.mako Sun Apr 25 16:18:15 2010 -0400
@@ -50,7 +50,7 @@
##<td valign="top" class="annotation">Describe this step: why was it done? what data does it produce?</td>
<td>
<div class="historyItemContainer" id="historyItemContainer-${data.id}">
- ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, user_owns_dataset = False )}
+ ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing = False )}
</div>
</td>
</tr>
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/root/history.mako
--- a/templates/root/history.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/root/history.mako Sun Apr 25 16:18:15 2010 -0400
@@ -387,7 +387,7 @@
%for data in reversed( datasets ):
%if data.visible:
<div class="historyItemContainer" id="historyItemContainer-${data.id}">
- ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, user_owns_dataset = True )}
+ ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing = True )}
</div>
%endif
%endfor
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/root/history_common.mako
--- a/templates/root/history_common.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/root/history_common.mako Sun Apr 25 16:18:15 2010 -0400
@@ -1,6 +1,6 @@
<% _=n_ %>
## Render the dataset `data` as history item, using `hid` as the displayed id
-<%def name="render_dataset( data, hid, show_deleted_on_refresh = False, user_owns_dataset = True )">
+<%def name="render_dataset( data, hid, show_deleted_on_refresh = False, for_editing = True )">
<a name="${trans.security.encode_id( data.id )}"></a>
<%
if data.state in ['no state','',None]:
@@ -29,16 +29,28 @@
## links should be enough. However the number of datasets being uploaded
## at a time is usually small so the impact of these images is also small.
<img src="${h.url_for('/static/images/eye_icon_grey.png')}" width='16' height='16' alt='display data' title='display data' class='button display' border='0'>
- %if user_owns_dataset:
+ %if for_editing:
<img src="${h.url_for('/static/images/pencil_icon_grey.png')}" width='16' height='16' alt='edit attributes' title='edit attributes' class='button edit' border='0'>
%endif
%else:
- <a class="icon-button display tooltip" title="Display data in browser" href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), preview=True, filename='' )}" target="galaxy_main"></a>
- %if user_owns_dataset:
+ <%
+ dataset_id = trans.security.encode_id( data.id )
+ if for_editing:
+ display_url = h.url_for( controller='dataset', action='display', dataset_id=dataset_id, preview=True, filename='' )
+ else:
+ display_url = h.url_for( controller='dataset', action='display_by_username_and_slug',
+ username=data.history.user.username, slug=dataset_id )
+ %>
+ <a class="icon-button display tooltip" title="Display data in browser" href="${display_url}"
+ %if for_editing:
+ target="galaxy_main"
+ %endif
+ ></a>
+ %if for_editing:
<a class="icon-button edit tooltip" title="Edit attributes" href="${h.url_for( controller='root', action='edit', id=data.id )}" target="galaxy_main"></a>
%endif
%endif
- %if user_owns_dataset:
+ %if for_editing:
<a class="icon-button delete tooltip" title="Delete" href="${h.url_for( action='delete', id=data.id, show_deleted_on_refresh=show_deleted_on_refresh )}" id="historyItemDeleter-${data.id}"></a>
%endif
</div>
@@ -89,7 +101,7 @@
<% dataset_id=trans.security.encode_id( data.id ) %>
%if data.has_data:
<a href="${h.url_for( controller='dataset', action='display', dataset_id=dataset_id, to_ext=data.ext )}" title="Save" class="icon-button disk tooltip"></a>
- %if user_owns_dataset:
+ %if for_editing:
<a href="${h.url_for( controller='tool_runner', action='rerun', id=data.id )}" target="galaxy_main" title="Run this job again" class="icon-button arrow-circle tooltip"></a>
%if app.config.get_bool( 'enable_tracks', False ) and data.ext in app.datatypes_registry.get_available_tracks():
<a class="icon-button vis-chart tooltip trackster" title="Visualize in Trackster" id="visualize_${hid}"></a>
@@ -110,6 +122,10 @@
</div>
%endif
+ %else:
+ ## When displaying datasets for viewing, this is often needed to prevent peek from overlapping
+ ## icons.
+ <div style="clear: both"></div>
%endif
%if data.peek != "no peek":
<div><pre id="peek${data.id}" class="peek">${_(data.display_peek())}</pre></div>
diff -r 7151ae06bf7a -r df8fc06fdac9 templates/workflow/display.mako
--- a/templates/workflow/display.mako Sat Apr 24 15:03:22 2010 -0400
+++ b/templates/workflow/display.mako Sun Apr 25 16:18:15 2010 -0400
@@ -71,7 +71,12 @@
<%def name="render_item_links( workflow )">
- <a href="${h.url_for( controller='/workflow', action='imp', id=trans.security.encode_id(workflow.id) )}" class="icon-button import tooltip" title="Import workflow"></a>
+ <a
+ href="${h.url_for( controller='/workflow', action='imp', id=trans.security.encode_id(workflow.id) )}"
+ class="icon-button import"
+ ## Needed to overwide initial width so that link is floated left appropriately.
+ style="width: 100%"
+ title="Import workflow">Import workflow</a>
</%def>
<%def name="render_item( workflow, steps )">
1
0
10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/7151ae06bf7a
changeset: 3692:7151ae06bf7a
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Sat Apr 24 15:03:22 2010 -0400
description:
Better labels for rna-seq tools' output datasets.
diffstat:
tools/ngs_rna/cuffcompare_wrapper.py | 4 +++-
tools/ngs_rna/cuffcompare_wrapper.xml | 6 +++---
tools/ngs_rna/cuffdiff_wrapper.py | 4 +++-
tools/ngs_rna/cuffdiff_wrapper.xml | 22 +++++++++++-----------
tools/ngs_rna/cufflinks_wrapper.py | 4 +++-
tools/ngs_rna/cufflinks_wrapper.xml | 6 +++---
tools/ngs_rna/tophat_wrapper.xml | 6 +++---
7 files changed, 29 insertions(+), 23 deletions(-)
diffs (130 lines):
diff -r 0dd1676e5b6f -r 7151ae06bf7a tools/ngs_rna/cuffcompare_wrapper.py
--- a/tools/ngs_rna/cuffcompare_wrapper.py Fri Apr 23 17:04:39 2010 -0400
+++ b/tools/ngs_rna/cuffcompare_wrapper.py Sat Apr 24 15:03:22 2010 -0400
@@ -33,11 +33,13 @@
if options.ignore_nonoverlap:
cmd += " -R "
+ # Output/debugging.
+ print cmd
+
# Add input files.
if type(args) is list:
args = " ".join(args)
cmd += " " + args
- print cmd
# Run command.
try:
diff -r 0dd1676e5b6f -r 7151ae06bf7a tools/ngs_rna/cuffcompare_wrapper.xml
--- a/tools/ngs_rna/cuffcompare_wrapper.xml Fri Apr 23 17:04:39 2010 -0400
+++ b/tools/ngs_rna/cuffcompare_wrapper.xml Sat Apr 24 15:03:22 2010 -0400
@@ -32,9 +32,9 @@
</inputs>
<outputs>
- <data format="gtf" name="transcripts_combined" label="Cuffcompare on data ${input1.hid} and data ${input2.hid}: combined transcripts"/>
- <data format="tracking" name="transcripts_tracking" label="Cuffcompare on data ${input1.hid} and data ${input2.hid}: transcript tracking"/>
- <data format="gtf" name="transcripts_accuracy" label="Cuffcompare on data ${input1.hid} and data ${input2.hid}: transcript accuracy"/>
+ <data format="gtf" name="transcripts_combined" label="${tool.name} on ${on_string}: combined transcripts"/>
+ <data format="tracking" name="transcripts_tracking" label="${tool.name} on ${on_string}: transcript tracking"/>
+ <data format="gtf" name="transcripts_accuracy" label="${tool.name} on ${on_string}: transcript accuracy"/>
</outputs>
<tests>
diff -r 0dd1676e5b6f -r 7151ae06bf7a tools/ngs_rna/cuffdiff_wrapper.py
--- a/tools/ngs_rna/cuffdiff_wrapper.py Fri Apr 23 17:04:39 2010 -0400
+++ b/tools/ngs_rna/cuffdiff_wrapper.py Sat Apr 24 15:03:22 2010 -0400
@@ -69,9 +69,11 @@
if options.max_mle_iterations:
cmd += ( " --max-mle-iterations %i" % int ( options.max_mle_iterations ) )
+ # Output/debugging.
+ print cmd
+
# Add inputs.
cmd += " " + options.inputA + " " + options.input1 + " " + options.input2
- print cmd
# Run command.
try:
diff -r 0dd1676e5b6f -r 7151ae06bf7a tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml Fri Apr 23 17:04:39 2010 -0400
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml Sat Apr 24 15:03:22 2010 -0400
@@ -44,17 +44,17 @@
</inputs>
<outputs>
- <data format="tabular" name="isoforms_exp" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: isoform expression"/>
- <data format="tabular" name="genes_exp" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: gene expression"/>
- <data format="tabular" name="tss_groups_exp" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: TSS groups expression"/>
- <data format="tabular" name="cds_exp_fpkm_tracking" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: CDS Expression FPKM Tracking"/>
- <data format="tabular" name="splicing_diff" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: splicing diff"/>
- <data format="tabular" name="cds_diff" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: CDS diff"/>
- <data format="tabular" name="promoters_diff" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: promoters diff"/>
- <data format="tabular" name="tss_groups_fpkm_tracking" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: TSS groups FPKM tracking" />
- <data format="tabular" name="cds_fpkm_tracking" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: CDS FPKM tracking"/>
- <data format="tabular" name="genes_fpkm_tracking" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: gene FPKM tracking"/>
- <data format="tabular" name="isoforms_fpkm_tracking" label="Cuffdiff on data ${gtf_input.hid}, data ${aligned_reads1.hid}, and data ${aligned_reads2.hid}: isoform FPKM tracking"/>
+ <data format="tabular" name="isoforms_exp" label="${tool.name} on ${on_string}: isoform expression"/>
+ <data format="tabular" name="genes_exp" label="${tool.name} on ${on_string}: gene expression"/>
+ <data format="tabular" name="tss_groups_exp" label="${tool.name} on ${on_string}: TSS groups expression"/>
+ <data format="tabular" name="cds_exp_fpkm_tracking" label="${tool.name} on ${on_string}: CDS Expression FPKM Tracking"/>
+ <data format="tabular" name="splicing_diff" label="${tool.name} on ${on_string}: splicing diff"/>
+ <data format="tabular" name="cds_diff" label="${tool.name} on ${on_string}: CDS diff"/>
+ <data format="tabular" name="promoters_diff" label="${tool.name} on ${on_string}: promoters diff"/>
+ <data format="tabular" name="tss_groups_fpkm_tracking" label="${tool.name} on ${on_string}: TSS groups FPKM tracking" />
+ <data format="tabular" name="cds_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM tracking"/>
+ <data format="tabular" name="genes_fpkm_tracking" label="${tool.name} on ${on_string}: gene FPKM tracking"/>
+ <data format="tabular" name="isoforms_fpkm_tracking" label="${tool.name} on ${on_string}: isoform FPKM tracking"/>
</outputs>
<tests>
diff -r 0dd1676e5b6f -r 7151ae06bf7a tools/ngs_rna/cufflinks_wrapper.py
--- a/tools/ngs_rna/cufflinks_wrapper.py Fri Apr 23 17:04:39 2010 -0400
+++ b/tools/ngs_rna/cufflinks_wrapper.py Sat Apr 24 15:03:22 2010 -0400
@@ -62,9 +62,11 @@
if options.max_mle_iterations:
cmd += ( " --max-mle-iterations %i" % int ( options.max_mle_iterations ) )
+ # Output/debugging.
+ print cmd
+
# Add input files.
cmd += " " + options.input
- print cmd
# Run command.
try:
diff -r 0dd1676e5b6f -r 7151ae06bf7a tools/ngs_rna/cufflinks_wrapper.xml
--- a/tools/ngs_rna/cufflinks_wrapper.xml Fri Apr 23 17:04:39 2010 -0400
+++ b/tools/ngs_rna/cufflinks_wrapper.xml Sat Apr 24 15:03:22 2010 -0400
@@ -50,9 +50,9 @@
</inputs>
<outputs>
- <data format="expr" name="genes_expression" label="Cufflinks on data ${input.hid}: gene expression"/>
- <data format="expr" name="transcripts_expression" label="Cufflinks on data ${input.hid}: transcript expression"/>
- <data format="gtf" name="assembled_isoforms" label="Cufflinks on data ${input.hid}: assembled transcripts"/>
+ <data format="expr" name="genes_expression" label="${tool.name} on ${on_string}: gene expression"/>
+ <data format="expr" name="transcripts_expression" label="${tool.name} on ${on_string}: transcript expression"/>
+ <data format="gtf" name="assembled_isoforms" label="${tool.name} on ${on_string}: assembled transcripts"/>
</outputs>
<tests>
diff -r 0dd1676e5b6f -r 7151ae06bf7a tools/ngs_rna/tophat_wrapper.xml
--- a/tools/ngs_rna/tophat_wrapper.xml Fri Apr 23 17:04:39 2010 -0400
+++ b/tools/ngs_rna/tophat_wrapper.xml Sat Apr 24 15:03:22 2010 -0400
@@ -55,9 +55,9 @@
</inputs>
<outputs>
- <data format="sam" name="accepted_hits"/>
- <data format="wig" name="coverage" />
- <data format="bed" name="junctions" />
+ <data format="sam" name="accepted_hits" label="${tool.name} on ${on_string}: accepted_hits"/>
+ <data format="wig" name="coverage" label="${tool.name} on ${on_string}: coverage"/>
+ <data format="bed" name="junctions" label="${tool.name} on ${on_string}: splice junctions"/>
</outputs>
<tests>
1
0
10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/0dd1676e5b6f
changeset: 3691:0dd1676e5b6f
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Fri Apr 23 17:04:39 2010 -0400
description:
Some fixes for the async datasource tool controller.
diffstat:
lib/galaxy/web/controllers/async.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (19 lines):
diff -r 7ae394334e5c -r 0dd1676e5b6f lib/galaxy/web/controllers/async.py
--- a/lib/galaxy/web/controllers/async.py Fri Apr 23 16:32:40 2010 -0400
+++ b/lib/galaxy/web/controllers/async.py Fri Apr 23 17:04:39 2010 -0400
@@ -108,8 +108,8 @@
data.name = GALAXY_NAME
data.dbkey = GALAXY_BUILD
data.info = GALAXY_INFO
+ trans.sa_session.add( data ) #Need to add data to session before setting state (setting state requires that the data object is in the session, but this may change)
data.state = data.states.NEW
- trans.sa_session.add( data )
open( data.file_name, 'wb' ).close() #create the file
trans.history.add_dataset( data, genome_build=GALAXY_BUILD )
trans.sa_session.add( trans.history )
@@ -135,4 +135,4 @@
trans.sa_session.flush()
- return trans.fill_template('tool_executed.tmpl', out_data={}, tool=tool, config=self.app.config )
+ return trans.fill_template( 'tool_executed.mako', history=history, toolbox=toolbox, tool=tool, util=util, out_data={} )
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/7ae394334e5c
changeset: 3690:7ae394334e5c
user: Nate Coraor <nate(a)bx.psu.edu>
date: Fri Apr 23 16:32:40 2010 -0400
description:
Added missing templates
diffstat:
templates/webapps/community/admin/category/category_create.mako | 35 ++
templates/webapps/community/admin/category/category_rename.mako | 44 +++
templates/webapps/community/admin/category/grid.mako | 1 +
templates/webapps/community/admin/category/role.mako | 118 ++++++++++
4 files changed, 198 insertions(+), 0 deletions(-)
diffs (214 lines):
diff -r a66d849924d2 -r 7ae394334e5c templates/webapps/community/admin/category/category_create.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/webapps/community/admin/category/category_create.mako Fri Apr 23 16:32:40 2010 -0400
@@ -0,0 +1,35 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ $(function(){
+ $("input:text:first").focus();
+ })
+ </script>
+</%def>
+
+%if message:
+ ${render_msg( message, status )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Create Role</div>
+ <div class="toolFormBody">
+ <form name="create_category_form" id="create_category_form" action="${h.url_for( action='create_category' )}" method="post" >
+ <div class="form-row">
+ <input name="webapp" type="hidden" value="${webapp}" size=40"/>
+ <label>Name:</label>
+ <input name="name" type="textfield" value="" size=40"/>
+ </div>
+ <div class="form-row">
+ <label>Description:</label>
+ <input name="description" type="textfield" value="" size=40"/>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="create_category_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+</div>
diff -r a66d849924d2 -r 7ae394334e5c templates/webapps/community/admin/category/category_rename.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/webapps/community/admin/category/category_rename.mako Fri Apr 23 16:32:40 2010 -0400
@@ -0,0 +1,44 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+%if message:
+ ${render_msg( message, status )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Change category name and description</div>
+ <div class="toolFormBody">
+ <form name="library" action="${h.url_for( controller='admin', action='rename_category' )}" method="post" >
+ <div class="form-row">
+ <input name="webapp" type="hidden" value="${webapp}" size=40"/>
+ <label>Name:</label>
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="text" name="name" value="${category.name}" size="40"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>Description:</label>
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input name="description" type="textfield" value="${category.description}" size=40"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="hidden" name="rename" value="submitted"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="hidden" name="id" value="${trans.security.encode_id( category.id )}"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="rename_category_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+</div>
diff -r a66d849924d2 -r 7ae394334e5c templates/webapps/community/admin/category/grid.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/webapps/community/admin/category/grid.mako Fri Apr 23 16:32:40 2010 -0400
@@ -0,0 +1,1 @@
+<%inherit file="/grid_base.mako"/>
diff -r a66d849924d2 -r 7ae394334e5c templates/webapps/community/admin/category/role.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/webapps/community/admin/category/role.mako Fri Apr 23 16:32:40 2010 -0400
@@ -0,0 +1,118 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ $(function(){
+ $("input:text:first").focus();
+ })
+ </script>
+</%def>
+
+<%def name="render_select( name, options )">
+ <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
+ %for option in options:
+ <option value="${option[0]}">${option[1]}</option>
+ %endfor
+ </select>
+</%def>
+
+<script type="text/javascript">
+$().ready(function() {
+ $('#users_add_button').click(function() {
+ return !$('#out_users option:selected').remove().appendTo('#in_users');
+ });
+ $('#users_remove_button').click(function() {
+ return !$('#in_users option:selected').remove().appendTo('#out_users');
+ });
+ $('#groups_add_button').click(function() {
+ return !$('#out_groups option:selected').remove().appendTo('#in_groups');
+ });
+ $('#groups_remove_button').click(function() {
+ return !$('#in_groups option:selected').remove().appendTo('#out_groups');
+ });
+ $('form#associate_role_user_group').submit(function() {
+ $('#in_users option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ $('#in_groups option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ });
+});
+</script>
+
+%if message:
+ ${render_msg( message, status )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Role '${role.name}'</div>
+ <div class="toolFormBody">
+ <form name="associate_role_user_group" id="associate_role_user_group" action="${h.url_for( action='manage_users_and_groups_for_role', id=trans.security.encode_id( role.id ) )}" method="post" >
+ <input name="webapp" type="hidden" value="${webapp}" size=40"/>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Users associated with '${role.name}'</label>
+ ${render_select( "in_users", in_users )}<br/>
+ <input type="submit" id="users_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Users not associated with '${role.name}'</label>
+ ${render_select( "out_users", out_users )}<br/>
+ <input type="submit" id="users_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Groups associated with '${role.name}'</label>
+ ${render_select( "in_groups", in_groups )}<br/>
+ <input type="submit" id="groups_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Groups not associated with '${role.name}'</label>
+ ${render_select( "out_groups", out_groups )}<br/>
+ <input type="submit" id="groups_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="role_members_edit_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+</div>
+<br clear="left"/>
+<br/>
+%if len( library_dataset_actions ) > 0:
+ <h3>Data library datasets associated with role '${role.name}'</h3>
+ <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td>
+ <ul>
+ %for ctr, library, in enumerate( library_dataset_actions.keys() ):
+ <li>
+ <img src="${h.url_for( '/static/images/silk/book_open.png' )}" class="rowIcon"/>
+ ${library.name}
+ <ul>
+ %for folder_path, permissions in library_dataset_actions[ library ].items():
+ <li>
+ <img src="/static/images/silk/folder_page.png" class="rowIcon"/>
+ ${folder_path}
+ <ul>
+ % for permission in permissions:
+ <ul>
+ <li>${permission}</li>
+ </ul>
+ %endfor
+ </ul>
+ </li>
+ %endfor
+ </ul>
+ </li>
+ %endfor
+ </ul>
+ </td>
+ </tr>
+ </table>
+%endif
1
0
10 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/a66d849924d2
changeset: 3689:a66d849924d2
user: Nate Coraor <nate(a)bx.psu.edu>
date: Fri Apr 23 16:24:49 2010 -0400
description:
Move setting categories to the Tool class in the model
diffstat:
lib/galaxy/webapps/community/controllers/tool_browser.py | 17 +---------------
lib/galaxy/webapps/community/model/__init__.py | 9 ++++++++
2 files changed, 10 insertions(+), 16 deletions(-)
diffs (50 lines):
diff -r 87cee993fa2d -r a66d849924d2 lib/galaxy/webapps/community/controllers/tool_browser.py
--- a/lib/galaxy/webapps/community/controllers/tool_browser.py Fri Apr 23 16:11:55 2010 -0400
+++ b/lib/galaxy/webapps/community/controllers/tool_browser.py Fri Apr 23 16:24:49 2010 -0400
@@ -117,7 +117,7 @@
elif params.save_button:
tool.user_description = util.restore_text( params.description )
categories = []
- set_tool_category_associations( trans, tool, util.listify( params.category ) )
+ tool.set_categories( trans, util.listify( params.category ) )
trans.sa_session.add( tool )
trans.sa_session.flush()
return trans.response.send_redirect( web.url_for( controller='tool_browser',
@@ -131,18 +131,3 @@
categories=categories,
message=message,
status=status )
-
-## ---- Utility methods -------------------------------------------------------
-
-# It may make sense to create something like the security controller to do
-# this, but seems unnecessary for this single operation
-
-def set_tool_category_associations( trans, tool, categories, delete_existing_assocs=True ):
- if delete_existing_assocs:
- for a in tool.categories:
- trans.sa_session.delete( a )
- trans.sa_session.flush()
- for category in categories:
- if not isinstance( category, trans.model.Category ):
- category = trans.sa_session.query( trans.model.Category ).get( int( category ) )
- tool.categories.append( trans.model.ToolCategoryAssociation( tool, category ) )
diff -r 87cee993fa2d -r a66d849924d2 lib/galaxy/webapps/community/model/__init__.py
--- a/lib/galaxy/webapps/community/model/__init__.py Fri Apr 23 16:11:55 2010 -0400
+++ b/lib/galaxy/webapps/community/model/__init__.py Fri Apr 23 16:24:49 2010 -0400
@@ -123,6 +123,15 @@
self.description = datatype_bunch.description
self.version = datatype_bunch.version
self.user_id = datatype_bunch.user.id
+ def set_categories( self, trans, categories, delete_existing_assocs=True ):
+ if delete_existing_assocs:
+ for a in self.categories:
+ trans.sa_session.delete( a )
+ trans.sa_session.flush()
+ for category in categories:
+ if not isinstance( category, Category ):
+ category = trans.sa_session.query( Category ).get( int( category ) )
+ self.categories.append( ToolCategoryAssociation( self, category ) )
class Tag ( object ):
def __init__( self, id=None, type=None, parent_id=None, name=None ):
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/87cee993fa2d
changeset: 3688:87cee993fa2d
user: Nate Coraor <nate(a)bx.psu.edu>
date: Fri Apr 23 16:11:55 2010 -0400
description:
Add categories to the community app
diffstat:
lib/galaxy/webapps/community/controllers/admin.py | 275 ++++++++++
lib/galaxy/webapps/community/controllers/tool_browser.py | 26 +-
lib/galaxy/webapps/community/controllers/upload.py | 7 +-
lib/galaxy/webapps/community/model/__init__.py | 7 +-
lib/galaxy/webapps/community/model/mapping.py | 3 +-
lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py | 3 +-
templates/webapps/community/admin/index.mako | 9 +
templates/webapps/community/base_panels.mako | 2 +-
templates/webapps/community/tool/edit_tool.mako | 4 +-
9 files changed, 323 insertions(+), 13 deletions(-)
diffs (452 lines):
diff -r 318dc4410301 -r 87cee993fa2d lib/galaxy/webapps/community/controllers/admin.py
--- a/lib/galaxy/webapps/community/controllers/admin.py Fri Apr 23 15:31:52 2010 -0400
+++ b/lib/galaxy/webapps/community/controllers/admin.py Fri Apr 23 16:11:55 2010 -0400
@@ -277,8 +277,283 @@
def build_initial_query( self, session ):
return session.query( self.model_class )
+class CategoryListGrid( grids.Grid ):
+ class NameColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, category ):
+ return category.name
+ class DescriptionColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, category ):
+ return category.description
+ class StatusColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, category ):
+ if category.deleted:
+ return "deleted"
+ return ""
+
+ # Grid definition
+ webapp = "community"
+ title = "Categories"
+ model_class = model.Category
+ template='/webapps/community/admin/category/grid.mako'
+ default_sort_key = "name"
+ columns = [
+ NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( operation="Edit category", id=item.id, webapp="community" ) ),
+ model_class=model.Category,
+ attach_popup=True,
+ filterable="advanced" ),
+ DescriptionColumn( "Description", attach_popup=False ),
+ StatusColumn( "Status", attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ grids.DeletedColumn( "Deleted", key="deleted", visible=False, filterable="advanced" )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search",
+ cols_to_filter=[ columns[0], columns[1], columns[2] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ global_actions = [
+ grids.GridAction( "Add new category",
+ dict( controller='admin', action='categories', operation='create', webapp="community" ) )
+ ]
+ operations = [ grids.GridOperation( "Rename",
+ condition=( lambda item: not item.deleted ),
+ allow_multiple=False,
+ url_args=dict( webapp="community", action="rename_category" ) ),
+ grids.GridOperation( "Delete",
+ condition=( lambda item: not item.deleted ),
+ allow_multiple=True,
+ url_args=dict( webapp="community", action="mark_category_deleted" ) ),
+ grids.GridOperation( "Undelete",
+ condition=( lambda item: item.deleted ),
+ allow_multiple=True,
+ url_args=dict( webapp="community", action="undelete_category" ) ),
+ grids.GridOperation( "Purge",
+ condition=( lambda item: item.deleted ),
+ allow_multiple=True,
+ url_args=dict( webapp="community", action="purge_category" ) ) ]
+ standard_filters = [
+ grids.GridColumnFilter( "Active", args=dict( deleted=False ) ),
+ grids.GridColumnFilter( "Deleted", args=dict( deleted=True ) ),
+ grids.GridColumnFilter( "All", args=dict( deleted='All' ) )
+ ]
+ num_rows_per_page = 50
+ preserve_state = False
+ use_paging = True
+ def get_current_item( self, trans ):
+ return None
+ def build_initial_query( self, session ):
+ return session.query( self.model_class )
+
class AdminCommunity( BaseController, Admin ):
user_list_grid = UserListGrid()
role_list_grid = RoleListGrid()
group_list_grid = GroupListGrid()
+ category_list_grid = CategoryListGrid()
+
+ @web.expose
+ @web.require_admin
+ def categories( self, trans, **kwargs ):
+ if 'operation' in kwargs:
+ operation = kwargs['operation'].lower()
+ if operation == "create":
+ return self.create_category( trans, **kwargs )
+ if operation == "delete":
+ return self.mark_category_deleted( trans, **kwargs )
+ if operation == "undelete":
+ return self.undelete_category( trans, **kwargs )
+ if operation == "purge":
+ return self.purge_category( trans, **kwargs )
+ if operation == "rename":
+ return self.rename_category( trans, **kwargs )
+ # Render the list view
+ return self.category_list_grid( trans, **kwargs )
+
+ @web.expose
+ @web.require_admin
+ def create_category( self, trans, **kwd ):
+ params = util.Params( kwd )
+ webapp = params.get( 'webapp', 'community' )
+ message = util.restore_text( params.get( 'message', '' ) )
+ status = params.get( 'status', 'done' )
+ if params.get( 'create_category_button', False ):
+ name = util.restore_text( params.name )
+ description = util.restore_text( params.description )
+ if not name or not description:
+ message = "Enter a valid name and a description"
+ elif trans.sa_session.query( trans.app.model.Category ).filter( trans.app.model.Category.table.c.name==name ).first():
+ message = "A category with that name already exists"
+ else:
+ # Create the category
+ category = trans.app.model.Category( name=name, description=description )
+ trans.sa_session.add( category )
+ message = "Category '%s' has been created" % category.name
+ trans.sa_session.flush()
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='done' ) )
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='create_category',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='error' ) )
+ return trans.fill_template( '/webapps/community/admin/category/category_create.mako',
+ webapp=webapp,
+ message=message,
+ status=status )
+ @web.expose
+ @web.require_admin
+ def rename_category( self, trans, **kwd ):
+ params = util.Params( kwd )
+ webapp = params.get( 'webapp', 'galaxy' )
+ message = util.restore_text( params.get( 'message', '' ) )
+ status = params.get( 'status', 'done' )
+ id = params.get( 'id', None )
+ if not id:
+ message = "No category ids received for renaming"
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=message,
+ status='error' ) )
+ category = get_category( trans, id )
+ if params.get( 'rename_category_button', False ):
+ old_name = category.name
+ new_name = util.restore_text( params.name )
+ new_description = util.restore_text( params.description )
+ if not new_name:
+ message = 'Enter a valid name'
+ status = 'error'
+ elif trans.sa_session.query( trans.app.model.Category ).filter( trans.app.model.Category.table.c.name==new_name ).first():
+ message = 'A category with that name already exists'
+ status = 'error'
+ else:
+ category.name = new_name
+ category.description = new_description
+ trans.sa_session.add( category )
+ trans.sa_session.flush()
+ message = "Category '%s' has been renamed to '%s'" % ( old_name, new_name )
+ return trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='done' ) )
+ return trans.fill_template( '/webapps/community/admin/category/category_rename.mako',
+ category=category,
+ webapp=webapp,
+ message=message,
+ status=status )
+ @web.expose
+ @web.require_admin
+ def mark_category_deleted( self, trans, **kwd ):
+ params = util.Params( kwd )
+ webapp = params.get( 'webapp', 'galaxy' )
+ id = kwd.get( 'id', None )
+ if not id:
+ message = "No category ids received for deleting"
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=message,
+ status='error' ) )
+ ids = util.listify( id )
+ message = "Deleted %d categories: " % len( ids )
+ for category_id in ids:
+ category = get_category( trans, category_id )
+ category.deleted = True
+ trans.sa_session.add( category )
+ trans.sa_session.flush()
+ message += " %s " % category.name
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='done' ) )
+ @web.expose
+ @web.require_admin
+ def undelete_category( self, trans, **kwd ):
+ params = util.Params( kwd )
+ webapp = params.get( 'webapp', 'galaxy' )
+ id = kwd.get( 'id', None )
+ if not id:
+ message = "No category ids received for undeleting"
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=message,
+ status='error' ) )
+ ids = util.listify( id )
+ count = 0
+ undeleted_categories = ""
+ for category_id in ids:
+ category = get_category( trans, category_id )
+ if not category.deleted:
+ message = "Category '%s' has not been deleted, so it cannot be undeleted." % category.name
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='error' ) )
+ category.deleted = False
+ trans.sa_session.add( category )
+ trans.sa_session.flush()
+ count += 1
+ undeleted_categories += " %s" % category.name
+ message = "Undeleted %d categories: %s" % ( count, undeleted_categories )
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='done' ) )
+ @web.expose
+ @web.require_admin
+ def purge_category( self, trans, **kwd ):
+ # This method should only be called for a Category that has previously been deleted.
+ # Purging a deleted Category deletes all of the following from the database:
+ # - ToolCategoryAssociations where category_id == Category.id
+ params = util.Params( kwd )
+ webapp = params.get( 'webapp', 'galaxy' )
+ id = kwd.get( 'id', None )
+ if not id:
+ message = "No category ids received for purging"
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='error' ) )
+ ids = util.listify( id )
+ message = "Purged %d categories: " % len( ids )
+ for category_id in ids:
+ category = get_category( trans, category_id )
+ if not category.deleted:
+ message = "Category '%s' has not been deleted, so it cannot be purged." % category.name
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='error' ) )
+ # Delete ToolCategoryAssociations
+ for tca in category.tools:
+ trans.sa_session.delete( tca )
+ trans.sa_session.flush()
+ message += " %s " % category.name
+ trans.response.send_redirect( web.url_for( controller='admin',
+ action='categories',
+ webapp=webapp,
+ message=util.sanitize_text( message ),
+ status='done' ) )
+
+## ---- Utility methods -------------------------------------------------------
+
+def get_category( trans, id ):
+ """Get a User from the database by id."""
+ # Load user from database
+ id = trans.security.decode_id( id )
+ category = trans.sa_session.query( trans.model.Category ).get( id )
+ if not category:
+ return trans.show_error_message( "Category not found for id (%s)" % str( id ) )
+ return category
diff -r 318dc4410301 -r 87cee993fa2d lib/galaxy/webapps/community/controllers/tool_browser.py
--- a/lib/galaxy/webapps/community/controllers/tool_browser.py Fri Apr 23 15:31:52 2010 -0400
+++ b/lib/galaxy/webapps/community/controllers/tool_browser.py Fri Apr 23 16:11:55 2010 -0400
@@ -115,8 +115,15 @@
message = 'Uploading new version not implemented'
status = 'error'
elif params.save_button:
- tool.user_description = params.description
- tool.category = params.category
+ tool.user_description = util.restore_text( params.description )
+ categories = []
+ set_tool_category_associations( trans, tool, util.listify( params.category ) )
+ trans.sa_session.add( tool )
+ trans.sa_session.flush()
+ return trans.response.send_redirect( web.url_for( controller='tool_browser',
+ action='browse_tools',
+ message='Saved categories and description for %s' % tool.name,
+ status='done' ) )
categories = trans.sa_session.query( trans.model.Category ).order_by( trans.model.Category.table.c.name ).all()
return trans.fill_template( '/webapps/community/tool/edit_tool.mako',
encoded_id = encoded_id,
@@ -124,3 +131,18 @@
categories=categories,
message=message,
status=status )
+
+## ---- Utility methods -------------------------------------------------------
+
+# It may make sense to create something like the security controller to do
+# this, but seems unnecessary for this single operation
+
+def set_tool_category_associations( trans, tool, categories, delete_existing_assocs=True ):
+ if delete_existing_assocs:
+ for a in tool.categories:
+ trans.sa_session.delete( a )
+ trans.sa_session.flush()
+ for category in categories:
+ if not isinstance( category, trans.model.Category ):
+ category = trans.sa_session.query( trans.model.Category ).get( int( category ) )
+ tool.categories.append( trans.model.ToolCategoryAssociation( tool, category ) )
diff -r 318dc4410301 -r 87cee993fa2d lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py Fri Apr 23 15:31:52 2010 -0400
+++ b/lib/galaxy/webapps/community/controllers/upload.py Fri Apr 23 16:11:55 2010 -0400
@@ -49,12 +49,15 @@
os.link( uploaded_file.name, obj.file_name )
except OSError:
shutil.copy( uploaded_file.name, obj.file_name )
- message = 'Uploaded %s' % meta.message
+ return trans.response.send_redirect( web.url_for( controller='tool_browser',
+ action='edit_tool',
+ message='Uploaded %s' % meta.message,
+ status='done' ) )
except datatypes.DatatypeVerificationError, e:
message = str( e )
status = 'error'
except sqlalchemy.exc.IntegrityError:
- message = 'A tool with the same ID already exists. If you are trying to update this tool to a new version, please ... ??? ... Otherwise, please choose a new ID.'
+ message = 'A tool with the same ID already exists. If you are trying to update this tool to a new version, please use the upload form on the "Edit Tool" page. Otherwise, please choose a new ID.'
status = 'error'
uploaded_file.close()
selected_upload_type = params.get( 'type', 'tool' )
diff -r 318dc4410301 -r 87cee993fa2d lib/galaxy/webapps/community/model/__init__.py
--- a/lib/galaxy/webapps/community/model/__init__.py Fri Apr 23 15:31:52 2010 -0400
+++ b/lib/galaxy/webapps/community/model/__init__.py Fri Apr 23 16:11:55 2010 -0400
@@ -134,10 +134,10 @@
return "Tag(id=%s, type=%i, parent_id=%s, name=%s)" % ( self.id, self.type, self.parent_id, self.name )
class Category( object ):
- def __init__( self, id=None, name=None, description=None ):
- self.id = id
+ def __init__( self, name=None, description=None, deleted=False ):
self.name = name
self.description = description
+ self.deleted = deleted
class ItemTagAssociation ( object ):
def __init__( self, id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None ):
@@ -156,8 +156,7 @@
pass
class ToolCategoryAssociation( object ):
- def __init__( self, id=None, tool=None, category=None ):
- self.id = id
+ def __init__( self, tool=None, category=None ):
self.tool = tool
self.category = category
diff -r 318dc4410301 -r 87cee993fa2d lib/galaxy/webapps/community/model/mapping.py
--- a/lib/galaxy/webapps/community/model/mapping.py Fri Apr 23 15:31:52 2010 -0400
+++ b/lib/galaxy/webapps/community/model/mapping.py Fri Apr 23 16:11:55 2010 -0400
@@ -119,7 +119,8 @@
Column( "create_time", DateTime, default=now ),
Column( "update_time", DateTime, default=now, onupdate=now ),
Column( "name", TrimmedString( 255 ), index=True, unique=True ),
- Column( "description" , TEXT ) )
+ Column( "description" , TEXT ),
+ Column( "deleted", Boolean, index=True, default=False ) )
ToolCategoryAssociation.table = Table( "tool_category_association", metadata,
Column( "id", Integer, primary_key=True ),
diff -r 318dc4410301 -r 87cee993fa2d lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py
--- a/lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py Fri Apr 23 15:31:52 2010 -0400
+++ b/lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py Fri Apr 23 16:11:55 2010 -0400
@@ -96,7 +96,8 @@
Column( "create_time", DateTime, default=now ),
Column( "update_time", DateTime, default=now, onupdate=now ),
Column( "name", TrimmedString( 255 ), index=True, unique=True ),
- Column( "description" , TEXT ) )
+ Column( "description" , TEXT ),
+ Column( "deleted", Boolean, index=True, default=False ) )
ToolCategoryAssociation_table = Table( "tool_category_association", metadata,
Column( "id", Integer, primary_key=True ),
diff -r 318dc4410301 -r 87cee993fa2d templates/webapps/community/admin/index.mako
--- a/templates/webapps/community/admin/index.mako Fri Apr 23 15:31:52 2010 -0400
+++ b/templates/webapps/community/admin/index.mako Fri Apr 23 16:11:55 2010 -0400
@@ -88,6 +88,15 @@
<div class="toolTitle"><a href="${h.url_for( controller='tool_browser', action='browse_tools', webapp='community' )}" target="galaxy_main">Manage tools</a></div>
</div>
</div>
+ <div class="toolSectionPad"></div>
+ <div class="toolSectionTitle">
+ <span>Community</span>
+ </div>
+ <div class="toolSectionBody">
+ <div class="toolSectionBg">
+ <div class="toolTitle"><a href="${h.url_for( controller='admin', action='categories', webapp='community' )}" target="galaxy_main">Manage categories</a></div>
+ </div>
+ </div>
</div>
</div>
</div>
diff -r 318dc4410301 -r 87cee993fa2d templates/webapps/community/base_panels.mako
--- a/templates/webapps/community/base_panels.mako Fri Apr 23 15:31:52 2010 -0400
+++ b/templates/webapps/community/base_panels.mako Fri Apr 23 16:11:55 2010 -0400
@@ -92,7 +92,7 @@
<div class="title" style="position: absolute; top: 0; left: 0;">
<a href="${app.config.get( 'logo_url', '/' )}">
<img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="width: 26px; vertical-align: top;">
- Galaxy
+ Galaxy Community
%if app.config.brand:
<span class='brand'>/ ${app.config.brand}</span>
%endif
diff -r 318dc4410301 -r 87cee993fa2d templates/webapps/community/tool/edit_tool.mako
--- a/templates/webapps/community/tool/edit_tool.mako Fri Apr 23 15:31:52 2010 -0400
+++ b/templates/webapps/community/tool/edit_tool.mako Fri Apr 23 16:11:55 2010 -0400
@@ -25,7 +25,7 @@
<div class="form-row">
<label>Categories:</label>
<div class="form-row-input">
- <select name="category" multiple size=5>
+ <select name="category" multiple size=5 style="min-width: 250px;">
%for category in categories:
%if category.id in [ tool_category.id for tool_category in tool.categories ]:
<option value="${category.id}" selected>${category.name}</option>
@@ -39,7 +39,7 @@
</div>
<div class="form-row">
<label>Description:</label>
- <div class="form-row-input"><textarea name="description" rows="5" cols="35"></textarea></div>
+ <div class="form-row-input"><textarea name="description" rows="5" cols="35">${tool.user_description}</textarea></div>
<div style="clear: both"></div>
</div>
<div class="form-row">
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/318dc4410301
changeset: 3687:318dc4410301
user: rc
date: Fri Apr 23 15:31:52 2010 -0400
description:
lims:
- ui cleanup
- fixed a functional test bug
diffstat:
templates/admin/requests/get_data.mako | 5 ++---
test/functional/test_forms_and_requests.py | 15 ++++++++++-----
2 files changed, 12 insertions(+), 8 deletions(-)
diffs (44 lines):
diff -r f6e86e26cfe2 -r 318dc4410301 templates/admin/requests/get_data.mako
--- a/templates/admin/requests/get_data.mako Fri Apr 23 15:16:24 2010 -0400
+++ b/templates/admin/requests/get_data.mako Fri Apr 23 15:31:52 2010 -0400
@@ -113,9 +113,8 @@
</div>
<div class="form-row">
<div class="toolParamHelp" style="clear: both;">
- After clicking <b>Transfer</b> do <i>not</i> close this page or
- navigate away from this page. Once the transfer is complete
- the dataset(s) will show up on this page.
+ After selecting dataset(s), be sure to click on the <b>Start transfer</b> button.
+ Once the transfer is complete the dataset(s) will show up on this page.
</div>
<input type="submit" name="select_files_button" value="Select"/>
</div>
diff -r f6e86e26cfe2 -r 318dc4410301 test/functional/test_forms_and_requests.py
--- a/test/functional/test_forms_and_requests.py Fri Apr 23 15:16:24 2010 -0400
+++ b/test/functional/test_forms_and_requests.py Fri Apr 23 15:31:52 2010 -0400
@@ -372,15 +372,20 @@
% ( request_two.name, request_two.states.REJECTED )
def test_055_reset_data_for_later_test_runs( self ):
"""Reseting data to enable later test runs to pass"""
- # TODO: RC: add whatever is missing from this method that should be marked
- # deleted or purged so that later test runs will correctly test features if the
- # database has not be purged.
- #
# Logged in as admin_user
+ # remove the request_type permissions
+ rt_actions = sa_session.query( galaxy.model.RequestTypePermissions ) \
+ .filter(and_(galaxy.model.RequestTypePermissions.table.c.request_type_id==request_type.id) ) \
+ .order_by( desc( galaxy.model.RequestTypePermissions.table.c.create_time ) ) \
+ .all()
+ for a in rt_actions:
+ sa_session.delete( a )
+ sa_session.flush()
+
##################
# Eliminate all non-private roles
##################
- for role in [ role_one ]:
+ for role in [ role_one, role_two ]:
self.mark_role_deleted( self.security.encode_id( role.id ), role.name )
self.purge_role( self.security.encode_id( role.id ), role.name )
# Manually delete the role from the database
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/f6e86e26cfe2
changeset: 3686:f6e86e26cfe2
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Fri Apr 23 15:16:24 2010 -0400
description:
Miscellaneous community space fixes.
diffstat:
lib/galaxy/web/base/controller.py | 6 +-
lib/galaxy/web/framework/__init__.py | 6 +-
lib/galaxy/web/security/__init__.py | 6 +-
lib/galaxy/webapps/community/controllers/admin.py | 1 -
lib/galaxy/webapps/community/controllers/upload.py | 10 +-
lib/galaxy/webapps/community/model/__init__.py | 7 +-
setup.sh | 2 +-
templates/admin/center.mako | 187 ---------------------
templates/webapps/community/admin/center.mako | 41 ++++
templates/webapps/community/admin/index.mako | 20 +-
templates/webapps/galaxy/admin/center.mako | 187 +++++++++++++++++++++
templates/webapps/galaxy/admin/index.mako | 2 +-
12 files changed, 265 insertions(+), 210 deletions(-)
diffs (620 lines):
diff -r 34eec4d48cc4 -r f6e86e26cfe2 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py Fri Apr 23 13:16:40 2010 -0400
+++ b/lib/galaxy/web/base/controller.py Fri Apr 23 15:16:24 2010 -0400
@@ -330,7 +330,11 @@
@web.expose
@web.require_admin
def center( self, trans, **kwd ):
- return trans.fill_template( '/admin/center.mako' )
+ webapp = kwd.get( 'webapp', 'galaxy' )
+ if webapp == 'galaxy':
+ return trans.fill_template( '/webapps/galaxy/admin/center.mako' )
+ else:
+ return trans.fill_template( '/webapps/community/admin/center.mako' )
@web.expose
@web.require_admin
def reload_tool( self, trans, **kwd ):
diff -r 34eec4d48cc4 -r f6e86e26cfe2 lib/galaxy/web/framework/__init__.py
--- a/lib/galaxy/web/framework/__init__.py Fri Apr 23 13:16:40 2010 -0400
+++ b/lib/galaxy/web/framework/__init__.py Fri Apr 23 15:16:24 2010 -0400
@@ -268,7 +268,7 @@
galaxy_session_requires_flush = False
if secure_id:
# Decode the cookie value to get the session_key
- session_key = self.security.decode_session_key( secure_id )
+ session_key = self.security.decode_guid( secure_id )
try:
# Make sure we have a valid UTF-8 string
session_key = session_key.encode( 'utf8' )
@@ -365,7 +365,7 @@
Caller is responsible for flushing the returned session.
"""
- session_key = self.security.get_new_session_key()
+ session_key = self.security.get_new_guid()
galaxy_session = self.app.model.GalaxySession(
session_key=session_key,
is_valid=True,
@@ -411,7 +411,7 @@
"""
Update the session cookie to match the current session.
"""
- self.set_cookie( self.security.encode_session_key( self.galaxy_session.session_key ), name=name, path=self.app.config.cookie_path )
+ self.set_cookie( self.security.encode_guid( self.galaxy_session.session_key ), name=name, path=self.app.config.cookie_path )
def handle_user_login( self, user, webapp ):
"""
Login a new user (possibly newly created)
diff -r 34eec4d48cc4 -r f6e86e26cfe2 lib/galaxy/web/security/__init__.py
--- a/lib/galaxy/web/security/__init__.py Fri Apr 23 13:16:40 2010 -0400
+++ b/lib/galaxy/web/security/__init__.py Fri Apr 23 15:16:24 2010 -0400
@@ -43,16 +43,16 @@
return self.id_cipher.encrypt( s ).encode( 'hex' )
def decode_id( self, obj_id ):
return int( self.id_cipher.decrypt( obj_id.decode( 'hex' ) ).lstrip( "!" ) )
- def encode_session_key( self, session_key ):
+ def encode_guid( self, session_key ):
# Session keys are strings
# Pad to a multiple of 8 with leading "!"
s = ( "!" * ( 8 - len( session_key ) % 8 ) ) + session_key
# Encrypt
return self.id_cipher.encrypt( s ).encode( 'hex' )
- def decode_session_key( self, session_key ):
+ def decode_guid( self, session_key ):
# Session keys are strings
return self.id_cipher.decrypt( session_key.decode( 'hex' ) ).lstrip( "!" )
- def get_new_session_key( self ):
+ def get_new_guid( self ):
# Generate a unique, high entropy 128 bit random number
return get_random_bytes( 16 )
\ No newline at end of file
diff -r 34eec4d48cc4 -r f6e86e26cfe2 lib/galaxy/webapps/community/controllers/admin.py
--- a/lib/galaxy/webapps/community/controllers/admin.py Fri Apr 23 13:16:40 2010 -0400
+++ b/lib/galaxy/webapps/community/controllers/admin.py Fri Apr 23 15:16:24 2010 -0400
@@ -43,7 +43,6 @@
return self.format( user.galaxy_sessions[ 0 ].update_time )
return 'never'
- log.debug("####In UserListGrid, in community" )
# Grid definition
webapp = "community"
title = "Users"
diff -r 34eec4d48cc4 -r f6e86e26cfe2 lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py Fri Apr 23 13:16:40 2010 -0400
+++ b/lib/galaxy/webapps/community/controllers/upload.py Fri Apr 23 15:16:24 2010 -0400
@@ -41,6 +41,7 @@
try:
meta = datatype.verify( uploaded_file )
meta.user = trans.user
+ meta.guid = trans.app.security.get_new_guid()
obj = datatype.create_model_object( meta )
trans.sa_session.add( obj )
trans.sa_session.flush()
@@ -57,7 +58,8 @@
status = 'error'
uploaded_file.close()
selected_upload_type = params.get( 'type', 'tool' )
- return trans.fill_template( '/webapps/community/upload/upload.mako', message=message,
- status=status,
- selected_upload_type=selected_upload_type,
- upload_types=trans.app.datatypes_registry.get_datatypes_for_select_list() )
+ return trans.fill_template( '/webapps/community/upload/upload.mako',
+ message=message,
+ status=status,
+ selected_upload_type=selected_upload_type,
+ upload_types=trans.app.datatypes_registry.get_datatypes_for_select_list() )
diff -r 34eec4d48cc4 -r f6e86e26cfe2 lib/galaxy/webapps/community/model/__init__.py
--- a/lib/galaxy/webapps/community/model/__init__.py Fri Apr 23 13:16:40 2010 -0400
+++ b/lib/galaxy/webapps/community/model/__init__.py Fri Apr 23 15:16:24 2010 -0400
@@ -93,7 +93,6 @@
self.name = name or "Unnamed tool"
self.description = description
self.user_description = user_description
- self.category = category
self.version = version or "1.0.0"
self.user_id = user_id
self.external_filename = external_filename
@@ -117,11 +116,13 @@
self.external_filename = filename
file_name = property( get_file_name, set_file_name )
def create_from_datatype( self, datatype_bunch ):
+ # TODO: ensure guid is unique and generate a new one if not.
+ self.guid = datatype_bunch.guid
self.tool_id = datatype_bunch.id
self.name = datatype_bunch.name
+ self.description = datatype_bunch.description
self.version = datatype_bunch.version
- self.description = datatype_bunch.description
- self.user_id = datatype_bunch.user
+ self.user_id = datatype_bunch.user.id
class Tag ( object ):
def __init__( self, id=None, type=None, parent_id=None, name=None ):
diff -r 34eec4d48cc4 -r f6e86e26cfe2 setup.sh
--- a/setup.sh Fri Apr 23 13:16:40 2010 -0400
+++ b/setup.sh Fri Apr 23 15:16:24 2010 -0400
@@ -31,7 +31,7 @@
DIRS="
database
database/files
-database/tools
+database/community_files
database/tmp
database/compiled_templates
database/job_working_directory
diff -r 34eec4d48cc4 -r f6e86e26cfe2 templates/admin/center.mako
--- a/templates/admin/center.mako Fri Apr 23 13:16:40 2010 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-<%inherit file="/base.mako"/>
-
-<%def name="title()">Galaxy Administration</%def>
-
-<h2>Administration</h2>
-
-<p>The menu on the left provides the following features</p>
-<ul>
- <li><strong>Security</strong> - see the <strong>Data Security and Data Libraries</strong> section below for details
- <p/>
- <ul>
- <li>
- <strong>Manage users</strong> - provides a view of the registered users and all groups and non-private roles associated
- with each user.
- </li>
- <p/>
- <li>
- <strong>Manage groups</strong> - provides a view of all groups along with the members of the group and the roles associated with
- each group (both private and non-private roles). The group names include a link to a page that allows you to manage the users and
- roles that are associated with the group.
- </li>
- <p/>
- <li>
- <strong>Manage roles</strong> - provides a view of all non-private roles along with the role type, and the users and groups that
- are associated with the role. The role names include a link to a page that allows you to manage the users and groups that are associated
- with the role. The page also includes a view of the data library datasets that are associated with the role and the permissions applied
- to each dataset.
- </li>
- </ul>
- </li>
- <p/>
- <li><strong>Data</strong>
- <p/>
- <ul>
- <li>
- <strong>Manage data libraries</strong> - Data libraries enable a Galaxy administrator to upload datasets into a data library. Currently,
- only administrators can create data libraries.
- <p/>
- When a data library is first created, it is considered "public" since it will be displayed in the "Data Libraries" view for any user, even
- those that are not logged in. The Galaxy administrator can restrict access to a data library by associating roles with the data library's
- "access library" permission. This permission will conservatively override the [dataset] "access" permission for the data library's contained
- datasets.
- <p/>
- For example, if a data library's "access library" permission is associated with Role1 and the data library contains "public" datasets, the
- data library will still only be displayed to those users that have Role1. However, if the data library's "access library" permission is
- associated with both Role1 and Role2 and the data library contains datasets whose [dataset] "access" permission is associated with only Role1,
- then users that have Role2 will be able to access the library, but will not see those contained datasets whose [dataset] "access" permission
- is associated with only Role1.
- <p/>
- In addition to the "access library" permission, permission to perform the following functions on the data library (and it's contents) can
- be granted to users (a library item is one of: a data library, a library folder, a library dataset).
- <p/>
- <ul>
- <li><strong>add library item</strong> - Role members can add library items to this data library or folder</li>
- <li><strong>modify library item</strong> - Role members can modify this library item</li>
- <li><strong>manage library permissions</strong> - Role members can manage permissions applied to this library item</li>
- </ul>
- <p/>
- The default behavior is for no permissions to be applied to a data library item, but applied permissions are inherited downward (with the exception
- of the "access library" permission, which is only available on the data library itself). Because of this, it is important to set desired permissions
- on a new data library when it is created. When this is done, new folders and datasets added to the data library will automatically inherit those
- permissions. In the same way, permissions can be applied to a folder, which will be automatically inherited by all contained datasets and sub-folders.
- <p/>
- The "Data Libraries" menu item allows users to access the datasets in a data library as long as they are not restricted from accessing them.
- Importing a library dataset into a history will not make a copy of the dataset, but will be a "pointer" to the dataset on disk. This
- approach allows for multiple users to use a single (possibly very large) dataset file.
- </li>
- </ul>
- </li>
- <p/>
- <li><strong>Server</strong>
- <p/>
- <ul>
- <li>
- <strong>Reload a tool's configuration</strong> - allows a new version of a tool to be loaded while the server is running
- </li>
- <p/>
- <li>
- <strong>Profile memory usage</strong> - measures system memory used for certain Galaxy functions
- </li>
- <p/>
- <li>
- <strong>Manage jobs</strong> - displays all jobs that are currently not finished (i.e., their state is new, waiting, queued, or
- running). Administrators are able to cleanly stop long-running jobs.
- </li>
- </ul>
- </li>
- <p/>
- <li><strong>Forms</strong>
- <p/>To be completed
- </li>
- <p/>
- <li><strong>Sequencing Requests</strong>
- <p/>To be completed
- </li>
- <p/>
- <li><strong>Cloud</strong>
- <p/>To be completed
- </li>
-</ul>
-<p/>
-<p><strong>Data Security and Data Libraries</strong></p>
-<p/>
-<strong>Security</strong> - Data security in Galaxy is a new feature, so familiarize yourself with the details which can be found
-here or in our <a href="http://g2.trac.bx.psu.edu/wiki/SecurityFeatures" target="_blank">data security page</a>. The data security
-process incorporates users, groups and roles, and enables the application of certain permissions on datasets, specifically "access"
-and "manage permissions". By default, the "manage permissions" permission is associated with the dataset owner's private role, and
-the "access" permission is not set, making the dataset public. With these default permissions, users should not see any difference
-in the way Galaxy has behaved in the past.
-<ul>
- <li>
- <strong>Users</strong> - registered Galaxy users that have created a Galaxy account. Users can belong to groups and can
- be associated with 1 or more roles. If a user is not authenticated during a Galaxy session, they will not have access to any
- of the security features, and datasets they create during that session will have no permissions applied to them (i.e., they
- will be considered "public", and no one will be allowed to change permissions on them).
- </li>
- <p/>
- <li>
- <strong>Groups</strong> - a set of 0 or more users which are considered members of the group. Groups can be associated with 0
- or more roles, simplifying the process of applying permissions to the data between a select group of users.
- </li>
- <p/>
- <li>
- <strong>Roles</strong> - associate users and groups with specific permissions on datasets. For example, users in groups A and B
- can be associated with role C which gives them the "access" permission on datasets D, E and F. Roles have a type which is currently
- one of the following:
- <ul>
- <li>
- <strong>private</strong> - every user is associated automatically with their own private role. Administrators cannot
- manage private roles.
- </li>
- <li>
- <strong>user</strong> - this is currently not used, but eventually any registered user will be able to create a new role
- and this will be it's type.
- </li>
- <li>
- <strong>sharing</strong> - a role created automatically during a Galaxy session that enables a user to share data with
- another user. This can generally be considered a temporary role.
- </li>
- <li><strong>admin</strong> - a role created by a Galaxy administrator.</li>
- </ul>
- </li>
- <p/>
- <li>
- <strong>Dataset Permissions</strong> - applying the following permissions will to a dataset will result in the behavior described.
- <ul>
- <li>
- <strong>access</strong> - users associated with the role can import this dataset into their history for analysis.
- <p>
- If no roles with the "access" permission are associated with a dataset, the dataset is "public" and may be accessed by anyone
- that can access the data library in which it is contained. See the <strong>Manage data libraries</strong> section above for
- details. Public datasets contained in public data libraries will be accessible to all users (as well as anyone not logged in
- during a Galaxy session) from the list of data libraries displayed when the "Data Libraries" menu item is selected.
- </p>
- <p>
- Associating a dataset with a role that includes the "access" permission restricts the set of users that can access it.
- For example, if 'Role A' includes the "access" permission and 'Role A' is associated with the dataset, only those users
- and groups who are associated with 'Role A' may access the dataset.
- </p>
- <p>
- If multiple roles that include the "access" permission are associated with a dataset, access to the dataset is derived
- from the intersection of the users associated with the roles. For example, if 'Role A' and 'Role B' are associated with
- a dataset, only those users and groups who are associated with both 'Role A' AND 'Role B' may access the dataset. When
- the "access" permission is applied to a dataset, Galaxy checks to make sure that at least 1 user belongs to all groups and
- roles associated with the "access" permission (otherwise the dataset would be restricted from everyone).
- </p>
- <p>
- In order for a user to make a dataset private (i.e., only they can access it), they should associate the dataset with
- their private role (the role identical to their Galaxy user name / email address). Associating additional roles that
- include the "access" permission is not possible, since it would render the dataset inaccessible to everyone.
- <p>
- To make a dataset private to themselves and one or more other users, the user can create a new role and associate the dataset
- with that role, not their "private role". Galaxy makes this easy by telling the user they are about to share a private dataset
- and giving them the option of doing so. If they respond positively, the sharing role is automatically created for them.
- </p>
- <p>
- Private data (data associated with roles that include the "access" permission) must be made public in order to be used
- with external applications like the "view at UCSC" link, or the "Perform genome analysis and prediction with EpiGRAPH"
- tool. Being made publically accessible means removing the association of all roles that include the "access" permission
- from the dataset.
- <p>
- </li>
- <li><strong>manage permissions</strong> - Role members can manage the permissions applied to this dataset</li>
- </ul>
- </li>
-</ul>
-<br/>
diff -r 34eec4d48cc4 -r f6e86e26cfe2 templates/webapps/community/admin/center.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/webapps/community/admin/center.mako Fri Apr 23 15:16:24 2010 -0400
@@ -0,0 +1,41 @@
+<%inherit file="/base.mako"/>
+
+<%def name="title()">Galaxy Administration</%def>
+
+<h2>Administration</h2>
+
+<p>The menu on the left provides the following features</p>
+<ul>
+ <li><strong>Security</strong> - see the <strong>Data Security and Data Libraries</strong> section below for details
+ <p/>
+ <ul>
+ <li>
+ <strong>Manage users</strong> - provides a view of the registered users and all groups and non-private roles associated
+ with each user.
+ </li>
+ <p/>
+ <li>
+ <strong>Manage groups</strong> - provides a view of all groups along with the members of the group and the roles associated with
+ each group (both private and non-private roles). The group names include a link to a page that allows you to manage the users and
+ roles that are associated with the group.
+ </li>
+ <p/>
+ <li>
+ <strong>Manage roles</strong> - provides a view of all non-private roles along with the role type, and the users and groups that
+ are associated with the role. The role names include a link to a page that allows you to manage the users and groups that are associated
+ with the role. The page also includes a view of the data library datasets that are associated with the role and the permissions applied
+ to each dataset.
+ </li>
+ </ul>
+ </li>
+ <p/>
+ <li><strong>Tools</strong>
+ <p/>
+ <ul>
+ <li>
+ <strong>Manage tools</strong> - coming soon...
+ </li>
+ </ul>
+ </li>
+</ul>
+<br/>
diff -r 34eec4d48cc4 -r f6e86e26cfe2 templates/webapps/community/admin/index.mako
--- a/templates/webapps/community/admin/index.mako Fri Apr 23 13:16:40 2010 -0400
+++ b/templates/webapps/community/admin/index.mako Fri Apr 23 15:16:24 2010 -0400
@@ -74,11 +74,19 @@
<span>Security</span>
</div>
<div class="toolSectionBody">
- <div class="toolSectionBg">
- <div class="toolTitle"><a href="${h.url_for( controller='admin', action='users', webapp='community' )}" target="galaxy_main">Manage users</a></div>
- <div class="toolTitle"><a href="${h.url_for( controller='admin', action='groups', webapp='community' )}" target="galaxy_main">Manage groups</a></div>
- <div class="toolTitle"><a href="${h.url_for( controller='admin', action='roles', webapp='community' )}" target="galaxy_main">Manage roles</a></div>
- </div>
+ <div class="toolSectionBg">
+ <div class="toolTitle"><a href="${h.url_for( controller='admin', action='users', webapp='community' )}" target="galaxy_main">Manage users</a></div>
+ <div class="toolTitle"><a href="${h.url_for( controller='admin', action='groups', webapp='community' )}" target="galaxy_main">Manage groups</a></div>
+ <div class="toolTitle"><a href="${h.url_for( controller='admin', action='roles', webapp='community' )}" target="galaxy_main">Manage roles</a></div>
+ </div>
+ </div>
+ <div class="toolSectionTitle">
+ <span>Tools</span>
+ </div>
+ <div class="toolSectionBody">
+ <div class="toolSectionBg">
+ <div class="toolTitle"><a href="${h.url_for( controller='tool_browser', action='browse_tools', webapp='community' )}" target="galaxy_main">Manage tools</a></div>
+ </div>
</div>
</div>
</div>
@@ -87,7 +95,7 @@
<%def name="center_panel()">
<%
- center_url = h.url_for( action='center' )
+ center_url = h.url_for( action='center', webapp='community' )
%>
<iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"> </iframe>
</%def>
diff -r 34eec4d48cc4 -r f6e86e26cfe2 templates/webapps/galaxy/admin/center.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/webapps/galaxy/admin/center.mako Fri Apr 23 15:16:24 2010 -0400
@@ -0,0 +1,187 @@
+<%inherit file="/base.mako"/>
+
+<%def name="title()">Galaxy Administration</%def>
+
+<h2>Administration</h2>
+
+<p>The menu on the left provides the following features</p>
+<ul>
+ <li><strong>Security</strong> - see the <strong>Data Security and Data Libraries</strong> section below for details
+ <p/>
+ <ul>
+ <li>
+ <strong>Manage users</strong> - provides a view of the registered users and all groups and non-private roles associated
+ with each user.
+ </li>
+ <p/>
+ <li>
+ <strong>Manage groups</strong> - provides a view of all groups along with the members of the group and the roles associated with
+ each group (both private and non-private roles). The group names include a link to a page that allows you to manage the users and
+ roles that are associated with the group.
+ </li>
+ <p/>
+ <li>
+ <strong>Manage roles</strong> - provides a view of all non-private roles along with the role type, and the users and groups that
+ are associated with the role. The role names include a link to a page that allows you to manage the users and groups that are associated
+ with the role. The page also includes a view of the data library datasets that are associated with the role and the permissions applied
+ to each dataset.
+ </li>
+ </ul>
+ </li>
+ <p/>
+ <li><strong>Data</strong>
+ <p/>
+ <ul>
+ <li>
+ <strong>Manage data libraries</strong> - Data libraries enable a Galaxy administrator to upload datasets into a data library. Currently,
+ only administrators can create data libraries.
+ <p/>
+ When a data library is first created, it is considered "public" since it will be displayed in the "Data Libraries" view for any user, even
+ those that are not logged in. The Galaxy administrator can restrict access to a data library by associating roles with the data library's
+ "access library" permission. This permission will conservatively override the [dataset] "access" permission for the data library's contained
+ datasets.
+ <p/>
+ For example, if a data library's "access library" permission is associated with Role1 and the data library contains "public" datasets, the
+ data library will still only be displayed to those users that have Role1. However, if the data library's "access library" permission is
+ associated with both Role1 and Role2 and the data library contains datasets whose [dataset] "access" permission is associated with only Role1,
+ then users that have Role2 will be able to access the library, but will not see those contained datasets whose [dataset] "access" permission
+ is associated with only Role1.
+ <p/>
+ In addition to the "access library" permission, permission to perform the following functions on the data library (and it's contents) can
+ be granted to users (a library item is one of: a data library, a library folder, a library dataset).
+ <p/>
+ <ul>
+ <li><strong>add library item</strong> - Role members can add library items to this data library or folder</li>
+ <li><strong>modify library item</strong> - Role members can modify this library item</li>
+ <li><strong>manage library permissions</strong> - Role members can manage permissions applied to this library item</li>
+ </ul>
+ <p/>
+ The default behavior is for no permissions to be applied to a data library item, but applied permissions are inherited downward (with the exception
+ of the "access library" permission, which is only available on the data library itself). Because of this, it is important to set desired permissions
+ on a new data library when it is created. When this is done, new folders and datasets added to the data library will automatically inherit those
+ permissions. In the same way, permissions can be applied to a folder, which will be automatically inherited by all contained datasets and sub-folders.
+ <p/>
+ The "Data Libraries" menu item allows users to access the datasets in a data library as long as they are not restricted from accessing them.
+ Importing a library dataset into a history will not make a copy of the dataset, but will be a "pointer" to the dataset on disk. This
+ approach allows for multiple users to use a single (possibly very large) dataset file.
+ </li>
+ </ul>
+ </li>
+ <p/>
+ <li><strong>Server</strong>
+ <p/>
+ <ul>
+ <li>
+ <strong>Reload a tool's configuration</strong> - allows a new version of a tool to be loaded while the server is running
+ </li>
+ <p/>
+ <li>
+ <strong>Profile memory usage</strong> - measures system memory used for certain Galaxy functions
+ </li>
+ <p/>
+ <li>
+ <strong>Manage jobs</strong> - displays all jobs that are currently not finished (i.e., their state is new, waiting, queued, or
+ running). Administrators are able to cleanly stop long-running jobs.
+ </li>
+ </ul>
+ </li>
+ <p/>
+ <li><strong>Forms</strong>
+ <p/>To be completed
+ </li>
+ <p/>
+ <li><strong>Sequencing Requests</strong>
+ <p/>To be completed
+ </li>
+ <p/>
+ <li><strong>Cloud</strong>
+ <p/>To be completed
+ </li>
+</ul>
+<p/>
+<p><strong>Data Security and Data Libraries</strong></p>
+<p/>
+<strong>Security</strong> - Data security in Galaxy is a new feature, so familiarize yourself with the details which can be found
+here or in our <a href="http://g2.trac.bx.psu.edu/wiki/SecurityFeatures" target="_blank">data security page</a>. The data security
+process incorporates users, groups and roles, and enables the application of certain permissions on datasets, specifically "access"
+and "manage permissions". By default, the "manage permissions" permission is associated with the dataset owner's private role, and
+the "access" permission is not set, making the dataset public. With these default permissions, users should not see any difference
+in the way Galaxy has behaved in the past.
+<ul>
+ <li>
+ <strong>Users</strong> - registered Galaxy users that have created a Galaxy account. Users can belong to groups and can
+ be associated with 1 or more roles. If a user is not authenticated during a Galaxy session, they will not have access to any
+ of the security features, and datasets they create during that session will have no permissions applied to them (i.e., they
+ will be considered "public", and no one will be allowed to change permissions on them).
+ </li>
+ <p/>
+ <li>
+ <strong>Groups</strong> - a set of 0 or more users which are considered members of the group. Groups can be associated with 0
+ or more roles, simplifying the process of applying permissions to the data between a select group of users.
+ </li>
+ <p/>
+ <li>
+ <strong>Roles</strong> - associate users and groups with specific permissions on datasets. For example, users in groups A and B
+ can be associated with role C which gives them the "access" permission on datasets D, E and F. Roles have a type which is currently
+ one of the following:
+ <ul>
+ <li>
+ <strong>private</strong> - every user is associated automatically with their own private role. Administrators cannot
+ manage private roles.
+ </li>
+ <li>
+ <strong>user</strong> - this is currently not used, but eventually any registered user will be able to create a new role
+ and this will be it's type.
+ </li>
+ <li>
+ <strong>sharing</strong> - a role created automatically during a Galaxy session that enables a user to share data with
+ another user. This can generally be considered a temporary role.
+ </li>
+ <li><strong>admin</strong> - a role created by a Galaxy administrator.</li>
+ </ul>
+ </li>
+ <p/>
+ <li>
+ <strong>Dataset Permissions</strong> - applying the following permissions will to a dataset will result in the behavior described.
+ <ul>
+ <li>
+ <strong>access</strong> - users associated with the role can import this dataset into their history for analysis.
+ <p>
+ If no roles with the "access" permission are associated with a dataset, the dataset is "public" and may be accessed by anyone
+ that can access the data library in which it is contained. See the <strong>Manage data libraries</strong> section above for
+ details. Public datasets contained in public data libraries will be accessible to all users (as well as anyone not logged in
+ during a Galaxy session) from the list of data libraries displayed when the "Data Libraries" menu item is selected.
+ </p>
+ <p>
+ Associating a dataset with a role that includes the "access" permission restricts the set of users that can access it.
+ For example, if 'Role A' includes the "access" permission and 'Role A' is associated with the dataset, only those users
+ and groups who are associated with 'Role A' may access the dataset.
+ </p>
+ <p>
+ If multiple roles that include the "access" permission are associated with a dataset, access to the dataset is derived
+ from the intersection of the users associated with the roles. For example, if 'Role A' and 'Role B' are associated with
+ a dataset, only those users and groups who are associated with both 'Role A' AND 'Role B' may access the dataset. When
+ the "access" permission is applied to a dataset, Galaxy checks to make sure that at least 1 user belongs to all groups and
+ roles associated with the "access" permission (otherwise the dataset would be restricted from everyone).
+ </p>
+ <p>
+ In order for a user to make a dataset private (i.e., only they can access it), they should associate the dataset with
+ their private role (the role identical to their Galaxy user name / email address). Associating additional roles that
+ include the "access" permission is not possible, since it would render the dataset inaccessible to everyone.
+ <p>
+ To make a dataset private to themselves and one or more other users, the user can create a new role and associate the dataset
+ with that role, not their "private role". Galaxy makes this easy by telling the user they are about to share a private dataset
+ and giving them the option of doing so. If they respond positively, the sharing role is automatically created for them.
+ </p>
+ <p>
+ Private data (data associated with roles that include the "access" permission) must be made public in order to be used
+ with external applications like the "view at UCSC" link, or the "Perform genome analysis and prediction with EpiGRAPH"
+ tool. Being made publically accessible means removing the association of all roles that include the "access" permission
+ from the dataset.
+ <p>
+ </li>
+ <li><strong>manage permissions</strong> - Role members can manage the permissions applied to this dataset</li>
+ </ul>
+ </li>
+</ul>
+<br/>
diff -r 34eec4d48cc4 -r f6e86e26cfe2 templates/webapps/galaxy/admin/index.mako
--- a/templates/webapps/galaxy/admin/index.mako Fri Apr 23 13:16:40 2010 -0400
+++ b/templates/webapps/galaxy/admin/index.mako Fri Apr 23 15:16:24 2010 -0400
@@ -133,7 +133,7 @@
<%def name="center_panel()">
<%
- center_url = h.url_for( action='center' )
+ center_url = h.url_for( action='center', webapp='galaxy' )
%>
<iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"> </iframe>
</%def>
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/34eec4d48cc4
changeset: 3685:34eec4d48cc4
user: rc
date: Fri Apr 23 13:16:40 2010 -0400
description:
lims: add tests for request_type permissions
diffstat:
test/base/twilltestcase.py | 15 ++
test/functional/test_forms_and_requests.py | 214 ++++++++++++++++++----------
2 files changed, 151 insertions(+), 78 deletions(-)
diffs (337 lines):
diff -r a77ec2944999 -r 34eec4d48cc4 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Fri Apr 23 11:30:16 2010 -0400
+++ b/test/base/twilltestcase.py Fri Apr 23 13:16:40 2010 -0400
@@ -1526,6 +1526,21 @@
tc.fv("1", "state_desc_%i" % index, state[1])
tc.submit( "save_request_type" )
self.check_page_for_string( "Request type <b>%s</b> has been created" % name )
+ def request_type_permissions( self, request_type_id, request_type_name, role_ids_str, permissions_in, permissions_out ):
+ # role_ids_str must be a comma-separated string of role ids
+ url = "requests_admin/manage_request_types?operation=permissions&id=%s&update_roles_button=Save" % ( request_type_id )
+ for po in permissions_out:
+ key = '%s_out' % po
+ url ="%s&%s=%s" % ( url, key, role_ids_str )
+ for pi in permissions_in:
+ key = '%s_in' % pi
+ url ="%s&%s=%s" % ( url, key, role_ids_str )
+ self.home()
+ self.visit_url( "%s/%s" % ( self.url, url ) )
+ print url
+ check_str = "Permissions updated for request type '%s'" % request_type_name
+ self.check_page_for_string( check_str )
+ self.home()
def create_request( self, request_type_id, name, desc, fields ):
self.home()
self.visit_url( "%s/requests/new?create=True&select_request_type=%i" % ( self.url,
diff -r a77ec2944999 -r 34eec4d48cc4 test/functional/test_forms_and_requests.py
--- a/test/functional/test_forms_and_requests.py Fri Apr 23 11:30:16 2010 -0400
+++ b/test/functional/test_forms_and_requests.py Fri Apr 23 13:16:40 2010 -0400
@@ -2,6 +2,7 @@
from galaxy.model.orm import *
from galaxy.model.mapping import context as sa_session
from base.twilltestcase import *
+from base.test_db_util import *
not_logged_in_as_admin_security_msg = 'You must be logged in as an administrator to access this feature.'
logged_in_as_admin_security_msg = 'You must be an administrator to access this feature.'
@@ -37,7 +38,80 @@
class TestFormsAndRequests( TwillTestCase ):
- def test_000_create_form( self ):
+ def test_000_initiate_users( self ):
+ """Ensuring all required user accounts exist"""
+ self.logout()
+ self.login( email='test1(a)bx.psu.edu', username='regular-user1' )
+ global regular_user1
+ regular_user1 = get_user( 'test1(a)bx.psu.edu' )
+ assert regular_user1 is not None, 'Problem retrieving user with email "test1(a)bx.psu.edu" from the database'
+ global regular_user1_private_role
+ regular_user1_private_role = get_private_role( regular_user1 )
+ self.logout()
+ self.login( email='test2(a)bx.psu.edu', username='regular-user2' )
+ global regular_user2
+ regular_user2 = get_user( 'test2(a)bx.psu.edu' )
+ assert regular_user2 is not None, 'Problem retrieving user with email "test2(a)bx.psu.edu" from the database'
+ global regular_user2_private_role
+ regular_user2_private_role = get_private_role( regular_user2 )
+ self.logout()
+ self.login( email='test3(a)bx.psu.edu', username='regular-user3' )
+ global regular_user3
+ regular_user3 = get_user( 'test3(a)bx.psu.edu' )
+ assert regular_user3 is not None, 'Problem retrieving user with email "test3(a)bx.psu.edu" from the database'
+ global regular_user3_private_role
+ regular_user3_private_role = get_private_role( regular_user3 )
+ self.logout()
+ self.login( email='test(a)bx.psu.edu', username='admin-user' )
+ global admin_user
+ admin_user = get_user( 'test(a)bx.psu.edu' )
+ assert admin_user is not None, 'Problem retrieving user with email "test(a)bx.psu.edu" from the database'
+ global admin_user_private_role
+ admin_user_private_role = get_private_role( admin_user )
+ def test_005_create_required_groups_and_roles( self ):
+ """Testing creating all required groups and roles for this script"""
+ # Logged in as admin_user
+ # Create role_one
+ name = 'Role One'
+ description = "This is Role One's description"
+ user_ids = [ str( admin_user.id ), str( regular_user1.id ), str( regular_user3.id ) ]
+ self.create_role( name=name,
+ description=description,
+ in_user_ids=user_ids,
+ in_group_ids=[],
+ create_group_for_role='no',
+ private_role=admin_user.email )
+ # Get the role object for later tests
+ global role_one
+ role_one = get_role_by_name( name )
+ # Create group_one
+ name = 'Group One'
+ self.create_group( name=name, in_user_ids=[ str( regular_user1.id ) ], in_role_ids=[ str( role_one.id ) ] )
+ # Get the group object for later tests
+ global group_one
+ group_one = get_group_by_name( name )
+ assert group_one is not None, 'Problem retrieving group named "Group One" from the database'
+ # NOTE: To get this to work with twill, all select lists on the ~/admin/role page must contain at least
+ # 1 option value or twill throws an exception, which is: ParseError: OPTION outside of SELECT
+ # Due to this bug in twill, we create the role, we bypass the page and visit the URL in the
+ # associate_users_and_groups_with_role() method.
+ #
+ #create role_two
+ name = 'Role Two'
+ description = 'This is Role Two'
+ user_ids = [ str( admin_user.id ) ]
+ group_ids = [ str( group_one.id ) ]
+ private_role = admin_user.email
+ self.create_role( name=name,
+ description=description,
+ in_user_ids=user_ids,
+ in_group_ids=group_ids,
+ private_role=private_role )
+ # Get the role object for later tests
+ global role_two
+ role_two = get_role_by_name( name )
+ assert role_two is not None, 'Problem retrieving role named "Role Two" from the database'
+ def test_010_create_form( self ):
"""Testing creating a new form and editing it"""
self.logout()
self.login( email='test(a)bx.psu.edu' )
@@ -58,7 +132,7 @@
self.check_page_for_string( new_name )
self.check_page_for_string( new_desc )
form_one_name = new_name
- def test_005_add_form_fields( self ):
+ def test_015_add_form_fields( self ):
"""Testing adding fields to a form definition"""
fields = [dict(name='Test field name one',
desc='Test field description one',
@@ -78,7 +152,7 @@
field_index=len(form_one.fields), fields=fields)
form_one_latest = get_latest_form(form_one_name)
assert len(form_one_latest.fields) == len(form_one.fields)+len(fields)
- def test_015_create_sample_form( self ):
+ def test_020_create_sample_form( self ):
"""Testing creating another form (for samples)"""
global form_two_name
desc = "This is Form Two's description"
@@ -90,7 +164,7 @@
self.check_page_for_string( form_two_name )
self.check_page_for_string( desc )
self.check_page_for_string( formtype )
- def test_020_create_request_type( self ):
+ def test_025_create_request_type( self ):
"""Testing creating a new requestype"""
request_form = get_latest_form(form_one_name)
sample_form = get_latest_form(form_two_name)
@@ -102,93 +176,77 @@
.order_by( desc( galaxy.model.RequestType.table.c.create_time ) ) \
.first()
assert request_type is not None, 'Problem retrieving request type named "%s" from the database' % request_type_name
- def test_025_create_address_and_library( self ):
+ # Set permissions
+ permissions_in = [ k for k, v in galaxy.model.RequestType.permitted_actions.items() ]
+ permissions_out = []
+ # Role one members are: admin_user, regular_user1, regular_user3. Each of these users will be permitted for
+ # REQUEST_TYPE_ACCESS on this request_type
+ self.request_type_permissions(self.security.encode_id( request_type.id ),
+ request_type.name,
+ str( role_one.id ),
+ permissions_in,
+ permissions_out )
+ # Make sure the request_type is not accessible by regular_user2 since regular_user2 does not have Role1.
+ self.logout()
+ self.login( email=regular_user2.email )
+ self.visit_url( '%s/requests/new?create=True&select_request_type=%i' % (self.url, request_type.id) )
+ try:
+ self.check_page_for_string( 'There are no request types created for a new request.' )
+ raise AssertionError, 'The request_type %s is accessible by %s when it should be restricted' % ( request_type.name, regular_user2.email )
+ except:
+ pass
+ self.logout()
+ self.login( email=admin_user.email )
+
+ def test_030_create_address_and_library( self ):
"""Testing address & library creation"""
- # first create a regular user
- self.logout()
- self.login( email='test1(a)bx.psu.edu', username='regular-user1' )
- self.logout()
- self.login( email='test(a)bx.psu.edu' )
# first create a library for the request so that it can be submitted later
- lib_name = 'TestLib001'
- self.create_library( lib_name, '' )
- self.visit_page( 'library_admin/browse_libraries' )
- self.check_page_for_string( lib_name )
+ name = "TestLib001"
+ description = "TestLib001 description"
+ synopsis = "TestLib001 synopsis"
+ self.create_library( name=name, description=description, synopsis=synopsis )
# Get the library object for later tests
global library_one
- library_one = sa_session.query( galaxy.model.Library ) \
- .filter( and_( galaxy.model.Library.table.c.name==lib_name,
- galaxy.model.Library.table.c.deleted==False ) ) \
- .first()
- assert library_one is not None, 'Problem retrieving library named "%s" from the database' % lib_name
- global admin_user
- admin_user = sa_session.query( galaxy.model.User ) \
- .filter( galaxy.model.User.table.c.email=='test(a)bx.psu.edu' ) \
- .first()
- assert admin_user is not None, 'Problem retrieving user with email "test(a)bx.psu.edu" from the database'
- # Get the admin user's private role for later use
- global admin_user_private_role
- admin_user_private_role = None
- for role in admin_user.all_roles():
- if role.name == admin_user.email and role.description == 'Private Role for %s' % admin_user.email:
- admin_user_private_role = role
- break
- if not admin_user_private_role:
- raise AssertionError( "Private role not found for user '%s'" % admin_user.email )
- global regular_user1
- regular_user1 = sa_session.query( galaxy.model.User ) \
- .filter( galaxy.model.User.table.c.email=='test1(a)bx.psu.edu' ) \
- .first()
- assert regular_user1 is not None, 'Problem retrieving user with email "test1(a)bx.psu.edu" from the database'
- # Get the regular user's private role for later use
- global regular_user1_private_role
- regular_user1_private_role = None
- for role in regular_user1.all_roles():
- if role.name == regular_user1.email and role.description == 'Private Role for %s' % regular_user1.email:
- regular_user1_private_role = role
- break
- if not regular_user1_private_role:
- raise AssertionError( "Private role not found for user '%s'" % regular_user1.email )
- # Set permissions on the library, sort for later testing
+ library_one = get_library( name, description, synopsis )
+ assert library_one is not None, 'Problem retrieving library named "%s" from the database' % name
+ # Make sure library_one is public
+ assert 'access library' not in [ a.action for a in library_one.actions ], 'Library %s is not public when first created' % library_one.name
+ # Set permissions on the library, sort for later testing.
permissions_in = [ k for k, v in galaxy.model.Library.permitted_actions.items() ]
permissions_out = []
- name = 'Role for testing forms'
- description = "This is Role Ones description"
- user_ids=[ str( admin_user.id ), str( regular_user1.id ) ]
- self.create_role( name=name,
- description=description,
- in_user_ids=user_ids,
- in_group_ids=[],
- create_group_for_role='yes',
- private_role=admin_user.email )
- # Get the role object for later tests
- global role_one
- role_one = sa_session.query( galaxy.model.Role ).filter( galaxy.model.Role.table.c.name==name ).first()
- assert role_one is not None, 'Problem retrieving role named "Role for testing forms" from the database'
- # Role one members are: admin_user, regular_user1. Each of these users will be permitted to
- # LIBRARY_ADD, LIBRARY_MODIFY, LIBRARY_MANAGE for library items.
+ # Role one members are: admin_user, regular_user1, regular_user3. Each of these users will be permitted for
+ # LIBRARY_ACCESS, LIBRARY_ADD, LIBRARY_MODIFY, LIBRARY_MANAGE on this library and it's contents.
self.library_permissions( self.security.encode_id( library_one.id ),
library_one.name,
str( role_one.id ),
permissions_in,
permissions_out )
- # create a folder in the library
+ # Make sure the library is accessible by admin_user
+ self.visit_url( '%s/library/browse_libraries' % self.url )
+ self.check_page_for_string( library_one.name )
+ # Make sure the library is not accessible by regular_user2 since regular_user2 does not have Role1.
+ self.logout()
+ self.login( email=regular_user2.email )
+ self.visit_url( '%s/library/browse_libraries' % self.url )
+ try:
+ self.check_page_for_string( library_one.name )
+ raise AssertionError, 'Library %s is accessible by %s when it should be restricted' % ( library_one.name, regular_user2.email )
+ except:
+ pass
+ self.logout()
+ self.login( email=admin_user.email )
+ # create folder
root_folder = library_one.root_folder
- name = "Folder One"
+ name = "Root Folder's Folder One"
+ description = "This is the root folder's Folder One"
self.add_folder( 'library_admin',
self.security.encode_id( library_one.id ),
self.security.encode_id( root_folder.id ),
name=name,
- description='' )
+ description=description )
global folder_one
- folder_one = sa_session.query( galaxy.model.LibraryFolder ) \
- .filter( and_( galaxy.model.LibraryFolder.table.c.parent_id==root_folder.id,
- galaxy.model.LibraryFolder.table.c.name==name ) ) \
- .first()
+ folder_one = get_folder( root_folder.id, name, description )
assert folder_one is not None, 'Problem retrieving library folder named "%s" from the database' % name
- self.home()
- self.visit_url( '%s/library_common/browse_library?cntrller=library_admin&id=%s' % ( self.url, self.security.encode_id( library_one.id ) ) )
- self.check_page_for_string( name )
# create address
self.logout()
self.login( email='test1(a)bx.psu.edu', username='regular-user1' )
@@ -202,7 +260,7 @@
.filter( and_( galaxy.model.UserAddress.table.c.desc==address1[ 'short_desc' ],
galaxy.model.UserAddress.table.c.deleted==False ) ) \
.first()
- def test_030_create_request( self ):
+ def test_035_create_request( self ):
"""Testing creating, editing and submitting a request as a regular user"""
# login as a regular user
self.logout()
@@ -240,7 +298,7 @@
# check if the request's state is now set to 'submitted'
assert request_one.state is not request_one.states.SUBMITTED, "The state of the request '%s' should be set to '%s'" \
% ( request_one.name, request_one.states.SUBMITTED )
- def test_035_request_lifecycle( self ):
+ def test_040_request_lifecycle( self ):
"""Testing request lifecycle as it goes through all the states"""
# goto admin manage requests page
self.logout()
@@ -264,7 +322,7 @@
self.check_request_grid(state='Complete', request_name=request_one.name)
assert request_one.state is not request_one.states.COMPLETE, "The state of the request '%s' should be set to '%s'" \
% ( request_one.name, request_one.states.COMPLETE )
- def test_040_admin_create_request_on_behalf_of_regular_user( self ):
+ def test_045_admin_create_request_on_behalf_of_regular_user( self ):
"""Testing creating and submitting a request as an admin on behalf of a regular user"""
self.logout()
self.login( email='test(a)bx.psu.edu' )
@@ -301,7 +359,7 @@
# check if both the requests is showing in the 'All' filter
self.check_request_admin_grid(state='All', request_name=request_one.name)
self.check_request_admin_grid(state='All', request_name=request_two.name)
- def test_045_reject_request( self ):
+ def test_050_reject_request( self ):
'''Testing rejecting a request'''
self.logout()
self.login( email='test(a)bx.psu.edu' )
@@ -312,7 +370,7 @@
# check if the request's state is now set to 'submitted'
assert request_two.state is not request_two.states.REJECTED, "The state of the request '%s' should be set to '%s'" \
% ( request_two.name, request_two.states.REJECTED )
- def test_050_reset_data_for_later_test_runs( self ):
+ def test_055_reset_data_for_later_test_runs( self ):
"""Reseting data to enable later test runs to pass"""
# TODO: RC: add whatever is missing from this method that should be marked
# deleted or purged so that later test runs will correctly test features if the
1
0