public static String makeId ( final SummaryGroup group ) { return makeHierarchy ( makeHierarchy ( group ) ); }
public static String makeId ( final SummaryGroup group ) { return makeHierarchy ( makeHierarchy ( group ) ); }
private Pattern makeAknProxyPattern ( final List<String> hierarchy ) { final String str = Names.makeHierarchy ( hierarchy ); return Pattern.compile ( "^" + Pattern.quote ( str ) + "$" ); }
protected <T extends Item> T addItem ( final T item, final CustomizationRequest customizationRequest, final Set<MasterListener<T>> masterListeners ) { final List<String> originalLocalTags = new ArrayList<> ( customizationRequest.getLocalTags () ); // we do need a copy customizeItem ( item, customizationRequest ); // set the name after customizing final List<String> hier = new LinkedList<> (); hier.addAll ( customizationRequest.getHierarchy () ); hier.addAll ( customizationRequest.getLocalTags () ); item.setName ( Names.makeHierarchy ( hier ) ); // FIXME: should allow a different naming scheme logger.debug ( "Setting item name: {}", item.getName () ); if ( item.getInformation () == null ) { item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); } // apply the hierarchy afterwards ... overriding! ECollections.setEList ( item.getInformation ().getHierarchy (), customizationRequest.getHierarchy () ); itemAdded ( item, customizationRequest, originalLocalTags, masterListeners ); return item; }
protected <T extends Item> T addItem ( final T item, final CustomizationRequest customizationRequest, final Set<MasterListener<T>> masterListeners ) { final List<String> originalLocalTags = new ArrayList<> ( customizationRequest.getLocalTags () ); // we do need a copy customizeItem ( item, customizationRequest ); // set the name after customizing final List<String> hier = new LinkedList<> (); hier.addAll ( customizationRequest.getHierarchy () ); hier.addAll ( customizationRequest.getLocalTags () ); item.setName ( Names.makeHierarchy ( hier ) ); // FIXME: should allow a different naming scheme logger.debug ( "Setting item name: {}", item.getName () ); if ( item.getInformation () == null ) { item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); } // apply the hierarchy afterwards ... overriding! ECollections.setEList ( item.getInformation ().getHierarchy (), customizationRequest.getHierarchy () ); itemAdded ( item, customizationRequest, originalLocalTags, masterListeners ); return item; }
public static Map<String, String> createInfoAttributes ( final Item item ) { final Map<String, String> attributes = new HashMap<> (); Configurations.fillAttributesWithHierarchy ( attributes, Names.makeHierarchy ( item ) ); attributes.put ( "item", item.getName () ); if ( item.getInformation () != null ) { addAttribute ( attributes, "system", item.getInformation ().getSystem () ); addAttribute ( attributes, "unit", item.getInformation ().getUnit () ); addAttribute ( attributes, "itemDescription", item.getInformation ().getDescription () ); } return attributes; }
public static Map<String, String> createInfoAttributes ( final Item item ) { final Map<String, String> attributes = new HashMap<> (); Configurations.fillAttributesWithHierarchy ( attributes, Names.makeHierarchy ( item ) ); attributes.put ( "item", item.getName () ); if ( item.getInformation () != null ) { addAttribute ( attributes, "system", item.getInformation ().getSystem () ); addAttribute ( attributes, "unit", item.getInformation ().getUnit () ); addAttribute ( attributes, "itemDescription", item.getInformation ().getDescription () ); } return attributes; }
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 ); } }