diff --git a/.gitattributes b/.gitattributes index 93bd123708d..e661498e54e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -130,7 +130,6 @@ api/schemas/rdfTypes.xsd -text api/schemas/report.xsd -text api/schemas/reportProps.xsd -text api/schemas/study.xsd -text -api/schemas/studyDesign.xsd -text api/schemas/studyViews.xsd -text api/schemas/view.xsd -text api/schemas/viewCategory.xsd -text @@ -2649,43 +2648,6 @@ search/src/org/labkey/search/view/search.jsp -text search/src/org/labkey/search/view/SearchWebPart.java -text search/src/org/labkey/search/view/SearchWebPartFactory.java -text search/src/org/labkey/search/view/testJson.jsp -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/ActivatingLabel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/AssayPanel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/DeprecatedMessagePanel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/DescriptionWidget.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/Designer.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/DesignerLookupConfigDialog.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/EditableGrid.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/GridModel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupGrid.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupPanel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/ImmunizationPanel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/ListChangeListener.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/AbstractXMLSavable.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAdjuvant.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAntigen.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayDefinition.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayNote.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssaySchedule.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTCohort.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunization.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunizationSchedule.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunogen.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTSampleMeasure.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDefinition.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDesignVersion.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTTimepoint.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/Schedule.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/VaccineComponent.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLSavable.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLUtils.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/OverviewPanel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/SampleMeasurePanel.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/ScheduleGrid.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionService.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionServiceAsync.java -text -study/gwtsrc/gwt/client/org/labkey/study/designer/client/VaccinePanel.java -text -study/gwtsrc/gwt/StudyApplication.gwt.xml -text study/module.properties -text study/resources/schemas/dbscripts/postgresql/study-create.sql -text study/resources/schemas/dbscripts/postgresql/study-drop.sql -text @@ -2702,7 +2664,6 @@ study/src/org/labkey/study/BaseCohortFilter.java -text study/src/org/labkey/study/CohortFilterFactory.java -text study/src/org/labkey/study/controllers/BaseStudyController.java -text study/src/org/labkey/study/controllers/CreateChildStudyAction.java -text -study/src/org/labkey/study/controllers/designer/DesignerController.java -text study/src/org/labkey/study/controllers/ParticipantGroupController.java -text study/src/org/labkey/study/controllers/reports/ReportsController.java -text study/src/org/labkey/study/controllers/reports/StudyManageReportsBean.java -text @@ -2715,15 +2676,8 @@ study/src/org/labkey/study/dataset/DatasetSnapshotProvider.java -text study/src/org/labkey/study/dataset/DatasetViewProvider.java -text study/src/org/labkey/study/dataset/SnapshotDependency.java -text study/src/org/labkey/study/DefragmentParticipantVisitIndexesTask.java -text -study/src/org/labkey/study/designer/JSONSerializer.java -text -study/src/org/labkey/study/designer/StudyDefinitionServiceImpl.java -text -study/src/org/labkey/study/designer/StudyDesignInfo.java -text study/src/org/labkey/study/designer/StudyDesignManager.java -text -study/src/org/labkey/study/designer/StudyDesignVersion.java -text study/src/org/labkey/study/designer/StudySchedule.java -text -study/src/org/labkey/study/designer/view/CreateRepositoryWizard.jsp -text -study/src/org/labkey/study/designer/view/StudyDesignsWebPart.java -text -study/src/org/labkey/study/designer/XMLSerializer.java -text study/src/org/labkey/study/importer/AssayScheduleImporter.java -text study/src/org/labkey/study/importer/CohortImporter.java -text study/src/org/labkey/study/importer/CreateChildStudyPipelineJob.java -text diff --git a/api/schemas/studyDesign.xsd b/api/schemas/studyDesign.xsd deleted file mode 100644 index 10e9488ebff..00000000000 --- a/api/schemas/studyDesign.xsd +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api/src/org/labkey/api/study/Study.java b/api/src/org/labkey/api/study/Study.java index b1050480a29..31516b8b830 100644 --- a/api/src/org/labkey/api/study/Study.java +++ b/api/src/org/labkey/api/study/Study.java @@ -37,8 +37,6 @@ */ public interface Study extends StudyEntity { - public static final String GWT_STUDY_DESIGN = "GWTStudyDesign"; - String getShortName(); Collection getVisits(Visit.Order order); @@ -60,8 +58,6 @@ public interface Study extends StudyEntity Collection getCohorts(User user); - boolean hasGWTStudyDesign(Container c, User user); - Collection getAssaySpecimenConfigs(); List getVisitsForAssaySchedule(); diff --git a/study/gwtsrc/gwt/StudyApplication.gwt.xml b/study/gwtsrc/gwt/StudyApplication.gwt.xml deleted file mode 100644 index 04afc8f15a4..00000000000 --- a/study/gwtsrc/gwt/StudyApplication.gwt.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/study/gwtsrc/gwt/client/org/labkey/study/StudyApplication.java b/study/gwtsrc/gwt/client/org/labkey/study/StudyApplication.java deleted file mode 100644 index 15eca001754..00000000000 --- a/study/gwtsrc/gwt/client/org/labkey/study/StudyApplication.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2010-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package gwt.client.org.labkey.study; - -import com.google.gwt.core.client.EntryPoint; -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.RunAsyncCallback; -import com.google.gwt.user.client.ui.RootPanel; -import org.labkey.api.gwt.client.util.ErrorDialogAsyncCallback; -import org.labkey.api.gwt.client.util.PropertyUtil; - -import java.util.HashSet; -import java.util.Set; - -/** - * User: matthewb - * Date: Mar 31, 2010 - * Time: 1:59:56 PM - */ -public class StudyApplication implements EntryPoint -{ - /** - * As of 2.4.0, the GWT compiler NPEs if you pass an enum value in to GWT.runAsync(). Therefore, this is enum-like - * but not an actual enum anymore. - */ - public abstract static class GWTModule implements RunAsyncCallback - { - public final String className; - - private static final Set MODULES = new HashSet<>(); - - static - { - MODULES.add(new StudyDesigner()); - } - - GWTModule(String clss) - { - this.className = clss; - } - - abstract EntryPoint getEntryPoint(); - - // - // RunAsyncCallback - // - @Override - public void onFailure(Throwable caught) - { - ErrorDialogAsyncCallback.showDialog(caught, "Failed to load code for module: " + getClass()); - } - - public static Set values() - { - return MODULES; - } - } - - public static class StudyDesigner extends GWTModule - { - public StudyDesigner() - { - super("gwt.client.org.labkey.study.designer.client.Designer"); - } - - @Override - public void onSuccess() - { - new gwt.client.org.labkey.study.designer.client.Designer().onModuleLoad(); - } - - @Override - EntryPoint getEntryPoint() - { - return new gwt.client.org.labkey.study.designer.client.Designer(); - } - } - - - public static RootPanel getRootPanel() - { - String name = PropertyUtil.getServerProperty("RootPanel"); - if (null == name) - name = "gwt.StudyApplication-Root"; - return RootPanel.get(name); - } - - - @Override - public void onModuleLoad() - { - RootPanel panel = getRootPanel(); - if (null != panel) - { - panel.getElement().setInnerHTML(""); - } - - final String moduleName = PropertyUtil.getServerProperty("GWTModule"); - - if ("StudyDesigner".equalsIgnoreCase(moduleName)) - { - GWT.runAsync(new StudyDesigner()); - } - else - { - throw new IllegalArgumentException("Unknown module: " + moduleName); - } - } -} diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ActivatingLabel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ActivatingLabel.java deleted file mode 100644 index c0d33265ee2..00000000000 --- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ActivatingLabel.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2010-2013 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package gwt.client.org.labkey.study.designer.client; - -import com.google.gwt.user.client.ui.*; -import org.labkey.api.gwt.client.util.StringUtils; - - -/** - * User: Mark Igra - * Date: Dec 17, 2006 - * Time: 2:50:47 PM - */ -public class ActivatingLabel extends Composite implements SourcesFocusEvents, SourcesChangeEvents, ChangeListener, FocusListener, HasText -{ - FocusPanel fp = new FocusPanel(); - HTML l = new HTML(); - String emptyText = "Click to edit"; - Widget widget = null; - FocusListenerCollection focusListeners = new FocusListenerCollection(); - ChangeListenerCollection changeListeners = new ChangeListenerCollection(); - - - public ActivatingLabel(Widget activated, String textWhenEmpty) - { - widget = activated; - emptyText = textWhenEmpty; - - assert widget instanceof HasFocus; - assert widget instanceof SourcesChangeEvents; - assert widget instanceof HasText; - - initWidget(fp); - fp.addFocusListener(this); - ((HasFocus) widget).addFocusListener(this); - ((SourcesChangeEvents) widget).addChangeListener(this); - l.setWordWrap(true); - updateLabelText(((HasText) widget).getText()); - fp.setWidget(l); - } - - public ActivatingLabel() - { - this(new TextArea(), "Click to edit"); - } - - @Override - public Widget getWidget() - { - return widget; - } - - @Override - public String getText() - { - return ((HasText) widget).getText(); - } - - @Override - public void setText(String text) - { - l.setHTML(StringUtils.filter(text, true)); - ((HasText) widget).setText(text); - updateLabelText(text); - } - - private void updateLabelText(String text) - { - text = StringUtils.trimToNull(text); - if (null == text) - { - l.setText(emptyText); - l.setStyleName("empty"); - } - else - { - l.setHTML(StringUtils.filter(text, true)); - l.setStyleName("gwt-Label"); - } - } - - @Override - public void addFocusListener(FocusListener listener) - { - focusListeners.add(listener); - } - - @Override - public void removeFocusListener(FocusListener listener) - { - focusListeners.remove(listener); - } - - @Override - public void addChangeListener(ChangeListener listener) - { - changeListeners.add(listener); - } - - @Override - public void removeChangeListener(ChangeListener listener) - { - changeListeners.remove(listener); - } - - @Override - public void onChange(Widget sender) - { - updateLabelText(((HasText) widget).getText()); - changeListeners.fireChange(this); - } - - @Override - public void onFocus(Widget sender) - { - if (sender.equals(fp)) - { - int labelHeight = l.getOffsetHeight(); - fp.setWidget(widget); - if (widget.getOffsetHeight() < labelHeight && !(widget.getOffsetHeight() <= 0)) - widget.setHeight((labelHeight + 8) + "px"); - ((HasFocus) widget).setFocus(true); - } - focusListeners.fireFocus(this); - } - - @Override - public void onLostFocus(Widget sender) - { - if (sender.equals(fp)) - return; - - //NOTE: On Firefox, onChange not necessarily fired on lost focus. - //Double check here. - String text = ((HasText) widget).getText(); - if (!text.equals(l.getText())) - { - changeListeners.fireChange(this); - updateLabelText(((HasText) widget).getText()); - } - fp.setWidget(l); - focusListeners.fireLostFocus(this); - } -} diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/AssayPanel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/AssayPanel.java deleted file mode 100644 index 06196c04053..00000000000 --- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/AssayPanel.java +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Copyright (c) 2010-2018 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package gwt.client.org.labkey.study.designer.client; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.ui.*; -import org.labkey.api.gwt.client.util.StringUtils; -import gwt.client.org.labkey.study.designer.client.model.*; - -import java.util.List; - -/** - * User: Mark Igra - * Date: Dec 20, 2006 - * Time: 4:20:46 PM - */ -public class AssayPanel extends Composite -{ - GWTStudyDefinition studyDef; - GWTAssaySchedule assaySchedule; - Designer designer; - AssayGrid eg; - - public AssayPanel(Designer parent) - { - this.designer = parent; - this.studyDef = parent.getDefinition(); - this.assaySchedule = studyDef.getAssaySchedule(); - - eg = new AssayGrid(parent); - VerticalPanel vpanel = new VerticalPanel(); - - if (!designer.isReadOnly()) - { - final TextArea tbDescription = new TextArea(); - tbDescription.setWidth("100%"); - tbDescription.setVisibleLines(5); - tbDescription.setName("assayPlan"); //For easier testing - ActivatingLabel descriptionEditor = new ActivatingLabel(tbDescription, "Click to type assay plan here"); - if (null != assaySchedule.getDescription()) - descriptionEditor.setText(assaySchedule.getDescription()); - descriptionEditor.addChangeListener(new ChangeListener() { - @Override - public void onChange(Widget sender) { - assaySchedule.setDescription(((HasText) sender).getText()); - designer.setDirty(true); - } - }); - vpanel.add(descriptionEditor); - vpanel.add(eg); - } - else - { - if (eg.getCategoryRowCount() == 0 && assaySchedule.getTimepoints().size() == 0) - { - String html = "No assays have been scheduled."; - if (designer.canEdit) - html += "
Click the edit button to add assays."; - vpanel.add(new HTML(html)); - } - else - { - HTML description = new HTML(StringUtils.filter(assaySchedule.getDescription(), true)); - vpanel.add(description); - vpanel.add(eg); - } - } - - eg.updateAll(); - initWidget(vpanel); - } - - public void updateAll() - { - eg.updateAll(); - } - - public boolean validate() - { - return true; - } - - class AssayGrid extends ScheduleGrid - { - private GWTAssayDefinition ghostAssayDefinition = null; - - AssayGrid(Designer designer) - { - super(assaySchedule, "Assay Schedule", designer); - DOM.setAttribute(getElement(), "id", "AssayGrid"); - setReadOnly(designer.isReadOnly()); - } - - @Override - int getCategoryColumnCount() - { - return 2; //Assay, Lab - } - - @Override - int getCategoryRowCount() - { - return assaySchedule.getAssays().size(); - } - - - @Override - Widget getCategoryHeader(int col) - { - if (col == 0) - return new Label("Assay"); - else - return new Label("Lab"); - } - - @Override - Widget getCategoryWidget(int categoryIndex, int col) - { - if (categoryIndex >= assaySchedule.getAssays().size()) - return null; - - if (col == 0) - { - final GWTAssayDefinition ad = assaySchedule.getAssay(categoryIndex); - final Label lb = new Label(ad.getAssayName()); - return lb; - } - else - return getLabPicker(assaySchedule.getAssay(categoryIndex)); - } - - @Override - Object getCategoryValue(int categoryIndex, int col) - { - if (categoryIndex >= assaySchedule.getAssays().size()) - return null; - - if (col == 0) - return assaySchedule.getAssay(categoryIndex); - else - return assaySchedule.getAssay(categoryIndex).getLab(); - } - - @Override - Object getEventValue(int categoryIndex, GWTTimepoint tp) - { - if (categoryIndex >= assaySchedule.getAssays().size()) - return null; - - GWTAssayDefinition assayDefinition = assaySchedule.getAssay(categoryIndex); - return assaySchedule.getAssayPerformed(assayDefinition, tp); - } - - @Override - Widget getGhostCategoryWidget(int col) - { - if (col == 0) - { - return new AssayListBox(); - } - return new Label(""); - } - - private class AssayListBox extends ListBox implements ChangeListener - { - private ChangeListenerCollection externalListeners = new ChangeListenerCollection(); - AssayListBox() - { - //Handle changes locally and may or may not fire external listeners depending - //on user confirmation - super.addChangeListener(this); - addItem(" - - -<% - if (form.getWizardStep() == WizardStep.PICK_FOLDER) - { -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Study Settings
Study Begin Date
Subject Noun (Singular)
Subject Noun (Plural)
Subject Column Name
Study Folder Location
Folder Name
Parent Folder - -
- <%=generateBackButton()%> - <%= button("Next").submit(true) %>  <%= button("Cancel").href(cancelUrl) %> - -<% -} -else -{ -%> - - - - - - -<% -} -if (form.getWizardStep() == WizardStep.SHOW_SAMPLES) -{ -%> -Each study needs specimen ids for the specimens included in the study. To upload the - specimens, follow the instructions below.
-
    -
  1. Download the specimen spreadsheet - <%=link("Download Excel Workbook").href("#downloadSpecimens").onClick("sendFormTo('study-designer-getSpecimenExcel.view')")%>
    -
  2. -
  3. Save the spreadsheet to your computer
  4. -
  5. Fill in the specimen spreadsheet. The following columns must be filled in -
      -
    • Subject -- Unique identifier for the <%=h(species)%>
    • -
    • Day -- The day number when the sample was drawn
    • -
    -
  6. -
  7. Paste data copied from the downloaded workbook and paste in the box below.
  8. -
-
- - -
- <%= generateBackButton() %> - <% if (form.isContainsWarnings()) {%> - <%= button("Ignore Warnings and Continue").submit(true).onClick("form.ignoreWarnings.value = 'true';form.submit();") %> - <%}%> - <%= button("Next").submit(true) %>  <%= button("Cancel").href(cancelUrl) %> -
<% -%> -
-<% -} -if (form.getWizardStep() == WizardStep.UPLOAD_SAMPLES) -{ -%> -Paste a tab-delimited dataset copied from the workbook downloaded in the previous set. Copy the area - containing specimen information and paste it here.
- - -
-<%= generateBackButton() %> - <% if (form.isContainsWarnings()) {%> - <%= button("Ignore Warnings and Continue").submit(true).onClick("form.ignoreWarnings.value = 'true';form.submit();")%> - <%}%> - <%= button("Next").submit(true) %>  <%= button("Cancel").href(cancelUrl) %> -<% -} -if (form.getWizardStep() != WizardStep.UPLOAD_SAMPLES && - form.getWizardStep() != WizardStep.SHOW_SAMPLES) -{ -%> - -<% -} -if (form.getWizardStep() == WizardStep.SHOW_PARTICIPANTS) -{ - List groups = DesignerController.getStudyDefinition(form, user, container).getGroups(); - int nParticipants = 0; - for (GWTCohort group : groups) - nParticipants += group.getCount(); -%> - This study defines <%=DesignerController.getStudyDefinition(form, user, container).getGroups().size()%> cohorts with a total of - <%=nParticipants%> subjects. -
- To initiate this study, you will need to fill out an excel workbook with the subject id and cohort for each <%=h(species)%>. -
    -
  • <%=link("Download the Excel Workbook with subjects").href("#downloadSubjects").onClick("sendFormTo('study-designer-getParticipantExcel.view')").clearClasses()%>
  • -
  • Save the workbook on your computer
  • -
  • Fill in identifiers for each subject in the study
  • -
  • You can also add new columns to this list containing other information about each subject.
  • -
  • Upload your own set of subject data by pasting spreadsheet data in the following text field. The first - row of the data must contain the following columns.
  • -
      -
    • SubjectId -- The id for a particular <%=h(species)%>.
    • -
    • Cohort -- The cohort name. Must be a cohort in the study design
    • -
    • StartDate -- The date this subject started the study (Day 0)
    • -
    • Other columns may be added as well
    • -
    -
-
<% - %> - - The correct number of participants should be supplied for each cohort.
- -
- <%= generateBackButton() %> - <% if (form.isContainsWarnings()) {%> - <%= button("Ignore Warnings and Continue").submit(true).onClick("form.ignoreWarnings.value = 'true';form.submit();") %> - <%}%> - <%= button("Next").submit(true) %>  <%= button("Cancel").href(cancelUrl) %> -<% -} -if (form.getWizardStep() == WizardStep.UPLOAD_PARTICIPANTS) -{ -%> - You can upload your own set of subject data by pasting spreadsheet data in the following text field. The first - row of the data must contain the following columns. -
    -
  • SubjectId -- The id for a particular <%=h(species)%>.
  • -
  • Cohort -- The cohort name. Must be a cohort in the study design
  • -
- Other columns may be added. The correct number of participants should be supplied for each cohort.
- -
- <%= generateBackButton() %> <% if (form.isContainsWarnings()) {%> - <%= button("Ignore Warnings and Continue").submit(true).onClick("form.ignoreWarnings.value = 'true';form.submit();") %> - <%}%> - <%= button("Next").submit(true) %>  <%= button("Cancel").href(cancelUrl) %><% -} -if (form.getWizardStep() == WizardStep.CONFIRM) -{ - List groups = DesignerController.getStudyDefinition(form, user, container).getGroups(); - int nParticipants = 0; - for (GWTCohort group : groups) - nParticipants += group.getCount(); -%> -You are about to create a study folder with the following settings: -
    -
  • Folder Name: <%=h(form.getFolderName())%>
  • -
  • Start Date: <%=formatDate(form.getBeginDate())%>
  • -
  • Subjects: <%=DesignerController.getParticipants().size()%> <% - if (nParticipants != DesignerController.getParticipants().size()) { %> - Warning: Study design called for <%=nParticipants%> subjects. - <%} - %>
  • -
  • Specimens: <%=DesignerController.getSpecimens().size()%>
  • -
-
-<%= generateBackButton() %> - <%= button("Finish").submit(true) %>  <%= button("Cancel").href(cancelUrl) %> -<% -} - -if (form.getWizardStep() != WizardStep.UPLOAD_PARTICIPANTS && - form.getWizardStep() != WizardStep.SHOW_PARTICIPANTS) -{ -%> - -<% -} -%> - - - - - diff --git a/study/src/org/labkey/study/designer/view/studyDesignSummary.jsp b/study/src/org/labkey/study/designer/view/studySummary.jsp similarity index 50% rename from study/src/org/labkey/study/designer/view/studyDesignSummary.jsp rename to study/src/org/labkey/study/designer/view/studySummary.jsp index 13130d84613..260bcb5313f 100644 --- a/study/src/org/labkey/study/designer/view/studyDesignSummary.jsp +++ b/study/src/org/labkey/study/designer/view/studySummary.jsp @@ -15,23 +15,14 @@ * limitations under the License. */ %> -<%@ page import="gwt.client.org.labkey.study.designer.client.model.GWTAntigen" %> -<%@ page import="gwt.client.org.labkey.study.designer.client.model.GWTCohort" %> -<%@ page import="gwt.client.org.labkey.study.designer.client.model.GWTImmunogen" %> -<%@ page import="gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition" %> -<%@ page import="org.labkey.api.action.SpringActionController" %> <%@ page import="org.labkey.api.attachments.Attachment" %> <%@ page import="org.labkey.api.data.Container" %> <%@ page import="org.labkey.api.security.User" %> <%@ page import="org.labkey.api.security.permissions.AdminPermission" %> -<%@ page import="org.labkey.api.security.permissions.ReadPermission" %> <%@ page import="org.labkey.api.study.Study" %> <%@ page import="org.labkey.api.util.HtmlString" %> <%@ page import="org.labkey.api.view.ActionURL" %> <%@ page import="org.labkey.study.controllers.StudyController" %> -<%@ page import="org.labkey.study.controllers.designer.DesignerController" %> -<%@ page import="org.labkey.study.designer.StudyDesignInfo" %> -<%@ page import="org.labkey.study.designer.StudyDesignManager" %> <%@ page import="org.labkey.study.model.StudyManager" %> <%@ page import="java.util.List" %> <%@ page extends="org.labkey.api.jsp.JspBase" %> @@ -40,89 +31,24 @@ User user = getUser(); Study study = StudyManager.getInstance().getStudy(c); if (null == study) - { %> - No study is active in the current container.
- <%= button("Create Study").href(new ActionURL(StudyController.ManageStudyPropertiesAction.class, c)) %> -<% - return; - } - - // issue 21432: only create study design as admin if the label is not already in use - StudyDesignInfo info = StudyDesignManager.get().getDesignForStudy(study); - boolean designExistsForLabel = StudyDesignManager.get().getStudyDesign(c, study.getLabel()) != null; - if (info == null && c.hasPermission(user, AdminPermission.class) && !designExistsForLabel) { - try (var ignored = SpringActionController.ignoreSqlUpdates()) - { - info = StudyDesignManager.get().ensureDesignForStudy(user, study, true); - } - } - - if (null == info) - {%> - No protocol has been registered for this study.<% - return; - } - //Shouldn't happen, but being defensive - if (!info.getContainer().equals(study.getContainer()) && !info.getContainer().hasPermission(getUser(), ReadPermission.class)) - {%> - Study protocol is in another folder you do not have permission to read. -<% - - } - GWTStudyDefinition revision = StudyDesignManager.get().getGWTStudyDefinition(user, info.getContainer(), info); %> + No study is active in the current container.
+ <%= button("Create Study").href(new ActionURL(StudyController.ManageStudyPropertiesAction.class, c)) %> <% - if (null == study.getDescription() && null != revision.getDescription()) //No study description. Generate one from the study design - { -%> -This study was created from a vaccine study protocol with the following description. -
- <%=h(revision.getDescription(), true)%> -
-Immunogens: <% - String sep = ""; - for (GWTImmunogen immunogen : revision.getImmunogens()) - { - out.print(unsafe(sep)); - out.print(h(immunogen.getName())); - String antigenSep = ""; - for (GWTAntigen antigen : immunogen.getAntigens()) - { - out.print(unsafe(antigenSep)); - out.print(h(antigen.getName())); - antigenSep = ","; - } - sep = ", "; - } -%>
-Cohorts: <% - sep = ""; - for (GWTCohort cohort : revision.getGroups()) - { - out.print(unsafe(sep)); - out.print(h(cohort.getName() + " (" + cohort.getCount() + ")")); - sep = ", "; + return; } %> -
+ <% - ActionURL url = new ActionURL(DesignerController.DesignerAction.class, info.getContainer()); - url.replaceParameter("studyId", info.getStudyId()); + boolean isAdmin = c.hasPermission(user, AdminPermission.class); + HtmlString descriptionHtml = study.getDescriptionHtml(); + String investigator = study.getInvestigator(); + String grant = study.getGrant(); + List protocolDocs = study.getProtocolDocuments(); + ActionURL editMetadataURL = new ActionURL(StudyController.ManageStudyPropertiesAction.class, c); + editMetadataURL.addReturnURL(getActionURL()); %> -<%=link("View Complete Protocol", url)%> -<% - } - else - { - boolean isAdmin = c.hasPermission(user, AdminPermission.class); - HtmlString descriptionHtml = study.getDescriptionHtml(); - String investigator = study.getInvestigator(); - String grant = study.getGrant(); - List protocolDocs = study.getProtocolDocuments(); - ActionURL editMetadataURL = new ActionURL(StudyController.ManageStudyPropertiesAction.class, c); - editMetadataURL.addReturnURL(getActionURL()); - %> @@ -184,9 +110,10 @@ This study was created from a vaccine study protocol with the following descript <% - if (isAdmin) - { %> -<%=link("Edit", editMetadataURL)%> -<% } - } + if (isAdmin) + { +%> + <%=link("Edit", editMetadataURL)%> +<% + } %> \ No newline at end of file diff --git a/study/src/org/labkey/study/model/StudyImpl.java b/study/src/org/labkey/study/model/StudyImpl.java index 3df101d3e43..4b2a2859e0c 100644 --- a/study/src/org/labkey/study/model/StudyImpl.java +++ b/study/src/org/labkey/study/model/StudyImpl.java @@ -16,7 +16,6 @@ package org.labkey.study.model; -import gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -77,8 +76,6 @@ import org.labkey.api.wiki.WikiRenderingService; import org.labkey.study.StudyModule; import org.labkey.study.controllers.StudyController; -import org.labkey.study.designer.StudyDesignInfo; -import org.labkey.study.designer.StudyDesignManager; import org.labkey.study.query.StudyQuerySchema; import java.io.IOException; @@ -294,25 +291,6 @@ public Collection getCohorts(User user) return StudyManager.getInstance().getCohorts(getContainer(), user); } - @Override - public boolean hasGWTStudyDesign(Container c, User user) - { - StudyDesignManager manager = StudyDesignManager.get(); - StudyDesignInfo info = manager.getDesignForStudy(this); - if (info != null) - { - // consider the XML study design non-empty if we have an immunogen, adjuvant, immunization timepoint, etc. - GWTStudyDefinition def = manager.getGWTStudyDefinition(user, c, info); - return def != null && ( - !def.getImmunogens().isEmpty() || !def.getAdjuvants().isEmpty() || - !def.getImmunizationSchedule().getTimepoints().isEmpty() || - !def.getAssaySchedule().getAssays().isEmpty() || !def.getAssaySchedule().getTimepoints().isEmpty() - ); - } - - return false; - } - @Override public Collection getAssaySpecimenConfigs() { diff --git a/study/src/org/labkey/study/model/StudyManager.java b/study/src/org/labkey/study/model/StudyManager.java index f9285886051..29722df0a12 100644 --- a/study/src/org/labkey/study/model/StudyManager.java +++ b/study/src/org/labkey/study/model/StudyManager.java @@ -2701,7 +2701,6 @@ public void deleteAllStudyData(Container c, User user) try (Transaction transaction = scope.ensureTransaction()) { - StudyDesignManager.get().deleteStudyDesigns(c, deletedTables); StudyDesignManager.get().deleteStudyDesignLookupValues(c, deletedTables); for (DatasetDefinition dsd : dsds) diff --git a/study/src/org/labkey/study/view/StudyGWTView.java b/study/src/org/labkey/study/view/StudyGWTView.java deleted file mode 100644 index f51d7efd649..00000000000 --- a/study/src/org/labkey/study/view/StudyGWTView.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2010-2013 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.labkey.study.view; - -import com.google.gwt.core.client.EntryPoint; -import gwt.client.org.labkey.study.StudyApplication; -import org.labkey.api.view.GWTView; - -import java.util.Map; - -/** - * User: matthewb - * Date: Mar 31, 2010 - * Time: 2:21:17 PM - */ -public class StudyGWTView extends GWTView -{ - public StudyGWTView(Class clss, Map properties) - { - super("gwt.StudyApplication", properties); - for (StudyApplication.GWTModule m : StudyApplication.GWTModule.values()) - { - if (m.className.equals(clss.getName())) - { - getModelBean().getProperties().put("GWTModule", m.getClass().getSimpleName()); - return; - } - } - throw new IllegalArgumentException(clss.getName()); - } -} diff --git a/study/src/org/labkey/study/view/VaccineStudyWebPart.java b/study/src/org/labkey/study/view/VaccineStudyWebPart.java deleted file mode 100644 index 38a2ac99e68..00000000000 --- a/study/src/org/labkey/study/view/VaccineStudyWebPart.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2011-2013 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.labkey.study.view; - -import org.labkey.api.view.JspView; - -/** - * User: markigra - * Date: 11/17/11 - * Time: 3:43 PM - */ -public class VaccineStudyWebPart extends JspView -{ - enum Panels { - VACCINE("Vaccine Design"), - IMMUNIZATIONS("Immunization Schedule"), - ASSAYS("Assay Schedule"); - - private String _title; - Panels(String title) - { - _title = title; - } - - String getTitle() - { - return _title; - } - - } - - public VaccineStudyWebPart(Model model) - { - super("/org/labkey/study/view/vaccineStudy.jsp", model); - assert (null != model.getStudyId() && 0 != model.getStudyId()); - String title = null; - if (null != model.getPanel()) - { - Panels p = Panels.valueOf(model.getPanel()); - if (null != p) - title = p.getTitle(); - } - if (null == title) - title = "Vaccine Study Protocol"; - - setTitle(title); - } - - - public static class Model - { - private String _panel; - private boolean _editMode; - private Integer _studyId; - private String _finishURL; - - public String getPanel() - { - return _panel; - } - - public void setPanel(String panel) - { - _panel = panel; - } - - public boolean isEditMode() - { - return _editMode; - } - - public void setEditMode(boolean editMode) - { - _editMode = editMode; - } - - public Integer getStudyId() - { - return _studyId; - } - - public void setStudyId(Integer studyId) - { - _studyId = studyId; - } - - public String getFinishURL() - { - return _finishURL; - } - - public void setFinishURL(String finishURL) - { - _finishURL = finishURL; - } - } -} diff --git a/study/src/org/labkey/study/view/vaccineStudy.jsp b/study/src/org/labkey/study/view/vaccineStudy.jsp deleted file mode 100644 index b1d1a3f6e3a..00000000000 --- a/study/src/org/labkey/study/view/vaccineStudy.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<% -/* - * Copyright (c) 2011-2018 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -%> -<%@ page import="org.labkey.api.data.Container" %> -<%@ page import="org.labkey.api.security.permissions.AdminPermission" %> -<%@ page import="org.labkey.api.security.permissions.UpdatePermission" %> -<%@ page import="org.labkey.api.settings.OptionalFeatureService" %> -<%@ page import="org.labkey.api.study.Study" %> -<%@ page import="org.labkey.api.study.Visit" %> -<%@ page import="org.labkey.api.view.HttpView" %> -<%@ page import="org.labkey.api.view.NotFoundException" %> -<%@ page import="org.labkey.api.view.ViewContext" %> -<%@ page import="org.labkey.api.view.template.ClientDependencies" %> -<%@ page import="org.labkey.study.designer.StudyDesignManager" %> -<%@ page import="org.labkey.study.model.StudyImpl" %> -<%@ page import="org.labkey.study.model.StudyManager" %> -<%@ page import="org.labkey.study.view.StudyGWTView" %> -<%@ page import="org.labkey.study.view.VaccineStudyWebPart" %> -<%@ page import="java.util.HashMap" %> -<%@ page import="java.util.Map" %> -<%@ page extends="org.labkey.api.jsp.JspBase"%> -<%! - @Override - public void addClientDependencies(ClientDependencies dependencies) - { - dependencies.add("study/StudyVaccineDesign.css"); - } -%> -<% - HttpView me = HttpView.currentView(); - ViewContext context = getViewContext(); - Container c = getContainer(); - VaccineStudyWebPart.Model bean = (VaccineStudyWebPart.Model) me.getModelBean(); - - Map params = new HashMap<>(); - params.put("studyId", Integer.toString(bean.getStudyId())); - - //In the web part we always show the latest revision - Integer revInteger = StudyDesignManager.get().getLatestRevisionNumber(c, bean.getStudyId()); - if (revInteger == null) - throw new NotFoundException("No revision found for Study ID: " + bean.getStudyId()); - - params.put("revision", Integer.toString(revInteger)); - params.put("edit", context.hasPermission(UpdatePermission.class) && bean.isEditMode() ? "true" : "false"); - boolean canEdit = OptionalFeatureService.get().isFeatureEnabled(Study.GWT_STUDY_DESIGN) && context.hasPermission(UpdatePermission.class); - params.put("canEdit", Boolean.toString(canEdit)); - //Can't create repository from web part - params.put("canCreateRepository", Boolean.FALSE.toString()); - - StudyImpl study = StudyManager.getInstance().getStudy(getContainer()); - boolean canAdmin = context.hasPermission(AdminPermission.class) && null != study; - params.put("canAdmin", Boolean.toString(canAdmin)); - params.put("canCreateTimepoints", Boolean.toString(canAdmin && study.getVisits(Visit.Order.DISPLAY).isEmpty())); - - params.put("panel", bean.getPanel()); //bean.getPanel()); - if (null != bean.getFinishURL()) - params.put("finishURL", bean.getFinishURL()); - - StudyGWTView innerView = new StudyGWTView(gwt.client.org.labkey.study.designer.client.Designer.class, params); - - response.setContentType("text/css"); -%> -<% -include(innerView, out); -%>