Changeset 3768


Ignore:
Timestamp:
Aug 17, 2010, 11:26:20 AM (13 years ago)
Author:
Gregory Vincic
Message:

Fixing #685. Multiple file selection now works. This commit also modifies the job name such that it states 'Mascot search: _name of parameter set_'. The TextField? class got a new constructor for easy construction with default value. HtmlTagWriter? was fixed so indentation works nicely. Action classes have been partly refactored aswell.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/api/waf/src/se/lu/thep/waf/HtmlTagWriter.java

    r3759 r3768  
    7474  public void draw(Tag tag)
    7575  {
     76    indent++;
    7677    if (tag instanceof CData)
    7778    {
     
    8889      for (Tag child : elements)
    8990      {
    90         indent++;
    9191        child.draw(this);
    9292      }
     
    9494   {
    9595      writeEndTag(writer, tag);
    96       indent--;
    9796   }
    9897    }
     98  indent--;
    9999  }
    100100
     
    113113          sb.append(">");
    114114      else
    115         sb.append("\n>");
     115        sb.append(">\n");
    116116  }
    117117  else
  • trunk/client/servlet/src/org/proteios/action/mascot/SaveMascotParameterSetStorage.java

    r3297 r3768  
    4848import org.proteios.gui.Toolbar;
    4949import org.proteios.gui.form.Form;
     50import org.proteios.gui.form.Fieldset;
     51import org.proteios.gui.form.TextField;
    5052import org.proteios.gui.form.FormFactory;
    5153import org.proteios.gui.layout.RowLayout;
     
    125127      throws ActionException, InvalidParameterValue
    126128  {
    127     /*
    128      * Get the Mascot parameter set storage
    129      */
    130     log.debug("########## - Start");
    131     //Integer mascotpssId = getSessionAttribute(ViewActiveMascotParameterSetStorage.VMASCOTPARAMETERSETSTORAGEID);
    132     Integer mascotpssId = getValidInteger(ViewActiveMascotParameterSetStorage.VMASCOTPARAMETERSETSTORAGEID);
     129
     130  Integer mascotpssId;
     131  Boolean saveMascotParameterSetFlag;
     132  Boolean saveAsMascotParameterSetFlag;
     133  Boolean useWebInterfaceFlag;
     134  List<Integer> spectrumFileIds;
     135  String forwardId, mascotSearchUserName, mascotSearchUserEmail, errorMessage, saveLabel;
     136  DbControl dc;
     137  ItemFactory factory;
     138  MascotParameterSetStorage mascotpss;
     139  MascotParameterSet mascotParameterSet;
     140  Form form;
     141  Toolbar tb;
     142  RowLayout layout;
     143  ActionLink action, forwardLink, saveAction;
     144  // Define
     145
     146    mascotpssId = getValidInteger(ViewActiveMascotParameterSetStorage.VMASCOTPARAMETERSETSTORAGEID);
     147    saveMascotParameterSetFlag = getValidBoolean(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG);
     148    saveAsMascotParameterSetFlag = getValidBoolean(SearchMascot.VSAVEASMASCOTPARAMETERSETFLAG);
     149    forwardId = getValidString(FormFactory.VFWDACTION);
     150    spectrumFileIds = getValidIntegerList(SearchMascot.VSPECTRUMFILEID);
     151    useWebInterfaceFlag = getValidBoolean(SearchMascot.VMASCOTUSEWEBINTERFACEFLAG);
     152  mascotSearchUserName = getValidString(SearchMascot.VMASCOT_SEARCH_USER_NAME);
     153  mascotSearchUserEmail = getValidString(SearchMascot.VMASCOT_SEARCH_USER_EMAIL);
     154
     155    if (saveMascotParameterSetFlag == null) { saveMascotParameterSetFlag = false; }
     156    if (saveAsMascotParameterSetFlag == null) { saveAsMascotParameterSetFlag = false; }
     157
    133158    log.debug("mascotParameterSetStorageId = " + mascotpssId);
    134     // Get the save Mascot parameter set flag
    135     Boolean saveMascotParameterSetFlag = getValidBoolean(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG);
    136     log.debug("saveMascotParameterSetFlag from request = " + saveMascotParameterSetFlag);
    137     if (saveMascotParameterSetFlag == null)
    138     {
    139       saveMascotParameterSetFlag = false;
    140     }
    141159    log.debug("saveMascotParameterSetFlag = " + saveMascotParameterSetFlag);
    142     // Get the "save as" Mascot parameter set flag
    143     Boolean saveAsMascotParameterSetFlag = getValidBoolean(SearchMascot.VSAVEASMASCOTPARAMETERSETFLAG);
    144     log.debug("saveAsMascotParameterSetFlag from request = " + saveAsMascotParameterSetFlag);
    145     if (saveAsMascotParameterSetFlag == null)
    146     {
    147       saveAsMascotParameterSetFlag = false;
    148     }
    149160    log.debug("saveAsMascotParameterSetFlag = " + saveAsMascotParameterSetFlag);
    150     String forwardId = getValidString(FormFactory.VFWDACTION);
    151     // Get the forward id
    152161    log.debug("forwardId = " + forwardId);
    153     /*
    154      * Get parameters that might need to be forwarded to next action
    155      */
    156     // Get the spectrum file items to use for the search
    157     List<Integer> spectrumFileIds = getValidIntegerList(SearchMascot.VSPECTRUMFILEID);
    158162    log.debug("spectrumFileIds = " + spectrumFileIds);
    159     // Get the Mascot web interface flag
    160     Boolean useWebInterfaceFlag = getValidBoolean(SearchMascot.VMASCOTUSEWEBINTERFACEFLAG);
    161     log.debug("useWebInterfaceFlag from request = " + useWebInterfaceFlag);
    162     // Get Mascot search user name
    163     String mascotSearchUserName = getValidString(SearchMascot.VMASCOT_SEARCH_USER_NAME);
    164     log.debug("mascotSearchUserName from request = \"" + mascotSearchUserName + "\"");
    165     // Get Mascot search user email
    166     String mascotSearchUserEmail = getValidString(SearchMascot.VMASCOT_SEARCH_USER_EMAIL);
    167     log.debug("mascotSearchUserEmail from request = \"" + mascotSearchUserEmail + "\"");
    168     //Integer eventId = getValidInteger(FormFactory.VID);
    169     DbControl dc = newDbControl();
    170     ItemFactory factory = getItemFactory(dc);
    171     //UpdateEvent ue = factory.getById(UpdateEvent.class, eventId);
    172     //MascotParameterSetStorage mascotpss = factory.getById(MascotParameterSetStorage.class, mascotpssId);
    173     MascotParameterSetStorage mascotpss = null;
     163  log.debug("useWebInterfaceFlag from request = " + useWebInterfaceFlag);
     164  log.debug("mascotSearchUserName from request = \"" + mascotSearchUserName + "\"");
     165  log.debug("mascotSearchUserEmail from request = \"" + mascotSearchUserEmail + "\"");
     166  // Here
     167    dc = newDbControl();
     168    factory = getItemFactory(dc);
     169    mascotpss = null;
    174170    if (mascotpssId != null)
    175171    {
     
    177173    }
    178174    // Fetch current Mascot parameter set from request
    179     MascotParameterSet mascotParameterSet = fetchCurrentMascotParameterSet();
    180     //
    181     String errorMessage = null;
     175    mascotParameterSet = fetchCurrentMascotParameterSet();
     176    //
     177    errorMessage = null;
    182178    if (saveAsMascotParameterSetFlag)
    183179    {
     
    193189        log.debug("mascotpss.getParameterFile() = \"" + mascotpss.getParameterFile() + "\"");
    194190        // MascotParameterSetStorage form
    195         //Form form = getFormFactory().getSaveAsMascotParameterSetStorageForm(mascotParameterSetStorage, mascotParameterSet);
    196         Form form = getFormFactory().getSaveAsMascotParameterSetStorageForm(mascotpss, mascotParameterSet);
     191        form = getFormFactory().getSaveAsMascotParameterSetStorageForm(mascotpss, mascotParameterSet);
    197192        // Toolbar
    198         Toolbar tb = new Toolbar();
     193        tb = new Toolbar();
    199194        // Save button
    200         String saveLabel = "Save";
    201         ActionLink saveAction = getActionFactory().getActionLink(SaveMascotParameterSetStorage.class, saveLabel);
    202         //saveAction.addParameter(ViewActiveMascotParameterSetStorage.VMASCOTPARAMETERSETSTORAGEID,
    203         //  mascotpssId);
     195        saveLabel = "Save";
     196        saveAction = getActionFactory().getActionLink(SaveMascotParameterSetStorage.class, saveLabel);
    204197        saveAction.addParameter(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG,
    205198          true);
     
    212205          for (Integer spectrumFileId : spectrumFileIds)
    213206          {
    214             saveAction.addParameter(SearchMascot.VSPECTRUMFILEID, spectrumFileId);
     207            form.getFieldsets().get(0).add(new TextField<Integer>(SearchMascot.VSPECTRUMFILEID, spectrumFileId).setHidden(true));
    215208          }
    216209        }
     
    227220        form.setToolbar(tb);
    228221        // Layout
    229         RowLayout layout = getLayoutFactory().getRowLayout();
     222        layout = getLayoutFactory().getRowLayout();
    230223        layout.add(new Title("SaveAsMascotParameterSetStorage"));
    231224        layout.add(form);
     
    391384      // Return to "Save As..." form and display error message
    392385      setError(errorMessage);
    393       String saveLabel = "Save";
    394       ActionLink action = getActionFactory().getActionLink(SaveMascotParameterSetStorage.class, saveLabel);
     386      saveLabel = "Save";
     387      action = getActionFactory().getActionLink(SaveMascotParameterSetStorage.class, saveLabel);
    395388      setAttribute(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG,
    396389        false);
     
    413406    {
    414407      log.debug("forwardId != null, calling setForwardTo(forwardId = " + forwardId + ")");
    415       ActionLink forwardLink = new ActionLink("forward",
     408      forwardLink = new ActionLink("forward",
    416409        forwardId);
    417410      forwardLink.addParameter(ViewActiveMascotParameterSetStorage.VMASCOTPARAMETERSETSTORAGEID, mascotpssId);
     
    434427    {
    435428      log.debug("forwardId == null, calling setForwardTo(ViewActiveMascotParameterSetStorage.class)");
    436       ActionLink forwardLink = getActionLink(ViewActiveMascotParameterSetStorage.class, "forward");
     429      forwardLink = getActionLink(ViewActiveMascotParameterSetStorage.class, "forward");
    437430      setForwardTo(forwardLink.getActionId());
    438431    }
  • trunk/client/servlet/src/org/proteios/action/mascot/SearchMascot.java

    r3763 r3768  
    270270      //job.setName(plugin.getName() + " File: " + file.getName());
    271271      //job.setDescription("Gel: " + gelId + " File: " + file.getName());
    272       job.setName(plugin.getName() + " Mascot Parameter Set: " + mascotpss.getName());
    273       job.setDescription("Mascot Parameter Set: " + mascotpss.getName() + "[" + mascotpss.getId() + "] Spectrum File: " + spectrumFile.getName() + "[" + spectrumFile.getId() + "]");
     272      job.setName("Mascot Search: " + mascotpss.getName());
     273      job.setDescription("Mascot Parameter Set: " + mascotpss.getName() + "[" + mascotpss.getId() + "]\n Spectrum File: " + spectrumFile.getName() + "[" + spectrumFile.getId() + "]");
    274274      //
    275275      StringParameterType mascotWebServerURLStrParam = new StringParameterType();
  • trunk/client/servlet/src/org/proteios/action/mascot/ViewActiveMascotParameterSetStorage.java

    r3767 r3768  
    3737import org.proteios.gui.form.Form;
    3838import org.proteios.gui.form.FormFactory;
     39import org.proteios.gui.form.Fieldset;
    3940import org.proteios.gui.form.Option;
     41import org.proteios.gui.form.TextField;
    4042import org.proteios.gui.layout.RowLayout;
    4143import org.proteios.io.MascotParameterSet;
     
    5052
    5153/**
    52  * @author olle
     54 * @author olle, gregory
    5355 */
    5456public class ViewActiveMascotParameterSetStorage
     
    108110  List<String> reportTopStringList;
    109111  List<Option> reportTopOptionList;
     112  Fieldset fs;
    110113  // Define
    111114
     
    218221     */
    219222    toolbar = new Toolbar();
     223  fs = mascotParameterSetForm.getFieldsets().get(0);
     224  fs.add(new TextField<Integer>(VMASCOTPARAMETERSETSTORAGEID, mascotpssId).setHidden(true));
     225  fs.add(new TextField<String>(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName).setHidden(true));
     226  fs.add(new TextField<String>(SearchMascot.VMASCOT_SEARCH_USER_EMAIL, mascotSearchUserEmail).setHidden(true));
     227
    220228    if (spectrumFileIds == null)
    221229    {
    222230      // Save Mascot parameter set button
    223231      save = getActionLink(SaveMascotParameterSetStorage.class, "Save");
    224       save.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId);
    225       save.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName);
    226       save.addParameter(SearchMascot.VMASCOT_SEARCH_USER_EMAIL, mascotSearchUserEmail);
    227232      save.addParameter(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG, true);
    228233      save.addParameter(FormFactory.VFWDACTION, ViewActiveMascotParameterSetStorage.class.getName());
     
    230235      // "Save As" Mascot parameter set button
    231236      saveAs = getActionLink(SaveMascotParameterSetStorage.class, "SaveAs");
    232       saveAs.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId);
    233       saveAs.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName);
    234       saveAs.addParameter(SearchMascot.VMASCOT_SEARCH_USER_EMAIL, mascotSearchUserEmail);
    235237      saveAs.addParameter(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG, false);
    236238      saveAs.addParameter(SearchMascot.VSAVEASMASCOTPARAMETERSETFLAG, true);
     
    240242    else
    241243    {
     244   // Add file ids as hidden fields to the form
     245      for (Integer spectrumFileId : spectrumFileIds)
     246      {
     247    TextField<Integer> hiddenFileField = new TextField<Integer>(SearchMascot.VSPECTRUMFILEID, spectrumFileId).setHidden(true);
     248        fs.add(hiddenFileField);
     249      }
     250   fs.add(new TextField<Boolean>(SearchMascot.VMASCOTUSEWEBINTERFACEFLAG, useWebInterfaceFlag).setHidden(true));
    242251      // Save and Search Mascot
    243252      searchMascot = getActionLink(SaveMascotParameterSetStorage.class, "SaveAndSearchMascot");
    244       searchMascot.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId);
    245       searchMascot.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName);
    246       searchMascot.addParameter(SearchMascot.VMASCOT_SEARCH_USER_EMAIL, mascotSearchUserEmail);
    247253      searchMascot.addParameter(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG, true);
    248254      searchMascot.addParameter(FormFactory.VFWDACTION, SearchMascot.class.getName());
    249       for (Integer spectrumFileId : spectrumFileIds)
    250       {
    251         searchMascot.addParameter(SearchMascot.VSPECTRUMFILEID, spectrumFileId);
    252       }
    253       searchMascot.addParameter(SearchMascot.VMASCOTUSEWEBINTERFACEFLAG, useWebInterfaceFlag);
    254255      toolbar.add(searchMascot);
    255256      // "Save As" and Search Mascot
    256257      saveAsAndSearchMascot = getActionLink(SaveMascotParameterSetStorage.class, "SaveAsAndSearchMascot");
    257       saveAsAndSearchMascot.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId);
    258       saveAsAndSearchMascot.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName);
    259       saveAsAndSearchMascot.addParameter(SearchMascot.VMASCOT_SEARCH_USER_EMAIL, mascotSearchUserEmail);
    260258      saveAsAndSearchMascot.addParameter(SearchMascot.VSAVEMASCOTPARAMETERSETFLAG, false);
    261259      saveAsAndSearchMascot.addParameter(SearchMascot.VSAVEASMASCOTPARAMETERSETFLAG, true);
    262260      saveAsAndSearchMascot.addParameter(FormFactory.VFWDACTION, SearchMascot.class.getName());
    263       for (Integer spectrumFileId : spectrumFileIds)
    264       {
    265         saveAsAndSearchMascot.addParameter(SearchMascot.VSPECTRUMFILEID, spectrumFileId);
    266       }
    267       saveAsAndSearchMascot.addParameter(SearchMascot.VMASCOTUSEWEBINTERFACEFLAG, useWebInterfaceFlag);
    268261      toolbar.add(saveAsAndSearchMascot);
    269262    }
  • trunk/client/servlet/src/org/proteios/gui/form/TextField.java

    r3593 r3768  
    5252
    5353
    54   public TextField(VParameter vemail)
     54  public TextField(VParameter vparam)
    5555  {
    56     super(vemail);
     56    super(vparam);
     57  }
     58
     59  public TextField(VParameter vparam, D value)
     60  {
     61    super(vparam);
     62  setValue(value);
    5763  }
    5864
Note: See TracChangeset for help on using the changeset viewer.