Changeset 2147
- Timestamp:
- Apr 4, 2006, 11:21:54 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/test/NullPlugin.java
r1789 r2147 25 25 import net.sf.basedb.core.Item; 26 26 import net.sf.basedb.core.BaseException; 27 import net.sf.basedb.core.Path; 28 import net.sf.basedb.core.PathParameterType; 27 29 import net.sf.basedb.core.PluginParameter; 28 30 import net.sf.basedb.core.ProgressReporter; … … 216 218 new FileParameterType(null, false, 0) 217 219 ); 220 221 private static final PluginParameter<String> oneDirectory = new PluginParameter<String>( 222 "oneDirectory", "Save to directory", "Please specify the output directory where the plugin should store it's generated files", 223 new PathParameterType(Path.Type.DIRECTORY) 224 ); 225 226 private static final PluginParameter<String> onePath = new PluginParameter<String>( 227 "onePath", "Save as", "Please specify the file name where the plugin should store it's output", 228 new PathParameterType(Path.Type.FILE) 229 ); 218 230 219 231 private RequestInformation configurePlugin; … … 307 319 parameters.add(oneFile); 308 320 parameters.add(manyFiles); 321 parameters.add(oneDirectory); 322 parameters.add(onePath); 309 323 310 324 configurePlugin = new RequestInformation( -
trunk/www/common/plugin/configure.jsp
r2126 r2147 50 50 import="net.sf.basedb.core.BooleanParameterType" 51 51 import="net.sf.basedb.core.FileParameterType" 52 import="net.sf.basedb.core.PathParameterType" 52 53 import="net.sf.basedb.core.ItemContext" 54 import="net.sf.basedb.core.Path" 53 55 import="net.sf.basedb.clients.web.Base" 54 56 import="net.sf.basedb.clients.web.WebException" … … 417 419 valueOnBlur(path); 418 420 } 421 function saveAsOnClick(inputName) 422 { 423 var frm = document.forms['configure']; 424 var url = '../../filemanager/index.jsp?ID=<%=ID%>&cmd=SaveAs&callback=saveAsCallback'; 425 lastFileInputName = inputName; 426 Main.openPopup(url, 'SaveAs', 1000, 700); 427 } 428 function saveAsCallback(path) 429 { 430 var frm = document.forms['configure']; 431 frm[lastFileInputName].value = path; 432 valueOnBlur(path); 433 } 434 function selectDirectoryOnClick(inputName) 435 { 436 var frm = document.forms['configure']; 437 var url = '../../filemanager/directories/index.jsp?ID=<%=ID%>&mode=selectonedirectory&callback=setFileCallback'; 438 lastFileInputName = inputName; 439 Main.openPopup(url, 'SelectDirectory', 350, 500); 440 } 441 419 442 function hideErrorList() 420 443 { … … 813 836 } 814 837 } 838 else if (pType instanceof PathParameterType) 839 { 840 PathParameterType ppType = (PathParameterType)pType; 841 String browse = ""; 842 if (ppType.getPathType() == Path.Type.FILE) 843 { 844 browse = "saveAsOnClick('" + inputName + "')"; 845 } 846 else 847 { 848 browse = "selectDirectoryOnClick('" + inputName + "')"; 849 } 850 %> 851 <table border="0" cellspacing="0" cellpadding="0"> 852 <tr> 853 <td> 854 <input type="text" class="text" name="<%=inputName%>" size="40" value="" 855 onblur="valueOnBlur(this.value)"> </td> 856 <td><base:button 857 title="Browse…" 858 onclick="<%=browse%>" 859 /> 860 </td> 861 </tr> 862 </table> 863 <% 864 } 815 865 else 816 866 { -
trunk/www/common/plugin/index.jsp
r1945 r2147 44 44 import="net.sf.basedb.core.BooleanParameterType" 45 45 import="net.sf.basedb.core.FileParameterType" 46 import="net.sf.basedb.core.PathParameterType" 46 47 import="net.sf.basedb.core.File" 47 48 import="net.sf.basedb.core.Path" … … 306 307 dc.close(); 307 308 } 309 else if (pType instanceof PathParameterType) 310 { 311 oValues = sValues; 312 } 308 313 } 309 314 pcRequest.setParameterValues(param.getName(), oValues == null ? null : Arrays.asList(oValues));
Note: See TracChangeset
for help on using the changeset viewer.