Changeset 815
- Timestamp:
- 06/23/2009 03:08:40 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 7 modified
-
ch.ehermes.core/src/ch/ehermes/core/EPFUtil.java (modified) (1 diff)
-
ch.ehermes.epf.import.ui/plugin.properties (modified) (1 diff)
-
ch.ehermes.epf.import.ui/plugin_de.properties (modified) (1 diff)
-
ch.ehermes.epf.import.ui/plugin_fr.properties (modified) (1 diff)
-
ch.ehermes.epf.import.ui/src/ch/ehermes/epf/importing/ui/SelectWBSPage.java (modified) (4 diffs)
-
ch.ehermes.epf.import.ui/src/ch/ehermes/epf/importing/wbs/ImportWBSWizard.java (modified) (3 diffs)
-
ch.ehermes.epf.import/src/ch/ehermes/epf/importing/ImportWBS.java (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ch.ehermes.core/src/ch/ehermes/core/EPFUtil.java
r800 r815 275 275 { 276 276 String search = toks.nextToken().trim(); 277 String title = search;278 277 int p = search.indexOf('.'); 279 278 if ( p != -1 ) 280 { 281 search = title.substring( 0, p ); 282 title = title.substring(0, p) + "(" + title.substring(p+1) + ")"; 283 } 279 search = search.substring( 0, p ); 284 280 if ( list == null ) 285 281 list = new LinkedHashMap(); 286 282 287 ContentElement element = find WorkProductByPresentationName(pkg, search);283 ContentElement element = findContentElement( pkg, EPFUtil.makeValidLink( search ), WorkProduct.class ); 288 284 list.put( search, element ); 289 285 } -
trunk/ch.ehermes.epf.import.ui/plugin.properties
r766 r815 17 17 SelectedFilesPage_ASP_Source_Roles=Roles (option) 18 18 SelectedFilesPage_ASP_Source_WorkProducts=Work Products (option) 19 SelectedFilesPage_RollUp_Option=RollUp (Arbeitsschritte konsolidieren) 19 20 20 21 # Import HERMES xTract -
trunk/ch.ehermes.epf.import.ui/plugin_de.properties
r766 r815 17 17 SelectedFilesPage_ASP_Source_Roles=Rollen (optional) 18 18 SelectedFilesPage_ASP_Source_WorkProducts=Ergebnisse (optional) 19 SelectedFilesPage_RollUp_Option=RollUp (Arbeitsschritte konsolidieren) 19 20 20 21 # Import HERMES xTract -
trunk/ch.ehermes.epf.import.ui/plugin_fr.properties
r766 r815 17 17 SelectedFilesPage_ASP_Source_Roles=Roles (option) 18 18 SelectedFilesPage_ASP_Source_WorkProducts=Résultats (option) 19 SelectedFilesPage_RollUp_Option=RollUp (Consolider les étapes de travail) 19 20 20 21 # Import HERMES xTract -
trunk/ch.ehermes.epf.import.ui/src/ch/ehermes/epf/importing/ui/SelectWBSPage.java
r729 r815 16 16 import java.io.File; 17 17 18 import org.eclipse.gmf.runtime.common.ui.preferences.CheckBoxFieldEditor; 18 19 import org.eclipse.jface.preference.FileFieldEditor; 19 20 import org.eclipse.jface.preference.IPreferenceStore; … … 42 43 protected StringFieldEditor wbsEditorRoles; 43 44 protected StringFieldEditor wbsEditorWorkProducts; 45 protected CheckBoxFieldEditor rollUpOptionEditor; 44 46 45 47 public SelectWBSPage() … … 88 90 .getDefault().getPreferenceStore().getString( "wbsSelectWorkProducts" ) : "" ); 89 91 92 rollUpOptionEditor = new CheckBoxFieldEditor( "rollUpOptionEditor", ImportUIPlugin.getDefault() 93 .getString( "SelectedFilesPage_RollUp_Option" ), fileSelectionArea ); 94 90 95 fileSelectionArea.moveAbove( null ); 91 96 setControl( fileSelectionArea ); … … 117 122 { 118 123 return ( wbsEditorWorkProducts.getStringValue() ); 119 } 124 } 125 126 public boolean getRollUpOption() 127 { 128 return ( rollUpOptionEditor.getBooleanValue() ); 129 } 120 130 121 131 /** -
trunk/ch.ehermes.epf.import.ui/src/ch/ehermes/epf/importing/wbs/ImportWBSWizard.java
r788 r815 132 132 String wbsRoles; 133 133 String wbsWorkProducts; 134 boolean rollUpOption; 134 135 135 136 public ImportOperation() … … 143 144 wbsRoles = wbsPage.getWbsRoles(); 144 145 wbsWorkProducts = wbsPage.getWbsWorkProducts(); 146 rollUpOption = wbsPage.getRollUpOption(); 145 147 } 146 148 … … 175 177 176 178 // import WBS 177 wbs.importWBSSheet( context, contentRoot, null, wbsFilename, wbsSheetname, monitor );179 wbs.importWBSSheet( context, contentRoot, null, wbsFilename, wbsSheetname, rollUpOption, monitor ); 178 180 179 181 monitor.done(); -
trunk/ch.ehermes.epf.import/src/ch/ehermes/epf/importing/ImportWBS.java
r814 r815 23 23 import java.util.List; 24 24 import java.util.Map; 25 import java.util.StringTokenizer; 25 26 26 27 import org.apache.poi.hssf.usermodel.HSSFWorkbook; … … 71 72 public class ImportWBS extends ImportContent 72 73 { 74 // rollUP steps, default = no 75 private boolean rollUp = false; 76 73 77 public ImportWBS(MethodPlugin plugin, MethodConfiguration config, MultiStatus messages, IProgressMonitor monitor) 74 78 { … … 139 143 // import the others WBS categories (medium, small) 140 144 if ( sheets.length > 1 && sheets[1].trim().length() > 0 ) 141 wbs.importWBSSheet( context, contentRoot, customRoot, wbsFile, sheets[1], monitor );145 wbs.importWBSSheet( context, contentRoot, customRoot, wbsFile, sheets[1], false, monitor ); 142 146 if ( sheets.length > 2 && sheets[2].trim().length() > 0 ) 143 wbs.importWBSSheet( context, contentRoot, customRoot, wbsFile, sheets[2], monitor );147 wbs.importWBSSheet( context, contentRoot, customRoot, wbsFile, sheets[2], false, monitor ); 144 148 145 149 monitor.done(); … … 147 151 148 152 public void importWBSSheet(MethodConfiguration context, ContentPackage[] contentRoot, CustomCategory customRoot, String wbsFile, String sheetName, 149 IProgressMonitor monitor) throws Exception 150 { 153 boolean rollUp, IProgressMonitor monitor) throws Exception 154 { 155 this.rollUp = rollUp; 156 151 157 // load Excel WBS 152 158 WBSRoot sheet = loadWBS( contentRoot, wbsFile, sheetName, monitor ); … … 312 318 { 313 319 case ACTIVITY_NODE: 314 /* rollUp( name, phase, phasePkg, activityNode ); 315 break;*/ 320 if ( rollUp ) 321 { 322 rollUp( name, phase, phasePkg, activityNode ); 323 break; 324 } 316 325 Activity activity = UmaFactory.eINSTANCE.createActivity(); 317 326 activity.setName( EPFUtil.makeValidLink(activityNode.name) ); … … 843 852 if ( entry.getValue() != null ) 844 853 list.put( entry.getKey(), entry.getValue() ); 845 else 846 addMessage( IStatus.WARNING, "warning_missing_workproduct", name + ": " + task ); 847 } 848 } 854 } 855 } 856 // Not all workproducts found in step without chapters (workproducts.chapter) 857 HashSet<String> wp = new HashSet<String>(); 858 StringTokenizer tokens = new StringTokenizer( name, ",\n" ); 859 while ( tokens.hasMoreTokens() ) 860 { 861 String search = tokens.nextToken().trim(); 862 String title = search; 863 int p = search.indexOf('.'); 864 if ( p != -1 ) 865 search = title.substring( 0, p ); 866 wp.add( search ); 867 } 868 if ( wp.size() > list.size() ) 869 addMessage( IStatus.WARNING, "warning_missing_workproduct", name + ": " + task ); 870 849 871 return ( list ); 850 872 } … … 860 882 if ( l != null ) 861 883 list.addAll( l ); 862 else 863 addMessage( IStatus.WARNING, "warning_missing_role", name + ": " + task ); 864 } 884 } 885 // Not all roles found in step 886 if ( new StringTokenizer( name, ",\n" ).countTokens() > list.size() ) 887 addMessage( IStatus.WARNING, "warning_missing_role", name + ": " + task ); 888 865 889 return ( list ); 866 890 }
