private void processItem ( final MasterServer app, final Item item ) { if ( item.getInformation () == null ) { return; } final EList<String> hier = item.getInformation ().getHierarchy (); if ( hier.isEmpty () ) { return; } final SummaryGroup group = getSummaryGroup ( null, app.getSummaryGroups (), new LinkedList<> ( hier ) ); if ( group == null ) { return; } group.getItems ().add ( item ); }
protected void processGroup ( final MasterServer app, final SummaryGroup group, final AbstractComponentItemCreator creator ) { final SummaryItem item = OsgiFactory.eINSTANCE.createSummaryItem (); item.setGroup ( group ); item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); item.getInformation ().setDescription ( String.format ( "Summary group information: %s", Names.makeId ( group ) ) ); item.getInformation ().getHierarchy ().addAll ( Names.makeHierarchy ( group ) ); item.getInformation ().setSystem ( "SCADA" ); final CreationRequest<SummaryItem> c = creator.addItem ( item ); c.localTags ( "SUMMARY" ); c.customizationTags ( "summary" ); final SummaryItem sumItem = c.create (); /* * FIXME: next thing is a bit wonky * actually the summary group should be used for generating sub items * but since the customization process can rename the item, the generator * cannot create a name for this later on. So for now all items * that are SummaryItem will be treated as sub-summary items. */ if ( group.eContainer () instanceof SummaryGroup ) { ( (SummaryGroup)group.eContainer () ).getItems ().add ( sumItem ); } }