labs = studyDef.getLabs();
- String selectedLab = assayDefinition.getLab();
-
- ListBox lb = new ListBox();
- //If selection is not valid, just add it to the top of the picker to reflect current state
- if (null == selectedLab || null == labs || !labs.contains(selectedLab))
- {
- lb.addItem(selectedLab == null ? "" : selectedLab);
- lb.setItemSelected(0, true);
- }
- if (null != labs)
- for (int i = 0; i < labs.size(); i++)
- {
- lb.addItem(labs.get(i));
- if (labs.get(i).equals(selectedLab))
- lb.setItemSelected(i, true);
- }
- lb.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender) {
- assayDefinition.setLab(((ListBox) sender).getItemText(((ListBox) sender).getSelectedIndex()));
- designer.setDirty(true);
- }
- });
- return lb;
-
- }
-
- class AssayCheckBox extends FlowPanel implements ClickListener
- {
- final GWTAssayDefinition assayDefinition;
- final GWTTimepoint tp;
- CheckBox checkbox = new CheckBox();
- Label label = new Label();
-
- AssayCheckBox(GWTAssayDefinition assayDefinition, GWTTimepoint tp)
- {
- this.assayDefinition = assayDefinition;
- this.tp = tp;
-
- checkbox.setChecked (assaySchedule.isAssayPerformed(assayDefinition, tp));
- updateLabel();
- checkbox.addClickHandler(new ClickHandler() {
- @Override
- public void onClick(ClickEvent e)
- {
- assaySchedule.setAssayPerformed(AssayCheckBox.this.assayDefinition, AssayCheckBox.this.tp, checkbox.isChecked());
- designer.setDirty(true);
- updateLabel();
- }
- });
- label.addClickHandler(new ClickHandler() {
- @Override
- public void onClick(ClickEvent e)
- {
- SampleMeasureDialog dlg = new SampleMeasureDialog();
- dlg.setPopupPosition(label.getAbsoluteLeft(), label.getAbsoluteTop() + label.getOffsetHeight());
- dlg.show();
- }
- });
- this.add(checkbox);
- this.add(label);
- }
-
- public GWTAssayNote getAssayNote()
- {
- return assaySchedule.getAssayPerformed(assayDefinition, tp);
- }
-
- @Override
- public void onClick(Widget sender)
- {
- assaySchedule.setAssayPerformed(assayDefinition, tp, checkbox.isChecked());
- designer.setDirty(true);
- updateLabel();
- }
-
- void updateLabel()
- {
- if (checkbox.isChecked() && getAssayNote() != null)
- label.setText(getAssayNote().getSampleMeasure() != null && !getAssayNote().getSampleMeasure().isEmpty() ? getAssayNote().getSampleMeasure().toString() : "Add Measure");
- }
-
- class SampleMeasureDialog extends DialogBox
- {
- SampleMeasurePanel editor;
- public SampleMeasureDialog()
- {
- this.setText("Edit Measurement");
- VerticalPanel vp = new VerticalPanel();
-
- if (getAssayNote() != null && getAssayNote().getSampleMeasure() != null)
- editor = new SampleMeasurePanel(new GWTSampleMeasure(getAssayNote().getSampleMeasure()), studyDef);
- else
- editor = new SampleMeasurePanel(new GWTSampleMeasure(), studyDef);
-
- vp.add(editor);
- HorizontalPanel hp = new HorizontalPanel();
- hp.add(new Button("OK", new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- getAssayNote().setSampleMeasure(editor.getValue());
- designer.setDirty(true);
- updateLabel();
- SampleMeasureDialog.this.hide();
- }
- }));
- hp.add(new Button("Cancel", new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- SampleMeasureDialog.this.hide();
- }
- }));
- vp.add(hp);
- this.setWidget(vp);
- }
- }
- }
-
- }
-}
-
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DeprecatedMessagePanel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DeprecatedMessagePanel.java
deleted file mode 100644
index 016cf9b0619..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DeprecatedMessagePanel.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2016 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.HTML;
-import org.labkey.api.gwt.client.util.PropertyUtil;
-
-public class DeprecatedMessagePanel extends HTML
-{
- public DeprecatedMessagePanel(String panelName)
- {
- String html = "Notice: this study design editor format has been deprecated. " +
- "Please create any new study designs in the format as defined by the ";
-
- if (panelName != null && panelName.toLowerCase().equals("vaccine"))
- {
- String manageLinkTxt = "Manage Study Products";
- String manageUrl = PropertyUtil.getRelativeURL("manageStudyProducts", "study-design");
- html += "" + manageLinkTxt + " link ";
- }
- else if (panelName != null && panelName.toLowerCase().equals("immunizations"))
- {
- String manageLinkTxt = "Manage Treatments";
- String manageUrl = PropertyUtil.getRelativeURL("manageTreatments", "study-design");
- html += "" + manageLinkTxt + " link ";
- }
- else if (panelName != null && panelName.toLowerCase().equals("assays"))
- {
- String manageLinkTxt = "Manage Assay Schedule";
- String manageUrl = PropertyUtil.getRelativeURL("manageAssaySchedule", "study-design");
- html += "" + manageLinkTxt + " link ";
- }
- else
- {
- html += "manage links ";
- }
-
- html += "on the study Manage tab.
";
-
- setHTML(html);
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DescriptionWidget.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DescriptionWidget.java
deleted file mode 100644
index b7d98e85eff..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DescriptionWidget.java
+++ /dev/null
@@ -1,34 +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.TextArea;
-import gwt.client.org.labkey.study.designer.client.ActivatingLabel;
-
-/**
- * User: Mark Igra
- * Date: Dec 21, 2006
- * Time: 12:10:05 AM
- */
-public class DescriptionWidget extends ActivatingLabel
-{
- public DescriptionWidget()
- {
- super(new TextArea(), "Click to edit description");
- getWidget().setWidth("60em");
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/Designer.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/Designer.java
deleted file mode 100644
index 71285e58312..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/Designer.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*
- * Copyright (c) 2010-2016 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.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.*;
-import com.google.gwt.http.client.URL;
-import gwt.client.org.labkey.study.StudyApplication;
-import gwt.client.org.labkey.study.designer.client.model.*;
-import org.labkey.api.gwt.client.util.ErrorDialogAsyncCallback;
-import org.labkey.api.gwt.client.util.ServiceUtil;
-import org.labkey.api.gwt.client.util.PropertyUtil;
-import org.labkey.api.gwt.client.ui.WindowUtil;
-import org.labkey.api.gwt.client.ui.LinkButton;
-import org.labkey.api.gwt.client.ui.ImageButton;
-
-import java.util.List;
-
-/**
- * Entry point classes define onModuleLoad().
- */
-public class Designer implements EntryPoint
-{
- final Label label = new Label();
- private boolean readOnly;
-
- private boolean dirty;
-
- public GWTStudyDefinition getDefinition()
- {
- return definition;
- }
-
- public void setDefinition(GWTStudyDefinition definition)
- {
- this.definition = definition;
- }//Need to init from the server...
- //StudyDefinition definition = new StudyDefinition();
- private GWTStudyDefinition definition;
- private StudyDefinitionServiceAsync service;
- OverviewPanel overviewPanel;
- AssayPanel assayPanel;
- VaccinePanel vaccinePanel;
- ImmunizationPanel immunizationPanel;
- private String panelName;
- boolean canEdit;
- Label saveStatus;
- ImageButton saveButton;
-
-
- /**
- * This is the entry point method.
- */
- @Override
- public void onModuleLoad()
- {
- StudyApplication.getRootPanel().add(new Label("Loading..."));
- final int studyId = Integer.parseInt(PropertyUtil.getServerProperty("studyId"));
- final int revision = Integer.parseInt(PropertyUtil.getServerProperty("revision"));
- panelName = PropertyUtil.getServerProperty("panel");
- readOnly = !"true".equals(PropertyUtil.getServerProperty("edit"));
- canEdit = "true".equals(PropertyUtil.getServerProperty("canEdit"));
- if (0 == studyId)
- {
- getService().getBlank(new ErrorDialogAsyncCallback("Couldn't get blank protocol"){
-
- @Override
- public void onSuccess(GWTStudyDefinition result)
- {
- showStudy(result);
- }
- }
- );
- }
- else
- {
- showStudy(studyId, revision);
- }
-
- Window.addWindowClosingHandler(new Window.ClosingHandler()
- {
- @Override
- public void onWindowClosing(Window.ClosingEvent event)
- {
- if (dirty)
- event.setMessage("Changes have not been saved and will be discarded.");
- }
- });
-
- }
-
- private boolean validate()
- {
- return (null == overviewPanel || overviewPanel.validate()) &&
- (null == vaccinePanel || vaccinePanel.validate()) &&
- (null == immunizationPanel || immunizationPanel.validate()) &&
- (null == assayPanel || assayPanel.validate());
- }
-
- void showStudy(final int studyId, final int revision)
- {
- getService().getRevision(studyId, revision, new ErrorDialogAsyncCallback("Couldn't get protocol " + studyId + ", revision " + revision){
- @Override
- public void onSuccess(GWTStudyDefinition result)
- {
- showStudy(result);
- }
- }
- );
- }
-
- private void showStudy(GWTStudyDefinition def)
- {
- definition = def;
- VerticalPanel mainPanel = new VerticalPanel();
- mainPanel.setStylePrimaryName("study-vaccine-design");
- mainPanel.add(label);
-
- if (!isReadOnly())
- mainPanel.add(new DeprecatedMessagePanel(panelName));
-
- if (null == panelName || panelName.toLowerCase().equals("overview"))
- {
- if (null == panelName)
- mainPanel.add(new HTML("Study Protocol Overview
"));
- overviewPanel = new OverviewPanel(this);
- mainPanel.add(overviewPanel);
- }
-
- if (null == panelName || panelName.toLowerCase().equals("vaccine"))
- {
- //Vaccine panel contains its own headings.
- vaccinePanel = new VaccinePanel(this, definition.getImmunogens(), definition.getAdjuvants());
- mainPanel.add(vaccinePanel);
- }
-
- if (null == panelName || panelName.toLowerCase().equals("immunizations"))
- {
- if (null == panelName)
- mainPanel.add(new HTML("Immunization Protocol
"));
- immunizationPanel = new ImmunizationPanel(this);
- mainPanel.add(immunizationPanel);
- }
-
- if (null == panelName || panelName.toLowerCase().equals("assays"))
- {
- if (null == panelName)
- mainPanel.add(new HTML("Assays
"));
- assayPanel = new AssayPanel(this);
- mainPanel.add(assayPanel);
- }
-
- HorizontalPanel buttonPanel = new HorizontalPanel();
- buttonPanel.getElement().setClassName("gwt-ButtonBar");
- buttonPanel.setSpacing(3);
- mainPanel.add(buttonPanel);
-
- if (readOnly)
- {
- if (canEdit)
- {
-
- String editURL = PropertyUtil.getRelativeURL("designer.view") + "?edit=true&studyId=" + definition.getCavdStudyId();
- if (null != panelName)
- editURL += "&panel=" + panelName;
- //issue 14006: changed encodeComponent to encodePathSegment, b/c the former will convert spaces to '+'
- editURL += "&finishURL=" + URL.encodePathSegment(PropertyUtil.getCurrentURL());
- buttonPanel.add(new LinkButton("Edit", editURL));
-
- if ("true".equals(PropertyUtil.getServerProperty("canCreateRepository")))
- {
- Widget createRepositoryButton = new ImageButton("Create Study Folder", (ClickHandler) event -> createRepository());
- buttonPanel.add(createRepositoryButton);
- }
- buttonPanel.setSpacing(3);
- }
- }
- else
- {
- buttonPanel.add(new ImageButton("Finished", new ClickHandler()
- {
- @Override
- public void onClick(ClickEvent event)
- {
- if (isDirty())
- {
- new Saver() {
- @Override
- void afterSave(GWTStudyDesignVersion info) {
- String location = PropertyUtil.getServerProperty("finishURL");
- if (null == location)
- {
- location = PropertyUtil.getRelativeURL("designer.view") + "?studyId=" + info.getStudyId();
- if (null != panelName)
- location = location + "&panel=" + panelName;
- }
- WindowUtil.setLocation(location);
- }
- }.save();
- //Do the rest async.
- return;
- }
-
- if (null != PropertyUtil.getServerProperty("finishURL"))
- WindowUtil.setLocation(PropertyUtil.getServerProperty("finishURL"));
- else if (definition.getCavdStudyId() == 0)
- WindowUtil.setLocation(PropertyUtil.getContextPath() + PropertyUtil.getContainerPath() + "/project-start.view");
- else
- WindowUtil.setLocation(PropertyUtil.getRelativeURL("designer.view") + "?studyId=" + definition.getCavdStudyId());
- }
-
- }));
-
- saveButton = new ImageButton("Save", new ClickHandler() {
- @Override
- public void onClick(ClickEvent event)
- {
- new Saver().save();
- }
- });
- buttonPanel.add(saveButton);
- saveStatus = new Label("");
- buttonPanel.add(saveStatus);
- }
-
-
- if (null != panelName && "assays".equals(panelName.toLowerCase()) && "true".equals(PropertyUtil.getServerProperty("canEdit")))
- {
- if (!isReadOnly())
- {
- buttonPanel.add(new ImageButton("Configure Dropdown Options", new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- DesignerLookupConfigDialog dlg = new DesignerLookupConfigDialog(false, true);
- dlg.setPopupPosition(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + sender.getOffsetHeight());
- dlg.show();
- }
- }));
- }
- }
-
- if (null != panelName && "assays".equals(panelName.toLowerCase()) && "true".equals(PropertyUtil.getServerProperty("canAdmin")) && canEdit)
- {
- if (definition.getAssaySchedule().getAssays().size() > 0)
- {
- Widget createPlaceholderDatasetsButton = new ImageButton("Create Assay Datasets", new ClickHandler()
- {
- @Override
- public void onClick(ClickEvent event)
- {
- getService().ensureDatasetPlaceholders(definition, new ErrorDialogAsyncCallback()
- {
- @Override
- public void onSuccess(GWTStudyDefinition def)
- {
- Window.alert("Placeholder datasets created. Use Manage/Study Schedule to define datasets or link to assay data.");
- }
- });
- }
- });
- createPlaceholderDatasetsButton.setTitle("Create placeholder datasets, with no data, matching these assay names. Placeholders can be linked to assay data using Manage/Study Schedule.");
- buttonPanel.add(createPlaceholderDatasetsButton);
- }
-
- final ImageButton createTimepointButton = new ImageButton("Create Study Timepoints");
- createTimepointButton.setTitle("Create timepoints for date based study. Enabled if no timepoints currently exist.");
- createTimepointButton.setEnabled("true".equals(PropertyUtil.getServerProperty("canCreateTimepoints")));
- createTimepointButton.addClickHandler(new ClickHandler()
- {
- @Override
- public void onClick(ClickEvent event)
- {
- if (definition.getAssaySchedule().getTimepoints().size() == 0)
- {
- Window.alert("No timepoints are defined in the assay schedule.");
- return;
- }
-
- getService().createTimepoints(definition, new ErrorDialogAsyncCallback()
- {
- @Override
- public void onSuccess(GWTStudyDefinition def)
- {
- Window.alert(def.getAssaySchedule().getTimepoints().size() + " timepoints created.");
- createTimepointButton.setEnabled(false);
- }
- });
- }
- });
- buttonPanel.add(createTimepointButton);
- }
- else if (null != panelName && "immunizations".equals(panelName.toLowerCase()) && "true".equals(PropertyUtil.getServerProperty("canAdmin")))
- {
- final ImageButton createCohortButton = new ImageButton("Create Study Cohorts");
- createCohortButton.setTitle("Create study cohorts for the specified groups.");
-
- // visible if the user has Admin permissions and if the study definition has a group/cohort that
- // does not exist in the study folder
- createCohortButton.setVisible("true".equals(PropertyUtil.getServerProperty("canAdmin")));
- getService().hasNewCohorts(definition, new ErrorDialogAsyncCallback()
- {
- @Override
- public void onSuccess(Boolean hasNewCohort)
- {
- createCohortButton.setVisible(hasNewCohort);
- }
- });
-
- createCohortButton.addClickHandler(new ClickHandler()
- {
- @Override
- public void onClick(ClickEvent event)
- {
- if (definition.getGroups().size() == 0)
- {
- Window.alert("No groups are defined in the immunization schedule.");
- return;
- }
-
- getService().createCohorts(definition, new ErrorDialogAsyncCallback()
- {
- @Override
- public void onSuccess(GWTStudyDefinition def)
- {
- Window.alert("New cohorts created.");
- createCohortButton.setVisible(false);
- }
- });
- }
- });
- buttonPanel.add(createCohortButton);
- }
-
- StudyApplication.getRootPanel().clear();
- StudyApplication.getRootPanel().add(mainPanel);
- setDirty(false);
- }
-
- private class Saver
- {
- void save()
- {
- if (!validate())
- return;
-
- if (!isDirty())
- {
- Window.alert("Protocol was not changed. No new version saved");
- return;
- }
-
- getService().save(definition, new ErrorDialogAsyncCallback()
- {
- @Override
- public void onSuccess(GWTStudyDesignVersion info)
- {
- if (info.isSaveSuccessful())
- {
- setDirty(false);
- if (0 == definition.getCavdStudyId())
- definition.setCavdStudyId(info.getStudyId());
- definition.setRevision(info.getRevision());
- afterSave(info);
- }
- else
- {
- Window.alert("Could not save: " + info.getErrorMessage());
- }
- }
- });
- }
-
- void afterSave(GWTStudyDesignVersion info)
- {
- if (null != overviewPanel)
- overviewPanel.updateRevisionInfo();
- saveStatus.setText("Revision " + info.getRevision() + " saved successfully.");
- }
- }
-
- StudyDefinitionServiceAsync getService()
- {
- if (service == null)
- {
- service = GWT.create(StudyDefinitionService.class);
- ServiceUtil.configureEndpoint(service, "definitionService");
- }
- return service;
- }
-
- public void createRepository()
- {
- //Make sure we have at least one assay scheduled
- if (definition.getGroups().isEmpty())
- {
- Window.alert("At least one group should be defined before creating a study folder.");
- return;
- }
- boolean assaysScheduled = false;
-
- GWTAssaySchedule schedule = definition.getAssaySchedule();
- List assays = schedule.getAssays();
- List timepoints = schedule.getTimepoints();
- for (int itp = 0; itp < schedule.getTimepoints().size(); itp++)
- for (int iassay = 0; iassay < schedule.getAssays().size(); iassay++)
- if (schedule.isAssayPerformed(assays.get(iassay), timepoints.get(itp)))
- {
- assaysScheduled = true;
- break;
- }
-
- if (!assaysScheduled)
- {
- Window.alert("At least one assay should be scheduled before creating a study folder.");
- return;
- }
-
- String createRepositoryURL = PropertyUtil.getContextPath() + PropertyUtil.getContainerPath() + "/study-designer-createRepository.view?wizardStepNumber=0&studyId=" + definition.getCavdStudyId();
- WindowUtil.setLocation(createRepositoryURL);
- }
-
- public boolean isDirty()
- {
- return dirty;
- }
-
- public void setDirty(boolean dirty)
- {
- this.dirty = dirty;
- if (dirty)
- saveStatus.setText("");
- if (!readOnly)
- saveButton.setEnabled(dirty);
- }
-
- public boolean isCanEdit()
- {
- return canEdit;
- }
-
- public boolean isReadOnly()
- {
- return readOnly;
- }
-
- public void setReadOnly(boolean readOnly)
- {
- this.readOnly = readOnly;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DesignerLookupConfigDialog.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DesignerLookupConfigDialog.java
deleted file mode 100644
index d724aba8724..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/DesignerLookupConfigDialog.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 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.ClickListener;
-import com.google.gwt.user.client.ui.DialogBox;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import org.labkey.api.gwt.client.ui.ImageButton;
-import org.labkey.api.gwt.client.util.PropertyUtil;
-
-/**
- * User: cnathe
- * Date: 7/26/13
- */
-public class DesignerLookupConfigDialog extends DialogBox
-{
- // NOTE: this is temparary UI until we convert to using Ext4 for the study designer
- public DesignerLookupConfigDialog(boolean includeVaccineProps, boolean includeAssayProps)
- {
- this.setText("Configure Dropdown Options");
- VerticalPanel vp = new VerticalPanel();
-
- String containerPath = PropertyUtil.getContainerPath();
- String baseFolderURL = PropertyUtil.getContextPath() + "/query" + containerPath + "/executeQuery.view?schemaName=study&query.queryName=";
- String projectPath = containerPath.indexOf("/", 1) == -1 ? containerPath : containerPath.substring(0, containerPath.indexOf("/", 1));
- String baseProjectURL = PropertyUtil.getContextPath() + "/query" + projectPath + "/executeQuery.view?schemaName=study&query.queryName=";
- boolean isProject = containerPath.equals(projectPath);
- String html = "Configure dropdown options at the project level to be shared across
study designs or within this folder for study specific properties.
";
-
- if (includeVaccineProps)
- {
- String projectLink = baseProjectURL + "StudyDesignImmunogenTypes";
- String folderLink = baseFolderURL + "StudyDesignImmunogenTypes";
- html += "| Immunogen Types: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
-
- projectLink = baseProjectURL + "StudyDesignRoutes";
- folderLink = baseFolderURL + "StudyDesignRoutes";
- html += "| Routes: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
-
- projectLink = baseProjectURL + "StudyDesignGenes";
- folderLink = baseFolderURL + "StudyDesignGenes";
- html += "| Genes: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
-
- projectLink = baseProjectURL + "StudyDesignSubTypes";
- folderLink = baseFolderURL + "StudyDesignSubTypes";
- html += "| SubTypes: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
- }
-
- if (includeAssayProps)
- {
- String projectLink = baseProjectURL + "StudyDesignAssays";
- String folderLink = baseFolderURL + "StudyDesignAssays";
- html += "| Assays: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
-
- projectLink = baseProjectURL + "StudyDesignLabs";
- folderLink = baseFolderURL + "StudyDesignLabs";
- html += "| Labs: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
-
- projectLink = baseProjectURL + "StudyDesignUnits";
- folderLink = baseFolderURL + "StudyDesignUnits";
- html += "| Units: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
-
- projectLink = baseProjectURL + "StudyDesignSampleTypes";
- folderLink = baseFolderURL + "StudyDesignSampleTypes";
- html += "| Sample Types: | [project] | "
- + (!isProject ? "[folder] | " : "")
- + "
";
- }
-
- vp.add(new HTML(html));
-
- HorizontalPanel hp = new HorizontalPanel();
- hp.add(new ImageButton("Done", new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- DesignerLookupConfigDialog.this.hide();
- }
- }));
- vp.add(hp);
- this.setWidget(vp);
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/EditableGrid.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/EditableGrid.java
deleted file mode 100644
index d22e43144e5..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/EditableGrid.java
+++ /dev/null
@@ -1,272 +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 com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import org.labkey.api.gwt.client.util.StringUtils;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 2:38:59 PM
- */
-public abstract class EditableGrid extends FlexTable
-{
- private boolean ghostRow = true;
- boolean readOnly = false;
- int rowSelected = -1;
-
- protected EditableGrid()
- {
- setCellSpacing(0);
- addTableListener(new RowHeaderClickListener());
- setStyleName("labkey-data-region labkey-show-borders");
- }
-
- public void updateAll()
- {
- int headerRowCount = getHeaderRows();
-
- //Make bigger or smaller as needed.
- if (getRowCount() < getDataRowCount() + headerRowCount + (isGhostRow() ? 1 : 0))
- prepareRow(getDataRowCount() + headerRowCount);
- else
- while (getRowCount() > getDataRowCount() + headerRowCount + (isGhostRow() ? 1 : 0))
- removeRow(getRowCount() - 1);
-
- if (getCellCount(getRowCount() - 1) < getDataColumnCount())
- prepareCell(getDataRowCount() + headerRowCount, getDataColumnCount());
- else
- for (int i = 0; i < getRowCount(); i++)
- removeCells(i, getDataColumnCount() + 1, getCellCount(i) - getDataColumnCount() - 1);
-
- for (int i = headerRowCount; i < getDataRowCount() + headerRowCount ; i++)
- initRow(i);
-
- if (isGhostRow())
- initGhostRow();
-
- for (int row = 0; row < getHeaderRows(); row++)
- {
- for (int i = 0; i < getDataColumnCount(); i++)
- {
- Widget header = getColumnHeader(row, i);
- if (null != header)
- {
- setWidget(row, i + 1, header);
- getCellFormatter().setStyleName(row, i + 1, "labkey-col-header");
- }
- }
- getCellFormatter().setStyleName(row, 0, "labkey-col-header");
- }
- }
-
- public boolean isReadOnly()
- {
- return readOnly;
- }
-
- public void setReadOnly(boolean readOnly)
- {
- this.readOnly = readOnly;
- setStyleName(readOnly ? "labkey-read-only labkey-data-region labkey-show-borders" : "labkey-data-region labkey-show-borders");
- }
-
- private void initRow(int row)
- {
- getCellFormatter().setStyleName(row, 0, "labkey-row-header");
- setWidget(row, 0, getRowNumberWidget(row - getHeaderRows()));
-
- for (int col = 0; col < getDataColumnCount(); col++)
- {
- Widget widget;
- if (readOnly)
- widget = getReadOnlyWidget(row - getHeaderRows(), col);
- else
- widget = getCellWidget(row - getHeaderRows(), col);
-
- getCellFormatter().setStyleName(row, col + 1, isReadOnly() ? "assay-row-padded-view" : "assay-row-padded");
- setWidget(row, col + 1, widget);
- }
- }
-
- private boolean isInGhostRow(Widget widget)
- {
- int ghostRowIndex = getDataRowCount() + getHeaderRows();
- for (int i = 0; i < getCellCount(ghostRowIndex); i++)
- if (widget == getWidget(ghostRowIndex, i))
- return true;
-
- return false;
- }
-
- private ChangeListener ghostChangeListener = new ChangeListener() {
- @Override
- public void onChange(Widget sender) {
- if (isInGhostRow(sender))
- adjustGhostRow();
- }
- };
-
- private void initGhostRow()
- {
- int row = getRowCount() - 1;
- getCellFormatter().setStyleName(row, 0, "labkey-row-header");
- setWidget(row, 0, getGhostRowHeaderWidget());
- for (int col = 0; col < getDataColumnCount(); col++)
- {
- Widget widget = getGhostRowWidget(col);
- if (widget instanceof SourcesChangeEvents)
- ((SourcesChangeEvents) widget).addChangeListener(ghostChangeListener);
- setWidget(row, col + 1, widget);
- }
-
- }
-
- public void adjustGhostRow()
- {
- int rows = getRowCount();
- makeGhostRowReal();
- setWidget(rows - 1, 0, getRowNumberWidget(rows - getHeaderRows() - 1));
- prepareRow(rows);
- initGhostRow();
- }
-
- public static final Widget EMPTY_LABEL = new Label("");
- public Widget getRowNumberWidget(final int row)
- {
- if (readOnly)
- return EMPTY_LABEL;
-
- final Label rowLabel = new Label(Integer.toString(row + 1));
- rowLabel.setTitle("Click to delete " + getRowNoun());
-
- return rowLabel;
- }
-
- public Widget getGhostRowHeaderWidget()
- {
- final Label rowLabel = new Label("+");
- rowLabel.setTitle("Use this row to add a new " + getRowNoun());
-
- return rowLabel;
- }
-
- public void showPopupMenu(PopupMenu popupMenu, int row, int col)
- {
- Widget w = getWidget(row, col);
-
- Element cell = getCellFormatter().getElement(row, col);
- int left = DOM.getAbsoluteLeft(cell);
- int top = w == null ? DOM.getAbsoluteTop(cell) + 15 : w.getAbsoluteTop() + w.getOffsetHeight();
- popupMenu.setPopupPosition(left, top);
-
- popupMenu.show();
- }
-
- public PopupMenu getRowPopupMenu(final int dataRow)
- {
- final PopupMenu popupMenu = new PopupMenu();
- popupMenu.addItem("Delete " + getRowNoun(), new Command() {
- @Override
- public void execute()
- {
- deleteRow(dataRow);
- popupMenu.hide();
- }
- });
-
- return popupMenu;
- }
-
- public boolean isGhostRow()
- {
- return ghostRow && !isReadOnly();
- }
-
- public void setGhostRow(boolean ghostRow)
- {
- this.ghostRow = ghostRow;
- }
-
- public static class PopupMenu extends PopupPanel
- {
- MenuBar menuBar = new MenuBar(true);
-
- public PopupMenu()
- {
- super(true);
- addPopupListener(menuBar);
- add(menuBar);
- }
-
- public void addItem(String title, final Command command)
- {
- MenuItem item = new MenuItem(title, new Command() {
- @Override
- public void execute()
- {
- command.execute();
- hide();
- }
- });
- menuBar.addItem(item);
- }
- }
-
- public Widget getReadOnlyWidget(int row, int col)
- {
- Object o = getCellValue(row, col);
- if (null == o)
- o = "";
- Label l = new Label(StringUtils.trimToEmpty(o.toString()));
- l.setWordWrap(false);
- return l;
- }
-
- public String getRowNoun()
- {
- return "row";
- }
-
- class RowHeaderClickListener implements TableListener
- {
- @Override
- public void onCellClicked(SourcesTableEvents sender, int row, int cell)
- {
- if (cell == 0 && row >= getHeaderRows() && row < getDataRowCount() + getHeaderRows())
- {
- PopupMenu popup = EditableGrid.this.getRowPopupMenu(row - EditableGrid.this.getHeaderRows());
- if (null != popup)
- showPopupMenu(popup, row, cell);
- }
- }
- }
-
- abstract int getDataColumnCount();
- abstract int getDataRowCount();
- abstract Widget getCellWidget(int row, int col);
- abstract Object getCellValue(int row, int col);
- abstract Widget getGhostRowWidget(int col);
- abstract int getHeaderRows();
- abstract Widget getColumnHeader(int row, int column);
- abstract void makeGhostRowReal();
- abstract void deleteRow(int dataRow);
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GridModel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GridModel.java
deleted file mode 100644
index 28dcc4cfd97..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GridModel.java
+++ /dev/null
@@ -1,35 +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.Widget;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 2:39:57 PM
- */
-public interface GridModel
-{
- int getDataColumnCount();
- int getDataRowCount();
- Widget getCellWidget(int row, int col);
- int getHeaderRows();
- Widget getColumnHeader(int row, int column);
- void setOwner(EditableGrid grid);
- void makeGhostRowReal();
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupGrid.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupGrid.java
deleted file mode 100644
index d55a0344838..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupGrid.java
+++ /dev/null
@@ -1,171 +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.designer.client;
-
-import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.Window;
-
-import java.util.List;
-
-import gwt.client.org.labkey.study.designer.client.model.GWTCohort;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition;
-import org.labkey.api.gwt.client.util.StringUtils;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 2:53:56 PM
- */
-public class GroupGrid extends EditableGrid
-{
- private List/**/ groups;
- private GWTStudyDefinition studyDef;
- GWTCohort ghostCohort;
-
- public GroupGrid(GWTStudyDefinition studyDefinition)
- {
- this.groups = studyDefinition.getGroups();
- this.studyDef = studyDefinition;
- ghostCohort = new GWTCohort();
- }
- @Override
- public int getDataColumnCount()
- {
- return 2;
- }
-
- @Override
- public int getDataRowCount()
- {
- return groups.size();
- }
-
- Widget[] columnNames = new Widget[] {new Label("Name"), new Label("Count") };
- @Override
- public Widget getColumnHeader(int row, int column)
- {
- if (column >= columnNames.length)
- return new HTML("No such column");
- return columnNames[column];
- }
-
- @Override
- public Widget getCellWidget(int row, int column)
- {
- if (row < 0 || row > groups.size())
- return new Label("No such group: " + row);
-
- return getWidget((GWTCohort) groups.get(row), column);
- }
-
- @Override
- Object getCellValue(int row, int col)
- {
- GWTCohort group = (GWTCohort) groups.get(row);
- if (null == group)
- return null;
-
- if (col == 0)
- return group.getName();
- else
- return Integer.valueOf(group.getCount());
- }
-
- @Override
- public Widget getGhostRowWidget(int col)
- {
- return getWidget(ghostCohort, col);
- }
-
- private Widget getWidget(GWTCohort group, int column)
- {
- if (column == 0)
- return getNameWidget(group);
- if (column == 1)
- return getCountWidget(group);
-
- return new Label("No such column" + column);
- }
-
- @Override
- public int getHeaderRows()
- {
- return 1;
- }
-
- @Override
- public void makeGhostRowReal()
- {
- groups.add(ghostCohort);
- ghostCohort = new GWTCohort();
- studyDef.fireChangeEvents();
- }
-
- @Override
- void deleteRow(int dataRow)
- {
- groups.remove(dataRow);
- updateAll();
- }
-
-
- private TextBox getNameWidget(final GWTCohort cohort)
- {
- TextBox tb = new TextBox();
- tb.setText(StringUtils.trimToEmpty(cohort.getName()));
- tb.addChangeListener(new ChangeListener(){
- @Override
- public void onChange(Widget sender)
- {
- cohort.setName(((TextBox) sender).getText());
- }
- });
-
- return tb;
- }
-
- private TextBox getCountWidget(final GWTCohort cohort)
- {
- final TextBox tb = new TextBox();
- tb.setWidth("4em");
- tb.setText(String.valueOf(cohort.getCount()));
- tb.addChangeListener(new ChangeListener(){
- @Override
- public void onChange(Widget sender)
- {
- String countStr = tb.getText();
- int count = 0;
- try
- {
- count = Integer.parseInt(countStr);
- cohort.setCount(count);
- }
- catch (NumberFormatException e)
- {
- Window.alert("Please enter a number");
- tb.setFocus(true);
- return;
- }
- tb.setText(String.valueOf(count));
- }
- });
-
- return tb;
- }
-
-
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupPanel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupPanel.java
deleted file mode 100644
index 44f080dc842..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/GroupPanel.java
+++ /dev/null
@@ -1,43 +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 gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition;
-
-/**
- * User: Mark Igra
- * Date: Dec 15, 2006
- * Time: 3:23:17 PM
- */
-public class GroupPanel extends VerticalPanel
-{
- public GroupGrid gridModel;
-
- public GroupPanel(GWTStudyDefinition studyDefinition)
- {
- setHorizontalAlignment(DockPanel.ALIGN_LEFT);
-
- add(new DescriptionWidget());
- add(new HTML("Enter one row for each group of participants in the protocol."));
-
- EditableGrid groupGrid = new GroupGrid(studyDefinition);
- groupGrid.updateAll();
- add(groupGrid);
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ImmunizationPanel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ImmunizationPanel.java
deleted file mode 100644
index 16a86362edc..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ImmunizationPanel.java
+++ /dev/null
@@ -1,387 +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.designer.client;
-
-import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.DOM;
-
-import java.util.List;
-
-import gwt.client.org.labkey.study.designer.client.model.*;
-import org.labkey.api.gwt.client.util.StringUtils;
-
-/**
- * User: Mark Igra
- * Date: Dec 18, 2006
- * Time: 9:09:13 AM
- */
-public class ImmunizationPanel extends Composite
-{
- GWTStudyDefinition studyDef;
- GWTImmunizationSchedule immunizationSchedule;
- ImmunizationGrid immunizationGrid;
- Designer designer;
-
- public ImmunizationPanel(Designer parent)
- {
- this.designer = parent;
- this.studyDef = designer.getDefinition();
- this.immunizationSchedule = studyDef.getImmunizationSchedule();
- immunizationGrid = new ImmunizationGrid(parent);
- immunizationGrid.updateAll();
- VerticalPanel vpanel = new VerticalPanel();
- if (designer.isReadOnly())
- {
- if (immunizationGrid.getCategoryRowCount() == 0 && immunizationSchedule.getTimepoints().size() == 0)
- {
- String html = "No immunizations have been scheduled.";
- if (designer.canEdit)
- html += "
Click the edit button to add immunizations.";
- vpanel.add(new HTML(html));
- }
- else
- {
- vpanel.add(new HTML("This section shows the immunization schedule. Each immunization may consist of several adjuvants and immunizations."));
- vpanel.add(immunizationGrid);
- }
- }
- else
- {
- String html = "Enter the immunization schedule below." +
- "- Enter each group/cohort on a line by clicking the 'Add New' link" +
- "
- Enter the number of subjects in the cohort in the count column" +
- "
- Use the 'Add Timepoint' link to add new timepoints" +
- "
- Click on the cells underneath a timepoint to define adjuvants and immunogens used at that timepoint" +
- "
";
- vpanel.add(new HTML(html));
- vpanel.add(immunizationGrid);
- }
- initWidget(vpanel);
- DOM.setAttribute(getElement(), "id", "ImmunizationPanel");
- }
-
- public boolean validate()
- {
- return true;
- }
-
- public void updateAll()
- {
- immunizationGrid.updateAll();
- }
-
- private class ImmunizationGrid extends ScheduleGrid
- {
- protected ImmunizationGrid(Designer designer)
- {
- super(immunizationSchedule, "Immunization Schedule", designer);
- DOM.setAttribute(getElement(), "id", "ImmunizationGrid");
- setReadOnly(designer.isReadOnly());
- }
-
- @Override
- int getCategoryColumnCount()
- {
- return 2;
- }
-
- @Override
- int getCategoryRowCount()
- {
- return studyDef.getGroups().size();
- }
-
- @Override
- Widget getCategoryHeader(int col)
- {
- if (col == 0)
- return new Label("Group / Cohort");
- else
- return new Label("Count");
- }
-
- @Override
- Widget getCategoryWidget(int categoryIndex, int col)
- {
- return getCategoryWidget(studyDef.getGroups().get(categoryIndex), col);
- }
-
- @Override
- Object getCategoryValue(int categoryIndex, int col)
- {
- GWTCohort group = studyDef.getGroups().get(categoryIndex);
- if (col == 0)
- return group.getName();
- else
- {
- if (group.getCount() > 0)
- return Integer.valueOf(group.getCount());
- else
- return null;
- }
- }
-
-
- @Override
- Object getEventValue(int categoryIndex, GWTTimepoint tp)
- {
- GWTCohort cohort = studyDef.getGroups().get(categoryIndex);
- GWTImmunization immunization = immunizationSchedule.getImmunization(cohort, tp);
- if (null == immunization)
- return null;
- else
- return immunization;
- }
-
- @Override
- Widget getGhostCategoryWidget(int col)
- {
- if (col == 0)
- return new GroupWidget();
- else
- return null;
- }
-
- private Widget getCategoryWidget(final GWTCohort group, int col)
- {
- final TextBox tb = new TextBox();
- if (col == 0)
- {
- tb.setText(StringUtils.trimToEmpty(group.getName()));
- tb.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender) {
- // in the event of a group rename, add the old cohort name to the list of groups to be deleted (if they exist)
- studyDef.addGroupToDelete(group.getName());
- group.setCohortId(null);
-
- group.setName(tb.getText());
- designer.setDirty(true);
- }
- });
- }
- else
- {
- if (group.getCount() > 0)
- tb.setText(Integer.toString(group.getCount()));
- tb.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender) {
- int count;
- try
- {
- count = Integer.parseInt(tb.getText());
- designer.setDirty(true);
- }
- catch (NumberFormatException e)
- {
- Window.alert("Please enter a number");
- tb.setText(Integer.toString(group.getCount()));
- tb.setFocus(true);
- return;
- }
- group.setCount(count);
- }
- });
- }
- return tb;
- }
-
- @Override
- void makeGhostCategoryReal()
- {
- // noop
- }
-
-
- @Override
- void deleteCategory(final int index)
- {
- GWTCohort cohort = studyDef.getGroups().get(index);
- studyDef.addGroupToDelete(cohort.getName());
-
- studyDef.getGroups().remove(index);
- designer.setDirty(true);
- }
-
- @Override
- Widget getEventWidget(int categoryIndex, GWTTimepoint tp)
- {
- GWTCohort cohort = studyDef.getGroups().get(categoryIndex);
- return new ImmunizationWidget(cohort, tp);
- }
-
- @Override
- public String getRowNoun()
- {
- return "group";
- }
-
- public class ImmunizationWidget extends FocusPanel implements ClickListener, KeyboardListener
- {
- private GWTCohort group;
- private GWTTimepoint timepoint;
- private Label l = new Label();
- public ImmunizationWidget(GWTCohort group, GWTTimepoint timepoint)
- {
- this.group = group;
- this.timepoint = timepoint;
- this.addClickListener(this);
- this.addKeyboardListener(this);
- this.setWidth("100%");
- setTitle("Click to define immunization");
- add(l);
- updateText();
- }
-
- public void update(GWTImmunization immunization)
- {
- if (null == immunization)
- immunizationSchedule.removeImmunization(group, timepoint);
- else
- immunizationSchedule.setImmunization(group, timepoint, immunization);
-
- designer.setDirty(true);
- updateText();
- }
-
- private void updateText()
- {
- GWTImmunization immunization = immunizationSchedule.getImmunization(group, timepoint);
- if (null == immunization)
- l.setText("(none)");
- else
- l.setText(immunization.toString());
- }
-
-
- @Override
- public void onClick(Widget sender)
- {
- showPopup();
- }
-
- private void showPopup()
- {
- GWTImmunization immunization = immunizationSchedule.getImmunization(group, timepoint);
- if (null == immunization)
- immunization = new GWTImmunization();
- DefineImmunizationPopup popup = new DefineImmunizationPopup(immunization, ImmunizationWidget.this);
- popup.setPopupPosition(this.getAbsoluteLeft(), this.getAbsoluteTop() + this.getOffsetHeight());
- popup.show();
- }
-
- @Override
- public void onKeyDown(Widget sender, char keyCode, int modifiers)
- {
- }
-
- @Override
- public void onKeyPress(Widget sender, char keyCode, int modifiers)
- {
- if (keyCode == ' ' || keyCode == 13 || keyCode == 10)
- showPopup();
- }
-
- @Override
- public void onKeyUp(Widget sender, char keyCode, int modifiers)
- {
- }
- }
- }
-
- public class DefineImmunizationPopup extends DialogBox
- {
- private GWTImmunization immunization;
- private ImmunizationGrid.ImmunizationWidget owner;
- public DefineImmunizationPopup(GWTImmunization immunization, ImmunizationGrid.ImmunizationWidget owner)
- {
- this.immunization = immunization;
- this.owner = owner;
- FlexTable ft = new FlexTable();
- ft.setHTML(0, 0, "Immunogens");
- ft.setHTML(0, 1, "Adjuvants");
-
- for (int i = 0; i < studyDef.getImmunogens().size(); i++)
- {
- GWTImmunogen immunogen = studyDef.getImmunogens().get(i);
- CheckBox cb = new VaccineComponentCheckbox(immunization.immunogens, immunogen);
- cb.setChecked(immunization.immunogens.contains(immunogen));
- ft.setWidget(i + 1, 0, cb);
- }
-
- for (int i = 0; i < studyDef.getAdjuvants().size(); i++)
- {
- GWTAdjuvant adjuvant = studyDef.getAdjuvants().get(i);
- CheckBox cb = new VaccineComponentCheckbox(immunization.adjuvants, adjuvant);
- cb.setChecked(immunization.adjuvants.contains(adjuvant));
- ft.setWidget(i + 1, 1, cb);
- }
-
- int rowCount = ft.getRowCount();
- ft.insertRow(rowCount);
- ft.getFlexCellFormatter().setColSpan(rowCount, 0, 2);
- Button okButton = new Button("Done", new ClickListener() {
- @Override
- public void onClick(Widget sender)
- {
- DefineImmunizationPopup.this.hide();
- designer.setDirty(true);
- DefineImmunizationPopup.this.owner.setFocus(true);
- }
- });
- ft.setWidget(rowCount, 0, okButton);
-
- setText("Define Immunization");
- setWidget(ft);
- }
-
- private class VaccineComponentCheckbox extends CheckBox implements ClickListener
- {
- private List components;
- private VaccineComponent vc;
- VaccineComponentCheckbox(List/**/ components, VaccineComponent vc)
- {
- this.components = components;
- this.vc = vc;
- this.setChecked(components.contains(vc));
- this.addClickListener(this);
- this.setText(vc.getName());
- }
-
-
- @Override
- public void onClick(Widget sender)
- {
- if (isChecked())
- {
- if (!components.contains(vc))
- components.add(vc);
- }
- else
- {
- if (components.contains(vc))
- components.remove(vc);
- }
-
- owner.update(immunization);
- }
- }
- }
-
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ListChangeListener.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ListChangeListener.java
deleted file mode 100644
index 3239ba852b9..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ListChangeListener.java
+++ /dev/null
@@ -1,30 +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 java.util.List;
-
-/**
- * User: Mark Igra
- * Date: Dec 22, 2006
- * Time: 10:05:42 AM
- */
-public interface ListChangeListener
-{
- void itemInserted(List list, int position, Object itemInserted, Object sender);
- void itemDeleted(List list, int position, Object itemDeleted, Object sender);
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/OverviewPanel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/OverviewPanel.java
deleted file mode 100644
index e9b15b560d0..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/OverviewPanel.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 2010-2016 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.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.Window;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDesignVersion;
-import org.labkey.api.gwt.client.util.ErrorDialogAsyncCallback;
-import org.labkey.api.gwt.client.util.StringUtils;
-import org.labkey.api.gwt.client.util.PropertyUtil;
-import org.labkey.api.gwt.client.ui.WindowUtil;
-
-/**
- * User: Mark Igra
- * Date: Dec 16, 2006
- * Time: 3:12:40 PM
- */
-public class OverviewPanel extends Composite
-{
- FlexTable layout = new FlexTable();
- RevisionRow revisionRow;
- GWTStudyDefinition definition;
- Designer designer;
-
-
- public OverviewPanel(Designer parent)
- {
- this.designer = parent;
- this.definition = designer.getDefinition();
- initWidget(layout);
- Widget studyNameWidget;
- Widget speciesWidget;
- Widget investigatorWidget;
- Widget grantWidget;
- Widget descriptionWidget;
-
- int layoutRow = 0;
- revisionRow = new RevisionRow(layoutRow);
- revisionRow.update();
-
- if (designer.isReadOnly())
- {
- studyNameWidget = new Label(StringUtils.trimToEmpty(definition.getStudyName()));
- speciesWidget = new Label(StringUtils.trimToEmpty(definition.getAnimalSpecies()));
- investigatorWidget = new Label(StringUtils.trimToEmpty(definition.getInvestigator()));
- grantWidget = new Label(StringUtils.trimToEmpty(definition.getGrant()));
- descriptionWidget = new HTML(StringUtils.filter(definition.getDescription(), true));
- }
- else
- {
- final TextBox tbStudyName = new TextBox();
- tbStudyName.setText(StringUtils.trimToEmpty(definition.getStudyName()));
- //tbStudyName.setName("protocolName"); //for testing
- tbStudyName.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- definition.setStudyName(tbStudyName.getText().trim());
- designer.setDirty(true);
- }
- });
- studyNameWidget = tbStudyName;
-
- final TextBox tbSpecies = new TextBox();
- tbSpecies.setText(StringUtils.trimToEmpty(definition.getAnimalSpecies()));
- //tbSpecies.setName("species"); //for testing
- tbSpecies.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- definition.setAnimalSpecies(tbSpecies.getText().trim());
- designer.setDirty(true);
- }
- });
- speciesWidget = tbSpecies;
-
- final TextBox tbInvestigator = new TextBox();
- tbInvestigator.setText(StringUtils.trimToEmpty(definition.getInvestigator()));
- //tbInvestigator.setName("investigator"); //for testing
- tbInvestigator.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- definition.setInvestigator(tbInvestigator.getText().trim());
- designer.setDirty(true);
- }
- });
- investigatorWidget = tbInvestigator;
-
- final TextBox tbGrant = new TextBox();
- tbGrant.setText(StringUtils.trimToEmpty(definition.getGrant()));
- //tbGrant.setName("grant"); //for testing
- tbGrant.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- definition.setGrant(tbGrant.getText().trim());
- designer.setDirty(true);
- }
- });
- grantWidget = tbGrant;
-
- final TextArea tbDescription = new TextArea();
- tbDescription.setWidth("100%");
- tbDescription.setVisibleLines(5);
- tbDescription.setName("protocolDescription"); //For easier testing
- ActivatingLabel activatingLabel = new ActivatingLabel(tbDescription, "Click to edit description");
- if (null != definition.getDescription())
- activatingLabel.setText(definition.getDescription());
- activatingLabel.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- definition.setDescription(tbDescription.getText().trim());
- designer.setDirty(true);
- }
- });
- descriptionWidget = activatingLabel;
- }
-
- layout.insertRow(++layoutRow);
- layout.setText(layoutRow, 0, "Protocol Name");
- layout.setWidget(layoutRow, 1, studyNameWidget);
- layout.setText(layoutRow, 2, "Investigator");
- layout.setWidget(layoutRow, 3, investigatorWidget);
- layout.insertRow(++layoutRow);
- layout.setText(layoutRow, 0, "Grant");
- layout.setWidget(layoutRow, 1, grantWidget);
- layout.setText(layoutRow, 2, "Species");
- layout.setWidget(layoutRow, 3, speciesWidget);
- layout.insertRow(++layoutRow);
- layout.setText(layoutRow, 0, "Overview");
- layout.insertRow(++layoutRow);
- layout.addCell(layoutRow);
- layout.getFlexCellFormatter().setColSpan(layoutRow, 0, 4);
- layout.setWidget(layoutRow, 0, descriptionWidget);
- }
-
- public void updateRevisionInfo()
- {
- revisionRow.update();
- }
-
- class RevisionRow
- {
- int layoutRow;
-
- RevisionRow(int rowNum)
- {
- this.layoutRow = rowNum;
- }
-
- void update()
- {
- layout.setText(layoutRow, 0, "Protocol Id");
- layout.setText(layoutRow, 1, definition.getCavdStudyId() == 0 ? "unassigned" : "" + definition.getCavdStudyId());
- layout.setText(layoutRow, 2, "Revision");
-
- if (definition.getRevision() == 0)
- {
- layout.setText(layoutRow, 3, "Not saved.");
- return;
- }
-
- layout.setText(layoutRow, 3, definition.getRevision() + " (Loading List)");
- designer.getService().getVersions(definition.getCavdStudyId(), new ErrorDialogAsyncCallback("Error occurred getting revisions")
- {
- @Override
- public void onSuccess(GWTStudyDesignVersion[] versions)
- {
- final ListBox revisionList = new ListBox();
- for (GWTStudyDesignVersion version : versions)
- {
- String title = version.getRevision() + ": " + version.getWriterName() + " " + version.getCreated();
- revisionList.addItem(title, Integer.toString(version.getRevision()));
- if (version.getRevision() == definition.getRevision())
- revisionList.setItemSelected(revisionList.getItemCount() - 1, true);
- }
- revisionList.addChangeHandler(new ChangeHandler()
- {
- @Override
- public void onChange(ChangeEvent e)
- {
- if (designer.isDirty())
- if (!Window.confirm("Viewing another revision will discard changes. Continue?"))
- return;
-
- int revision = Integer.parseInt(revisionList.getValue(revisionList.getSelectedIndex()));
- //Redirect here. Include revision number only if it is NOT the latest revision
- String showRevision = PropertyUtil.getRelativeURL("designer.view") + "?studyId=" + definition.getCavdStudyId();
- if (revisionList.getSelectedIndex() < revisionList.getItemCount() - 1)
- showRevision += "&revision=" + revision;
- WindowUtil.setLocation(showRevision);
- }
- });
- layout.setWidget(layoutRow, 3, revisionList);
- }
- });
- }
- }
-
-
- public boolean validate()
- {
- if (null == StringUtils.trimToNull(definition.getStudyName()))
- {
- Window.alert("Please enter a protocol name");
- return false;
- }
- return true;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/SampleMeasurePanel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/SampleMeasurePanel.java
deleted file mode 100644
index 1beaa6a05d7..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/SampleMeasurePanel.java
+++ /dev/null
@@ -1,170 +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.Window;
-import com.google.gwt.user.client.ui.*;
-import gwt.client.org.labkey.study.designer.client.model.GWTSampleMeasure;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition;
-
-/**
- * User: Mark Igra
- * Date: Jan 26, 2007
- * Time: 11:54:08 AM
- */
-public class SampleMeasurePanel extends HorizontalPanel implements SourcesChangeEvents
-{
- TextBox tbAmount = new TextBox();
- ListBox lbSampleType = new ListBox();
- ListBox lbUnits = new ListBox();
- GWTSampleMeasure sampleMeasure;
- GWTStudyDefinition studyDef;
- ChangeListenerCollection listeners = new ChangeListenerCollection();
-
-
- public SampleMeasurePanel(GWTSampleMeasure measure, GWTStudyDefinition def)
- {
- this.studyDef = def;
- init(measure);
- tbAmount.setName("materialAmount");
- tbAmount.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- double val;
- try
- {
- val = Double.parseDouble(tbAmount.getText());
- sampleMeasure.setAmount(val);
- tbAmount.setText(GWTSampleMeasure.formatAmountString(val));
- }
- catch (NumberFormatException x)
- {
- Window.alert("Please enter a number");
- tbAmount.setFocus(true);
- return;
- }
- }
- });
-
- lbSampleType.setName("materialType");
- lbSampleType.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- sampleMeasure.setType(lbSampleType.getItemText(lbSampleType.getSelectedIndex()));
- listeners.fireChange(SampleMeasurePanel.this);
- }
- });
-
- lbUnits.setName("materialUnits");
- lbUnits.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- sampleMeasure.setUnit(lbUnits.getItemText(lbUnits.getSelectedIndex()));
- listeners.fireChange(SampleMeasurePanel.this);
- }
- });
- this.add(tbAmount);
- this.add(lbUnits);
- this.add(lbSampleType);
- }
-
- private void init(GWTSampleMeasure sampleMeasure)
- {
- this.sampleMeasure = sampleMeasure;
-
- //If selection is not valid, just add it to the top of the picker to reflect current state
- String selectedType = sampleMeasure.getType();
- if (null == selectedType || null == studyDef.getSampleTypes() || !studyDef.getSampleTypes().contains(selectedType))
- {
- lbSampleType.addItem(selectedType == null ? "" : selectedType);
- lbSampleType.setSelectedIndex(0);
- }
-
- for (int i = 0; i < studyDef.getSampleTypes().size(); i++)
- {
- String st = studyDef.getSampleTypes().get(i);
- lbSampleType.addItem(st);
- if (st.equals(selectedType))
- lbSampleType.setSelectedIndex(i);
- lbSampleType.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- listeners.fireChange(SampleMeasurePanel.this);
- }
- });
- }
-
- //If selection is not valid, just add it to the top of the picker to reflect current state
- String selectedUnit = sampleMeasure.getUnit();
- if (null == selectedUnit || null == studyDef.getUnits() || !studyDef.getUnits().contains(selectedUnit))
- {
- lbUnits.addItem(selectedUnit == null ? "" : selectedUnit);
- lbUnits.setSelectedIndex(0);
- }
-
- for (int i = 0; i < studyDef.getUnits().size(); i++)
- {
- String unit = studyDef.getUnits().get(i);
- lbUnits.addItem(unit);
- if (unit.equals(selectedUnit))
- lbUnits.setSelectedIndex(i);
- lbUnits.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- listeners.fireChange(SampleMeasurePanel.this);
- }
- });
- }
-
- tbAmount.setText(GWTSampleMeasure.formatAmountString(sampleMeasure.getAmount()));
- }
-
-
- public GWTSampleMeasure getValue()
- {
- return sampleMeasure;
- }
-
- public void setEnabled(boolean enabled)
- {
- tbAmount.setEnabled(enabled);
- lbUnits.setEnabled(enabled);
- lbSampleType.setEnabled(enabled);
- }
-
- @Override
- public void addChangeListener(ChangeListener listener)
- {
- listeners.add(listener);
- }
-
- @Override
- public void removeChangeListener(ChangeListener listener)
- {
- listeners.remove(listener);
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ScheduleGrid.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ScheduleGrid.java
deleted file mode 100644
index 566b661c3ae..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/ScheduleGrid.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- * Copyright (c) 2010-2016 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 gwt.client.org.labkey.study.designer.client.model.GWTCohort;
-import gwt.client.org.labkey.study.designer.client.model.GWTTimepoint;
-import gwt.client.org.labkey.study.designer.client.model.Schedule;
-import org.labkey.api.gwt.client.util.StringUtils;
-import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.DOM;
-
-/**
- * User: Mark Igra
- * Date: Dec 21, 2006
- * Time: 4:57:04 PM
- */
-public abstract class ScheduleGrid extends EditableGrid
-{
- abstract int getCategoryColumnCount();
- abstract int getCategoryRowCount();
- abstract Widget getCategoryWidget(int categoryIndex, int col);
- abstract Object getCategoryValue(int categoryIndex, int col);
- abstract Object getEventValue(int categoryIndex, GWTTimepoint tp);
- abstract Widget getEventWidget(int categoryIndex, GWTTimepoint tp);
- abstract Widget getCategoryHeader(int col);
- abstract Widget getGhostCategoryWidget(int col);
- abstract void makeGhostCategoryReal();
- abstract void deleteCategory(int index);
-
- protected Schedule schedule;
- protected String timelineTitle;
- protected final Designer designer;
-
- protected ScheduleGrid(Schedule schedule, String timelineTitle, Designer designer)
- {
- this.schedule = schedule;
- this.timelineTitle = timelineTitle;
- this.designer = designer;
- }
-
- @Override
- public void updateAll()
- {
- super.updateAll();
- getFlexCellFormatter().setColSpan(0, 1 + getCategoryColumnCount(), schedule.getTimepoints().size() + 1);
- getFlexCellFormatter().setStyleName(0, 1 + getCategoryColumnCount(), "labkey-col-header study-vaccine-design-header");
- if (!designer.isReadOnly())
- {
- //Timepoint headers are clickable
- for (int col = 1 + getCategoryColumnCount(); col < getCellCount(1); col++)
- getFlexCellFormatter().setStyleName(1, col, "labkey-col-header-active");
-
- //As are the cells that indicate an event...
- for (int row = getHeaderRows(); row < getRowCount(); row++)
- for (int col = 1 + getCategoryColumnCount(); col < getCellCount(getHeaderRows()); col++)
- getFlexCellFormatter().setStyleName(row, col, "labkey-row-active");
-
- // and the "add new" cell for the immunization schedule
- getFlexCellFormatter().setStyleName(getRowCount() - 1, 1, "labkey-col-header-active");
- getFlexCellFormatter().setStyleName(getRowCount() - 1, 2, "labkey-col-header-active");
- }
- }
-
- @Override
- int getDataColumnCount()
- {
- return getCategoryColumnCount() + schedule.getTimepoints().size() + (isReadOnly() ? 0 : 1);
- }
-
- @Override
- int getDataRowCount()
- {
- return getCategoryRowCount();
- }
-
- @Override
- Widget getCellWidget(int row, int col)
- {
- if (col < getCategoryColumnCount())
- return getCategoryWidget(row, col);
- else if (col < getDataColumnCount() - 1)
- {
- GWTTimepoint tp = schedule.getTimepoint(col - getCategoryColumnCount());
- return getEventWidget(row, tp);
- }
- else
- return new Label("");
- }
-
-
- @Override
- Object getCellValue(int row, int col)
- {
- if (col < getCategoryColumnCount())
- return getCategoryValue(row, col);
- else if (col < getDataColumnCount() - (isReadOnly() ? 0 : 1))
- {
- GWTTimepoint tp = schedule.getTimepoint(col - getCategoryColumnCount());
- return getEventValue(row, tp);
- }
- else
- return null;
- }
-
- @Override
- Widget getGhostRowWidget(int col)
- {
- if (col < getCategoryColumnCount())
- return getGhostCategoryWidget(col);
-
- return new Label("");
- }
-
- @Override
- void makeGhostRowReal()
- {
- int categoryIndex = getCategoryRowCount();
- int oldGhostRowIndex = categoryIndex + getHeaderRows();
- makeGhostCategoryReal();
- for (int i = 0; i < schedule.getTimepoints().size(); i++)
- {
- getFlexCellFormatter().setStyleName(oldGhostRowIndex, i + getCategoryColumnCount() + 1, "labkey-row-active");
- setWidget(oldGhostRowIndex, i + getCategoryColumnCount() + 1, getEventWidget(categoryIndex, schedule.getTimepoint(i)));
- }
- }
-
- @Override
- int getHeaderRows()
- {
- return 2;
- }
-
- @Override
- public Widget getColumnHeader(int row, int column)
- {
- if (row == 0)
- {
- if (column < getCategoryColumnCount())
- return new Label("");
- if (column == getCategoryColumnCount())
- {
- Label label = new Label(timelineTitle);
- label.setStyleName("study-vaccine-design-header");
- return label;
- }
- else
- return null;
- }
-
- if (column < getCategoryColumnCount())
- return getCategoryHeader(column);
- else
- return new TimepointWidget(column - getCategoryColumnCount());
- }
-
- class TimepointWidget extends Label
- {
- GWTTimepoint tp;
- boolean isGhost;
-
- TimepointWidget(final int index)
- {
- if (index < schedule.getTimepoints().size())
- {
- tp = schedule.getTimepoint(index);
- setText(tp.toString());
- setTitle("Click to modify or delete this timepoint.");
- }
- else
- {
- isGhost = true;
- tp = new GWTTimepoint();
- setText("Add Timepoint");
- setTitle("Click to add a new timepoint.");
- }
- setWidth("100%");
-
- addClickListener(new ClickListener() {
- @Override
- public void onClick(Widget sender)
- {
- if (designer.isReadOnly())
- return;
-
- DefineTimepointDialog dialog = new DefineTimepointDialog();
- dialog.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + getOffsetHeight());
- dialog.show();
- }
- });
- }
-
- void update()
- {
- designer.setDirty(true);
- if (isGhost)
- {
- schedule.addTimepoint(tp);
- updateAll();
- }
- else
- setText(tp.toString());
- }
-
- public class DefineTimepointDialog extends DialogBox
- {
- private TextBox tbName = new TextBox();
- private TextBox tbCount = new TextBox();
- private ListBox lbUnit = new ListBox();
-
- public DefineTimepointDialog()
- {
- setText("Define Timepoint");
- DOM.setAttribute(getElement(), "id", "DefineTimepointDialog");
-
- Grid formGrid = new Grid();
- formGrid.resize(2, 2);
- formGrid.setText(0, 0, "Name");
- formGrid.setText(1, 0, "Timepoint");
- tbName.setText(StringUtils.trimToEmpty(tp.getName()));
- tbName.setName("timepointName"); //For easier recording
- formGrid.setWidget(0, 1, tbName);
- HorizontalPanel hpTime = new HorizontalPanel();
- hpTime.add(tbCount);
- tbCount.setText(Integer.toString(tp.getUnit().daysAsUnit(tp.getDays())));
- tbCount.setName("timepointCount");
- lbUnit.addItem("Days");
- lbUnit.addItem("Weeks");
- lbUnit.setName("timepointUnit"); //For easier recording
- if (null == tp.getUnit() || tp.getUnit() == GWTTimepoint.DAYS)
- lbUnit.setSelectedIndex(0);
- else if (tp.getUnit() == GWTTimepoint.WEEKS)
- lbUnit.setSelectedIndex(1);
- hpTime.add(lbUnit);
-
- KeyboardListener enterListener = new KeyboardListener() {
- @Override
- public void onKeyDown(Widget sender, char keyCode, int modifiers) {
- }
-
- @Override
- public void onKeyPress(Widget sender, char keyCode, int modifiers) {
- if (keyCode == '\n' || keyCode == '\r')
- doOk();
- }
-
- @Override
- public void onKeyUp(Widget sender, char keyCode, int modifiers) {
- }
- };
- tbCount.addKeyboardListener(enterListener);
- tbName.addKeyboardListener(enterListener);
- lbUnit.addKeyboardListener(enterListener);
-
-
- formGrid.setWidget(1, 1, hpTime);
-
- HorizontalPanel hp = new HorizontalPanel();
- hp.setSpacing(3);
- hp.add(new Button("Cancel", new ClickListener() {
- @Override
- public void onClick(Widget sender)
- {
- hide();
- }
- }));
- hp.add(new Button("OK", new ClickListener(){
-
- @Override
- public void onClick(Widget sender)
- {
- doOk();
- }
- }
- ));
- if (!isGhost)
- {
- hp.add(new Button("Delete Timepoint", new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- schedule.removeTimepoint(tp);
- designer.setDirty(true);
- hide();
- updateAll();
- }
- }));
- }
-
- VerticalPanel vp = new VerticalPanel();
- vp.add(formGrid);
- vp.add(hp);
- setWidget(vp);
- }
-
-
- @Override
- protected void onLoad() {
- super.onLoad();
- tbCount.setFocus(true);
- tbCount.setSelectionRange(0, tbCount.getText().length());
- }
-
- private void doOk()
- {
- int count = 0;
- if (null == tbCount.getText() || 0 == tbCount.getText().length())
- {
- Window.alert("Enter a time for the timepoint");
- tbCount.setFocus(true);
- return;
- }
- try
- {
- count = Integer.parseInt(tbCount.getText());
- }
- catch (Exception x)
- {
- Window.alert("Enter a valid number for the count.");
- tbCount.setFocus(true);
- return;
- }
-
- tp.setName(StringUtils.trimToNull(tbName.getText()));
- GWTTimepoint.Unit unit = GWTTimepoint.Unit.fromString(lbUnit.getItemText(lbUnit.getSelectedIndex()));
- tp.setUnit(unit);
- tp.setDays(unit.daysPerUnit * count);
-
- for (GWTTimepoint existing : schedule.getTimepoints())
- {
- if (tp != existing && tp.getUnit() == existing.getUnit() && tp.getDays() == existing.getDays())
- {
- String msgStart = existing.getName() != null ? "Timepoint " + existing.getName() : "A timepoint";
- Window.alert(msgStart + " already exists at " + unit.daysAsUnit(existing.getDays()) +
- " " + unit.name + ". Duplicate timepoints are not allowed.");
- tbCount.setFocus(true);
- return;
- }
- }
-
- hide();
- update();
- }
- }
-
- }
-
- class GroupWidget extends Label
- {
- GWTCohort cohort;
-
- GroupWidget()
- {
- cohort = new GWTCohort();
- setText("Add New");
- setTitle("Click to add a new group / cohort.");
- setWidth("100%");
-
- addClickListener(new ClickListener() {
- @Override
- public void onClick(Widget sender)
- {
- if (designer.isReadOnly())
- return;
-
- DefineGroupDialog dialog = new DefineGroupDialog();
- dialog.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + getOffsetHeight());
- dialog.show();
- }
- });
- }
-
- void update()
- {
- designer.setDirty(true);
- designer.getDefinition().getGroups().add(cohort);
- updateAll();
- }
-
- public class DefineGroupDialog extends DialogBox
- {
- private RadioButton existRadio = new RadioButton("cohortType", "Select an existing group/cohort");
- private ListBox existList = new ListBox();
- private RadioButton newRadio = new RadioButton("cohortType", "Create a new group/cohort");
- private TextBox newNameTextBox = new TextBox();
-
-
- public DefineGroupDialog()
- {
- setText("Define Group / Cohort");
- DOM.setAttribute(getElement(), "id", "DefineGroupDialog");
-
- newRadio.setChecked(true);
- newNameTextBox.setName("newName");
- existList.setName("existName");
- for (String existCohortName : designer.getDefinition().getCohorts())
- {
- existList.addItem(existCohortName);
- }
- existRadio.setEnabled(existList.getItemCount() > 0);
- existList.setEnabled(false); // always initially disabled
-
- newRadio.addClickListener(new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- existList.setEnabled(false);
- }
- });
- existRadio.addClickListener(new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- existList.setEnabled(existList.getItemCount() > 0);
- }
- });
-
- Grid formGrid = new Grid();
- formGrid.resize(3, 2);
- formGrid.setWidget(0, 0, newRadio);
- formGrid.setWidget(0, 1, newNameTextBox);
- formGrid.setWidget(1, 0, existRadio);
- formGrid.setWidget(1, 1, existList);
-
- HorizontalPanel hp = new HorizontalPanel();
- hp.setSpacing(3);
- hp.add(new Button("Cancel", new ClickListener() {
- @Override
- public void onClick(Widget sender)
- {
- hide();
- }
- }));
- hp.add(new Button("OK", new ClickListener(){
-
- @Override
- public void onClick(Widget sender)
- {
- doOk();
- }
- }
- ));
-
- VerticalPanel vp = new VerticalPanel();
- vp.add(formGrid);
- vp.add(hp);
- setWidget(vp);
- }
-
- private void doOk()
- {
- String selectedCohortName = null;
- if (newRadio.isChecked())
- {
- selectedCohortName = StringUtils.trimToNull(newNameTextBox.getText());
- }
- else if (existRadio.isChecked())
- {
- selectedCohortName = existList.getItemText(existList.getSelectedIndex());
- }
-
- if (selectedCohortName == null || selectedCohortName.length() == 0)
- {
- Window.alert("Please specify a group/cohort name.");
- return;
- }
-
- for (GWTCohort existingGroup : designer.getDefinition().getGroups())
- {
- if (existingGroup.getName().equalsIgnoreCase(selectedCohortName))
- {
- Window.alert("A group/cohort already exists with the following name: " + selectedCohortName);
- return;
- }
- }
-
- cohort.setName(selectedCohortName);
-
- hide();
- update();
- }
- }
-
- }
-
- @Override
- void deleteRow(int dataRow)
- {
- deleteCategory(dataRow);
- updateAll();
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionService.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionService.java
deleted file mode 100644
index 0e7c3e9735f..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionService.java
+++ /dev/null
@@ -1,39 +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.rpc.RemoteService;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDesignVersion;
-
-/**
- * User: Mark Igra
- * Date: Feb 14, 2007
- * Time: 8:46:26 PM
- */
-public interface StudyDefinitionService extends RemoteService
-{
- public GWTStudyDesignVersion save(GWTStudyDefinition def);
- public GWTStudyDefinition getBlank();
- public GWTStudyDefinition getRevision(int studyId, int revision);
- public GWTStudyDesignVersion[] getVersions(int studyId);
- public GWTStudyDefinition getTemplate();
- public GWTStudyDefinition ensureDatasetPlaceholders(GWTStudyDefinition def);
- public GWTStudyDefinition createTimepoints(GWTStudyDefinition def);
- public GWTStudyDefinition createCohorts(GWTStudyDefinition def);
- public Boolean hasNewCohorts(GWTStudyDefinition def);
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionServiceAsync.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionServiceAsync.java
deleted file mode 100644
index 1b232bc9fb6..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/StudyDefinitionServiceAsync.java
+++ /dev/null
@@ -1,49 +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 gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDesignVersion;
-
-/**
- * User: Mark Igra
- * Date: Feb 14, 2007
- * Time: 8:47:24 PM
- */
-public interface StudyDefinitionServiceAsync
-{
-
- void save(GWTStudyDefinition def, AsyncCallback async);
-
- void getBlank(AsyncCallback async);
-
- void getRevision(int studyId, int revision, AsyncCallback async);
-
- void getVersions(int studyId, AsyncCallback async);
-
- void getTemplate(AsyncCallback async);
-
- void ensureDatasetPlaceholders(GWTStudyDefinition def, AsyncCallback callback);
-
- void createTimepoints(GWTStudyDefinition def, AsyncCallback callback);
-
- void createCohorts(GWTStudyDefinition def, AsyncCallback callback);
-
- void hasNewCohorts(GWTStudyDefinition def, AsyncCallback callback);
-
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/VaccinePanel.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/VaccinePanel.java
deleted file mode 100644
index f706d8aef01..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/VaccinePanel.java
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
- * Copyright (c) 2010-2016 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 com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.DOM;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import gwt.client.org.labkey.study.designer.client.model.*;
-import org.labkey.api.gwt.client.ui.ImageButton;
-import org.labkey.api.gwt.client.util.PropertyUtil;
-import org.labkey.api.gwt.client.util.StringUtils;
-import org.labkey.api.gwt.client.ui.StringListBox;
-
-public class VaccinePanel extends Composite
-{
- List immunogens;
- List/**/ adjuvants;
- private GWTAdjuvant ghostAdjuvant = new GWTAdjuvant();
- private GWTImmunogen ghostImmunogen = new GWTImmunogen();
- private Designer designer;
- GWTStudyDefinition studyDef;
-
- public VaccinePanel(Designer parent, List immunogens, List adjuvants)
- {
- this.designer = parent;
- this.studyDef = parent.getDefinition();
- this.immunogens = immunogens;
- this.adjuvants = adjuvants;
-
- VerticalPanel vPanel = new VerticalPanel();
- initWidget(vPanel);
- String html;
- vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
- vPanel.add(new HTML("Immunogens
"));
- if (designer.isReadOnly())
- {
- if (immunogens == null || immunogens.size() == 0)
- {
- html = "No immunogens have been defined.";
- if (designer.canEdit)
- html += "
To add immunogens, click the edit button below.";
- vPanel.add(new HTML(html));
- }
- else
- {
- html = "This section describes the immunogens and adjuvants evaluated in the study.";
- if (designer.isCanEdit())
- html += "
To change the set of immunogens and adjuvants, click the edit button below.";
- vPanel.add(new HTML(html));
- vPanel.add(getImmunogenGrid());
- }
- }
- else
- {
- html = "Enter vaccine information in the grids below.- Each immunogen in the study should be listed on one row of the immunogens grid below." +
- "
- Each adjuvant should be listed in the adjuvant grid. " +
- "
- Immunogens should have unique names. " +
- "
- If possible the immunogen description should include specific sequences of HIV Antigens included in the immunogen." +
- "
- Use the immunizations tab to describe the schedule of immunizations and combinations of immunogens and adjuvants administered at each timepoint.
";
- vPanel.add(new HTML(html));
-
- if ("true".equals(PropertyUtil.getServerProperty("canEdit")))
- {
- final boolean showAllLookups = "true".equals(PropertyUtil.getServerProperty("showAllLookups"));
- HorizontalPanel hp = new HorizontalPanel();
- hp.add(new ImageButton("Configure Dropdown Options", new ClickListener()
- {
- @Override
- public void onClick(Widget sender)
- {
- DesignerLookupConfigDialog dlg = new DesignerLookupConfigDialog(true, showAllLookups);
- dlg.setPopupPosition(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + sender.getOffsetHeight());
- dlg.show();
- }
- }));
- vPanel.add(hp);
- }
-
- vPanel.add(getImmunogenGrid());
- }
-
- vPanel.add(new HTML("Adjuvants
"));
- if (designer.isReadOnly() && (null == adjuvants || adjuvants.size() == 0))
- {
- html = "No adjuvants have been defined.";
- if (designer.canEdit)
- html += "
To add adjuvants, click the edit button below.";
- vPanel.add(new HTML(html));
- }
- else
- {
- vPanel.add(getAdjuvantGrid());
- }
- }
-
-
- public class ImmunogenGrid extends EditableGrid
- {
- public ImmunogenGrid()
- {
- super();
- setReadOnly(designer.isReadOnly());
- DOM.setAttribute(getElement(), "id", "ImmunogenGrid");
- }
-
- @Override
- public int getDataColumnCount()
- {
- return isShowAntigens() ? colHeaders.length : colHeaders.length - 1;
- }
-
- private boolean isShowAntigens()
- {
- //Always show antigens in edit mode
- if (!designer.isReadOnly())
- return true;
-
- for (GWTImmunogen immunogen : immunogens)
- if (null != immunogen.getAntigens() && immunogen.getAntigens().size() > 0)
- return true;
-
- return false;
- }
-
- @Override
- public int getDataRowCount()
- {
- return immunogens.size();
- }
-
- Label[] colHeaders = {new Label("Immunogen Name"), new Label("Type"), new Label("Dose and units"), new Label("Route"), new Label("HIV Antigens")};
- @Override
- public Widget getColumnHeader(int row, int column)
- {
- if (column >= colHeaders.length)
- return new Label("No such column");
-
- return colHeaders[column];
- }
-
- @Override
- public Widget getCellWidget(int row, int col)
- {
- final GWTImmunogen immunogen = row >= immunogens.size() ? ghostImmunogen : immunogens.get(row);
- return getCellWidget(immunogen, row, col);
- }
-
-
- @Override
- Object getCellValue(int row, int col)
- {
- final GWTImmunogen immunogen = row >= immunogens.size() ? ghostImmunogen : immunogens.get(row);
- switch (col)
- {
- case 0:
- return immunogen.getName();
- case 1:
- return immunogen.getType();
- case 2:
- return immunogen.getDose();
- case 3:
- return immunogen.getAdmin();
- }
-
- return null;
- }
-
-
- @Override
- public Widget getReadOnlyWidget(int row, int col)
- {
- if (col <= 3)
- return super.getReadOnlyWidget(row, col); //Just plain labels
- else
- {
- GWTImmunogen immunogen = immunogens.get(row);
- if (null != immunogen.getAntigens() && immunogen.getAntigens().size() > 0)
- return getCellWidget(row, col);
- else
- return new Label("");
- }
- }
-
- @Override
- Widget getGhostRowWidget(int col)
- {
- return getCellWidget(ghostImmunogen, getRowCount() - getHeaderRows(), col);
- }
-
- public Widget getCellWidget(final GWTImmunogen immunogen, int row, int col)
- {
-
- if (col == 0)
- {
- final TextBox tb = new TextBox();
- tb.setText(StringUtils.trimToEmpty(immunogen.getName()));
- tb.setTitle("Enter the name for immunogen " + (row + 1) + " here. Each immunogen should have a unique name.");
- tb.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- immunogen.setName(tb.getText());
- designer.setDirty(true);
- designer.immunizationPanel.updateAll();
- }
- });
- return tb;
- }
- else if (col == 3)
- {
- final StringListBox routeList = new StringListBox(studyDef.getRoutes(), StringUtils.trimToNull(immunogen.getAdmin()), false, true);
- routeList.setTitle("Immunogen " + (row + 1) + " route");
- routeList.addChangeListener(new ChangeListener(){
- @Override
- public void onChange(Widget sender)
- {
- immunogen.setAdmin(routeList.getText());
- designer.setDirty(true);
- }
- });
- return routeList;
- }
- else if (col == 2)
- {
- final TextBox tb = new TextBox();
- tb.setText(StringUtils.trimToEmpty(immunogen.getDose()));
- tb.setTitle("Enter the dose for immunogen " + (row + 1) + " here. If the same immunogen type is used with different dosages, enter it on two rows.");
- tb.addChangeListener(new ChangeListener(){
- @Override
- public void onChange(Widget sender)
- {
- immunogen.setDose(tb.getText());
- designer.setDirty(true);
- }
- });
- return tb;
- }
-
- if (col == 1)
- {
- final StringListBox lb = new StringListBox(studyDef.getImmunogenTypes(), StringUtils.trimToNull(immunogen.getType()), false, true);
- lb.setTitle("Immunogen " + (row + 1) + " type");
- lb.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender)
- {
- immunogen.setType(lb.getText());
- designer.setDirty(true);
- }
- });
-
- return lb;
- }
-
- if (col == 4)
- {
- return getAntigenGrid(immunogen.getAntigens(), row);
- }
-
- throw new IllegalArgumentException("No such column:" + col);
- }
-
- @Override
- public int getHeaderRows()
- {
- return 1;
- }
-
- public void setOwner(EditableGrid grid)
- {
-
- }
-
- @Override
- public String getRowNoun()
- {
- return "immunogen";
- }
-
- @Override
- public void makeGhostRowReal()
- {
- immunogens.add(ghostImmunogen);
- ghostImmunogen = new GWTImmunogen();
- }
-
-
- @Override
- void deleteRow(int dataRow)
- {
- GWTImmunogen immunogen = immunogens.remove(dataRow);
- GWTImmunizationSchedule schedule = designer.getDefinition().getImmunizationSchedule();
- schedule.removeImmunogen(immunogen);
- designer.setDirty(true);
- updateAll();
- designer.immunizationPanel.updateAll();
- }
- }
-
- class AntigenGrid extends EditableGrid
- {
- List/**/ antigens;
- GWTAntigen ghostAntigen = new GWTAntigen();
-
- AntigenGrid(List/**/ antigens, int row)
- {
- this.antigens = null == antigens ? new ArrayList() : antigens;
- DOM.setAttribute(this.getElement(), "id", "AntigenGrid" + row);
- setReadOnly(designer.isReadOnly());
- }
-
- @Override
- public int getDataColumnCount()
- {
- return 3;
- }
-
- @Override
- public int getDataRowCount()
- {
- return antigens.size();
- }
-
- private Widget[] colHeaders = new Widget[] {new Label("Gene"), new Label("Subtype"), new Label("Sequence") };
- @Override
- public Widget getColumnHeader(int row, int column)
- {
- return colHeaders[column];
- }
-
- @Override
- public Widget getCellWidget(int row, int col)
- {
- return getCellWidget((GWTAntigen) antigens.get(row), col);
- }
-
- @Override
- public Object getCellValue(int row, int col)
- {
- GWTAntigen antigen = (GWTAntigen) antigens.get(row);
- switch (col)
- {
- case 0:
- return antigen.getGene();
- case 1:
- return antigen.getSubtype();
- case 2:
- String s = null;
- if (null != antigen.getGenBankId())
- s = antigen.getGenBankId();
- if (null != antigen.getSequence())
- s = (s == null ? "" : s + ": ") + antigen.getSequence();
- return StringUtils.trimToEmpty(s);
- }
-
- return null;
- }
-
-
- @Override
- public Widget getReadOnlyWidget(int row, int col)
- {
- Label l = new Label((String) getCellValue(row, col));
- l.setWordWrap(col == 2);
- return l;
- }
-
- @Override
- Widget getGhostRowWidget(int col)
- {
- return getCellWidget(ghostAntigen, col);
- }
-
- private Widget getCellWidget(final GWTAntigen antigen, int col)
- {
- if (col == 0)
- {
- final StringListBox listBox = new StringListBox(studyDef.getGenes(), StringUtils.trimToNull(antigen.getGene()), false, true);
- listBox.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender)
- {
- antigen.setGene(listBox.getText());
- designer.setDirty(true);
- }
- });
- return listBox;
- }
- if (col == 1)
- {
- final StringListBox listBox = new StringListBox(studyDef.getSubTypes(), StringUtils.trimToNull(antigen.getSubtype()), false, true);
- listBox.setText(StringUtils.trimToEmpty(antigen.getSubtype()));
- listBox.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender)
- {
- antigen.setSubtype(listBox.getText());
- designer.setDirty(true);
- }
- });
- return listBox;
- }
- if (col == 2)
- {
- return new SequencePanel(antigen);
- }
-
- throw new IllegalArgumentException("No such column: " + col);
- }
-
- @Override
- public int getHeaderRows()
- {
- return 1;
- }
-
- @Override
- public void makeGhostRowReal()
- {
- antigens.add(ghostAntigen);
- ghostAntigen = new GWTAntigen();
- }
-
- @Override
- public String getRowNoun()
- {
- return "antigen";
- }
-
- @Override
- void deleteRow(int dataRow)
- {
- antigens.remove(dataRow);
- designer.setDirty(true);
- updateAll();
- }
-
- private static final String GEN_BANK_HELP_STRING = "Enter the GenBank ID for this HIV Antigen";
- private static final String GEN_BANK_HELP_STRING_DISABLED = "To edit, choose 'GenBank Id' or 'Both' for the sequence identifier type";
- public class SequencePanel extends FlexTable
- {
- private ListBox entryType = new ListBox();
- private TextBox genBankIdBox = new TextBox();
- private TextArea sequenceTextArea = new TextArea();
- GWTAntigen antigen;
-
- SequencePanel(GWTAntigen antigen)
- {
- this.antigen = antigen;
- entryType.addItem("GenBank Id");
- entryType.addItem("Sequence");
- entryType.addItem("Both");
- genBankIdBox.setText(StringUtils.trimToEmpty(antigen.getGenBankId()));
- genBankIdBox.setTitle(GEN_BANK_HELP_STRING);
- sequenceTextArea.setWidth("100%");
- sequenceTextArea.setVisibleLines(4);
- sequenceTextArea.setText(StringUtils.trimToEmpty(antigen.getSequence()));
- sequenceTextArea.setTitle("Enter the full sequence for this HIV Antigen");
- if (null != antigen.getSequence() && null != antigen.getGenBankId())
- entryType.setSelectedIndex(2);
- else if (null != antigen.getSequence())
- entryType.setSelectedIndex(1);
- else
- entryType.setSelectedIndex(0);
-
- this.prepareCell(1, 0);
- this.getFlexCellFormatter().setColSpan(1, 0, 2);
-
- setWidget(0, 0, entryType);
- setWidget(0, 1, genBankIdBox);
- if (null != antigen.getSequence())
- setWidget(1, 0, sequenceTextArea);
-
- entryType.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- switch (entryType.getSelectedIndex())
- {
- case 0:
- genBankIdBox.setEnabled(true);
- if (null != getWidget(1, 0))
- remove(sequenceTextArea);
- break;
- case 1:
- genBankIdBox.setEnabled(false);
- SequencePanel.this.antigen.setGenBankId(null);
- genBankIdBox.setText("");
- if (null == getWidget(1, 0))
- setWidget(1, 0, sequenceTextArea);
- break;
- default:
- genBankIdBox.setEnabled(true);
- setWidget(1, 0, sequenceTextArea);
- }
- genBankIdBox.setTitle(genBankIdBox.isEnabled() ? GEN_BANK_HELP_STRING : GEN_BANK_HELP_STRING_DISABLED);
- designer.setDirty(true);
- }
- });
- genBankIdBox.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- designer.setDirty(true);
- SequencePanel.this.antigen.setGenBankId(StringUtils.trimToNull(genBankIdBox.getText()));
- }
- });
- sequenceTextArea.addChangeListener(new ChangeListener()
- {
- @Override
- public void onChange(Widget sender)
- {
- designer.setDirty(true);
- SequencePanel.this.antigen.setSequence(StringUtils.trimToNull(sequenceTextArea.getText()));
- }
- });
- }
- }
-
- }
-
- public class AdjuvantGrid extends EditableGrid
- {
- private Widget[] columnNames = new Widget[] {new Label("Name"), new Label("Dose and units"), new Label("Route")};
-
- public AdjuvantGrid()
- {
- super();
- columnNames[0].setTitle("The name of the adjuvant as used in the study protocol.");
- columnNames[1].setTitle("The dose of this adjuvant. If the protocol uses the same adjuvant type with different dosages create multiple adjuvant rows.");
- columnNames[2].setTitle("Route of administration for this adjuvant.");
- setReadOnly(designer.isReadOnly());
- DOM.setAttribute(getElement(), "id", "AdjuvantGrid");
- }
-
- @Override
- public int getDataColumnCount()
- {
- return columnNames.length;
- }
-
- @Override
- public int getDataRowCount()
- {
- return null == adjuvants ? 0 : adjuvants.size();
- }
-
- @Override
- public Widget getColumnHeader(int row, int column)
- {
- if (column >= columnNames.length)
- return new Label("No such column: " + column);
-
- return columnNames[column];
- }
-
- @Override
- Widget getCellWidget(int row, int col)
- {
- return getCellWidget((GWTAdjuvant) adjuvants.get(row), col);
- }
-
- @Override
- Object getCellValue(int row, int col)
- {
- GWTAdjuvant adjuvant = (GWTAdjuvant) adjuvants.get(row);
- switch (col)
- {
- case 0:
- return adjuvant.getName();
- case 1:
- return adjuvant.getDose();
- case 2:
- return adjuvant.admin;
- }
- return null;
- }
-
-
- @Override
- Widget getGhostRowWidget(int col)
- {
- return getCellWidget(ghostAdjuvant, col);
- }
-
- private Widget getCellWidget(final GWTAdjuvant adjuvant, int col)
- {
-
- Widget w;
- String text = null;
- switch (col)
- {
- case 0:
- TextBox nameTextBox = new TextBox();
- text = adjuvant.getName();
- nameTextBox.setText(StringUtils.trimToEmpty(text));
- nameTextBox.setTitle("Enter the name of adjuvant.");
- nameTextBox.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender)
- {
- adjuvant.setName(((HasText) sender).getText());
- designer.setDirty(true);
- designer.immunizationPanel.updateAll();
- }
- });
- return nameTextBox;
- case 1:
- TextBox doseTextBox = new TextBox();
- text = adjuvant.getDose();
- doseTextBox.setText(StringUtils.trimToEmpty(text));
- doseTextBox.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender)
- {
- adjuvant.setDose(((HasText) sender).getText());
- designer.setDirty(true);
- }
- });
- return doseTextBox;
- case 2:
- StringListBox listBox = new StringListBox(studyDef.getRoutes(), StringUtils.trimToNull(adjuvant.admin), false, true);
- text = adjuvant.admin;
- listBox.addChangeListener(new ChangeListener() {
- @Override
- public void onChange(Widget sender)
- {
- adjuvant.admin = ((HasText) sender).getText();
- designer.setDirty(true);
- }
- });
- return listBox;
- }
- return null;
- }
-
- @Override
- public int getHeaderRows()
- {
- return 1;
- }
-
- @Override
- public String getRowNoun()
- {
- return "adjuvant";
- }
-
- @Override
- public void makeGhostRowReal()
- {
- adjuvants.add(ghostAdjuvant);
- ghostAdjuvant = new GWTAdjuvant();
- }
-
- @Override
- void deleteRow(int dataRow)
- {
- GWTAdjuvant adjuvant = (GWTAdjuvant) adjuvants.remove(dataRow);
- designer.getDefinition().getImmunizationSchedule().removeAdjuvant(adjuvant);
- designer.setDirty(true);
- updateAll();
- designer.immunizationPanel.updateAll();
- }
- }
-
- public EditableGrid getAntigenGrid(List/**/ antigens, int row)
- {
- EditableGrid eg = new AntigenGrid(antigens, row);
- eg.updateAll();
- return eg;
- }
-
- public EditableGrid getImmunogenGrid()
- {
- EditableGrid eg = new ImmunogenGrid();
- eg.updateAll();
- return eg;
- }
-
- public EditableGrid getAdjuvantGrid()
- {
- EditableGrid eg = new AdjuvantGrid();
- eg.updateAll();
- return eg;
- }
-
- public boolean validate()
- {
- return validateComponentNames(immunogens) && validateComponentNames(adjuvants);
- }
-
- private boolean validateComponentNames(List/**/ components)
- {
- for (int i = 0; i < components.size(); i++)
- {
- VaccineComponent component = (VaccineComponent) components.get(i);
- if (null == StringUtils.trimToNull(component.getName()))
- {
- Window.alert("All vaccine components must have a name");
- return false;
- }
- }
- return true;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/AbstractXMLSavable.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/AbstractXMLSavable.java
deleted file mode 100644
index 5ff13b6f93d..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/AbstractXMLSavable.java
+++ /dev/null
@@ -1,81 +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.model;
-
-import com.google.gwt.xml.client.Element;
-import com.google.gwt.xml.client.Document;
-
-/**
- * User: Mark Igra
- * Date: Jan 31, 2007
- * Time: 2:47:37 PM
- */
-public abstract class AbstractXMLSavable implements XMLSavable
-{
- @Override
- public String tagName()
- {
- return XMLUtils.tagName(this);
- }
-
- public String refTagName()
- {
- return tagName() + "Ref";
- }
-
- @Override
- public String pluralTagName()
- {
- return XMLUtils.pluralTagName(this);
- }
-
- protected Element createTag(Document doc)
- {
- return doc.createElement(tagName());
- }
-
- protected Element createTag(Document doc, String attr1, Object attr1Val)
- {
- Element el = createTag(doc);
- return XMLUtils.safeSetAttr(el, attr1, attr1Val);
- }
-
- protected Element createTag(Document doc, String attr1, Object attr1Val, String attr2, Object attr2Val)
- {
- Element el = createTag(doc);
- return XMLUtils.safeSetAttrs(el, new String[] {attr1, attr2}, new Object[] {attr1Val, attr2Val});
- }
-
- protected Element createTag(Document doc, String attr1, Object attr1Val, String attr2, Object attr2Val, String attr3, Object attr3Val)
- {
- Element el = createTag(doc);
- return XMLUtils.safeSetAttrs(el, new String[] {attr1, attr2, attr3}, new Object[] {attr1Val, attr2Val, attr3Val});
- }
-
- protected Element createTag(Document doc, String attr1, Object attr1Val, String attr2, Object attr2Val, String attr3, Object attr3Val, String attr4, Object attr4val)
- {
- Element el = createTag(doc);
- return XMLUtils.safeSetAttrs(el, new String[] {attr1, attr2, attr3, attr4}, new Object[] {attr1Val, attr2Val, attr3Val, attr4val});
- }
-
- protected Element createRefTag(Document doc, String name)
- {
- Element el = doc.createElement(tagName() + "Ref");
- el.setAttribute("name", name);
- return el;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAdjuvant.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAdjuvant.java
deleted file mode 100644
index aa154d798a7..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAdjuvant.java
+++ /dev/null
@@ -1,69 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 11:31:18 AM
- */
-public class GWTAdjuvant extends VaccineComponent implements IsSerializable
-{
- public String admin;
- public GWTAdjuvant(String name, String dose, String admin)
- {
- this.setName(name);
- this.setDose(dose);
- this.admin = admin;
- }
- public GWTAdjuvant()
- {
-
- }
-
-// public Element toElement(Document doc)
-// {
-// return createTag(doc, "name", name, "dose", dose, "admin", admin);
-// }
-//
-// public Element toRefElement(Document doc)
-// {
-// Element el = createRefTag(doc, name);
-// return el;
-// }
-//
-// public static GWTAdjuvant fromRefElement(Element el, List/**/ adjuvants)
-// {
-// String name = el.getAttribute("name");
-// for (int i = 0; i < adjuvants.size(); i++)
-// {
-// GWTAdjuvant adjuvant = (GWTAdjuvant) adjuvants.get(i);
-// if (adjuvant.name.equals(name))
-// return adjuvant;
-// }
-// return null;
-// }
-//
-// public GWTAdjuvant(Element el)
-// {
-// name = el.getAttribute("name");
-// dose = el.getAttribute("dose");
-// admin = el.getAttribute("admin");
-// }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAntigen.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAntigen.java
deleted file mode 100644
index 3b8fb4d54cf..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAntigen.java
+++ /dev/null
@@ -1,114 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 11:27:07 AM
- */
-public class GWTAntigen implements IsSerializable
-{
- private String name;
- private String gene;
- private String subtype;
- private String sequence;
- private String genBankId;
-
- public GWTAntigen()
- {
-
- }
- public GWTAntigen(String name, String gene, String subtype, String genBankId, String sequence)
- {
- this.name = name;
- this.gene = gene;
- this.subtype = subtype;
- this.genBankId = genBankId;
- this.sequence = sequence;
- }
-
- public String toString()
- {
- return name + ": " + gene + (null != subtype ? ("(" + subtype + ")") : "");
- }
-
-// public Element toElement(Document doc)
-// {
-// Element el = createTag(doc, "name", name, "gene", gene, "subtype", subtype);
-// XMLUtils.addTextTag(el, "sequence", sequence);
-//
-// return el;
-// }
-//
-// public GWTAntigen(Element el)
-// {
-// this(el.getAttribute("name"), el.getAttribute("gene"), el.getAttribute("subtype"), XMLUtils.getTextTag(el, "sequence"));
-// }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getGene()
- {
- return gene;
- }
-
- public void setGene(String gene)
- {
- this.gene = gene;
- }
-
- public String getSubtype()
- {
- return subtype;
- }
-
- public void setSubtype(String subtype)
- {
- this.subtype = subtype;
- }
-
- public String getSequence()
- {
- return sequence;
- }
-
- public void setSequence(String sequence)
- {
- this.sequence = sequence;
- }
-
- public String getGenBankId()
- {
- return genBankId;
- }
-
- public void setGenBankId(String genBankId)
- {
- this.genBankId = genBankId;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayDefinition.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayDefinition.java
deleted file mode 100644
index b7a522e7345..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayDefinition.java
+++ /dev/null
@@ -1,87 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 1:20:02 PM
- */
-public class GWTAssayDefinition implements IsSerializable
-{
- private String assayName;
- private String lab;
-
- public GWTAssayDefinition()
- {
-
- }
-
- public GWTAssayDefinition(GWTAssayDefinition copyFrom)
- {
- this.assayName = copyFrom.assayName;
- this.lab = copyFrom.lab;
- }
-
- public GWTAssayDefinition(String assayName, String lab)
- {
- this.assayName = assayName;
- this.lab = lab;
- }
-
- public String toString()
- {
- return assayName;
- }
-
- public boolean equals(Object o)
- {
- if (null == o)
- return false;
-
- GWTAssayDefinition ad = (GWTAssayDefinition) o;
- return (assayName == null ? ad.assayName == null : assayName.equals(ad.assayName)) &&
- (lab == null ? ad.lab == null : lab.equals(ad.lab));
- }
-
- public int hashCode()
- {
- return (assayName == null ? 0 : assayName.hashCode()) ^ (lab == null ? 1 : lab.hashCode());
- }
-
- public String getAssayName()
- {
- return assayName;
- }
-
- public void setAssayName(String assayName)
- {
- this.assayName = assayName;
- }
-
- public String getLab()
- {
- return lab;
- }
-
- public void setLab(String lab)
- {
- this.lab = lab;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayNote.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayNote.java
deleted file mode 100644
index 9b0a81c92d2..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssayNote.java
+++ /dev/null
@@ -1,76 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 1:22:09 PM
- */
-public class GWTAssayNote implements IsSerializable
-{
- private GWTSampleMeasure sampleMeasure;
-
- public GWTAssayNote()
- {
-
- }
-
- public GWTAssayNote(GWTAssayDefinition assay)
- {
- this.sampleMeasure = null;
- }
-
- public GWTAssayNote(GWTSampleMeasure sampleMeasure)
- {
- this.sampleMeasure = sampleMeasure;
- }
-
-
- public boolean equals(Object o)
- {
- if (this == o) return true;
-
- GWTAssayNote that = (GWTAssayNote) o;
-
- if (!sampleMeasure.equals(that.sampleMeasure)) return false;
-
- return true;
- }
-
- public int hashCode()
- {
- return sampleMeasure.hashCode();
- }
-
- public String toString()
- {
- return "[x] " + (!sampleMeasure.isEmpty() ? sampleMeasure.toString() : "");
- }
-
- public GWTSampleMeasure getSampleMeasure()
- {
- return sampleMeasure;
- }
-
- public void setSampleMeasure(GWTSampleMeasure sampleMeasure)
- {
- this.sampleMeasure = sampleMeasure;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssaySchedule.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssaySchedule.java
deleted file mode 100644
index c18946ed52a..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTAssaySchedule.java
+++ /dev/null
@@ -1,195 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import java.util.*;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 1:34:20 PM
- */
-public class GWTAssaySchedule implements Schedule, IsSerializable
-{
- List timepoints = new ArrayList();
- List assays = new ArrayList();
- Map> assaySchedule = new HashMap> ();
- private String description;
-
- public GWTAssaySchedule()
- {
-
- }
-
- public void setAssayPerformed(GWTAssayDefinition ad, GWTTimepoint tp, boolean perform)
- {
- Map tpatMap = assaySchedule.get(ad);
- if (null == tpatMap)
- {
- tpatMap = new HashMap();
- assaySchedule.put(ad, tpatMap);
- }
- if (perform)
- tpatMap.put(tp, new GWTAssayNote(ad));
- else
- tpatMap.remove(tp);
- }
-
- public void setAssayPerformed(GWTAssayDefinition ad, GWTTimepoint tp, GWTAssayNote gwtAssayNote)
- {
- if (!timepoints.contains(tp))
- {
- timepoints.add(tp);
- Collections.sort(timepoints, new GWTTimepoint.TimepointComparator());
- }
-
- Map tpatMap = assaySchedule.get(ad);
- if (null == tpatMap)
- {
- tpatMap = new HashMap();
- assaySchedule.put(ad, tpatMap);
- }
- tpatMap.put(tp, gwtAssayNote);
- }
-
-
- public boolean isAssayPerformed(GWTAssayDefinition ad, GWTTimepoint tp)
- {
- return null != getAssayPerformed(ad, tp);
- }
-
- public GWTAssayNote getAssayPerformed(GWTAssayDefinition ad, GWTTimepoint tp)
- {
- Map tpatMap = assaySchedule.get(ad);
- if (null == tpatMap)
- return null;
-
- return tpatMap.get(tp);
- }
-
- public void addAssay(GWTAssayDefinition ad)
- {
- assays.add(ad);
- }
-
- public void removeAssay(GWTAssayDefinition ad)
- {
- assays.remove(ad);
- assaySchedule.remove(ad);
- }
-
- public List getAssays()
- {
- return assays;
- }
-
- public GWTAssayDefinition getAssay(int i)
- {
- return assays.get(i);
- }
-
- public GWTAssayDefinition findAssayByName(String name)
- {
- for (GWTAssayDefinition assayDefinition : assays)
- {
- if (assayDefinition.getAssayName().equalsIgnoreCase(name))
- return assayDefinition;
- }
- return null;
- }
-
- @Override
- public void addTimepoint(GWTTimepoint tp)
- {
- timepoints.add(tp);
- }
-
- @Override
- public void addTimepoint(int index, GWTTimepoint tp)
- {
- timepoints.add(index, tp);
- }
-
- @Override
- public void removeTimepoint(int index)
- {
- GWTTimepoint tp = timepoints.get(index);
- removeTimepoint(tp);
- }
-
- @Override
- public void removeTimepoint(GWTTimepoint tp)
- {
- for (GWTAssayDefinition assayDef : assaySchedule.keySet())
- {
- Map tpatMap = assaySchedule.get(assayDef);
- if (null != tpatMap)
- tpatMap.remove(tp);
- }
- timepoints.remove(tp);
- }
-
- @Override
- public List getTimepoints()
- {
- return timepoints;
- }
-
- @Override
- public GWTTimepoint getTimepoint(int i)
- {
- return timepoints.get(i);
- }
-
-// public Element toElement(Document doc)
-// {
-// Element el = doc.createElement(XMLUtils.tagName(this));
-// Element elAssayTimes = doc.createElement(new GWTAssayTime().pluralTagName());
-// for (Iterator iterator = schedule.iterator(); iterator.hasNext();)
-// {
-// GWTAssayTime assayTime = (GWTAssayTime) iterator.next();
-// elAssayTimes.appendChild(assayTime.toElement(doc));
-// }
-// el.appendChild(elAssayTimes);
-//
-// return el;
-// }
-//
-// public GWTAssaySchedule(Element el, List/* */ assays)
-// {
-// GWTAssayTime at = new GWTAssayTime();
-// Element elAssayTimes = XMLUtils.getChildElement(el, at.pluralTagName());
-// NodeList nl = elAssayTimes.getElementsByTagName(at.tagName());
-// for (int i = 0; i < nl.getLength(); i++)
-// {
-// Element elAssayTime = (Element) nl.item(i);
-// schedule.add(new GWTAssayTime(elAssayTime, assays));
-// }
-// }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTCohort.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTCohort.java
deleted file mode 100644
index 353e477e873..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTCohort.java
+++ /dev/null
@@ -1,79 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-public class GWTCohort implements IsSerializable
-{
- private Integer cohortId;
- private String name;
- private String description;
- private int count;
-
- public GWTCohort()
- {
- }
-
- public GWTCohort(String name, String description, int count, Integer cohortId)
- {
- this.cohortId = cohortId;
- this.name = name;
- this.description = description;
- this.count = count;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public int getCount()
- {
- return count;
- }
-
- public void setCount(int count)
- {
- this.count = count;
- }
-
- public Integer getCohortId()
- {
- return cohortId;
- }
-
- public void setCohortId(Integer cohortId)
- {
- this.cohortId = cohortId;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunization.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunization.java
deleted file mode 100644
index 236f35f6590..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunization.java
+++ /dev/null
@@ -1,130 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import java.util.List;import java.util.ArrayList;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 11:45:57 AM
- */
-public class GWTImmunization implements IsSerializable
-{
- private int hashCode = 0;
- public List immunogens = new ArrayList();
- public List adjuvants = new ArrayList();
-
- public GWTImmunization()
- {
-
- }
-
- public boolean equals(Object o)
- {
- if (null == o)
- return false;
-
- GWTImmunization i = (GWTImmunization) o;
- return i.immunogens.equals(immunogens) && i.adjuvants.equals(adjuvants);
- }
-
- public int hashCode()
- {
- if (0 == hashCode)
- hashCode = (toString().hashCode());
-
- return hashCode;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- String sep = "";
- for (GWTImmunogen immunogen : immunogens)
- {
- sb.append(sep);
- sb.append(immunogen.getName());
- sep = "|";
- }
- int i = 0;
- while (i < adjuvants.size())
- {
- sb.append(sep);
- sb.append(adjuvants.get(i).getName());
- sep = "|";
- i++;
- }
-
- return sb.length() > 0 ? sb.toString() : "(none)";
- }
-
-// public Element toElement(Document doc)
-// {
-// Element el = createTag(doc);
-// for (int i = 0; i < immunogens.size(); i++)
-// el.appendChild(((GWTImmunogen) immunogens.get(i)).toRefElement(doc));
-// for (int i = 0; i < adjuvants.size(); i++)
-// el.appendChild(((GWTAdjuvant) adjuvants.get(i)).toRefElement(doc));
-//
-// return el;
-// }
-//
-// public GWTImmunization(Element el, GWTStudyDefinition definition)
-// {
-// NodeList nl = el.getElementsByTagName(new GWTImmunogen().refTagName());
-// for (int i = 0; i < nl.getLength(); i++)
-// {
-// Element immunogenElement = (Element) nl.item(i);
-// immunogens.add(GWTImmunogen.fromRefElement(immunogenElement, definition.immunogens));
-// }
-// nl = el.getElementsByTagName(new GWTAdjuvant().refTagName());
-// for (int i = 0; i < nl.getLength(); i++)
-// {
-// Element adjuvantElement = (Element) nl.item(i);
-// adjuvants.add(GWTAdjuvant.fromRefElement(adjuvantElement, definition.adjuvants));
-// }
-// }
-// public Element toElement(Document doc)
-// {
-// Element el = createTag(doc);
-// for (int i = 0; i < immunogens.size(); i++)
-// el.appendChild(((GWTImmunogen) immunogens.get(i)).toRefElement(doc));
-// for (int i = 0; i < adjuvants.size(); i++)
-// el.appendChild(((GWTAdjuvant) adjuvants.get(i)).toRefElement(doc));
-//
-// return el;
-// }
-//
-// public GWTImmunization(Element el, GWTStudyDefinition definition)
-// {
-// NodeList nl = el.getElementsByTagName(new GWTImmunogen().refTagName());
-// for (int i = 0; i < nl.getLength(); i++)
-// {
-// Element immunogenElement = (Element) nl.item(i);
-// immunogens.add(GWTImmunogen.fromRefElement(immunogenElement, definition.immunogens));
-// }
-// nl = el.getElementsByTagName(new GWTAdjuvant().refTagName());
-// for (int i = 0; i < nl.getLength(); i++)
-// {
-// Element adjuvantElement = (Element) nl.item(i);
-// adjuvants.add(GWTAdjuvant.fromRefElement(adjuvantElement, definition.adjuvants));
-// }
-// }
-}
\ No newline at end of file
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunizationSchedule.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunizationSchedule.java
deleted file mode 100644
index 45ed5031364..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunizationSchedule.java
+++ /dev/null
@@ -1,213 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import java.util.*;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 1:34:20 PM
- */
-public class GWTImmunizationSchedule implements Schedule, IsSerializable
-{
- Map> schedule = new HashMap>();
- List timepoints = new ArrayList();
-
- public GWTImmunizationSchedule()
- {
-
- }
-
- public boolean equals(Object o)
- {
- if (null == o)
- return false;
-
- GWTImmunizationSchedule is = (GWTImmunizationSchedule) o;
- return schedule.equals(is.schedule) && timepoints.equals(is.timepoints);
- }
-
- public void setImmunization(GWTCohort group, GWTTimepoint tp, GWTImmunization i)
- {
- if (!timepoints.contains(tp))
- timepoints.add(tp);
-
- Map tpimMap = schedule.get(group);
- if (null == tpimMap)
- {
- tpimMap = new HashMap();
- schedule.put(group, tpimMap);
- }
- tpimMap.put(tp, i);
- }
-
-
- public void removeImmunization(GWTCohort group, GWTTimepoint tp)
- {
- Map tpimMap = schedule.get(group);
- if (null == tpimMap)
- return;
-
- tpimMap.remove(tp);
-
- }
-
- public GWTImmunization getImmunization(GWTCohort group, GWTTimepoint tp)
- {
- Map tpimMap = schedule.get(group);
- if (null == tpimMap)
- return null;
-
- return tpimMap.get(tp);
- }
-
- public void removeGroup(GWTCohort group)
- {
- schedule.remove(group);
- }
-
- @Override
- public void removeTimepoint(GWTTimepoint tp)
- {
- for (GWTCohort group : schedule.keySet())
- {
- Map tpimMap = schedule.get(group);
- if (null == tpimMap)
- continue;
-
- tpimMap.remove(tp);
- }
- timepoints.remove(tp);
- }
-
- @Override
- public List getTimepoints()
- {
- return timepoints;
- }
-
- @Override
- public GWTTimepoint getTimepoint(int i)
- {
- if (i >= timepoints.size())
- return null;
-
- return timepoints.get(i);
- }
- @Override
- public void addTimepoint(GWTTimepoint tp)
- {
- timepoints.add(tp);
- }
-
- @Override
- public void addTimepoint(int index, GWTTimepoint tp)
- {
- timepoints.add(index, tp);
- }
-
- @Override
- public void removeTimepoint(int index)
- {
- GWTTimepoint tp = timepoints.get(index);
- removeTimepoint(tp);
- }
-
- public void removeImmunogen(GWTImmunogen immunogen)
- {
- for (GWTCohort gwtCohort : schedule.keySet())
- {
- for (GWTTimepoint gwtTimepoint : timepoints)
- {
- GWTImmunization im = getImmunization(gwtCohort, gwtTimepoint);
- if (null != im)
- im.immunogens.remove(immunogen);
- }
- }
- }
-
- public void removeAdjuvant(GWTAdjuvant adjuvant)
- {
- for (GWTCohort gwtCohort : schedule.keySet())
- {
- for (GWTTimepoint gwtTimepoint : timepoints)
- {
- GWTImmunization im = getImmunization(gwtCohort, gwtTimepoint);
- if (null != im)
- im.adjuvants.remove(adjuvant);
- }
- }
- }
-
-// private static final String IMMUNIZATION_EVENT_TAG_NAME = "ImmunizationEvent";
-// public Element toElement(Document doc)
-// {
-// Element el = createTag(doc);
-// for (Iterator iterator = schedule.keySet().iterator(); iterator.hasNext();)
-// {
-// GWTCohort group = (GWTCohort) iterator.next();
-// Map/**/ groupMap = (Map) schedule.get(group);
-// for (Iterator iterator1 = groupMap.keySet().iterator(); iterator1.hasNext();)
-// {
-// GWTTimepoint timepoint = (GWTTimepoint) iterator1.next();
-// Element elImmunizationEvent = doc.createElement(IMMUNIZATION_EVENT_TAG_NAME);
-// elImmunizationEvent.setAttribute("groupName", group.name);
-// elImmunizationEvent.appendChild(timepoint.toElement(doc));
-// GWTImmunization immunization = getImmunization(group, timepoint);
-// elImmunizationEvent.appendChild(immunization.toElement(doc));
-//
-// el.appendChild(elImmunizationEvent);
-// }
-// }
-// return el;
-// }
-//
-// public GWTImmunizationSchedule(Element el, GWTStudyDefinition def)
-// {
-// List/**/ groups = def.groups;
-// Map/**/ groupMap = new HashMap/**/();
-// for (int i = 0; i < groups.size(); i++)
-// {
-// GWTCohort cohort = (GWTCohort) groups.get(i);
-// groupMap.put(cohort.name, cohort);
-// }
-//
-// NodeList nl = el.getElementsByTagName(IMMUNIZATION_EVENT_TAG_NAME);
-// for (int i = 0; i < nl.getLength(); i++)
-// {
-// Element elEvent = (Element) nl.item(i);
-// String groupName = elEvent.getAttribute("groupName");
-// GWTCohort group = (GWTCohort) groupMap.get(groupName);
-// if (null == group)
-// throw new IllegalArgumentException("Group name " + groupName + " not found in group list");
-//
-// Map/**/ tpimMap = (Map) schedule.get(group);
-// if (null == tpimMap)
-// {
-// tpimMap = new HashMap();
-// schedule.put(group, tpimMap);
-// }
-// GWTTimepoint tp = new GWTTimepoint(XMLUtils.getChildElement(elEvent, new GWTTimepoint().tagName()));
-// GWTImmunization im = new GWTImmunization(XMLUtils.getChildElement(elEvent, new GWTImmunization().tagName()), def);
-// tpimMap.put(tp, im);
-// }
-//
-// }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunogen.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunogen.java
deleted file mode 100644
index 3770b7f24e5..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTImmunogen.java
+++ /dev/null
@@ -1,149 +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.model;
-
-import org.labkey.api.gwt.client.util.StringUtils;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 11:27:56 AM
- */
-public class GWTImmunogen extends VaccineComponent implements IsSerializable
-{
- private String type;
- private String admin;
- private List antigens = new ArrayList();
-
- public GWTImmunogen()
- {
-
- }
- public GWTImmunogen(String name, String dose, String type, String admin)
- {
- this.setName(name);
- this.setDose(dose);
- this.type = type;
- this.admin = admin;
- }
-
- public boolean equals(Object o)
- {
- GWTImmunogen i = (GWTImmunogen) o;
- return super.equals(o) && StringUtils.equals(type, i.type) && StringUtils.equals(admin, i.admin);
- }
-
- public int hashCode()
- {
- return (getName() + getDose() + type + admin + antigenString()).hashCode();
- }
-
- private String antigenString()
- {
- String sep = "";
- StringBuffer sb = new StringBuffer();
- for (GWTAntigen antigen : antigens)
- {
- sb.append(sep);
- sb.append(antigen.toString());
- sep = ",";
- }
- return sb.toString();
- }
-
-// public Element toElement(Document doc)
-// {
-// Element el = createTag(doc, "name", name, "dose", dose, "type", type, "admin", admin);
-// Element elAntigens = doc.createElement(new GWTAntigen().pluralTagName());
-// for (int i = 0; i < antigens.size(); i++)
-// {
-// Element elAntigen = ((GWTAntigen) antigens.get(i)).toElement(doc);
-// elAntigens.appendChild(elAntigen);
-// }
-// el.appendChild(elAntigens);
-//
-// return el;
-// }
-//
-// public Element toRefElement(Document doc)
-// {
-// return createRefTag(doc, name);
-// }
-//
-// public static GWTImmunogen fromRefElement(Element ref, List immunogens)
-// {
-// String name = ref.getAttribute("name");
-// for (int i = 0; i < immunogens.size(); i++)
-// {
-// GWTImmunogen immunogen = (GWTImmunogen) immunogens.get(i);
-// if (immunogen.name.equals(name))
-// return immunogen;
-// }
-//
-// return null;
-// }
-//
-// public GWTImmunogen(Element el)
-// {
-// name = el.getAttribute("name");
-// dose = el.getAttribute("dose");
-// type = el.getAttribute("type");
-// admin = el.getAttribute("admin");
-// Element elAntigens = XMLUtils.getChildElement(el, new GWTAntigen().pluralTagName());
-// NodeList nl = elAntigens.getElementsByTagName(new GWTAntigen().tagName());
-// for (int i = 0; i < nl.getLength(); i++)
-// {
-// Element elAntigen = (Element) nl.item(i);
-// antigens.add(new GWTAntigen(elAntigen));
-// }
-// }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAdmin()
- {
- return admin;
- }
-
- public void setAdmin(String admin)
- {
- this.admin = admin;
- }
-
- public List getAntigens()
- {
- return antigens;
- }
-
- public void setAntigens(List antigens)
- {
- this.antigens = antigens;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTSampleMeasure.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTSampleMeasure.java
deleted file mode 100644
index 0064ae60cde..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTSampleMeasure.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.designer.client.model;
-
-import com.google.gwt.xml.client.Element;
-import com.google.gwt.xml.client.Document;
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * User: Mark Igra
- * Date: Jan 25, 2007
- * Time: 3:11:41 PM
- */
-public class GWTSampleMeasure extends AbstractXMLSavable implements IsSerializable
-{
- private double amount;
- private String unit;
- private String type;
-
- public GWTSampleMeasure()
- {
-
- }
-
- public GWTSampleMeasure(double amount, String unit, String type)
- {
- this.amount = amount;
- this.unit = unit;
- this.type = type;
- }
-
- public GWTSampleMeasure(GWTSampleMeasure sm)
- {
- this(sm.amount, sm.unit, sm.type);
- }
-
- public String toString()
- {
- return formatAmountString(amount) + " " + unit + " " + type;
- }
-
- public static String formatAmountString(double amount)
- {
- //No number formats in GWT!
- if (amount > 10000)
- {
- int log = (int) (Math.log(amount) / Math.log(10));
- int val = (int) Math.round((amount / Math.pow(10, log - 3)));
- return (val / 1000.0) + "e" + log;
- }
- else
- return Double.toString(amount);
-
-
- }
-
- public boolean isEmpty()
- {
- return amount == 0.0 && unit == null && type == null;
- }
-
- public int hashCode()
- {
- return Double.valueOf(amount).hashCode() ^ (unit.hashCode() << 1) ^ (type.hashCode() << 2);
- }
-
- public boolean equals(Object o)
- {
- GWTSampleMeasure sm = (GWTSampleMeasure) o;
- return null == o ? false : (sm.amount == amount && sm.unit.equals(unit) && sm.type.equals(type));
- }
-
- @Override
- public Element toElement(Document doc)
- {
- return createTag(doc, "amount", Double.valueOf(amount), "unit", unit, "type", type);
- }
-
- public double getAmount()
- {
- return amount;
- }
-
- public void setAmount(double amount)
- {
- this.amount = amount;
- }
-
- public String getUnit()
- {
- return unit;
- }
-
- public void setUnit(String unit)
- {
- this.unit = unit;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDefinition.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDefinition.java
deleted file mode 100644
index 2c81fe7848e..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDefinition.java
+++ /dev/null
@@ -1,405 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.ChangeListenerCollection;
-import com.google.gwt.user.client.ui.SourcesChangeEvents;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * User: Mark Igra
- * Date: Dec 14, 2006
- * Time: 11:47:11 AM
- */
-public class GWTStudyDefinition implements SourcesChangeEvents, IsSerializable
-{
- private transient ChangeListenerCollection listeners = new ChangeListenerCollection();
-
- private String grant;
- private String investigator;
- private String studyName;
- private String animalSpecies;
- private int cavdStudyId;
- private int revision;
- private GWTImmunizationSchedule immunizationSchedule = new GWTImmunizationSchedule();
- private GWTAssaySchedule assaySchedule = new GWTAssaySchedule();
- private List groups = new ArrayList();
- private List groupsToDelete = new ArrayList();
- private List immunogens = new ArrayList();
- private List adjuvants = new ArrayList();
-
- private List assays = new ArrayList();
- private List labs = new ArrayList();
- private List sampleTypes = new ArrayList();
- private List units = new ArrayList();
- private List immunogenTypes = new ArrayList();
- private List genes = new ArrayList();
- private List routes = new ArrayList();
- private List subTypes = new ArrayList();
- private List cohorts = new ArrayList();
-
- private String description;
-
- public GWTStudyDefinition()
- {
- }
-
- @Override
- public void addChangeListener(ChangeListener listener)
- {
- listeners.add(listener);
- }
-
- @Override
- public void removeChangeListener(ChangeListener listener)
- {
- listeners.remove(listener);
- }
-
- public void fireChangeEvents()
- {
- listeners.fireChange(null);
- }
-
- public static GWTStudyDefinition getDefaultTemplate()
- {
- GWTStudyDefinition study = new GWTStudyDefinition();
- return study;
- }
-
- public static GWTStudyDefinition getDefaultTemplateWithValues()
- {
- GWTStudyDefinition study = new GWTStudyDefinition();
-
- List assays = study.getAssays();
- assays.add("ELISPOT");
- assays.add("Neutralizing Antibodies Panel 1");
- assays.add("ICS");
- assays.add("ELISA");
- study.setAssays(assays);
-
- List labs = study.getLabs();
- labs.add("Lab 1");
- labs.add("Lab 2");
- study.setLabs(labs);
-
- List units = study.getUnits();
- units.add("ml");
- units.add("ul");
- units.add("cells");
- study.setUnits(units);
-
- List sampleTypes = study.getSampleTypes();
- sampleTypes.add("Plasma");
- sampleTypes.add("Serum");
- sampleTypes.add("PBMC");
- sampleTypes.add("Vaginal Mucosal");
- sampleTypes.add("Nasal Mucosal");
- study.setSampleTypes(sampleTypes);
-
- study.getGroups().add(new GWTCohort("Vaccine", "First Group", 30, null));
- study.getGroups().add(new GWTCohort("Placebo", "Second Group", 30, null));
-
- study.getAdjuvants().add(new GWTAdjuvant("Adjuvant1", null, null));
- study.getAdjuvants().add(new GWTAdjuvant("Adjuvant2", null, null));
-
- GWTImmunogen immunogen = new GWTImmunogen("Cp1", "1.5e10 Ad vg", "Canarypox", "Intramuscular (IM)");
- immunogen.getAntigens().add(new GWTAntigen("A1", "Gag", "Clade B", null, null));
- study.getImmunogens().add(immunogen);
-
- immunogen = new GWTImmunogen("gp120", "1.6e8 Ad vg", "Subunit Protein", "Intramuscular (IM)");
- immunogen.getAntigens().add(new GWTAntigen("Env", "Env", null, null, null));
- study.getImmunogens().add(immunogen);
-
- GWTTimepoint tp1 = new GWTTimepoint(null, 0, null);
- study.getImmunizationSchedule().addTimepoint(tp1);
- GWTTimepoint tp2 = new GWTTimepoint(null, 28, GWTTimepoint.DAYS);
- study.getImmunizationSchedule().addTimepoint(tp2);
-
- GWTImmunization immunization1 = new GWTImmunization();
- immunization1.adjuvants.add(study.getAdjuvants().get(0));
- immunization1.immunogens.add(study.getImmunogens().get(0));
- study.getImmunizationSchedule().setImmunization(study.getGroups().get(0), tp1, immunization1);
-
- GWTImmunization immunization2 = new GWTImmunization();
- immunization2.adjuvants.add(study.getAdjuvants().get(0));
- immunization2.immunogens.add(study.getImmunogens().get(1));
- study.getImmunizationSchedule().setImmunization(study.getGroups().get(0), tp2, immunization2);
-
- GWTImmunization immunization3 = new GWTImmunization();
- immunization3.adjuvants.add(study.getAdjuvants().get(0));
- study.getImmunizationSchedule().setImmunization(study.getGroups().get(1), tp1, immunization3);
-
- GWTImmunization immunization4 = new GWTImmunization();
- immunization4.adjuvants.add(study.getAdjuvants().get(0));
- study.getImmunizationSchedule().setImmunization(study.getGroups().get(1), tp2, immunization4);
-
- for (int i = 0; i < study.getAssays().size(); i++)
- {
- GWTSampleMeasure measure = new GWTSampleMeasure(2, study.getUnits().get(0), study.getSampleTypes().get(0));
- GWTAssayDefinition assayDef = new GWTAssayDefinition(study.getAssays().get(i), "Lab 1");
- study.getAssaySchedule().addAssay(assayDef);
- }
-
- return study;
- }
-
- public boolean equals(GWTStudyDefinition d)
- {
- return isEqual(grant, d.grant) &&
- isEqual(investigator, d.investigator) &&
- isEqual(animalSpecies, animalSpecies) &&
- isEqual(assays, d.assays) &&
- isEqual(assaySchedule, d.assaySchedule) &&
- isEqual(immunizationSchedule, d.immunizationSchedule);
- }
-
- private boolean isEqual(Object o1, Object o2)
- {
- return o1 == o2 || (null != o1 && o1.equals(o2));
- }
-
-
- public GWTImmunizationSchedule getImmunizationSchedule()
- {
- return immunizationSchedule;
- }
-
- public void setImmunizationSchedule(GWTImmunizationSchedule immunizationSchedule)
- {
- this.immunizationSchedule = immunizationSchedule;
- }
-
- public GWTAssaySchedule getAssaySchedule()
- {
- return assaySchedule;
- }
-
- public void setAssaySchedule(GWTAssaySchedule assaySchedule)
- {
- this.assaySchedule = assaySchedule;
- }
-
- public List getGroups()
- {
- return groups;
- }
-
- public void setGroups(List groups)
- {
- this.groups = groups;
- }
-
- public List getAssays()
- {
- return assays;
- }
-
- public void setAssays(List assays)
- {
- this.assays = assays;
- }
-
- public List getImmunogens()
- {
- return immunogens;
- }
-
- public void setImmunogens(List immunogens)
- {
- this.immunogens = immunogens;
- }
-
- public List getAdjuvants()
- {
- return adjuvants;
- }
-
- public void setAdjuvants(List adjuvants)
- {
- this.adjuvants = adjuvants;
- }
-
- public String getGrant()
- {
- return grant;
- }
-
- public void setGrant(String grant)
- {
- this.grant = grant;
- }
-
- public String getInvestigator()
- {
- return investigator;
- }
-
- public void setInvestigator(String investigator)
- {
- this.investigator = investigator;
- }
-
- public String getStudyName()
- {
- return studyName;
- }
-
- public void setStudyName(String studyName)
- {
- this.studyName = studyName;
- }
-
- public String getAnimalSpecies()
- {
- return animalSpecies;
- }
-
- public void setAnimalSpecies(String animalSpecies)
- {
- this.animalSpecies = animalSpecies;
- }
-
- public int getCavdStudyId()
- {
- return cavdStudyId;
- }
-
- public void setCavdStudyId(int cavdStudyId)
- {
- this.cavdStudyId = cavdStudyId;
- }
-
- public int getRevision()
- {
- return revision;
- }
-
- public void setRevision(int revision)
- {
- this.revision = revision;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public List getSampleTypes()
- {
- return sampleTypes;
- }
-
- public void setSampleTypes(List sampleTypes)
- {
- this.sampleTypes = sampleTypes;
- }
-
- public List getImmunogenTypes()
- {
- return immunogenTypes;
- }
-
- public void setImmunogenTypes(List immunogenTypes)
- {
- this.immunogenTypes = immunogenTypes;
- }
-
- public List getGenes()
- {
- return genes;
- }
-
- public void setGenes(List genes)
- {
- this.genes = genes;
- }
-
- public List getRoutes()
- {
- return routes;
- }
-
- public void setRoutes(List routes)
- {
- this.routes = routes;
- }
-
- public List getSubTypes()
- {
- return subTypes;
- }
-
- public void setSubTypes(List subTypes)
- {
- this.subTypes = subTypes;
- }
-
- public List getLabs()
- {
- return labs;
- }
-
- public void setLabs(List labs)
- {
- this.labs = labs;
- }
-
- public List getUnits()
- {
- return units;
- }
-
- public void setUnits(List units)
- {
- this.units = units;
- }
-
- public List getGroupsToDelete()
- {
- return groupsToDelete;
- }
-
- public void clearGroupsToDelete()
- {
- this.groupsToDelete = new ArrayList();
- }
-
- public void addGroupToDelete(String groupName)
- {
- this.groupsToDelete.add(groupName);
- }
-
- public List getCohorts()
- {
- return cohorts;
- }
-
- public void setCohorts(List cohorts)
- {
- this.cohorts = cohorts;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDesignVersion.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDesignVersion.java
deleted file mode 100644
index 6c437c1f430..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTStudyDesignVersion.java
+++ /dev/null
@@ -1,129 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import java.util.Date;
-
-/**
- * User: Mark Igra
- * Date: Feb 15, 2007
- * Time: 9:17:41 PM
- */
-public class GWTStudyDesignVersion implements IsSerializable
-{
- private int studyId;
- private Date created;
- private int revision;
- private boolean draft;
- private String label;
- private String description;
- private String writerName;
- private boolean saveSuccessful;
- private String errorMessage;
-
- public int getStudyId()
- {
- return studyId;
- }
-
- public void setStudyId(int studyId)
- {
- this.studyId = studyId;
- }
-
- public Date getCreated()
- {
- return created;
- }
-
- public void setCreated(Date created)
- {
- this.created = created;
- }
-
- public int getRevision()
- {
- return revision;
- }
-
- public void setRevision(int revision)
- {
- this.revision = revision;
- }
-
- public boolean isDraft()
- {
- return draft;
- }
-
- public void setDraft(boolean draft)
- {
- this.draft = draft;
- }
-
- public String getLabel()
- {
- return label;
- }
-
- public void setLabel(String label)
- {
- this.label = label;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public void setWriterName(String writerName)
- {
- this.writerName = writerName;
- }
-
- public String getWriterName()
- {
- return writerName;
- }
-
- public boolean isSaveSuccessful()
- {
- return saveSuccessful;
- }
-
- public void setSaveSuccessful(boolean saveSuccessful)
- {
- this.saveSuccessful = saveSuccessful;
- }
-
- public String getErrorMessage()
- {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage)
- {
- this.errorMessage = errorMessage;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTTimepoint.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTTimepoint.java
deleted file mode 100644
index 4308231c34e..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/GWTTimepoint.java
+++ /dev/null
@@ -1,189 +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.model;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import java.util.Comparator;
-
-/**
- * User: Mark Igra
- * Date: Dec 4, 2006
- * Time: 9:58:11 PM
- */
-public class GWTTimepoint implements Comparable, IsSerializable
-{
- public static final Unit DAYS = new Unit("days", 1);
- public static final Unit WEEKS = new Unit("weeks", 7);
- public static final Unit MONTHS = new Unit("months", 30);
- public static final Unit[] UNIT_CHOICES = {DAYS, WEEKS};
-
- private String name;
- private Unit unit = DAYS;
- private int days;
-
- public GWTTimepoint()
- {
-
- }
-
- public GWTTimepoint(String name, int numUnits, Unit displayUnit)
- {
- this.name = name;
- this.unit = displayUnit == null ? DAYS : displayUnit;
- this.days = numUnits * unit.daysPerUnit;
- }
-
- public String toString()
- {
- return (name != null ? name + ": " : "") + unit.daysAsUnit(days) + " " + unit.name;
- }
-
- @Override
- public int compareTo(Object o)
- {
- GWTTimepoint p = (GWTTimepoint) o;
- if (null == p)
- return -1;
-
- if (days - p.days == 0)
- {
- if (null == name)
- return null == p.name ? 0 : -1;
- return p.name == null ? 1 : name.compareTo(p.name);
- }
-
- return days - p.days;
- }
-
- public boolean equals(Object o)
- {
- if (this == o) return true;
-
- GWTTimepoint that = (GWTTimepoint) o;
-
- if (days != that.days) return false;
- if (name != null ? !name.equals(that.name) : that.name != null) return false;
- if (!unit.equals(that.unit)) return false;
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = (name != null ? name.hashCode() : 0);
- result = 31 * result + unit.hashCode();
- result = 31 * result + days;
- return result;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public Unit getUnit()
- {
- return unit;
- }
-
- public void setUnit(Unit unit)
- {
- this.unit = unit;
- }
-
- public int getDays()
- {
- return days;
- }
-
- public void setDays(int days)
- {
- this.days = days;
- }
-
-// public Element toElement(Document doc)
-// {
-// return createTag(doc, "name", name, "days", new Integer(days), "displayUnit", unit);
-// }
-//
-// public GWTTimepoint(Element el)
-// {
-// this(el.getAttribute("name"), Integer.parseInt(el.getAttribute("days")), Unit.fromString(el.getAttribute("displayUnit")));
-// }
-//
- public static class Unit implements IsSerializable
- {
- public Unit()
- {
-
- }
- public static Unit fromString(String unit)
- {
- for (int i = 0; i < UNIT_CHOICES.length; i++)
- if (UNIT_CHOICES[i].name.equalsIgnoreCase(unit))
- return UNIT_CHOICES[i];
-
- return DAYS;
- }
-
- private Unit(String name, int daysPerUnit)
- {
- this.name = name;
- this.daysPerUnit = daysPerUnit;
- }
-
- public int daysAsUnit(double days)
- {
- return (int) days/daysPerUnit;
- }
-
- public double unitsAsDays(double units)
- {
- return units * daysPerUnit;
- }
-
- public String toString() {
- return name;
- }
-
- @Override
- public boolean equals(Object that)
- {
- return that != null && that instanceof Unit && this.name.equals(((Unit) that).name);
- }
-
- public String name;
- public int daysPerUnit;
- }
-
- //Need this since bad bug in google's sorting...
- public static class TimepointComparator implements Comparator
- {
- @Override
- public int compare(GWTTimepoint o1, GWTTimepoint o2)
- {
- return o1.compareTo(o2);
- }
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/Schedule.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/Schedule.java
deleted file mode 100644
index 0df380ac413..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/Schedule.java
+++ /dev/null
@@ -1,40 +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.model;
-
-import java.util.List;
-
-/**
- * User: Mark Igra
- * Date: Dec 20, 2006
- * Time: 4:26:30 PM
- */
-public interface Schedule /*extends XMLSavable*/
-{
- void removeTimepoint(GWTTimepoint tp);
-
- List getTimepoints();
-
- GWTTimepoint getTimepoint(int i);
-
- void addTimepoint(GWTTimepoint tp);
-
- void addTimepoint(int index, GWTTimepoint tp);
-
- void removeTimepoint(int index);
-
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/VaccineComponent.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/VaccineComponent.java
deleted file mode 100644
index 1069dc1cbf6..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/VaccineComponent.java
+++ /dev/null
@@ -1,65 +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.model;
-
-import org.labkey.api.gwt.client.util.StringUtils;
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-/**
- * User: Mark Igra
- * Date: Dec 17, 2006
- * Time: 11:20:36 PM
- */
-public abstract class VaccineComponent implements IsSerializable
-{
- private String name;
- private String dose;
-
- public String toString()
- {
- return StringUtils.trimToEmpty(name) + "(" + StringUtils.trimToEmpty(dose) + ")";
- }
-
- public boolean equals(Object o)
- {
- if (null == o)
- return false;
-
- VaccineComponent vc = (VaccineComponent) o;
- return StringUtils.equals(name, vc.name) && StringUtils.equals(dose, vc.dose);
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getDose()
- {
- return dose;
- }
-
- public void setDose(String dose)
- {
- this.dose = dose;
- }
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLSavable.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLSavable.java
deleted file mode 100644
index 4024a2ac419..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLSavable.java
+++ /dev/null
@@ -1,32 +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.model;
-
-import com.google.gwt.xml.client.Element;
-import com.google.gwt.xml.client.Document;
-
-/**
- * User: Mark Igra
- * Date: Jan 30, 2007
- * Time: 12:15:51 AM
- */
-public interface XMLSavable
-{
- public Element toElement(Document doc);
- public String tagName();
- public String pluralTagName();
-}
diff --git a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLUtils.java b/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLUtils.java
deleted file mode 100644
index be2931fa72a..00000000000
--- a/study/gwtsrc/gwt/client/org/labkey/study/designer/client/model/XMLUtils.java
+++ /dev/null
@@ -1,111 +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.model;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.xml.client.*;
-
-/**
- * User: Mark Igra
- * Date: Jan 31, 2007
- * Time: 2:28:51 PM
- */
-public class XMLUtils
-{
- public interface ClassNameService
- {
- public String getClassName(Object obj);
- }
-
- private static class GWTClassNameService implements ClassNameService
- {
- @Override
- public String getClassName(Object obj)
- {
- return GWT.getTypeName(obj);
- }
- }
-
- private static ClassNameService service = new GWTClassNameService();
- public static String tagName(Object obj)
- {
- String typeName = GWT.getTypeName(obj);
- int index = typeName.lastIndexOf('.');
- if (index >= 0)
- typeName = typeName.substring(index + 1);
-
- return typeName;
- }
-
- public static String pluralTagName(Object obj)
- {
- String tagName = tagName(obj);
- //UNDONE: Custom pluralizing...
- return tagName + "s";
- }
-
- public static void setClassNameService(ClassNameService s)
- {
- service = s;
- }
-
- public static Element safeSetAttrs(Element el, String[] attrNames, Object[] attrVals)
- {
- assert attrNames.length == attrVals.length;
- for (int i = 0; i < attrNames.length; i++)
- safeSetAttr(el, attrNames[i], attrVals[i]);
-
- return el;
- }
-
- public static Element safeSetAttr(Element el, String attrName, Object attrVal)
- {
- if (null != attrVal)
- el.setAttribute(attrName, attrVal.toString());
- return el;
- }
-
- public static void addTextTag(Element el, String tagName, String text)
- {
- if (null != text)
- {
- Element elChild = el.getOwnerDocument().createElement(tagName);
- elChild.appendChild(el.getOwnerDocument().createTextNode(text));
- }
- }
-
- public static String getTextTag(Element el, String tagName)
- {
- Element elText = getChildElement(el, tagName);
- if (null == elText)
- return null;
-
- return elText.getNodeValue();
- }
-
- public static Element getChildElement(Element parent, String childName)
- {
- NodeList nl = parent.getElementsByTagName(childName);
- if (null == nl || nl.getLength() == 0)
- return null;
-
- if (nl.getLength() > 1)
- throw new IllegalArgumentException("Expected only one child element with tag " + childName);
-
- return (Element) nl.item(0);
- }
-}
diff --git a/study/src/org/labkey/study/StudyModule.java b/study/src/org/labkey/study/StudyModule.java
index ba53fff66f0..f2592c3cd18 100644
--- a/study/src/org/labkey/study/StudyModule.java
+++ b/study/src/org/labkey/study/StudyModule.java
@@ -68,7 +68,6 @@
import org.labkey.api.services.ServiceRegistry;
import org.labkey.api.settings.AdminConsole;
import org.labkey.api.settings.AdminConsole.OptionalFeatureFlag;
-import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.settings.OptionalFeatureService.FeatureType;
import org.labkey.api.specimen.SpecimenSampleTypeDomainKind;
import org.labkey.api.specimen.model.AdditiveTypeDomainKind;
@@ -126,7 +125,6 @@
import org.labkey.study.controllers.StudyDefinitionController;
import org.labkey.study.controllers.StudyDesignController;
import org.labkey.study.controllers.StudyPropertiesController;
-import org.labkey.study.controllers.designer.DesignerController;
import org.labkey.study.controllers.publish.PublishController;
import org.labkey.study.controllers.reports.ReportsController;
import org.labkey.study.controllers.security.SecurityController;
@@ -134,7 +132,6 @@
import org.labkey.study.dataset.DatasetNotificationInfoProvider;
import org.labkey.study.dataset.DatasetSnapshotProvider;
import org.labkey.study.dataset.DatasetViewProvider;
-import org.labkey.study.designer.view.StudyDesignsWebPart;
import org.labkey.study.importer.StudyImporterFactory;
import org.labkey.study.model.CohortDomainKind;
import org.labkey.study.model.ContinuousDatasetDomainKind;
@@ -176,7 +173,6 @@
import org.labkey.study.reports.StudyReportUIProvider;
import org.labkey.study.view.DatasetsWebPartView;
import org.labkey.study.view.StudyListWebPartFactory;
-import org.labkey.study.view.StudySummaryWebPartFactory;
import org.labkey.study.view.StudyToolsWebPartFactory;
import org.labkey.study.view.SubjectDetailsWebPartFactory;
import org.labkey.study.view.SubjectsWebPart;
@@ -210,9 +206,8 @@ public class StudyModule extends SpringModule implements SearchService.DocumentP
public static final WebPartFactory dataToolsWebPartFactory = new StudyToolsWebPartFactory();
public static final WebPartFactory datasetsPartFactory = new DatasetsWebPartFactory();
public static final WebPartFactory immunizationScheduleWebpartFactory = new ImmunizationScheduleWebpartFactory();
- public static final WebPartFactory manageStudyPartFactory = new StudySummaryWebPartFactory();
- public static final WebPartFactory studyDesignSummaryWebPartFactory = new StudyDesignSummaryWebPartFactory();
- public static final WebPartFactory studyDesignsWebPartFactory = new StudyDesignsWebPartFactory();
+ public static final WebPartFactory manageStudyPartFactory = new org.labkey.study.view.StudySummaryWebPartFactory();
+ public static final WebPartFactory studyDesignSummaryWebPartFactory = new StudySummaryWebPartFactory();
public static final WebPartFactory studyListWebPartFactory = new StudyListWebPartFactory();
public static final WebPartFactory studyScheduleWebPartFactory = new StudyScheduleWebPartFactory();
public static final WebPartFactory subjectDetailsWebPartFactory = new SubjectDetailsWebPartFactory();
@@ -241,7 +236,6 @@ protected void init()
addController("publish", PublishController.class);
addController("study-definition", StudyDefinitionController.class);
addController("study-design", StudyDesignController.class);
- addController("study-designer", DesignerController.class);
addController("study-properties", StudyPropertiesController.class);
addController("study-reports", ReportsController.class);
addController("study-security", SecurityController.class);
@@ -311,7 +305,6 @@ protected Collection createWebPartFactories()
manageStudyPartFactory,
reportsPartFactory,
studyDesignSummaryWebPartFactory,
- studyDesignsWebPartFactory,
studyListWebPartFactory,
studyScheduleWebPartFactory,
subjectDetailsWebPartFactory,
@@ -418,14 +411,6 @@ protected void startupAfterSpringConfig(ModuleContext moduleContext)
"Merging of dataset that uses server-managed third key (such as GUID or auto RowId) is not officially supported. Unexpected outcome might be experienced when merge is performed.",
false);
- AdminConsole.addOptionalFeatureFlag(new OptionalFeatureFlag(Study.GWT_STUDY_DESIGN,
- "Restore vaccine study protocol editor",
- "The study protocol editor (accessed from the Vaccine Study Protocols webpart) has been deprecated and protocol " +
- "information will be shown in read-only mode. The edit button can be shown by enabling this feature, " +
- "but this option and all support for this study protocol editor will be removed in LabKey Server v24.12. " +
- "Please create any new study protocols in the format as defined by the \"Manage Study Products\" link on the study Manage tab.",
- false, false, FeatureType.Deprecated));
-
ReportAndDatasetChangeDigestProvider.get().addNotificationInfoProvider(new DatasetNotificationInfoProvider());
AdminLinkManager.getInstance().addListener((adminNavTree, container, user) -> {
@@ -687,36 +672,9 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta
}
}
- private static class StudyDesignsWebPartFactory extends BaseWebPartFactory
- {
- public StudyDesignsWebPartFactory()
- {
- super("Vaccine Study Protocols");
- addLegacyNames("Study Designs");
- }
-
- @Override
- public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart)
- {
- if (OptionalFeatureService.get().isFeatureEnabled(Study.GWT_STUDY_DESIGN))
- return new StudyDesignsWebPart(portalCtx, true);
- else
- return null;
- }
-
- @Override
- public boolean isAvailable(Container c, String scope, String location)
- {
- if (OptionalFeatureService.get().isFeatureEnabled(Study.GWT_STUDY_DESIGN))
- return super.isAvailable(c, scope, location);
- else
- return false;
- }
- }
-
- private static class StudyDesignSummaryWebPartFactory extends BaseWebPartFactory
+ private static class StudySummaryWebPartFactory extends BaseWebPartFactory
{
- public StudyDesignSummaryWebPartFactory()
+ public StudySummaryWebPartFactory()
{
super("Study Protocol Summary");
}
@@ -724,7 +682,7 @@ public StudyDesignSummaryWebPartFactory()
@Override
public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart)
{
- JspView view = new JspView("/org/labkey/study/designer/view/studyDesignSummary.jsp");
+ JspView view = new JspView("/org/labkey/study/designer/view/studySummary.jsp");
view.setTitle("Study Protocol Summary");
view.setFrame(WebPartView.FrameType.PORTAL);
return view;
diff --git a/study/src/org/labkey/study/controllers/designer/DesignerController.java b/study/src/org/labkey/study/controllers/designer/DesignerController.java
deleted file mode 100644
index 66e94635bb0..00000000000
--- a/study/src/org/labkey/study/controllers/designer/DesignerController.java
+++ /dev/null
@@ -1,1167 +0,0 @@
-/*
- * Copyright (c) 2008-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 org.labkey.study.controllers.designer;
-
-import gwt.client.org.labkey.study.designer.client.model.GWTCohort;
-import gwt.client.org.labkey.study.designer.client.model.GWTStudyDefinition;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.servlet.http.HttpSession;
-import org.apache.commons.lang3.StringUtils;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.labkey.api.action.ApiJsonWriter;
-import org.labkey.api.action.ApiResponse;
-import org.labkey.api.action.ApiSimpleResponse;
-import org.labkey.api.action.ExportAction;
-import org.labkey.api.action.FormHandlerAction;
-import org.labkey.api.action.FormViewAction;
-import org.labkey.api.action.GWTServiceAction;
-import org.labkey.api.action.ReadOnlyApiAction;
-import org.labkey.api.action.SimpleRedirectAction;
-import org.labkey.api.action.SimpleViewAction;
-import org.labkey.api.action.SpringActionController;
-import org.labkey.api.announcements.DiscussionService;
-import org.labkey.api.collections.CaseInsensitiveHashMap;
-import org.labkey.api.data.Container;
-import org.labkey.api.data.ContainerManager;
-import org.labkey.api.data.DataRegionSelection;
-import org.labkey.api.gwt.server.BaseRemoteService;
-import org.labkey.api.portal.ProjectUrls;
-import org.labkey.api.reader.ColumnDescriptor;
-import org.labkey.api.reader.TabLoader;
-import org.labkey.api.security.RequiresPermission;
-import org.labkey.api.security.User;
-import org.labkey.api.security.permissions.AdminPermission;
-import org.labkey.api.security.permissions.DeletePermission;
-import org.labkey.api.security.permissions.ReadPermission;
-import org.labkey.api.security.permissions.UpdatePermission;
-import org.labkey.api.settings.OptionalFeatureService;
-import org.labkey.api.specimen.SpecimenMigrationService;
-import org.labkey.api.study.MapArrayExcelWriter;
-import org.labkey.api.study.Study;
-import org.labkey.api.study.StudyService;
-import org.labkey.api.study.TimepointType;
-import org.labkey.api.util.PageFlowUtil;
-import org.labkey.api.util.URLHelper;
-import org.labkey.api.view.ActionURL;
-import org.labkey.api.view.HtmlView;
-import org.labkey.api.view.HttpView;
-import org.labkey.api.view.JspView;
-import org.labkey.api.view.NavTree;
-import org.labkey.api.view.NotFoundException;
-import org.labkey.api.view.RedirectException;
-import org.labkey.api.view.VBox;
-import org.labkey.api.view.template.ClientDependency;
-import org.labkey.study.controllers.BaseStudyController;
-import org.labkey.study.designer.JSONSerializer;
-import org.labkey.study.designer.StudyDefinitionServiceImpl;
-import org.labkey.study.designer.StudyDesignInfo;
-import org.labkey.study.designer.StudyDesignManager;
-import org.labkey.study.designer.StudyDesignVersion;
-import org.labkey.study.designer.XMLSerializer;
-import org.labkey.study.designer.view.StudyDesignsWebPart;
-import org.labkey.study.view.StudyGWTView;
-import org.labkey.study.view.VaccineStudyWebPart;
-import org.springframework.validation.BindException;
-import org.springframework.validation.Errors;
-import org.springframework.web.servlet.ModelAndView;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.labkey.api.study.publish.StudyPublishService.SOURCE_LSID_PROPERTY_NAME;
-
-public class DesignerController extends SpringActionController
-{
- public enum WizardStep
- {
- INIT(0, null),
- PICK_FOLDER(1, "Choose Destination Folder"),
- SHOW_PARTICIPANTS(2, "Subject Information"),
- UPLOAD_PARTICIPANTS(3, "Upload Subject Information"),
- SHOW_SAMPLES(4, "Sample Information"),
- UPLOAD_SAMPLES(5, "Upload Sample Information"),
- CONFIRM(6, "Confirm");
-
- WizardStep(int number, String title)
- {
- _number = number;
- _title = title;
- }
-
- public String getTitle()
- {
- return _title;
- }
-
- public int getNumber()
- {
- return _number;
- }
-
- private final String _title;
- private final int _number;
-
- public static WizardStep fromNumber(int number)
- {
- for (WizardStep step : values())
- if (step._number == number)
- return step;
-
- return null;
- }
- }
-
- private static final String TEMPLATE_NAME = "Template";
- private static final ColumnDescriptor[] PARTICIPANT_COLS = new ColumnDescriptor[]{
- new ColumnDescriptor("ParticipantId", String.class),
- new ColumnDescriptor("Cohort", String.class),
- new ColumnDescriptor("StartDate", Date.class)
- };
-
- private static final String PARTICIPANT_KEY = DesignerController.class + ".participants";
- private static final String SPECIMEN_KEY = DesignerController.class + ".specimens";
-
- private static final DefaultActionResolver ACTION_RESOLVER = new DefaultActionResolver(DesignerController.class);
-
- public DesignerController()
- {
- setActionResolver(ACTION_RESOLVER);
- }
-
- @RequiresPermission(ReadPermission.class)
- public static class BeginAction extends SimpleViewAction
<%
- 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 extends EntryPoint> 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);
-%>