Changeset 5242
- Timestamp:
- Feb 11, 2010, 11:05:48 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/core/net/sf/basedb/plugins/ReporterFlatFileImporter.java
r5241 r5242 328 328 storeValue(configuration, request, complexMappings); 329 329 boolean allowComplex = "allow".equals(request.getParameterValue(complexMappings.getName())); 330 for (PluginParameter<String> pp : getAllColumnMappings( ))330 for (PluginParameter<String> pp : getAllColumnMappings(false)) 331 331 { 332 332 String mapExpression = (String)request.getParameterValue(pp.getName()); … … 348 348 return; 349 349 } 350 if (context != null && 351 (context.getItem() == Item.REPORTERLIST || context.getItem() == Item.REPORTERSCORE)) 350 351 boolean reporterListContext = context != null && 352 (context.getItem() == Item.REPORTERLIST || context.getItem() == Item.REPORTERSCORE); 353 if (reporterListContext) 352 354 { 353 355 storeValue(job, request, reporterListParameter); … … 371 373 storeValue(job, request, complexMappings); 372 374 boolean allowComplex = "allow".equals(request.getParameterValue(complexMappings.getName())); 373 for (PluginParameter<String> pp : getAllColumnMappings( ))375 for (PluginParameter<String> pp : getAllColumnMappings(reporterListContext)) 374 376 { 375 377 String mapExpression = (String)request.getParameterValue(pp.getName()); … … 439 441 extendedProperties = ExtendedProperties.getProperties("ReporterData"); 440 442 batcher = ReporterBatcher.getNew(dc); 441 reporterType = (ReporterType) configuration.getValue("reporterType");443 reporterType = (ReporterType)getJobOrConfigurationValue("reporterType"); 442 444 reporterList = (ReporterList)job.getValue("reporterList"); 443 445 String mode = (String)job.getValue("mode"); … … 537 539 { 538 540 ReporterData reporter = batcher.getByExternalId(entry.getKey()); 539 reporterList.addReporter(reporter, entry.getValue()); 540 numAddedToList++; 541 if (reporterList.addReporter(reporter, entry.getValue())) 542 { 543 numAddedToList++; 544 } 541 545 } 542 546 } … … 644 648 else 645 649 { 646 reporterList.addReporter(reporter, score); 647 numAddedToList++; 650 if (reporterList.addReporter(reporter, score)) 651 { 652 numAddedToList++; 653 } 648 654 } 649 655 } … … 732 738 // ------------------------------------------- 733 739 734 private List<PluginParameter<String>> getAllColumnMappings( )740 private List<PluginParameter<String>> getAllColumnMappings(boolean reporterListContext) 735 741 { 736 742 if (allColumnMappings == null) … … 738 744 // Column mappings 739 745 allColumnMappings = new ArrayList<PluginParameter<String>>(); 740 allColumnMappings.add(nameColumnMapping); 741 allColumnMappings.add(reporterIdColumnMapping); 742 allColumnMappings.add(descriptionColumnMapping); 743 allColumnMappings.add(symbolColumnMapping); 744 allColumnMappings.add(scoreColumnMapping); 745 allColumnMappings.add(reporterTypeColumnMapping); 746 List<ExtendedProperty> extended = ExtendedProperties.getProperties("ReporterData"); 747 if (extended != null) 748 { 749 for (ExtendedProperty ep : extended) 750 { 751 allColumnMappings.add( 752 new PluginParameter<String>( 753 "extendedColumnMapping."+ep.getName(), 754 ep.getTitle(), 755 ep.getDescription(), 756 optionalColumnMapping 757 ) 758 ); 746 if (reporterListContext) 747 { 748 allColumnMappings.add(reporterIdColumnMapping); 749 allColumnMappings.add(scoreColumnMapping); 750 } 751 else 752 { 753 allColumnMappings.add(nameColumnMapping); 754 allColumnMappings.add(reporterIdColumnMapping); 755 allColumnMappings.add(descriptionColumnMapping); 756 allColumnMappings.add(symbolColumnMapping); 757 allColumnMappings.add(reporterTypeColumnMapping); 758 List<ExtendedProperty> extended = ExtendedProperties.getProperties("ReporterData"); 759 if (extended != null) 760 { 761 for (ExtendedProperty ep : extended) 762 { 763 allColumnMappings.add( 764 new PluginParameter<String>( 765 "extendedColumnMapping."+ep.getName(), 766 ep.getTitle(), 767 ep.getDescription(), 768 optionalColumnMapping 769 ) 770 ); 771 } 759 772 } 760 773 } … … 843 856 parameters.add(cloneParameterWithDefaultValue(maxDataColumnsParameter)); 844 857 parameters.add(Parameters.charsetParameter(null, null, 845 (String) configuration.getValue(Parameters.CHARSET_PARAMETER)));858 (String)getJobOrConfigurationValue(Parameters.CHARSET_PARAMETER))); 846 859 parameters.add(Parameters.decimalSeparatorParameter(null, null, 847 (String) configuration.getValue(Parameters.DECIMAL_SEPARATOR_PARAMETER)));860 (String)getJobOrConfigurationValue(Parameters.DECIMAL_SEPARATOR_PARAMETER))); 848 861 849 862 // Column mappings 850 863 parameters.add(mappingSection); 851 864 parameters.add(complexMappings); 852 parameters.addAll(getAllColumnMappings( ));865 parameters.addAll(getAllColumnMappings(reporterListContext)); 853 866 854 867 parameters.add(errorSection); … … 914 927 parameters.add(mappingSection); 915 928 parameters.add(complexMappings); 916 parameters.addAll(getAllColumnMappings( ));929 parameters.addAll(getAllColumnMappings(false)); 917 930 918 931 configurePlugin = new RequestInformation
Note: See TracChangeset
for help on using the changeset viewer.