Changeset 3805
- Timestamp:
- Sep 1, 2010, 9:17:58 AM (13 years ago)
- Location:
- trunk/client/servlet/src/org/proteios
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/action/file/ListFilePlugins.java
r2399 r3805 35 35 import org.proteios.gui.Title; 36 36 import org.proteios.gui.Toolbar; 37 import org.proteios.gui.form. Form;37 import org.proteios.gui.form.*; 38 38 import org.proteios.gui.layout.RowLayout; 39 39 import se.lu.thep.waf.ActionException; … … 63 63 Integer fileId = getSessionAttribute(ViewActiveFile.VFILEID); 64 64 File file = factory.getById(File.class, fileId); 65 Form form = getFormFactory().getImportFileForm(file);65 Form form = new ImportFileForm(file); 66 66 /*********************************************************************** 67 67 * Toolbar -
trunk/client/servlet/src/org/proteios/action/plugin/CreateFileImportJob.java
r1916 r3805 36 36 import org.proteios.core.Job; 37 37 import org.proteios.core.PluginDefinition; 38 import org.proteios.gui.form.Form; 39 import org.proteios.gui.form.FormFactory; 38 import org.proteios.gui.form.*; 40 39 import se.lu.thep.waf.ActionException; 41 40 import se.lu.thep.waf.constraints.InvalidParameterValue; … … 57 56 * Verify parameters 58 57 */ 59 Form form = getFormFactory().getImportFileForm(null); 60 verifyParameters(form); 61 Integer fileId = getValidInteger(FormFactory.VID); 62 Integer pluginDefId = getValidInteger(FormFactory.VPLUGINDEFID); 58 Integer fileId = getValidInteger(ItemIdField.VPARAM); 59 Integer pluginDefId = getValidInteger(ImportPluginSelect.VPARAM); 63 60 /*********************************************************************** 64 61 * Create job -
trunk/client/servlet/src/org/proteios/gui/form/FileTypeForm.java
r3804 r3805 2 2 $Id$ 3 3 4 Copyright (C) 20 06, 2007,2009Gregory Vincic4 Copyright (C) 2010 Gregory Vincic 5 5 6 6 Files are copyright by their respective authors. The contributions to … … 11 11 Available at http://www.proteios.org/ 12 12 13 proteios-2.xis free software; you can redistribute it and/or13 Proteios is free software; you can redistribute it and/or 14 14 modify it under the terms of the GNU General Public License 15 15 as published by the Free Software Foundation; either version 2 -
trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java
r3804 r3805 179 179 /** 180 180 * Generates various forms used in the gui. It also populates forms from 181 * requests. 181 * requests. NOTE! this class will be deprecated shortly 182 182 * 183 183 * @author gregory 184 * @deprecated Do not use this class. Create your own form classes in package org.proteios.gui.form or reuse the existing ones.185 184 */ 186 185 public class FormFactory … … 241 240 1, 255, false); 242 241 public static final VInteger VPLUGINDEFID = new VInteger("definitionId", 1, 243 true); 242 true); // Remove 244 243 public static final VDate VCDATE = new VDate("created", false, 245 244 Format.DATETIME); … … 1119 1118 // Cleaning up from here 1120 1119 1121 private Select<VInteger> selectImportPlugins(DbControl dc,1122 Plugin.MainType... types)1123 {1124 Select<VInteger> typeS = new Select<VInteger>(VPLUGINDEFID);1125 typeS.setLabel("Plugin");1126 if (dc != null && dc.isConnected())1127 {1128 ItemQuery<PluginDefinition> query = PluginDefinition.getQuery();1129 query.include(Include.SHARED);1130 Expression[] exp = new Expression[types.length];1131 int i = 0;1132 for (MainType type : types)1133 {1134 exp[i] = Expressions.integer(type.getValue());1135 i++;1136 }1137 query.restrict(Restrictions.in(Hql.property("mainType"), exp));1138 query.order(Orders.asc(Hql.property("mainType")));1139 for (PluginDefinition pd : query.list(dc))1140 {1141 Option o = new Option(pd.getId(), pd.getName());1142 typeS.addOption(o);1143 }1144 }1145 return typeS;1146 }1147 1148 1149 /**1150 * @param file the file to import1151 * @return Form representing the import plugins for a file1152 */1153 public Form getImportFileForm(File file)1154 {1155 Fieldset fs = new Fieldset();1156 fs.getLegendTitle().setTitle("ImportPlugins");1157 // id1158 TextField<Integer> itemIdF = newHiddenItemIdField();1159 fs.add(itemIdF);1160 // Select field1161 if (file != null)1162 {1163 itemIdF.setValue(file.getId());1164 Select<VInteger> typeS = selectImportPlugins(file.getDbControl(),1165 Plugin.MainType.IMPORT);1166 fs.add(typeS);1167 }1168 /***********************************************************************1169 * Form1170 */1171 Form form = new Form("importPluginsForm");1172 form.setTitle("File plugins");1173 form.addFieldset(fs);1174 return form;1175 }1176 1177 1178 1120 public Form getSelectPluginForm(DbControl dc, Plugin.MainType... types) 1179 1121 { … … 1182 1124 if (dc != null) 1183 1125 { 1184 Select<VInteger> typeS = selectImportPlugins(dc, types);1126 Select<VInteger> typeS = new ImportPluginSelect(dc, types); 1185 1127 fs.add(typeS); 1186 1128 } … … 2901 2843 properties.add(getPlateExternalIdField()); 2902 2844 // Selector of plugins 2903 properties.add( selectImportPlugins(dc, Plugin.MainType.IMPORT,2845 properties.add(new ImportPluginSelect(dc, Plugin.MainType.IMPORT, 2904 2846 Plugin.MainType.OTHER)); 2905 2847 //
Note: See TracChangeset
for help on using the changeset viewer.