Changeset 815

Show
Ignore:
Timestamp:
06/23/2009 03:08:40 PM (15 months ago)
Author:
mbern
Message:

RollUp? beim Import ASP eingebaut
Suche nach vorhanden WorkProducts? findet jetzt mit Name statt Praesentationsname statt

Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/ch.ehermes.core/src/ch/ehermes/core/EPFUtil.java

    r800 r815  
    275275        { 
    276276            String search = toks.nextToken().trim(); 
    277             String title = search; 
    278277            int p = search.indexOf('.'); 
    279278            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 ); 
    284280            if  ( list == null ) 
    285281                list = new LinkedHashMap(); 
    286282             
    287             ContentElement element = findWorkProductByPresentationName(pkg, search ); 
     283            ContentElement element = findContentElement( pkg, EPFUtil.makeValidLink( search ), WorkProduct.class ); 
    288284            list.put( search, element ); 
    289285        } 
  • trunk/ch.ehermes.epf.import.ui/plugin.properties

    r766 r815  
    1717SelectedFilesPage_ASP_Source_Roles=Roles (option) 
    1818SelectedFilesPage_ASP_Source_WorkProducts=Work Products (option) 
     19SelectedFilesPage_RollUp_Option=RollUp (Arbeitsschritte konsolidieren) 
    1920 
    2021# Import HERMES xTract 
  • trunk/ch.ehermes.epf.import.ui/plugin_de.properties

    r766 r815  
    1717SelectedFilesPage_ASP_Source_Roles=Rollen (optional) 
    1818SelectedFilesPage_ASP_Source_WorkProducts=Ergebnisse (optional) 
     19SelectedFilesPage_RollUp_Option=RollUp (Arbeitsschritte konsolidieren) 
    1920 
    2021# Import HERMES xTract 
  • trunk/ch.ehermes.epf.import.ui/plugin_fr.properties

    r766 r815  
    1717SelectedFilesPage_ASP_Source_Roles=Roles (option) 
    1818SelectedFilesPage_ASP_Source_WorkProducts=Résultats (option) 
     19SelectedFilesPage_RollUp_Option=RollUp (Consolider les étapes de travail) 
    1920 
    2021# Import HERMES xTract 
  • trunk/ch.ehermes.epf.import.ui/src/ch/ehermes/epf/importing/ui/SelectWBSPage.java

    r729 r815  
    1616import java.io.File; 
    1717 
     18import org.eclipse.gmf.runtime.common.ui.preferences.CheckBoxFieldEditor; 
    1819import org.eclipse.jface.preference.FileFieldEditor; 
    1920import org.eclipse.jface.preference.IPreferenceStore; 
     
    4243    protected StringFieldEditor wbsEditorRoles; 
    4344    protected StringFieldEditor wbsEditorWorkProducts; 
     45    protected CheckBoxFieldEditor rollUpOptionEditor; 
    4446 
    4547    public SelectWBSPage() 
     
    8890                        .getDefault().getPreferenceStore().getString( "wbsSelectWorkProducts" ) : "" ); 
    8991 
     92        rollUpOptionEditor = new CheckBoxFieldEditor( "rollUpOptionEditor", ImportUIPlugin.getDefault() 
     93                        .getString( "SelectedFilesPage_RollUp_Option" ), fileSelectionArea ); 
     94         
    9095        fileSelectionArea.moveAbove( null ); 
    9196        setControl( fileSelectionArea ); 
     
    117122    { 
    118123        return  ( wbsEditorWorkProducts.getStringValue() ); 
    119     }     
     124    }  
     125     
     126    public boolean getRollUpOption() 
     127    { 
     128        return  ( rollUpOptionEditor.getBooleanValue() ); 
     129    } 
    120130 
    121131    /** 
  • trunk/ch.ehermes.epf.import.ui/src/ch/ehermes/epf/importing/wbs/ImportWBSWizard.java

    r788 r815  
    132132        String wbsRoles; 
    133133        String wbsWorkProducts; 
     134        boolean rollUpOption; 
    134135 
    135136        public ImportOperation() 
     
    143144            wbsRoles = wbsPage.getWbsRoles(); 
    144145            wbsWorkProducts = wbsPage.getWbsWorkProducts(); 
     146            rollUpOption = wbsPage.getRollUpOption(); 
    145147        } 
    146148 
     
    175177 
    176178                // import WBS 
    177                 wbs.importWBSSheet( context, contentRoot, null, wbsFilename, wbsSheetname, monitor ); 
     179                wbs.importWBSSheet( context, contentRoot, null, wbsFilename, wbsSheetname, rollUpOption, monitor ); 
    178180                 
    179181                monitor.done(); 
  • trunk/ch.ehermes.epf.import/src/ch/ehermes/epf/importing/ImportWBS.java

    r814 r815  
    2323import java.util.List; 
    2424import java.util.Map; 
     25import java.util.StringTokenizer; 
    2526 
    2627import org.apache.poi.hssf.usermodel.HSSFWorkbook; 
     
    7172public class ImportWBS extends ImportContent 
    7273{ 
     74    // rollUP steps, default = no 
     75    private boolean rollUp = false; 
     76     
    7377    public ImportWBS(MethodPlugin plugin, MethodConfiguration config, MultiStatus messages, IProgressMonitor monitor) 
    7478    { 
     
    139143        // import the others WBS categories (medium, small) 
    140144        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 ); 
    142146        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 );         
    144148 
    145149        monitor.done(); 
     
    147151     
    148152    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         
    151157        // load Excel WBS 
    152158        WBSRoot sheet = loadWBS( contentRoot, wbsFile, sheetName, monitor ); 
     
    312318                { 
    313319                    case    ACTIVITY_NODE: 
    314 /*                        rollUp( name, phase, phasePkg, activityNode ); 
    315                         break;*/ 
     320                        if  ( rollUp ) 
     321                        { 
     322                            rollUp( name, phase, phasePkg, activityNode ); 
     323                            break; 
     324                        } 
    316325                        Activity activity = UmaFactory.eINSTANCE.createActivity(); 
    317326                        activity.setName( EPFUtil.makeValidLink(activityNode.name) ); 
     
    843852                    if  ( entry.getValue() != null ) 
    844853                        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         
    849871        return  ( list ); 
    850872    } 
     
    860882            if  ( l != null ) 
    861883                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         
    865889        return  ( list ); 
    866890    }