Changeset 7809
- Timestamp:
- May 19, 2020, 1:35:05 PM (3 years ago)
- Location:
- branches/3.16-stable/www
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.16-stable/www/biomaterials/biosources/list_biosources.jsp
r7801 r7809 118 118 final boolean createSamplePermission = sc.hasPermission(Permission.CREATE, Item.SAMPLE); 119 119 120 // List membership 120 121 final ItemQuery<ItemList> listQuery = ItemList.getQuery(); 121 122 listQuery.setIncludes(cc.getInclude()); … … 245 246 title="Description" 246 247 sortable="true" 247 filterable="true" subclass="foobar"248 filterable="true" 248 249 exportable="true" 249 250 /> -
branches/3.16-stable/www/biomaterials/extracts/list_extracts.jsp
r7804 r7809 48 48 import="net.sf.basedb.core.ItemResultList" 49 49 import="net.sf.basedb.core.ItemContext" 50 import="net.sf.basedb.core.ItemList" 50 51 import="net.sf.basedb.core.Nameable" 51 52 import="net.sf.basedb.core.Permission" … … 74 75 import="net.sf.basedb.util.formatter.Formatter" 75 76 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 77 import="net.sf.basedb.util.formatter.NameableFormatter" 78 import="net.sf.basedb.clients.web.formatter.LinkedItemFormatter" 76 79 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 77 80 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" … … 105 108 106 109 final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); 110 final Formatter<Nameable> nameableFormatter = mode.hasPropertyLink() ? new LinkedItemFormatter(mode.hasEditLink()) : new NameableFormatter(); 107 111 final String callback = request.getParameter("callback"); 108 112 final String title = mode.generateTitle("extract", "extracts"); … … 141 145 bioAssayQuery.restrict(Restrictions.eq(Hql.property("src", "bioMaterial"), Hql.entityParameter("extract", Item.EXTRACT))); 142 146 bioAssayQuery.order(Orders.asc(Hql.property("name"))); 143 bioAssayQuery. include(cc.getInclude());147 bioAssayQuery.setIncludes(cc.getInclude()); 144 148 145 149 // Child derived bioassays … … 147 151 derivedAssayQuery.restrict(Restrictions.eq(Hql.property("extract"), Hql.entityParameter("extract", Item.EXTRACT))); 148 152 derivedAssayQuery.order(Orders.asc(Hql.property("name"))); 149 derivedAssayQuery. include(cc.getInclude());153 derivedAssayQuery.setIncludes(cc.getInclude()); 150 154 151 155 // Child raw bioassays … … 153 157 rawAssayQuery.restrict(Restrictions.eq(Hql.property("parentExtract"), Hql.entityParameter("extract", Item.EXTRACT))); 154 158 rawAssayQuery.order(Orders.asc(Hql.property("name"))); 155 rawAssayQuery. include(cc.getInclude());159 rawAssayQuery.setIncludes(cc.getInclude()); 156 160 157 161 // Child extracts … … 161 165 childExtractsQuery.restrict(Restrictions.eq(Hql.property("src", "bioMaterial"), Hql.entityParameter("extract", Item.EXTRACT))); 162 166 childExtractsQuery.order(Orders.asc(Hql.property("name"))); 163 childExtractsQuery. include(cc.getInclude());167 childExtractsQuery.setIncludes(cc.getInclude()); 164 168 165 169 // Parent extracts … … 169 173 parentExtractsQuery.restrict(Restrictions.eq(Hql.alias("evt"), Hql.entityParameter("creationEvent", Item.BIOMATERIALEVENT))); 170 174 parentExtractsQuery.order(Orders.asc(Hql.property("name"))); 171 parentExtractsQuery. include(cc.getInclude());175 parentExtractsQuery.setIncludes(cc.getInclude()); 172 176 177 // List membership 178 final ItemQuery<ItemList> listQuery = ItemList.getQuery(); 179 listQuery.setIncludes(cc.getInclude()); 180 listQuery.join(Hql.innerJoin("members", "m")); 181 listQuery.restrict(Restrictions.eq(Hql.property("memberType"), Expressions.integer(itemType.getValue()))); 182 listQuery.restrict(Restrictions.eq(Hql.alias("m"), Expressions.parameter("itemId", Type.INT))); 183 listQuery.order(Orders.asc(Hql.property("name"))); 184 173 185 Unit microGram = UnitUtil.getUnit(dc, Quantity.MASS, "µg"); 174 186 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 896 908 <% 897 909 childExtractsQuery.setEntityParameter("extract", item); 898 String separator = "";899 for (Extract e : childExtractsQuery.list(dc))900 {901 out.write(separator);902 if (mode.hasPropertyLink())903 {904 out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink()));905 }906 else907 {908 out.write(HTML.encodeTags(e.getName()));909 }910 separator = ", ";911 }912 910 %> 911 <%=Values.getString(childExtractsQuery.list(dc), ", ", false, nameableFormatter) %> 913 912 <base:icon 914 913 id="<%="newextract."+itemId%>" … … 923 922 <tbl:cell column="physicalBioAssays"> 924 923 <% 925 try 926 { 927 bioAssayQuery.setEntityParameter("extract", item); 928 String separator = ""; 929 for (PhysicalBioAssay pba : bioAssayQuery.list(dc)) 930 { 931 out.write(separator); 932 if (mode.hasPropertyLink()) 933 { 934 out.write(Base.getLinkedName(ID, pba, false, mode.hasEditLink())); 935 } 936 else 937 { 938 out.write(HTML.encodeTags(pba.getName())); 939 } 940 separator = ", "; 941 } 942 } 943 catch (Throwable t) 944 { 945 %> 946 <div class="error"><%=t.getMessage()%></div> 947 <% 948 } 924 bioAssayQuery.setEntityParameter("extract", item); 949 925 %> 926 <%=Values.getString(bioAssayQuery.list(dc), ", ", false, nameableFormatter) %> 950 927 </tbl:cell> 951 928 <tbl:cell column="derivedBioAssays"> 952 929 <% 953 try 954 { 955 derivedAssayQuery.setEntityParameter("extract", item); 956 String separator = ""; 957 for (DerivedBioAssay dba : derivedAssayQuery.list(dc)) 958 { 959 out.write(separator); 960 if (mode.hasPropertyLink()) 961 { 962 out.write(Base.getLinkedName(ID, dba, false, mode.hasEditLink())); 963 } 964 else 965 { 966 out.write(HTML.encodeTags(dba.getName())); 967 } 968 separator = ", "; 969 } 970 } 971 catch (Throwable t) 972 { 973 %> 974 <div class="error"><%=t.getMessage()%></div> 975 <% 976 } 930 derivedAssayQuery.setEntityParameter("extract", item); 977 931 %> 932 <%=Values.getString(derivedAssayQuery.list(dc), ", ", false, nameableFormatter) %> 978 933 <base:icon 979 934 id="<%="newDerivedBioAssay."+itemId%>" … … 988 943 <tbl:cell column="rawBioAssays"> 989 944 <% 990 try 991 { 992 rawAssayQuery.setEntityParameter("extract", item); 993 String separator = ""; 994 for (RawBioAssay rba : rawAssayQuery.list(dc)) 995 { 996 out.write(separator); 997 if (mode.hasPropertyLink()) 998 { 999 out.write(Base.getLinkedName(ID, rba, false, mode.hasEditLink())); 1000 } 1001 else 1002 { 1003 out.write(HTML.encodeTags(rba.getName())); 1004 } 1005 separator = ", "; 1006 } 1007 } 1008 catch (Throwable t) 1009 { 1010 %> 1011 <div class="error"><%=t.getMessage()%></div> 1012 <% 1013 } 945 rawAssayQuery.setEntityParameter("extract", item); 1014 946 %> 947 <%=Values.getString(rawAssayQuery.list(dc), ", ", false, nameableFormatter) %> 1015 948 <base:icon 1016 949 id="<%="newRawBioAssay."+itemId%>" … … 1022 955 visible="<%=mode.hasEditLink() && createRawBioAssayPermission && usePermission %>" 1023 956 /> 957 </tbl:cell> 958 <tbl:cell column="itemList"> 959 <% 960 listQuery.setParameter("itemId", itemId, Type.INT); 961 %> 962 <%=Values.getString(listQuery.list(dc), ", ", false, nameableFormatter) %> 1024 963 </tbl:cell> 1025 964 <% … … 1120 1059 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 1121 1060 <tbl:cell column="sharedTo"> 1122 <% 1123 Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); 1124 while(sharees.hasNext()) 1125 { 1126 Nameable n = sharees.next(); 1127 if (mode.hasPropertyLink()) 1128 { 1129 out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); 1130 } 1131 else 1132 { 1133 out.write(HTML.encodeTags(n.getName())); 1134 } 1135 out.write(sharees.hasNext() ? ", " : ""); 1136 } 1137 %> 1061 <%=Values.getString(ShareableUtil.getSharedTo(dc, item), ", ", false, nameableFormatter) %> 1138 1062 </tbl:cell> 1139 1063 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> -
branches/3.16-stable/www/biomaterials/extracts/view_extract.jsp
r7604 r7809 628 628 <jsp:param name="title" value="Other items related to this extract" /> 629 629 </jsp:include> 630 631 <jsp:include page="../../common/itemlists/list_membership.jsp"> 632 <jsp:param name="ID" value="<%=ID%>" /> 633 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 634 <jsp:param name="item_id" value="<%=itemId%>" /> 635 <jsp:param name="title" value="Item lists where this extract is a member" /> 636 </jsp:include> 637 630 638 <jsp:include page="../../common/share/list_share.jsp"> 631 639 <jsp:param name="ID" value="<%=ID%>" /> -
branches/3.16-stable/www/biomaterials/samples/list_samples.jsp
r7804 r7809 42 42 import="net.sf.basedb.core.ItemResultList" 43 43 import="net.sf.basedb.core.ItemContext" 44 import="net.sf.basedb.core.ItemList" 44 45 import="net.sf.basedb.core.Nameable" 45 46 import="net.sf.basedb.core.Permission" … … 72 73 import="net.sf.basedb.util.formatter.Formatter" 73 74 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 75 import="net.sf.basedb.util.formatter.NameableFormatter" 76 import="net.sf.basedb.clients.web.formatter.LinkedItemFormatter" 74 77 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 75 78 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" … … 102 105 103 106 final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); 107 final Formatter<Nameable> nameableFormatter = mode.hasPropertyLink() ? new LinkedItemFormatter(mode.hasEditLink()) : new NameableFormatter(); 104 108 final String callback = request.getParameter("callback"); 105 109 final String title = mode.generateTitle("sample", "samples"); … … 125 129 childSamplesQuery.restrict(Restrictions.eq(Hql.property("src", "bioMaterial"), Hql.entityParameter("sample", Item.SAMPLE))); 126 130 childSamplesQuery.order(Orders.asc(Hql.property("name"))); 127 childSamplesQuery. include(cc.getInclude());131 childSamplesQuery.setIncludes(cc.getInclude()); 128 132 129 133 // Parent samples … … 133 137 parentSamplesQuery.restrict(Restrictions.eq(Hql.alias("evt"), Hql.entityParameter("creationEvent", Item.BIOMATERIALEVENT))); 134 138 parentSamplesQuery.order(Orders.asc(Hql.property("name"))); 135 parentSamplesQuery. include(cc.getInclude());139 parentSamplesQuery.setIncludes(cc.getInclude()); 136 140 141 // List membership 142 final ItemQuery<ItemList> listQuery = ItemList.getQuery(); 143 listQuery.setIncludes(cc.getInclude()); 144 listQuery.join(Hql.innerJoin("members", "m")); 145 listQuery.restrict(Restrictions.eq(Hql.property("memberType"), Expressions.integer(itemType.getValue()))); 146 listQuery.restrict(Restrictions.eq(Hql.alias("m"), Expressions.parameter("itemId", Type.INT))); 147 listQuery.order(Orders.asc(Hql.property("name"))); 148 137 149 Unit microGram = UnitUtil.getUnit(dc, Quantity.MASS, "µg"); 138 150 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 842 854 <% 843 855 childSamplesQuery.setEntityParameter("sample", item); 844 String separator = "";845 for (Sample s : childSamplesQuery.list(dc))846 {847 out.write(separator);848 if (mode.hasPropertyLink())849 {850 out.write(Base.getLinkedName(ID, s, false, mode.hasEditLink()));851 }852 else853 {854 out.write(HTML.encodeTags(s.getName()));855 }856 separator = ", ";857 }858 856 %> 857 <%=Values.getString(childSamplesQuery.list(dc), ", ", false, nameableFormatter) %> 859 858 <base:icon 860 859 id="<%="newsample."+itemId%>" … … 870 869 <% 871 870 extractQuery.setEntityParameter("sample", item); 872 try873 {874 String separator = "";875 for(Extract e : extractQuery.list(dc))876 {877 out.write(separator);878 if (mode.hasPropertyLink())879 {880 out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink()));881 }882 else883 {884 out.write(HTML.encodeTags(e.getName()));885 }886 separator = ", ";887 }888 }889 catch (Throwable t)890 {891 %>892 <div class="error"><%=t.getMessage()%></div>893 <%894 }895 871 %> 872 <%=Values.getString(extractQuery.list(dc), ", ", false, nameableFormatter) %> 896 873 <base:icon 897 874 id="<%="newsample."+itemId%>" … … 903 880 visible="<%=mode.hasEditLink() && createExtractPermission && usePermission %>" 904 881 /> 882 </tbl:cell> 883 <tbl:cell column="itemList"> 884 <% 885 listQuery.setParameter("itemId", itemId, Type.INT); 886 %> 887 <%=Values.getString(listQuery.list(dc), ", ", false, nameableFormatter) %> 905 888 </tbl:cell> 906 889 <tbl:cell column="owner" … … 937 920 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 938 921 <tbl:cell column="sharedTo"> 939 <% 940 Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); 941 while(sharees.hasNext()) 942 { 943 Nameable n = sharees.next(); 944 if (mode.hasPropertyLink()) 945 { 946 out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); 947 } 948 else 949 { 950 out.write(HTML.encodeTags(n.getName())); 951 } 952 out.write(sharees.hasNext() ? ", " : ""); 953 } 954 %> 922 <%=Values.getString(ShareableUtil.getSharedTo(dc, item), ", ", false, nameableFormatter) %> 955 923 </tbl:cell> 956 924 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> -
branches/3.16-stable/www/biomaterials/samples/view_sample.jsp
r7604 r7809 490 490 <jsp:param name="title" value="Other items related to this sample" /> 491 491 </jsp:include> 492 493 <jsp:include page="../../common/itemlists/list_membership.jsp"> 494 <jsp:param name="ID" value="<%=ID%>" /> 495 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 496 <jsp:param name="item_id" value="<%=itemId%>" /> 497 <jsp:param name="title" value="Item lists where this sample is a member" /> 498 </jsp:include> 499 492 500 493 501 <jsp:include page="../../common/share/list_share.jsp"> -
branches/3.16-stable/www/common/itemlists/list_membership.jsp
r7808 r7809 149 149 RawDataType rdt = list.getRawDataType(); 150 150 %> 151 (<%=rdt != null ? HTML.encodeTags(rdt.getName()) : "<i>any</i>"%>)151 <%=rdt != null ? HTML.encodeTags(rdt.getName()) : "<i>any</i>"%> 152 152 <% 153 153 } -
branches/3.16-stable/www/views/derivedbioassays/list_bioassays.jsp
r7804 r7809 36 36 import="net.sf.basedb.core.DataFileType" 37 37 import="net.sf.basedb.core.ItemQuery" 38 import="net.sf.basedb.core.ItemList" 38 39 import="net.sf.basedb.core.Include" 39 40 import="net.sf.basedb.core.Type" … … 64 65 import="net.sf.basedb.clients.web.util.HTML" 65 66 import="net.sf.basedb.util.formatter.Formatter" 67 import="net.sf.basedb.util.formatter.NameableFormatter" 68 import="net.sf.basedb.clients.web.formatter.LinkedItemFormatter" 66 69 import="net.sf.basedb.clients.web.formatter.DataFileFormatter" 67 70 import="net.sf.basedb.clients.web.formatter.FormatterFactory" … … 97 100 98 101 final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); 102 final Formatter<Nameable> nameableFormatter = mode.hasPropertyLink() ? new LinkedItemFormatter(mode.hasEditLink()) : new NameableFormatter(); 99 103 final String callback = request.getParameter("callback"); 100 104 final String title = mode.generateTitle("derived bioassay", "derived bioassays"); … … 123 127 // Query for parent physical bioassays to the current bioassay 124 128 final ItemQuery<PhysicalBioAssay> physicalBioAssayQuery = PhysicalBioAssay.getQuery(); 125 physicalBioAssayQuery. include(cc.getInclude());129 physicalBioAssayQuery.setIncludes(cc.getInclude()); 126 130 physicalBioAssayQuery.join(Hql.innerJoin("derivedBioAssays", "dba")); 127 131 physicalBioAssayQuery.restrict(Restrictions.eq(Hql.alias("dba"), Expressions.parameter("bioAssay"))); … … 130 134 // Query for parent bioassays to the current bioassay 131 135 final ItemQuery<DerivedBioAssay> parentQuery = DerivedBioAssay.getQuery(); 132 parentQuery. include(cc.getInclude());136 parentQuery.setIncludes(cc.getInclude()); 133 137 parentQuery.join(Hql.innerJoin("children", "c")); 134 138 parentQuery.restrict(Restrictions.eq(Hql.alias("c"), Expressions.parameter("bioAssay"))); … … 137 141 // Query for child bioassays to the current bioassay 138 142 final ItemQuery<DerivedBioAssay> childQuery = DerivedBioAssay.getQuery(); 139 childQuery. include(cc.getInclude());143 childQuery.setIncludes(cc.getInclude()); 140 144 childQuery.join(Hql.innerJoin("parents", "p")); 141 145 childQuery.restrict(Restrictions.eq(Hql.alias("p"), Expressions.parameter("bioAssay"))); … … 144 148 // Query for raw bioassays to the current bioassay 145 149 final ItemQuery<RawBioAssay> rawBioAssayQuery = RawBioAssay.getQuery(); 146 rawBioAssayQuery. include(cc.getInclude());150 rawBioAssayQuery.setIncludes(cc.getInclude()); 147 151 rawBioAssayQuery.restrict(Restrictions.eq(Hql.property("parentBioAssay"), Expressions.parameter("bioAssay"))); 148 152 rawBioAssayQuery.order(Orders.asc(Hql.property("name"))); 149 153 154 // List membership 155 final ItemQuery<ItemList> listQuery = ItemList.getQuery(); 156 listQuery.setIncludes(cc.getInclude()); 157 listQuery.join(Hql.innerJoin("members", "m")); 158 listQuery.restrict(Restrictions.eq(Hql.property("memberType"), Expressions.integer(itemType.getValue()))); 159 listQuery.restrict(Restrictions.eq(Hql.alias("m"), Expressions.parameter("itemId", Type.INT))); 160 listQuery.order(Orders.asc(Hql.property("name"))); 161 150 162 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 151 163 try … … 676 688 <% 677 689 childQuery.setParameter("bioAssay", itemId, Type.INT); 678 try679 {680 String separator = "";681 for (DerivedBioAssay child : childQuery.list(dc))682 {683 out.write(separator);684 if (mode.hasPropertyLink())685 {686 out.write(Base.getLinkedName(ID, child, false, mode.hasEditLink()));687 }688 else689 {690 out.write(HTML.encodeTags(child.getName()));691 }692 separator = ", ";693 }694 }695 catch (Throwable t)696 {697 %>698 <div class="error"><%=t.getMessage()%></div>699 <%700 }701 690 %> 691 <%=Values.getString(childQuery.list(dc), ", ", false, nameableFormatter) %> 702 692 <base:icon 703 693 subclass="link auto-init" … … 712 702 <% 713 703 rawBioAssayQuery.setParameter("bioAssay", itemId, Type.INT); 714 try715 {716 String separator = "";717 for (RawBioAssay rba : rawBioAssayQuery.list(dc))718 {719 out.write(separator);720 if (mode.hasPropertyLink())721 {722 out.write(Base.getLinkedName(ID, rba, false, mode.hasEditLink()));723 }724 else725 {726 out.write(HTML.encodeTags(rba.getName()));727 }728 separator = ", ";729 }730 }731 catch (Throwable t)732 {733 %>734 <div class="error"><%=t.getMessage()%></div>735 <%736 }737 704 %> 705 <%=Values.getString(rawBioAssayQuery.list(dc), ", ", false, nameableFormatter) %> 738 706 <base:icon 739 707 subclass="link auto-init" … … 748 716 <% 749 717 physicalBioAssayQuery.setParameter("bioAssay", itemId, Type.INT); 750 try751 {752 String separator = "";753 for (PhysicalBioAssay pba : physicalBioAssayQuery.list(dc))754 {755 out.write(separator);756 if (mode.hasPropertyLink())757 {758 out.write(Base.getLinkedName(ID, pba, false, mode.hasEditLink()));759 }760 else761 {762 out.write(HTML.encodeTags(pba.getName()));763 }764 separator = ", ";765 }766 }767 catch (Throwable t)768 {769 %>770 <div class="error"><%=t.getMessage()%></div>771 <%772 }773 718 %> 719 <%=Values.getString(physicalBioAssayQuery.list(dc), ", ", false, nameableFormatter) %> 774 720 </tbl:cell> 775 721 <tbl:cell column="parents"> … … 778 724 { 779 725 parentQuery.setParameter("bioAssay", itemId, Type.INT); 780 try 781 { 782 String separator = ""; 783 for (DerivedBioAssay dba : parentQuery.list(dc)) 784 { 785 out.write(separator); 786 if (mode.hasPropertyLink()) 787 { 788 out.write(Base.getLinkedName(ID, dba, false, mode.hasEditLink())); 789 } 790 else 791 { 792 out.write(HTML.encodeTags(dba.getName())); 793 } 794 separator = ", "; 795 } 796 } 797 catch (Throwable t) 798 { 799 %> 800 <div class="error"><%=t.getMessage()%></div> 801 <% 802 } 726 %> 727 <%=Values.getString(parentQuery.list(dc), ", ", false, nameableFormatter) %> 728 <% 803 729 } 804 730 %> 731 </tbl:cell> 732 <tbl:cell column="itemList"> 733 <% 734 listQuery.setParameter("itemId", itemId, Type.INT); 735 %> 736 <%=Values.getString(listQuery.list(dc), ", ", false, nameableFormatter) %> 805 737 </tbl:cell> 806 738 <tbl:cell column="extract" … … 896 828 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 897 829 <tbl:cell column="sharedTo"> 898 <% 899 Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); 900 while(sharees.hasNext()) 901 { 902 Nameable n = sharees.next(); 903 if (mode.hasPropertyLink()) 904 { 905 out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); 906 } 907 else 908 { 909 out.write(HTML.encodeTags(n.getName())); 910 } 911 out.write(sharees.hasNext() ? ", " : ""); 912 } 913 %> 830 <%=Values.getString(ShareableUtil.getSharedTo(dc, item), ", ", false, nameableFormatter) %> 914 831 </tbl:cell> 915 832 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> -
branches/3.16-stable/www/views/derivedbioassays/view_bioassay.jsp
r7786 r7809 740 740 <jsp:param name="title" value="Other items related to this bioassay" /> 741 741 </jsp:include> 742 <jsp:include page="../../common/itemlists/list_membership.jsp"> 743 <jsp:param name="ID" value="<%=ID%>" /> 744 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 745 <jsp:param name="item_id" value="<%=itemId%>" /> 746 <jsp:param name="title" value="Item lists where this bioassay is a member" /> 747 </jsp:include> 748 742 749 <jsp:include page="../../common/share/list_share.jsp"> 743 750 <jsp:param name="ID" value="<%=ID%>" /> -
branches/3.16-stable/www/views/physicalbioassays/list_bioassays.jsp
r7804 r7809 44 44 import="net.sf.basedb.core.ItemResultList" 45 45 import="net.sf.basedb.core.ItemContext" 46 import="net.sf.basedb.core.ItemList" 46 47 import="net.sf.basedb.core.Nameable" 47 48 import="net.sf.basedb.core.Permission" … … 67 68 import="net.sf.basedb.clients.web.util.HTML" 68 69 import="net.sf.basedb.util.formatter.Formatter" 70 import="net.sf.basedb.util.formatter.NameableFormatter" 71 import="net.sf.basedb.clients.web.formatter.LinkedItemFormatter" 69 72 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 70 73 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" … … 98 101 99 102 final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); 103 final Formatter<Nameable> nameableFormatter = mode.hasPropertyLink() ? new LinkedItemFormatter(mode.hasEditLink()) : new NameableFormatter(); 100 104 final String callback = request.getParameter("callback"); 101 105 final String title = mode.generateTitle("physical bioassay", "physical bioassays"); … … 121 125 // Query for extracts relatated to the current bioassay 122 126 final ItemQuery<Extract> extractQuery = Extract.getQuery(); 123 extractQuery. include(cc.getInclude());127 extractQuery.setIncludes(cc.getInclude()); 124 128 extractQuery.join(Hql.innerJoin("childCreationEvents", "cce")); 125 129 extractQuery.join(Hql.innerJoin("cce", "event", "evt")); … … 130 134 // Query for derived bioassay sets from to the current bioassay 131 135 final ItemQuery<DerivedBioAssay> dbasQuery = DerivedBioAssay.getQuery(); 132 dbasQuery. include(cc.getInclude());136 dbasQuery.setIncludes(cc.getInclude()); 133 137 dbasQuery.join(Hql.innerJoin("physicalBioAssays", "pba")); 134 138 dbasQuery.restrict(Restrictions.eq(Hql.alias("pba"), Expressions.parameter("bioAssay"))); 135 139 dbasQuery.restrict(Restrictions.eq(Hql.property("root"), Expressions.bool(true))); 136 140 dbasQuery.order(Orders.asc(Hql.property("name"))); 141 142 // List membership 143 final ItemQuery<ItemList> listQuery = ItemList.getQuery(); 144 listQuery.setIncludes(cc.getInclude()); 145 listQuery.join(Hql.innerJoin("members", "m")); 146 listQuery.restrict(Restrictions.eq(Hql.property("memberType"), Expressions.integer(itemType.getValue()))); 147 listQuery.restrict(Restrictions.eq(Hql.alias("m"), Expressions.parameter("itemId", Type.INT))); 148 listQuery.order(Orders.asc(Hql.property("name"))); 149 137 150 final boolean createDerivedBioAssayPermission = sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY); 138 151 … … 693 706 <% 694 707 dbasQuery.setParameter("bioAssay", itemId, Type.INT); 695 try696 {697 String separator = "";698 for (DerivedBioAssay dbas : dbasQuery.list(dc))699 {700 out.write(separator);701 if (mode.hasPropertyLink())702 {703 out.write(Base.getLinkedName(ID, dbas, false, mode.hasEditLink()));704 }705 else706 {707 out.write(HTML.encodeTags(dbas.getName()));708 }709 separator = ", ";710 }711 }712 catch (Throwable t)713 {714 %>715 <div class="error"><%=t.getMessage()%></div>716 <%717 }718 708 %> 709 <%=Values.getString(dbasQuery.list(dc), ", ", false, nameableFormatter) %> 719 710 <base:icon 720 711 subclass="link auto-init" … … 725 716 visible="<%=mode.hasEditLink() && createDerivedBioAssayPermission && usePermission %>" 726 717 /> 718 </tbl:cell> 719 <tbl:cell column="itemList"> 720 <% 721 listQuery.setParameter("itemId", itemId, Type.INT); 722 %> 723 <%=Values.getString(listQuery.list(dc), ", ", false, nameableFormatter) %> 727 724 </tbl:cell> 728 725 <tbl:cell column="protocol" … … 782 779 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 783 780 <tbl:cell column="sharedTo"> 784 <% 785 Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); 786 while(sharees.hasNext()) 787 { 788 Nameable n = sharees.next(); 789 if (mode.hasPropertyLink()) 790 { 791 out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); 792 } 793 else 794 { 795 out.write(HTML.encodeTags(n.getName())); 796 } 797 out.write(sharees.hasNext() ? ", " : ""); 798 } 799 %> 781 <%=Values.getString(ShareableUtil.getSharedTo(dc, item), ", ", false, nameableFormatter) %> 800 782 </tbl:cell> 801 783 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> -
branches/3.16-stable/www/views/physicalbioassays/view_bioassay.jsp
r7604 r7809 476 476 <jsp:param name="title" value="Other items related to this physical bioassay" /> 477 477 </jsp:include> 478 <jsp:include page="../../common/itemlists/list_membership.jsp"> 479 <jsp:param name="ID" value="<%=ID%>" /> 480 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 481 <jsp:param name="item_id" value="<%=itemId%>" /> 482 <jsp:param name="title" value="Item lists where this physical bioassay is a member" /> 483 </jsp:include> 484 478 485 <jsp:include page="../../common/share/list_share.jsp"> 479 486 <jsp:param name="ID" value="<%=ID%>" /> -
branches/3.16-stable/www/views/rawbioassays/list_rawbioassays.jsp
r7804 r7809 47 47 import="net.sf.basedb.core.ItemResultList" 48 48 import="net.sf.basedb.core.ItemContext" 49 import="net.sf.basedb.core.ItemList" 49 50 import="net.sf.basedb.core.Job" 50 51 import="net.sf.basedb.core.Nameable" … … 75 76 import="net.sf.basedb.util.Values" 76 77 import="net.sf.basedb.util.formatter.Formatter" 78 import="net.sf.basedb.util.formatter.NameableFormatter" 79 import="net.sf.basedb.clients.web.formatter.LinkedItemFormatter" 77 80 import="net.sf.basedb.clients.web.formatter.DataFileFormatter" 78 81 import="net.sf.basedb.clients.web.formatter.FormatterFactory" … … 108 111 109 112 final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); 113 final Formatter<Nameable> nameableFormatter = mode.hasPropertyLink() ? new LinkedItemFormatter(mode.hasEditLink()) : new NameableFormatter(); 110 114 final String callback = request.getParameter("callback"); 111 115 final String title = mode.generateTitle("raw bioassay", "raw bioassays"); … … 133 137 // Query for experiments relatated to the current raw bioassay 134 138 final ItemQuery<Experiment> experimentQuery = Experiment.getQuery(); 135 experimentQuery. include(cc.getInclude());139 experimentQuery.setIncludes(cc.getInclude()); 136 140 experimentQuery.join(Hql.innerJoin("rawBioAssays", "rba")); 137 141 experimentQuery.restrict(Restrictions.eq(Hql.alias("rba"), Expressions.parameter("rawBioAssay"))); 138 142 experimentQuery.order(Orders.asc(Hql.property("name"))); 139 143 144 // List membership 145 final ItemQuery<ItemList> listQuery = ItemList.getQuery(); 146 listQuery.setIncludes(cc.getInclude()); 147 listQuery.join(Hql.innerJoin("members", "m")); 148 listQuery.restrict(Restrictions.eq(Hql.property("memberType"), Expressions.integer(itemType.getValue()))); 149 listQuery.restrict(Restrictions.eq(Hql.alias("m"), Expressions.parameter("itemId", Type.INT))); 150 listQuery.order(Orders.asc(Hql.property("name"))); 151 140 152 // Get all platforms 141 153 final ItemQuery<Platform> platformQuery = Platform.getQuery(); 142 platformQuery. include(cc.getInclude());154 platformQuery.setIncludes(cc.getInclude()); 143 155 platformQuery.order(Orders.asc(Hql.property("name"))); 144 156 platformQuery.setCacheResult(true); … … 818 830 value="<%=job == null ? null : job.getEnded() %>" 819 831 /> 832 <tbl:cell column="itemList"> 833 <% 834 listQuery.setParameter("itemId", itemId, Type.INT); 835 %> 836 <%=Values.getString(listQuery.list(dc), ", ", false, nameableFormatter) %> 837 </tbl:cell> 820 838 <tbl:cell column="experiments"> 821 839 <% 822 840 experimentQuery.setParameter("rawBioAssay", itemId, Type.INT); 823 try824 {825 String separator = "";826 for (Experiment e : experimentQuery.list(dc))827 {828 out.write(separator);829 if (mode.hasPropertyLink())830 {831 out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink()));832 }833 else834 {835 out.write(HTML.encodeTags(e.getName()));836 }837 separator = ", ";838 }839 }840 catch (Throwable t)841 {842 %>843 <div class="error"><%=t.getMessage()%></div>844 <%845 }846 841 %> 842 <%=Values.getString(experimentQuery.list(dc), ", ", false, nameableFormatter) %> 847 843 </tbl:cell> 848 844 <tbl:cell column="owner" … … 889 885 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 890 886 <tbl:cell column="sharedTo"> 891 <% 892 Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); 893 while(sharees.hasNext()) 894 { 895 Nameable n = sharees.next(); 896 if (mode.hasPropertyLink()) 897 { 898 out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); 899 } 900 else 901 { 902 out.write(HTML.encodeTags(n.getName())); 903 } 904 out.write(sharees.hasNext() ? ", " : ""); 905 } 906 %> 887 <%=Values.getString(ShareableUtil.getSharedTo(dc, item), ", ", false, nameableFormatter) %> 907 888 </tbl:cell> 908 889 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> -
branches/3.16-stable/www/views/rawbioassays/view_rawbioassay.jsp
r7635 r7809 592 592 <jsp:param name="title" value="Other items related to this sample" /> 593 593 </jsp:include> 594 <jsp:include page="../../common/itemlists/list_membership.jsp"> 595 <jsp:param name="ID" value="<%=ID%>" /> 596 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 597 <jsp:param name="item_id" value="<%=itemId%>" /> 598 <jsp:param name="title" value="Item lists where this raw bioassay is a member" /> 599 </jsp:include> 600 594 601 <jsp:include page="../../common/share/list_share.jsp"> 595 602 <jsp:param name="ID" value="<%=ID%>" />
Note: See TracChangeset
for help on using the changeset viewer.