public static String makeId ( final SummaryGroup group ) { return makeHierarchy ( makeHierarchy ( group ) ); }
protected String makeName () { return Names.makeName ( this.documentable ); }
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 ); } }
protected String makeName () { return Names.makeName ( this.documentable ); }
public static String makeId ( final SummaryGroup group ) { return makeHierarchy ( makeHierarchy ( group ) ); }
public String makeId ( final ValueArchive archive, final int number, final String suffix ) { return String.format ( "%s/%s.%s", Names.makeName ( archive ), number, suffix ); } }
private Pattern makeAknProxyPattern ( final List<String> hierarchy ) { final String str = Names.makeHierarchy ( hierarchy ); return Pattern.compile ( "^" + Pattern.quote ( str ) + "$" ); }
public String makeId ( final ValueArchive archive, final int number, final String suffix ) { return String.format ( "%s/%s.%s", Names.makeName ( archive ), number, suffix ); } }
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 String makeId () { return Components.makeFullQualified ( this.calculationComponent, Names.makeName ( this.calculationComponent ) ); }
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 String makeFullQualified ( final Component component, final String... local ) { final List<String> hier = Components.makeHierarchy ( component ); if ( component instanceof NamedDocumentable ) { hier.add ( Names.makeName ( (NamedDocumentable)component ) ); } hier.addAll ( Arrays.asList ( local ) ); return StringHelper.join ( hier, delimiter ); }
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 String makeFullQualified ( final Component component, final String... local ) { final List<String> hier = Components.makeHierarchy ( component ); if ( component instanceof NamedDocumentable ) { hier.add ( Names.makeName ( (NamedDocumentable)component ) ); } hier.addAll ( Arrays.asList ( local ) ); return StringHelper.join ( hier, delimiter ); }
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; }
private void createMonitorPool ( final MonitorPool pool ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "filter", pool.getFilter () ); //$NON-NLS-1$ addData ( Factories.FACTORY_AE_MONITOR_POOL, Names.makeName ( pool ), data ); }
private void createMonitorPool ( final MonitorPool pool ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "filter", pool.getFilter () ); //$NON-NLS-1$ addData ( Factories.FACTORY_AE_MONITOR_POOL, Names.makeName ( pool ), data ); }
private String createProxy ( final ValueArchive archive, final List<String> sources ) { final Map<String, String> data = new HashMap<String, String> (); final String id = Names.makeName ( archive ) + ".proxy"; for ( final String source : sources ) { if ( source.contains ( "," ) ) { throw new IllegalArgumentException ( String.format ( "Item name '%s' is invalid. Proxy sources must not contain comma (,) in their name.", source ) ); } } Collections.sort ( sources ); // make output reproducible data.put ( "sources", StringHelper.join ( sources, ", " ) ); addData ( Factories.FACTORY_DA_PROXY_SOURCE, id, data ); return id; }
private void createFilter ( final ExternalEventFilter filter, final int priority ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "priority", "" + priority ); //$NON-NLS-1$ //$NON-NLS-2$ data.put ( "id", Names.makeName ( filter ) ); // for now ... //$NON-NLS-1$ if ( filter instanceof SimpleExternalEventFilter ) { data.put ( "type", "filter" ); //$NON-NLS-1$ //$NON-NLS-2$ data.put ( "filter", ( (SimpleExternalEventFilter)filter ).getFilter () ); addData ( Factories.FACTORY_EXTERNAL_EVENT_FILTER, Names.makeName ( filter ), data ); } else if ( filter instanceof StaticExternalEventFilter ) { data.put ( "type", "static" ); //$NON-NLS-1$ //$NON-NLS-2$ data.put ( "value", ( (StaticExternalEventFilter)filter ).getValue () ); addData ( Factories.FACTORY_EXTERNAL_EVENT_FILTER, Names.makeName ( filter ), data ); } }
private void createFilter ( final ExternalEventFilter filter, final int priority ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "priority", "" + priority ); //$NON-NLS-1$ //$NON-NLS-2$ data.put ( "id", Names.makeName ( filter ) ); // for now ... //$NON-NLS-1$ if ( filter instanceof SimpleExternalEventFilter ) { data.put ( "type", "filter" ); //$NON-NLS-1$ //$NON-NLS-2$ data.put ( "filter", ( (SimpleExternalEventFilter)filter ).getFilter () ); addData ( Factories.FACTORY_EXTERNAL_EVENT_FILTER, Names.makeName ( filter ), data ); } else if ( filter instanceof StaticExternalEventFilter ) { data.put ( "type", "static" ); //$NON-NLS-1$ //$NON-NLS-2$ data.put ( "value", ( (StaticExternalEventFilter)filter ).getValue () ); addData ( Factories.FACTORY_EXTERNAL_EVENT_FILTER, Names.makeName ( filter ), data ); } }