2121import org .labkey .api .data .Container ;
2222import org .labkey .api .data .SimpleFilter ;
2323import org .labkey .api .data .TableInfo ;
24- import org .labkey .api .exp .api .ExpSampleSet ;
25- import org .labkey .api .exp .api .ExperimentService ;
24+ import org .labkey .api .exp .api .ExpSampleType ;
25+ import org .labkey .api .exp .api .SampleTypeService ;
2626import org .labkey .api .laboratory .AbstractDataProvider ;
2727import org .labkey .api .laboratory .LaboratoryService ;
2828import org .labkey .api .laboratory .QueryCountNavItem ;
4747 * Date: 10/8/12
4848 * Time: 9:06 AM
4949 */
50- public class SampleSetDataProvider extends AbstractDataProvider
50+ public class SampleTypeDataProvider extends AbstractDataProvider
5151{
52- public static final String NAME = "SampleSetDataProvider " ;
52+ public static final String NAME = "SampleTypeDataProvider " ;
5353
54- public SampleSetDataProvider ()
54+ public SampleTypeDataProvider ()
5555 {
56-
5756 }
5857
5958 @ Override
@@ -77,12 +76,12 @@ public List<NavItem> getDataNavItems(Container c, User u)
7776 @ Override
7877 public List <NavItem > getSampleNavItems (Container c , User u )
7978 {
80- //also append all sample sets in this container
79+ //also append all sample types in this container
8180 List <NavItem > navItems = new ArrayList <NavItem >();
8281
83- for (ExpSampleSet ss : ExperimentService .get ().getSampleSets (c , u , true ))
82+ for (ExpSampleType st : SampleTypeService .get ().getSampleTypes (c , u , true ))
8483 {
85- navItems .add (new SampleSetNavItem (this , LaboratoryService .NavItemCategory .samples , ss ));
84+ navItems .add (new SampleTypeNavItem (this , LaboratoryService .NavItemCategory .samples , st ));
8685 }
8786 return navItems ;
8887 }
@@ -116,12 +115,12 @@ public Module getOwningModule()
116115 public List <SummaryNavItem > getSummary (Container c , User u )
117116 {
118117 List <SummaryNavItem > items = new ArrayList <>();
119- for (ExpSampleSet ss : ExperimentService .get ().getSampleSets (c , u , true ))
118+ for (ExpSampleType st : SampleTypeService .get ().getSampleTypes (c , u , true ))
120119 {
121- SampleSetNavItem nav = new SampleSetNavItem (this , LaboratoryService .NavItemCategory .samples , ss );
120+ SampleTypeNavItem nav = new SampleTypeNavItem (this , LaboratoryService .NavItemCategory .samples , st );
122121 if (nav .isVisible (c , u ))
123122 {
124- items .add (new QueryCountNavItem (this , "Samples" , ss .getName (), LaboratoryService .NavItemCategory .samples , "Samples" , ss .getName ()));
123+ items .add (new QueryCountNavItem (this , "Samples" , st .getName (), LaboratoryService .NavItemCategory .samples , "Samples" , st .getName ()));
125124 }
126125 }
127126
@@ -132,18 +131,18 @@ public List<SummaryNavItem> getSummary(Container c, User u)
132131 public List <NavItem > getSubjectIdSummary (Container c , User u , String subjectId )
133132 {
134133 List <NavItem > items = new ArrayList <NavItem >();
135- for (ExpSampleSet ss : ExperimentService .get ().getSampleSets (c , u , true ))
134+ for (ExpSampleType st : SampleTypeService .get ().getSampleTypes (c , u , true ))
136135 {
137136 UserSchema us = QueryService .get ().getUserSchema (u , c , "Samples" );
138137 if (us != null )
139138 {
140- TableInfo ti = us .getTable (ss .getName ());
139+ TableInfo ti = us .getTable (st .getName ());
141140 if (ti != null )
142141 {
143142 ColumnInfo ci = getSubjectColumn (ti );
144143 if (ci != null )
145144 {
146- QueryCountNavItem qc = new QueryCountNavItem (this , "Samples" , ss .getName (), LaboratoryService .NavItemCategory .samples , "Samples" , ss .getName ());
145+ QueryCountNavItem qc = new QueryCountNavItem (this , "Samples" , st .getName (), LaboratoryService .NavItemCategory .samples , "Samples" , st .getName ());
147146 qc .setFilter (new SimpleFilter (FieldKey .fromString (ci .getName ()), subjectId ));
148147 items .add (qc );
149148 }
0 commit comments