"));
- return panel;
- }
-
- @Override
- public String validate()
- {
- return "";
- }
-
- @Override
- public void setName(String s)
- {
- enzymeListBox.setName(s);
- }
-
- @Override
- public String getName()
- {
- return enzymeListBox.getName();
- }
-
- public String getSelectedEnzyme()
- {
- int index = enzymeListBox.getSelectedIndex();
- if(index == -1) return "";
- return enzymeListBox.getValue(index);
- }
-
- public String setSelectedEnzymeByName(String enzyme)
- {
-
- int enzCount = enzymeListBox.getItemCount();
- boolean foundEnz = false;
- for(int i = 0; i < enzCount; i++)
- {
- if(enzyme.equals(enzymeListBox.getItemText(i)))
- {
- enzymeListBox.setSelectedIndex(i);
- foundEnz = true;
- }
- }
- if(!foundEnz)
- return "The enzyme '" + enzyme + "' was not found.";
- return "";
- }
-
- public String setSelectedEnzyme(String enzymeSignature)
- {
- try
- {
- new Enzyme(enzymeSignature);
- }
- catch(EnzymeParseException e)
- {
- return e.getMessage();
- }
- return findEnzyme(enzymeSignature);
- }
-
- private String findEnzyme(String enzymeSignature)
- {
- int enzCount = enzymeListBox.getItemCount();
- boolean foundEnz = false;
-
- String canonicalSignature = null;
-
- for (Map.Entry> entry : enzymes.entrySet())
- {
- if (entry.getValue().contains(enzymeSignature))
- {
- canonicalSignature = entry.getValue().get(0);
- break;
- }
- }
- if(canonicalSignature == null)
- return "The enzyme '" + enzymeSignature + "' was not found.";
-
- for(int i = 0; i < enzCount; i++)
- {
- try
- {
- String listBoxValue = enzymeListBox.getValue(i);
- // Create to see if it parses
- new Enzyme(listBoxValue);
- if(canonicalSignature.equals(listBoxValue))
- {
- enzymeListBox.setSelectedIndex(i);
- foundEnz = true;
- }
- }
- catch(EnzymeParseException e)
- {
- return e.getMessage();
- }
- }
- if(!foundEnz)
- return "The enzyme '" + enzymeSignature + "' was not found.";
- return "";
- }
-
- @Override
- public void setReadOnly(boolean readOnly)
- {
- super.setReadOnly(readOnly);
-
- if(readOnly)
- {
- int index = enzymeListBox.getSelectedIndex();
- if(index != -1)
- {
- String enzymeName = enzymeListBox.getItemText(index);
- enzymeReadOnly.setText(enzymeName);
- }
- else
- {
- enzymeReadOnly.setText(" ");
- }
- instance.remove(enzymeListBox);
- instance.insert(enzymeReadOnly, 0);
- }
- else
- {
- instance.remove(enzymeReadOnly);
- instance.add(enzymeListBox);
- }
- }
-
- public void addChangeListener(ChangeHandler changeHandler)
- {
- enzymeListBox.addChangeHandler(changeHandler);
- }
-
- @Override
- public void syncFormToXml(ParamParser params) throws SearchFormException
- {
- params.setInputParameter(ParameterNames.ENZYME, getSelectedEnzyme());
- }
-
- @Override
- public String syncXmlToForm(ParamParser params)
- {
- String enzyme = params.getInputParameter(ParameterNames.ENZYME);
- if(enzyme == null || enzyme.equals(""))
- {
- enzyme = getSelectedEnzyme();
- if(enzyme == null || enzyme.equals(""))
- {
- return "";
- }
- else
- {
- try
- {
- params.setInputParameter(ParameterNames.ENZYME, enzyme);
- }
- catch(SearchFormException e)
- {
- return "Cannot set the enzyme in XML: " + e.getMessage();
- }
- }
- }
- else if(!enzyme.equals(getSelectedEnzyme()))
- {
- return setSelectedEnzyme(enzyme);
- }
- return "";
- }
-
- @Override
- public Set getHandledParameterNames()
- {
- return Collections.singleton(ParameterNames.ENZYME);
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/EnzymeParseException.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/EnzymeParseException.java
deleted file mode 100644
index ab4c47ae32..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/EnzymeParseException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2008 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.ms2.pipeline.client;
-
-/**
- * User: billnelson@uky.edu
- * Date: Apr 26, 2008
- */
-
-/**
- * EnzymeParseException
- */
-public class EnzymeParseException extends RuntimeException
-{
-
- public EnzymeParseException()
- {
- super();
- }
-
- public EnzymeParseException(String s)
- {
- super(s);
- }
-
- public EnzymeParseException(String s, Throwable throwable)
- {
- super(s, throwable);
- }
-
- public EnzymeParseException(Throwable throwable)
- {
- super(throwable);
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/GWTSearchServiceResult.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/GWTSearchServiceResult.java
deleted file mode 100644
index 8aba7bff34..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/GWTSearchServiceResult.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2008-2014 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.ms2.pipeline.client;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * User: billnelson@uky.edu
- * Date: Feb 14, 2008
- */
-
-public class GWTSearchServiceResult implements IsSerializable
-{
- private List sequenceDBs;
- private String currentPath;
-
- private List sequenceDbPaths;
- private List mascotTaxonomyList;
-
- private Map> enzymeMap;
-
- private Map mod0Map;
-
- private Map mod1Map;
-
- private String defaultSequenceDb;
-
- private String selectedProtocol;
- private List protocols;
-
- private String protocolDescription;
-
- private String protocolXml;
- private List fileInputNames;
-
- private List fileInputStatus;
-
- private boolean activeJobs;
-
- private String errors = "";
-
-
- public String getSelectedProtocol()
- {
- return selectedProtocol;
- }
-
- public void setSelectedProtocol(String selectedProtocol)
- {
- this.selectedProtocol = selectedProtocol;
- }
-
- public List getSequenceDBs()
- {
- return sequenceDBs;
- }
- public void setSequenceDbs(List sequenceDbs, String currentPath)
- {
- this.sequenceDBs = sequenceDbs;
- this.currentPath = currentPath;
- }
-
- public String getCurrentPath()
- {
- return currentPath;
- }
-
- public List getSequenceDbPaths()
- {
- return sequenceDbPaths;
- }
-
- public void setSequenceDbPaths(List sequenceDbPaths)
- {
- this.sequenceDbPaths = sequenceDbPaths;
- }
-
- public List getProtocols()
- {
- return protocols;
- }
-
- public void setProtocols(List protocols)
- {
- this.protocols = protocols;
- }
-
- public String getErrors()
- {
- return errors;
- }
-
- public void appendError(String error)
- {
- if(error.trim().length() == 0) return;
- if(errors.length() > 0)
- errors += "\n";
- errors += error;
- }
-
- public String getDefaultSequenceDb()
- {
- return defaultSequenceDb;
- }
-
- public void setDefaultSequenceDb(String defaultSequenceDb)
- {
- this.defaultSequenceDb = defaultSequenceDb;
- }
-
- public String getProtocolXml()
- {
- if(protocolXml == null || protocolXml.length() == 0)
- return "";
- return protocolXml;
- }
-
- public void setProtocolXml(String protocolXml)
- {
- this.protocolXml = protocolXml;
- }
-
- public String getProtocolDescription()
- {
- return protocolDescription;
- }
-
- public void setProtocolDescription(String protocolDescription)
- {
- this.protocolDescription = protocolDescription;
- }
-
- public List getFileInputNames()
- {
- return fileInputNames;
- }
-
- public void setFileInputNames(List names)
- {
- this.fileInputNames = names;
- }
-
- public List getFileInputStatus()
- {
- return fileInputStatus;
- }
-
- public void setFileInputStatus(List fileInputStatus)
- {
- this.fileInputStatus = fileInputStatus;
- }
-
- public boolean isActiveJobs()
- {
- return activeJobs;
- }
-
- public void setActiveJobs(boolean activeJobs)
- {
- this.activeJobs = activeJobs;
- }
-
- public Map> getEnzymeMap()
- {
- return enzymeMap;
- }
-
- public void setEnzymeMap(Map> enzymeMap)
- {
- this.enzymeMap = enzymeMap;
- }
-
- public Map getMod0Map()
- {
- return mod0Map;
- }
-
- public void setMod0Map(Map mod0Map)
- {
- this.mod0Map = mod0Map;
- }
-
- public Map getMod1Map()
- {
- return mod1Map;
- }
-
- public void setMod1Map(Map mod1Map)
- {
- this.mod1Map = mod1Map;
- }
-
-
- public List getMascotTaxonomyList()
- {
- return mascotTaxonomyList;
- }
-
- public void setMascotTaxonomyList(List mascotTaxonomyList)
- {
- this.mascotTaxonomyList = mascotTaxonomyList;
- }
-
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/GeneralInputXmlComposite.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/GeneralInputXmlComposite.java
deleted file mode 100644
index adee7db2c2..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/GeneralInputXmlComposite.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2015-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.ms2.pipeline.client;
-
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-import org.labkey.api.gwt.client.ui.HelpPopup;
-
-/**
- * User: billnelson@uky.edu
- * Date: Apr 18, 2008
- */
-
-public class GeneralInputXmlComposite extends InputXmlComposite
-{
- private final String _description;
- private final String _helpTopic;
-
- public GeneralInputXmlComposite(String description, String helpTopic)
- {
- _description = description;
- _helpTopic = helpTopic;
- }
-
- @Override
- public String update(String text)
- {
- if(params == null)
- params = new ParamParser(inputXmlTextArea);
- return super.update(text);
- }
-
- @Override
- public Widget getLabel()
- {
- Label label = new Label(_description);
- label.setStyleName(LABEL_STYLE_NAME);
- HorizontalPanel panel = new HorizontalPanel();
- panel.add(label);
- panel.add(new HelpPopup(_description, "The full set of analysis parameters, represented in XML."));
- return panel;
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/InputXmlComposite.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/InputXmlComposite.java
deleted file mode 100644
index 3e49319e4f..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/InputXmlComposite.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2008-2018 LabKey Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.labkey.ms2.pipeline.client;
-
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Hidden;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.TextArea;
-import org.labkey.api.gwt.client.util.StringUtils;
-
-/**
- * User: billnelson@uky.edu
- * Date: Apr 8, 2008
- */
-public abstract class InputXmlComposite extends SearchFormComposite
-{
- protected TextAreaWrappable inputXmlTextArea = new TextAreaWrappable();
- protected Hidden inputXmlHidden = new Hidden();
- protected HTML inputXmlHtml = new HTML();
- protected HorizontalPanel instance = new HorizontalPanel();
- protected ParamParser params;
- public static final String DEFAULT_XML = "\n" +
- "\n" +
- "\n" +
- "";
-
- public InputXmlComposite()
- {
- inputXmlTextArea.setVisibleLines(10);
- inputXmlTextArea.setWrap("OFF");
- inputXmlHtml.setStylePrimaryName("labkey-read-only");
- instance.add(inputXmlTextArea);
- initWidget(instance);
- }
-
- public void setDefault()
- {
- update(DEFAULT_XML);
- }
-
- public String update(String text)
- {
- if(text.equals(""))
- text = DEFAULT_XML;
- inputXmlTextArea.setText(text);
- return validate();
- }
-
- @Override
- public void setReadOnly(boolean readOnly) {
- super.setReadOnly(readOnly);
- if(readOnly)
- {
- instance.remove(inputXmlTextArea);
- String text = inputXmlTextArea.getText();
- inputXmlHidden.setName(getName());
- inputXmlHidden.setValue(text);
- inputXmlHtml.setHTML(StringUtils.filter(text,true));
- instance.add(inputXmlHidden);
- instance.add(inputXmlHtml);
- }
- else
- {
- instance.remove(inputXmlHidden);
- instance.remove(inputXmlHtml);
- instance.add(inputXmlTextArea);
- }
- }
-
- @Override
- public String getName()
- {
- return inputXmlTextArea.getName();
- }
-
- @Override
- public void setName(String name)
- {
- inputXmlTextArea.setName(name);
- }
-
- @Override
- public void setWidth(String width)
- {
- instance.setWidth(width);
- inputXmlTextArea.setWidth(width);
- inputXmlHtml.setWidth(width);
- }
-
- @Override
- public String validate()
- {
- return params.validate();
- }
-
- public void addChangeListener(ChangeHandler changeHandler)
- {
- inputXmlTextArea.addChangeHandler(changeHandler);
- }
-
- public void writeXml() throws SearchFormException
- {
- params.writeXml();
- }
-
- @Override
- public void syncFormToXml(ParamParser params)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String syncXmlToForm(ParamParser params)
- {
- throw new UnsupportedOperationException();
- }
-
- private static class TextAreaWrappable extends TextArea
- {
- public void setWrap(String wrapOption)
- {
- Element textArea = getElement();
- DOM.setElementAttribute(textArea,"wrap", wrapOption);
- }
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/MzXmlComposite.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/MzXmlComposite.java
deleted file mode 100644
index c07d8964be..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/MzXmlComposite.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2008-2018 LabKey Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.labkey.ms2.pipeline.client;
-
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * User: billnelson@uky.edu
- * Date: Mar 31, 2008
- */
-public class MzXmlComposite extends SearchFormComposite
-{
- VerticalPanel instance = new VerticalPanel();
- private boolean hasWork;
- private boolean hasRun;
- private List _fileInputNames;
-
- public MzXmlComposite()
- {
- initWidget(instance);
- }
-
- public void update(List fileInputNames, List fileInputStatus, boolean isActiveJobs)
- {
- hasRun = false;
- hasWork = !isActiveJobs;
- // Stash for refreshing without getting a new list of files
- _fileInputNames = fileInputNames;
-
- instance.clear();
- int num = (fileInputNames == null ? 0 : fileInputNames.size());
- if(num != 0)
- {
- StringBuilder names = new StringBuilder();
- for(int i = 0; i < num; i++)
- {
- if (i > 0)
- names.append(" ");
- names.append(fileInputNames.get(i));
- if(fileInputStatus != null && i < fileInputStatus.size())
- {
- String status = fileInputStatus.get(i);
- if (status != null && !"".equals(status))
- {
- names.append(" (").append(status).append(")");
- hasRun = true;
- }
- }
- }
- HTML html = new HTML(names.toString());
- html.setStylePrimaryName("labkey-read-only");
- instance.add(html);
- }
- else
- {
- instance.add(new Label("No mzXML files found"));
- }
- }
-
- @Override
- public String getName()
- {
- return null; //Not needed. Just Labels.
- }
-
- @Override
- public void setName(String s)
- {
- //Not needed. Just Labels.
- }
-
- @Override
- public void setWidth(String width)
- {
- //defaults are okay for now
- }
-
- @Override
- public Widget getLabel()
- {
- Label label = new Label("Input file(s)");
- label.setStylePrimaryName(LABEL_STYLE_NAME);
- return label;
- }
-
- @Override
- public String validate()
- {
- return null; //No need for now.
- }
-
- public boolean hasWork()
- {
- return hasWork;
- }
-
- public void setHasWork(boolean hasWork)
- {
- this.hasWork = hasWork;
- }
-
- public boolean hasRun()
- {
- return hasRun;
- }
-
- public void setHasRun(boolean hasRun)
- {
- this.hasRun = hasRun;
- }
-
- public void clearStatus()
- {
- update(_fileInputNames, null, false);
- }
-
- @Override
- public void syncFormToXml(ParamParser params)
- {
-
- }
-
- @Override
- public String syncXmlToForm(ParamParser params)
- {
- return "";
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/OtherParametersComposite.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/OtherParametersComposite.java
deleted file mode 100644
index 171343d138..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/OtherParametersComposite.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2012-2018 LabKey Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.labkey.ms2.pipeline.client;
-
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.KeyCodes;
-import com.google.gwt.event.dom.client.KeyPressEvent;
-import com.google.gwt.event.dom.client.KeyPressHandler;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-import org.labkey.api.gwt.client.ui.FontButton;
-import org.labkey.api.gwt.client.ui.HelpPopup;
-import org.labkey.api.gwt.client.ui.ImageButton;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * User: jeckels
- * Date: Jan 30, 2012
- */
-public class OtherParametersComposite extends SearchFormComposite
-{
- protected FlexTable _table = new FlexTable();
- Map _inputs = new LinkedHashMap();
- private TextBox _newParameterNameTextBox = new TextBox();
- private ImageButton _newParameterButton = new ImageButton("Add");
- private ChangeHandler _handler;
- public static final String BLANK_PARAMETER_NAME_PROMPT = "";
- private final List _uiElements;
- private final InputXmlComposite _inputXmlComposite;
-
- public OtherParametersComposite(List uiElements, InputXmlComposite inputXmlComposite)
- {
- _uiElements = uiElements;
- _inputXmlComposite = inputXmlComposite;
- _newParameterNameTextBox.addBlurHandler(new BlurHandler()
- {
- @Override
- public void onBlur(BlurEvent event)
- {
- if (_newParameterNameTextBox.getText().trim().isEmpty())
- {
- _newParameterNameTextBox.setText(BLANK_PARAMETER_NAME_PROMPT);
- DOM.setStyleAttribute(_newParameterNameTextBox.getElement(), "color", "grey");
- }
- }
- });
-
- _newParameterButton.addClickHandler(new ClickHandler()
- {
- @Override
- public void onClick(ClickEvent event)
- {
- addParameter();
- }
- });
- _newParameterNameTextBox.addKeyPressHandler(new KeyPressHandler()
- {
- @Override
- public void onKeyPress(KeyPressEvent event)
- {
- if (KeyCodes.KEY_ENTER == event.getNativeEvent().getKeyCode())
- {
- addParameter();
- }
- }
- });
-
- _newParameterNameTextBox.addFocusHandler(new FocusHandler()
- {
- @Override
- public void onFocus(FocusEvent event)
- {
- if (BLANK_PARAMETER_NAME_PROMPT.equals(_newParameterNameTextBox.getText()))
- {
- _newParameterNameTextBox.setText("");
- }
- DOM.setStyleAttribute(_newParameterNameTextBox.getElement(), "color", "");
- }
- });
- _newParameterNameTextBox.setText(BLANK_PARAMETER_NAME_PROMPT);
- DOM.setStyleAttribute(_newParameterNameTextBox.getElement(), "color", "grey");
- _newParameterNameTextBox.setWidth("20em");
-
- _table.setStylePrimaryName("lk-fields-table");
- _table.setCellPadding(1);
- initWidget(_table);
- }
-
- private void addParameter()
- {
- String name = _newParameterNameTextBox.getText().trim();
- if (!name.isEmpty() && !name.equals(BLANK_PARAMETER_NAME_PROMPT))
- {
- if (isHandledParameter(name))
- {
- new Search.ErrorDialogBox("Please set the '" + name + "' parameter by using the user interface above");
- return;
- }
- if (!_inputs.containsKey(name))
- {
- Label label = new Label(name);
- _table.setWidget(_table.getRowCount() - 1, 0, label);
- _table.getCellFormatter().setStylePrimaryName(_table.getRowCount() - 1, 0, "labkey-form-label-nowrap");
- TextBox textBox = createParameterValueTextBox();
- _inputs.put(name, textBox);
- _table.setWidget(_table.getRowCount() - 1, 1, textBox);
- _table.setWidget(_table.getRowCount() - 1, 2, createDeleteButton(name));
- _table.setWidget(_table.getRowCount(), 0, _newParameterNameTextBox);
- _table.setWidget(_table.getRowCount() - 1, 1, _newParameterButton);
- _newParameterNameTextBox.setText("");
- _newParameterNameTextBox.setText(BLANK_PARAMETER_NAME_PROMPT);
- DOM.setStyleAttribute(_newParameterNameTextBox.getElement(), "color", "grey");
- _handler.onChange(null);
- textBox.setFocus(true);
- }
- else
- {
- new Search.ErrorDialogBox("Duplicate parameter name");
- }
- }
- }
-
- @Override
- public void setWidth(String width)
- {
- }
-
- @Override
- public Widget getLabel()
- {
- Label label = new Label("Other parameters");
- label.setStyleName(LABEL_STYLE_NAME);
- HorizontalPanel panel = new HorizontalPanel();
- panel.add(label);
- panel.add(new HelpPopup("Other parameters", "The names and values of other analysis parameters that are not controlled by the above inputs."));
- return panel;
- }
-
- @Override
- public String validate()
- {
- return "";
- }
-
- @Override
- public void syncFormToXml(ParamParser params) throws SearchFormException
- {
- for (Map.Entry entry : _inputs.entrySet())
- {
- params.setInputParameter(entry.getKey(), entry.getValue().getText());
- }
- }
-
- @Override
- public void setReadOnly(boolean readOnly)
- {
- super.setReadOnly(readOnly);
- createTable();
- }
-
- @Override
- public String syncXmlToForm(ParamParser params)
- {
- _inputs.clear();
- for (Map.Entry entry : params.getParameters().entrySet())
- {
- if (!isHandledParameter(entry.getKey()))
- {
- TextBox valueBox = createParameterValueTextBox();
- valueBox.setText(entry.getValue());
- _inputs.put(entry.getKey(), valueBox);
- }
- }
- createTable();
- return "";
- }
-
- private boolean isHandledParameter(String name)
- {
- for (SearchFormComposite uiElement : _uiElements)
- {
- if (uiElement.isHandledParameterName(name))
- {
- return true;
- }
- }
- return false;
- }
-
-
- private TextBox createParameterValueTextBox()
- {
- TextBox valueBox = new TextBox();
- valueBox.setWidth("20em");
- valueBox.addChangeHandler(_handler);
- return valueBox;
- }
-
- private void createTable()
- {
- int row = 0;
- _table.removeAllRows();
- for (final Map.Entry entry : _inputs.entrySet())
- {
- Label label = new Label(entry.getKey());
-
- _table.setWidget(row, 0, label);
- _table.getCellFormatter().setStylePrimaryName(row, 0, "labkey-form-label-nowrap");
-
- if (readOnly)
- {
- _table.setText(row, 1, entry.getValue().getText());
- }
- else
- {
- _table.setWidget(row, 1, entry.getValue());
- FontButton deleteButton = createDeleteButton(entry.getKey());
- _table.setWidget(row, 2, deleteButton);
- }
- row++;
- }
-
- if (!readOnly)
- {
- _table.setWidget(++row, 0, _newParameterNameTextBox);
- _table.setWidget(row, 1, _newParameterButton);
- }
-
- }
-
- private FontButton createDeleteButton(final String paramName)
- {
- FontButton button = new FontButton("fa-times");
- String id = "partdelete_" + paramName;
- button.getElement().setId(id);
- button.addClickHandler(clickEvent -> {
- _inputXmlComposite.params.removeInputParameter(paramName);
- _inputs.remove(paramName);
- createTable();
- _handler.onChange(null);
-
- });
- return button;
- }
-
- @Override
- public void setName(String name)
- {
-
- }
-
- @Override
- public String getName()
- {
- return null;
- }
-
- public void addChangeListener(ChangeHandler handler)
- {
- _handler = handler;
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ParamParser.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ParamParser.java
deleted file mode 100644
index 98c63664c1..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ParamParser.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (c) 2008-2012 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.ms2.pipeline.client;
-
-import com.google.gwt.xml.client.*;
-import com.google.gwt.xml.client.impl.DOMParseException;
-import com.google.gwt.user.client.ui.HasText;
-
-import java.util.*;
-
-/**
- * User: billnelson@uky.edu
- * Date: Apr 21, 2008
- */
-
-/**
- * ParamParser
- */
-public class ParamParser
-{
- public static String TAG_BIOML = "bioml";
- public static String TAG_NOTE = "note";
- public static String ATTR_LABEL = "label";
- public static String ATTR_TYPE = "type";
- public static String VAL_INPUT = "input";
- protected static String XML_HEADER = "\n" +
- "\n";
- protected static String XML_FOOTER = "";
-
- StringBuffer error;
- Document xmlDoc;
- HasText xmlWrapper;
-
- public ParamParser(HasText xml)
- {
- xmlWrapper = xml;
- }
-
- private void appendError(String s)
- {
- if(this.error == null)
- this.error = new StringBuffer();
- if(error.length() > 0) error.append("\n");
- error.append(s);
- }
-
- public String toXml()throws SearchFormException
- {
- NodeList nodes = getAllNodes();
- if(nodes == null || nodes.getLength() == 0 ) return "";
- StringBuffer sb = new StringBuffer();
- sb.append(XML_HEADER);
- int nodeCount = nodes.getLength();
- for(int i = 0; i < nodeCount; i++)
- {
- Node node = nodes.item(i);
- short nodeType = node.getNodeType();
- if(nodeType == Node.ELEMENT_NODE)
- {
- sb.append(element2String(node));
- }
- else if(nodeType == Node.COMMENT_NODE)
- {
- sb.append(comment2String(node));
- }
- }
- sb.append(XML_FOOTER);
- return sb.toString();
- }
-
- private String element2String(Node node)
- {
- if(node == null)return "";
- StringBuffer sb = new StringBuffer();
- Element el = (Element)node;
- Text text = (Text)el.getFirstChild();
-
- sb.append(" ");
- if(text == null)
- {
- sb.append("");
- }
- else
- {
- // The node value isn't XML encoded, so be sure to escape any special characters when building up the XML
- sb.append(encode(text.getNodeValue()));
- }
- sb.append("\n");
- return sb.toString();
- }
-
- private String comment2String(Node node)
- {
- StringBuffer sb = new StringBuffer();
- Comment com = (Comment)node;
- sb.append(" \n");
- return sb.toString();
- }
-
- public String validate()
- {
- try
- {
- refresh();
- }
- catch(SearchFormException e)
- {
- return e.getMessage();
- }
- Element el;
- try
- {
- el = getDocumentElement();
- }
- catch(SearchFormException e)
- {
- return "The input XML has syntax errors: " + e.getMessage();
- }
- if(!el.getTagName().equals(TAG_BIOML))
- return "Root tag name should be '" + TAG_BIOML + "'.";
- NodeList notes = el.getChildNodes();
- ArrayList foundList = new ArrayList();
- for(int i = 0; i < notes.getLength(); i++)
- {
- Node child = notes.item(i);
- if(child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- Element elNote = (Element)child;
- if(!elNote.getNodeName().equals(TAG_NOTE))
- return "Tag '" + elNote.getNodeName() + "' is not supported.";
- String type = elNote.getAttribute(ATTR_TYPE);
- if(type == null || type.length() == 0 || type.equals("description"))
- continue;
- if(!type.equals(VAL_INPUT))
- {
- return "Note type '" + type + "' is not supported";
- }
- String label = elNote.getAttribute(ATTR_LABEL);
- if(foundList.contains(label))
- {
- return "The \"" + label + "\" label appears more than once in the input XML.";
- }
- foundList.add(label);
- }
- return "";
- }
-
- public void removeInputParameter(String name)
- {
- if(name == null || name.equals("")) return;
- NodeList notes = getNoteElements();
- if(notes == null) return;
- for(int i = 0; i < notes.getLength(); i++)
- {
- Element elNote = (Element)notes.item(i);
- if(isInputParameterElement(name, elNote))
- removeNode(elNote);
- }
- }
-
- private void removeNode(Node node)
- {
- if(node == null) return;
- Element el;
- try
- {
- el = getDocumentElement();
- }
- catch(SearchFormException e)
- {
- return;
- }
- el.removeChild(node);
- }
-
- public void setInputParameter(String name, String value) throws SearchFormException
- {
- if(name == null) throw new SearchFormException("Parameter name is null.");
- if (value != null)
- {
- value = value.trim();
- }
- removeInputParameter(name);
- Element ip = getDocument().createElement(TAG_NOTE);
- ip.setAttribute(ATTR_TYPE, VAL_INPUT);
- ip.setAttribute(ATTR_LABEL,name);
- ip.appendChild(getDocument().createTextNode(value));
- Element de = getDocumentElement();
- if(de == null) return;
- de.appendChild(ip);
- }
-
- /** Simple XML encoding of a string */
- private String encode(String value)
- {
- if(value == null) value = "";
- value = value.replace("&", "&");
- value = value.replace("<", "<");
- value = value.replace(">", ">");
- value = value.replace("\"", """);
- return value;
- }
-
- public Map getParameters()
- {
- NodeList notes = getNoteElements();
- if (notes == null)
- {
- return Collections.emptyMap();
- }
- Map result = new LinkedHashMap();
- for(int i = 0; i < notes.getLength(); i++)
- {
- Element elNote = (Element)notes.item(i);
- String value = getTrimmedTextValue(elNote.getFirstChild());
- result.put(elNote.getAttribute(ATTR_LABEL), value);
- }
- return result;
- }
-
- public String getInputParameter(String name)
- {
- if(name == null) return "";
- NodeList notes = getNoteElements();
- if(notes == null) return null;
- for(int i = 0; i < notes.getLength(); i++)
- {
- Element elNote = (Element)notes.item(i);
- if(isInputParameterElement(name, elNote))
- {
- return getTrimmedTextValue(elNote.getFirstChild());
- }
- }
- return "";
- }
-
- private String getTrimmedTextValue(Node node)
- {
- if (node == null)
- {
- return "";
- }
- String result = node.getNodeValue();
- return result == null ? "" : result.trim();
- }
-
- private boolean isInputParameterElement(String name, Element elNote)
- {
- String type = elNote.getAttribute(ATTR_TYPE);
- return VAL_INPUT.equals(type) && name.equals(elNote.getAttribute(ATTR_LABEL));
- }
-
- private NodeList getNoteElements()
- {
- Element el;
- try
- {
- el = getDocumentElement();
- }
- catch(SearchFormException e)
- {
- appendError(e.getMessage());
- return null;
- }
- if(el == null) return null;
- return el.getElementsByTagName(TAG_NOTE);
-
- }
-
- private NodeList getAllNodes() throws SearchFormException
- {
- Element el = getDocumentElement();
- if(el == null) return null;
- return el.getChildNodes();
- }
-
- private Element getDocumentElement() throws SearchFormException
- {
- Document xmlDoc = getDocument();
- if(xmlDoc == null) return null;
- return xmlDoc.getDocumentElement();
- }
-
- private void refresh() throws SearchFormException
- {
- try
- {
- xmlDoc = XMLParser.parse(xmlWrapper.getText());
- }
- catch(DOMParseException e)
- {
- throw new SearchFormException("Invalid XML. Please check your input.");
- }
- }
-
- public void writeXml() throws SearchFormException
- {
- xmlWrapper.setText(toXml());
- }
-
- private Document getDocument() throws SearchFormException
- {
- if( xmlDoc == null)
- {
- try
- {
- xmlDoc = XMLParser.parse(xmlWrapper.getText());
- }
- catch(DOMParseException e)
- {
- throw new SearchFormException(e);
- }
- }
- return xmlDoc;
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/PipelineConfigCallback.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/PipelineConfigCallback.java
deleted file mode 100644
index 8d8d6f46ea..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/PipelineConfigCallback.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2012 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.ms2.pipeline.client;
-
-import org.labkey.api.gwt.client.pipeline.GWTPipelineConfig;
-
-/**
- * User: jeckels
- * Date: Feb 1, 2012
- */
-public interface PipelineConfigCallback
-{
- public void setPipelineConfig(GWTPipelineConfig result);
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ProtocolComposite.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ProtocolComposite.java
deleted file mode 100644
index a10af22204..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ProtocolComposite.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 2008-2018 LabKey Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.labkey.ms2.pipeline.client;
-
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HasHorizontalAlignment;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.TextArea;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-import org.labkey.api.gwt.client.util.StringUtils;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * User: billnelson@uky.edu
- * Date: Mar 25, 2008
- */
-public class ProtocolComposite extends SearchFormComposite
-{
- private FlexTable instance = new FlexTable();
- private ListBox protocolListBox = new ListBox();
- private TextBox protocolNameTextBox = new TextBox();
- private TextArea protocolDescTextArea = new TextArea();
- private HTML protocolDescHtml = new HTML();
- Label textBoxLabel;
- Label descriptionLabel;
- private static final String NEW_PROTOCOL = "";
- private List _protocols;
-
-
- public ProtocolComposite()
- {
- protocolListBox.setVisibleItemCount(1);
- protocolDescHtml.setWordWrap(true);
- protocolDescHtml.setStylePrimaryName("labkey-read-only");
- textBoxLabel = new Label("Name");
- descriptionLabel = new Label("Description");
-
- instance.setStylePrimaryName("lk-fields-table");
- instance.setWidget(0,0,protocolListBox);
- instance.getFlexCellFormatter().setColSpan(0,0,2);
-
- instance.setWidget(1,0,textBoxLabel);
- instance.getCellFormatter().setStylePrimaryName(1,0, "labkey-form-label-nowrap");
- instance.setWidget(1,1,protocolNameTextBox);
-
- instance.setWidget(2,0,descriptionLabel);
- instance.getCellFormatter().setStylePrimaryName(2,0, "labkey-form-label-nowrap");
- instance.getCellFormatter().setHorizontalAlignment(2,0,HasHorizontalAlignment.ALIGN_LEFT);
- instance.setWidget(2,1,protocolDescTextArea);
-
- textBoxLabel.setStylePrimaryName(LABEL_STYLE_NAME);
- descriptionLabel.setStylePrimaryName(LABEL_STYLE_NAME);
-
- initWidget(instance);
- }
-
-
- @Override
- public Widget getLabel()
- {
- Label listBoxLabel = new Label("Analysis protocol");
- listBoxLabel.setStylePrimaryName(LABEL_STYLE_NAME);
- return listBoxLabel;
- }
-
- public void addChangeHandler(ChangeHandler handler)
- {
- protocolListBox.addChangeHandler(handler);
- }
-
- @Override
- public void setName(String name)
- {
- protocolListBox.setName(name);
- protocolNameTextBox.setName(name + "Name");
- protocolDescTextArea.setName(name + "Description");
- }
-
- @Override
- public String getName()
- {
- return protocolListBox.getName();
- }
-
- @Override
- public void setWidth(String width)
- {
- instance.setWidth(width);
-
- protocolListBox.setWidth("100%");
- protocolNameTextBox.setWidth("100%");
- protocolDescTextArea.setWidth("100%");
- protocolDescHtml.setWidth("100%");
- instance.getColumnFormatter().setWidth(0,"2%");
- instance.getColumnFormatter().setWidth(1,"98%");
- }
-
- public void update(List protocolList, String defaultProtocol, String textArea)
- {
- setProtocolListBoxContents(protocolList, defaultProtocol);
- protocolDescTextArea.setText(textArea);
- }
-
- public void setProtocolListBoxContents(List protocols, String defaultProtocol)
- {
- if (protocolListBox.getItemCount() == 0 && (protocols == null || protocols.isEmpty()))
- {
- protocolListBox.clear();
- protocolListBox.addItem(NEW_PROTOCOL, "new");
- return;
- }
-
- if(protocols != null && protocolListBox.getItemCount() != protocols.size() + 1)
- {
- _protocols = protocols;
- protocolListBox.clear();
- Collections.sort(protocols);
- protocols.add(0,NEW_PROTOCOL);
- for (String protocol : protocols)
- {
- if (protocol.equals(NEW_PROTOCOL))
- {
- protocolListBox.addItem(protocol, "new");
- }
- else
- {
- protocolListBox.addItem(protocol, protocol);
- }
- }
- }
- setDefault(defaultProtocol);
- }
-
- public void setDefault(String defaultProtocol)
- {
- if(defaultProtocol == null || defaultProtocol.length() == 0)
- {
- protocolNameTextBox.setText("");
- defaultProtocol = "new";
- }
- int protocolCount = protocolListBox.getItemCount();
- boolean found = false;
- for(int i = 0; i < protocolCount; i++)
- {
- if(protocolListBox.getValue(i).equals(defaultProtocol))
- {
- found = true;
- protocolListBox.setSelectedIndex(i);
- break;
- }
- }
- if(found && !defaultProtocol.equals("new"))
- {
- protocolNameTextBox.setText(defaultProtocol);
- }
- else if(!found && !defaultProtocol.equals("new"))
- {
- protocolListBox.setSelectedIndex(0);
- protocolNameTextBox.setText(defaultProtocol);
- }
- else
- {
- protocolNameTextBox.setText("");
- }
- }
-
- @Override
- public void setReadOnly(boolean readOnly)
- {
- super.setReadOnly(readOnly);
-
- if(readOnly)
- {
-
- protocolNameTextBox.setVisible(false);
- textBoxLabel.setVisible(false);
- instance.getCellFormatter().removeStyleName(1, 0, "labkey-form-label-nowrap");
- instance.remove(protocolDescTextArea);
- instance.setWidget(2,1,protocolDescHtml);
- if (protocolDescTextArea.getText() != null && !protocolDescTextArea.getText().trim().equals(""))
- {
- protocolDescHtml.setHTML(StringUtils.filter(protocolDescTextArea.getText(), true));
- }
- else
- {
- protocolDescHtml.setHTML("" + StringUtils.filter("") + "");
- }
-
-// index = instance.getWidgetIndex(protocolNameTextBox);
-// protocolNameHidden.setValue(protocolNameTextBox.getText());
-// protocolNameHidden.setName(protocolNameTextBox.getName());
-// if(index != -1)
-// {
-// instance.remove(protocolNameTextBox);
-// ((VerticalPanel)labelWidget).remove(textBoxLabel);
-// instance.insert(protocolNameHidden, index);
-// }
-// index = instance.getWidgetIndex(protocolDescTextArea);
-// protocolDescHidden.setValue(protocolDescTextArea.getText());
-// protocolDescHtml.setHTML(StringUtils.filter(protocolDescTextArea.getText(), true));
-// protocolDescHidden.setName(protocolDescTextArea.getName());
-// if(index != -1)
-// {
-// instance.remove(protocolDescTextArea);
-// instance.add(protocolDescHidden);
-// instance.insert(protocolDescHtml, index);
-// }
- }
- else
- {
- instance.getCellFormatter().setStylePrimaryName(1,0, "labkey-form-label-nowrap");
- //instance.getCellFormatter().setStylePrimaryName(2,0, "labkey-form-label-nowrap");
- protocolNameTextBox.setVisible(true);
- instance.remove(protocolDescHtml);
- instance.setWidget(2,1,protocolDescTextArea);
- //protocolDescHtml.setHTML("");
- textBoxLabel.setVisible(true);
-
-// index = instance.getWidgetIndex(protocolNameHidden);
-// if(index != -1)
-// {
-// instance.remove(protocolNameHidden);
-// instance.insert(protocolNameTextBox, index);
-// ((VerticalPanel)labelWidget).insert(textBoxLabel,index);
-// }
-// index = instance.getWidgetIndex(protocolDescHtml);
-// if(index != -1)
-// {
-// instance.remove(protocolDescHidden);
-// instance.remove(protocolDescHtml);
-// instance.insert(protocolDescTextArea, index);
-// }
- }
- }
-
- public void setVisibleLines(int lines)
- {
- protocolDescTextArea.setVisibleLines(lines);
- }
-
- public String getSelectedProtocolValue()
- {
- try
- {
- return protocolListBox.getValue(protocolListBox.getSelectedIndex());
- }
- catch(IndexOutOfBoundsException e)
- {
- return "";
- }
-
- }
-
- @Override
- public String validate()
- {
- if(protocolNameTextBox.getText().equalsIgnoreCase("default"))
- return "Sorry, default is a reserved protocol name. Please choose another.";
- String selectedProtocol = getSelectedProtocolValue();
- if(selectedProtocol.equals("new"))
- {
- if(protocolNameTextBox.getText().equals(""))
- {
- return "Missing protocol name.";
- }
- else
- {
- for (int i = 0; i < protocolNameTextBox.getText().length(); i++)
- {
- char ch = protocolNameTextBox.getText().charAt(i);
- if (!Character.isLetterOrDigit(ch) && ch != '_' && ch != ' ')
- {
- return "The name '" + protocolNameTextBox.getText() + "' is not a valid protocol name.";
- }
- }
- }
- }
- return "";
- }
-
- public void newProtocol()
- {
- setDefault("");
- protocolDescTextArea.setText("");
- }
-
- /** We need to create a unique protocol name. We will append "_1", or change an existing "_X" to increment the X */
- public void copy()
- {
- String protocolName = protocolNameTextBox.getText();
-
- if(protocolName == null || protocolName.length() == 0 )
- {
- setDefault("");
- return;
- }
-
- int index = protocolName.lastIndexOf("_");
- String prefix = protocolName + "_";
-
- int versionInt = 1;
-
- // See if the current protocol name ends with "_X"
- if( index > 0 && index != protocolName.length() - 1)
- {
- String versionString = protocolName.substring(index + 1);
-
- try
- {
- // See if X is a number
- versionInt = Integer.parseInt(versionString) + 1;
-
- // Remove the X from the prefix
- prefix = protocolName.substring(0, index + 1);
- }
- catch(NumberFormatException ignored)
- {
- }
- }
-
- // Keep incrementing the number on the suffix until we have a unique name
- while (_protocols != null && _protocols.contains(prefix + versionInt))
- {
- versionInt++;
- }
-
- setDefault(prefix + versionInt);
- }
-
- public void setFocus(boolean hasFocus)
- {
- protocolNameTextBox.setFocus(hasFocus);
- }
-
- @Override
- public void syncFormToXml(ParamParser params)
- {
-
- }
-
- @Override
- public String syncXmlToForm(ParamParser params)
- {
- return "";
- }
-}
diff --git a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ResidueModComposite.java b/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ResidueModComposite.java
deleted file mode 100644
index 556ba900da..0000000000
--- a/ms2/gwtsrc/org/labkey/ms2/pipeline/client/ResidueModComposite.java
+++ /dev/null
@@ -1,708 +0,0 @@
-/*
- * Copyright (c) 2008-2017 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.ms2.pipeline.client;
-
-import com.google.gwt.user.client.ui.*;
-import org.labkey.api.gwt.client.ui.HelpPopup;
-import org.labkey.api.gwt.client.ui.ImageButton;
-
-import java.util.*;
-
-/**
- * User: billnelson@uky.edu
- * Date: Apr 30, 2008
- */
-
-/**
- * ResidueModComposite
- */
-public abstract class ResidueModComposite extends SearchFormComposite
-{
- protected Search searchForm;
- protected SimplePanel instance = new SimplePanel();
- protected TabPanel modTabPanel = new TabPanel();
- protected FlexTable staticFlexTable = new FlexTable();
- protected FlexTable dynamicFlexTable = new FlexTable();
- protected ListBox modStaticListBox = new ListBox(false);
- protected ListBox modDynamicListBox = new ListBox(false);
- protected ListBox staticListBox = new ListBox();
- protected ListBox dynamicListBox = new ListBox();
- protected HorizontalPanel staticPanel = new HorizontalPanel();
- protected HorizontalPanel dynamicPanel = new HorizontalPanel();
- protected AddButton addStaticButton = new AddButton(STATIC);
- protected AddButton addDynamicButton = new AddButton(DYNAMIC);
- protected DeleteButton deleteDynamicButton = new DeleteButton(DYNAMIC);
- protected DeleteButton deleteStaticButton = new DeleteButton(STATIC);
- protected NewButton newStaticButton = new NewButton(STATIC);
- protected NewButton newDynamicButton = new NewButton(DYNAMIC);
- protected VerticalPanel readOnlyPanel = new VerticalPanel();
- protected Label staticReadOnlyLabel = new Label();
- protected Label dynamicReadOnlyLabel = new Label();
- public static final int STATIC = 0;
- public static final int DYNAMIC = 1;
- private static final Map VALID_RESIDUES;
-
- static
- {
- Map residues = new LinkedHashMap();
- residues.put('A', "A - Alanine");
- residues.put('B', "B - Asparagine");
- residues.put('C', "C - Cysteine");
- residues.put('D', "D - Aspartic acid");
- residues.put('E', "E - Glutamic acid");
- residues.put('F', "F - Phenylalanine");
- residues.put('G', "G - Glycine");
- residues.put('H', "H - Histidine");
- residues.put('I', "I - Isoleucine");
- residues.put('K', "K - Lysine");
- residues.put('L', "L - Leucine");
- residues.put('M', "M - Methionine");
- residues.put('N', "N - Asparagine");
- residues.put('O', "O - Pyrrolysine");
- residues.put('P', "P - Proline");
- residues.put('Q', "Q - Glutamine");
- residues.put('R', "R - Argine");
- residues.put('S', "S - Serine");
- residues.put('T', "T - Threonine");
- residues.put('V', "V - Valine");
- residues.put('W', "W - Tryptophan");
- residues.put('X', "X - All residues");
- residues.put('Y', "Y - Tyrosine");
- residues.put('Z', "Z - Glutamine");
- residues.put(']', "C-Terminus");
- residues.put('[', "N-Terminus");
-
- VALID_RESIDUES = Collections.unmodifiableMap(residues);
- };
-
-
-
- public ResidueModComposite()
- {
- modStaticListBox.setVisibleItemCount(3);
- modStaticListBox.setWidth("250px");
- modDynamicListBox.setVisibleItemCount(3);
- modDynamicListBox.setWidth("250px");
- staticListBox.setWidth("250px");
- staticListBox.setVisibleItemCount(3);
- dynamicListBox.setWidth("250px");
- dynamicListBox.setVisibleItemCount(3);
- staticPanel.add(staticListBox);
- staticPanel.add(deleteStaticButton);
- dynamicPanel.add(dynamicListBox);
- dynamicPanel.add(deleteDynamicButton);
- staticFlexTable.setStylePrimaryName("lk-fields-table");
- modTabPanel.add(staticFlexTable, "Fixed");
- dynamicFlexTable.setStylePrimaryName("lk-fields-table");
- modTabPanel.add(dynamicFlexTable, "Variable");
- modTabPanel.selectTab(0);
- readOnlyPanel.add(staticReadOnlyLabel);
- readOnlyPanel.add(dynamicReadOnlyLabel);
- initWidget(instance);
- }
-
- @Override
- public void setWidth(String width)
- {
- StringBuffer num = new StringBuffer();
- StringBuffer type = new StringBuffer();
- StringBuffer endWidth = new StringBuffer();
- StringBuffer centerWidth = new StringBuffer();
- StringBuffer listWidth = new StringBuffer();
- for(int i = 0; i < width.length(); i++)
- {
- char widthChar = width.charAt(i);
- if(Character.isDigit(widthChar))
- {
- num.append(widthChar);
- }
- else
- {
- type.append(widthChar);
- }
- }
- try
- {
- int intWidth = Integer.parseInt(num.toString());
- endWidth.append(Integer.toString((intWidth/9) * 4));
- endWidth.append(type);
- centerWidth.append(Integer.toString(intWidth/9));
- centerWidth.append(type);
- listWidth.append(Integer.toString(((intWidth/9) * 4)-60));
- modTabPanel.setWidth(endWidth.toString());
- staticFlexTable.getColumnFormatter().setWidth(0, endWidth.toString());
- staticFlexTable.getColumnFormatter().setWidth(1, centerWidth.toString());
- staticFlexTable.getColumnFormatter().setWidth(2, endWidth.toString());
- dynamicFlexTable.getColumnFormatter().setWidth(0, endWidth.toString());
- dynamicFlexTable.getColumnFormatter().setWidth(1, centerWidth.toString());
- dynamicFlexTable.getColumnFormatter().setWidth(2, endWidth.toString());
- modStaticListBox.setWidth(endWidth.toString());
- modDynamicListBox.setWidth(endWidth.toString());
- dynamicPanel.setWidth(endWidth.toString());
- staticPanel.setWidth(endWidth.toString());
- staticListBox.setWidth(listWidth.toString());
- dynamicListBox.setWidth(listWidth.toString());
- }
- catch(NumberFormatException e)
- {}
- }
-
- @Override
- public Widget getLabel()
- {
- Label label = new Label("Residue modifications");
- label.setStylePrimaryName(LABEL_STYLE_NAME);
- HorizontalPanel panel = new HorizontalPanel();
- panel.add(label);
- panel.add(new HelpPopup("Residue modifications",
- "
Residue modifications, often referred to as posttranslational modifications (PTM) are the chemical modifications of a protein after its translation. Each modification will alter the mass of its associated amino acid.
" +
- "
Fixed modifications are expected to be present for every amino acid of that type.