Changeset 3598
- Timestamp:
- Jul 25, 2007, 8:19:55 AM (16 years ago)
- Location:
- trunk/src/plugins/core/net/sf/basedb/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/core/net/sf/basedb/plugins/AbstractFlatFileImporter.java
r3588 r3598 326 326 */ 327 327 protected static final PluginParameter<String> complexMappings = new PluginParameter<String>( 328 "complex Mappings",328 "complexExpressions", 329 329 "Complex column mappings", 330 330 "disallow = Only allow simple mappings that are constant value or pick the value " + -
trunk/src/plugins/core/net/sf/basedb/plugins/AnnotationFlatFileImporter.java
r3588 r3598 443 443 // Check that a mapping for name OR external ID is given 444 444 boolean hasExternalId = context == null || hasExternalId(context.getItem()); 445 String nameMapping = (String)request.getParameterValue("nameColumnMapping"); 446 String externalIdMapping = (String)request.getParameterValue("externalIdColumnMapping"); 445 447 if (hasExternalId) 446 448 { 447 if (request.getParameterValue("nameColumnMapping") == null && 448 request.getParameterValue("externalIdColumnMapping") == null) 449 if (nameMapping == null && externalIdMapping == null) 449 450 { 450 451 response.setError("A mapping for either 'Name' or 'External Id' must be given.", null); 451 452 return; 452 453 } 453 if (request.getParameterValue("nameColumnMapping") != null && 454 request.getParameterValue("externalIdColumnMapping") != null) 454 if (nameMapping != null && externalIdMapping != null) 455 455 { 456 456 response.setError("It is not possible to use a mapping for both 'Name' and 'External Id'.", null); … … 458 458 } 459 459 } 460 460 // Check the mapping expressions 461 boolean allowComplex = "allow".equals(request.getParameterValue(complexMappings.getName())); 462 checkColumnMapping(nameMapping, allowComplex, requiredNameColumnMapping.getLabel()); 463 checkColumnMapping(externalIdMapping, allowComplex, externalIdColumnMapping.getLabel()); 464 461 465 // Everything is ok, save values 462 466 if (forJob) storeValue(wrapper, request, fileParameter); … … 470 474 storeValue(wrapper, request, ri.getParameter(CHARSET)); 471 475 storeValue(wrapper, request, ri.getParameter(DECIMAL_SEPARATOR)); 476 477 // Column mappings 478 storeValue(wrapper, request, complexMappings); 472 479 if (hasExternalId) 473 480 { … … 879 886 // Mappings for Name and External ID 880 887 parameters.add(mappingSection); 888 parameters.add(complexMappings); 881 889 if (context == null || hasExternalId(context.getItem())) 882 890 {
Note: See TracChangeset
for help on using the changeset viewer.