Class IvmlDashboardMapper
java.lang.Object
de.iip_ecosphere.platform.configuration.IvmlDashboardMapper
IVML-to-AAS/submodel mapper for dashboard creation with ReGaP/Bitmotec. Not realized as VTL as intended to provide
application dashboard submodels also at runtime. May be integrated with the configuration maven build processes or
as VTL Java extension.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classRepresents relevant information form an (INFLUX) connector.private static classRepresents a display row.private static classRepresents a field in aIvmlDashboardMapper.RecordType.private static classRepresents a dashboard panel legend.private static classRepresents a dashboard panel position.private static classRepresents a resolved and mapped oktoflow record type.static interfaceConsumes a mapping result.private static classRepresents optional security/authentication settings. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIvmlDashboardMapper(de.iip_ecosphere.platform.support.aas.AasFactory factory, File projectFolder) Creates a mapper instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidclear()Clears this instance for reuse.private List<IvmlDashboardMapper.DisplayRow> collectDisplayRows(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Collects the display rows.private de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuildercreateDashboardSpec(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB) Creates the dashboard specification collection.private voidcreateDisplayRows(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB) Creates the display rows submodel.private voidcreateHeader(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB) Creates submodel header information.private voidcreateProperty(de.iip_ecosphere.platform.support.aas.SubmodelElementContainerBuilder parent, String idShort, de.iip_ecosphere.platform.support.aas.Type type, Object value, String description) Creates an AAS property.private static de.iip_ecosphere.platform.support.aas.AasFactorygetAasFactory(String aasFactoryPluginId) Returns the AAS factory to use, based onaasFactoryPluginId.private static de.iip_ecosphere.platform.support.logging.LoggerReturns the logger instance.private StringgetSemanticId(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String semanticId) Returns a the semantic id from the givenvar.private static booleanisBlank(CharSequence text) Returns whethertextis blank.private static booleanisNotBlank(CharSequence text) Returns whethertextis not blank.static voidPerforms the dashboard AAS-JSON instantiation.private static voidMain functionality without returning exit code/output of help for re-use.private StringmapSemanticIdToUnit(String semId) Resolves the (inherited/refined) semantic id to a display unit.voidprocess(net.ssehub.easy.varModel.confModel.Configuration cfg, de.iip_ecosphere.platform.support.aas.Aas aas, IvmlDashboardMapper.ResultConsumer consumer) Processes a given configuration.private StringprocessDb(net.ssehub.easy.varModel.confModel.IDecisionVariable impl, IvmlDashboardMapper.ConnectorInfo connInfo, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder dbsB) Processes a database entry.private voidprocessLegend(IvmlDashboardMapper.Legend legend, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelB) Turns a panel legend into AAS.private voidprocessNode(IvmlGraphMapper.IvmlGraphNode node, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelsB, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder dbsB, Map<String, String> dbMapping) Processes an IVML graph node, filters influx connectors and transfers the information into individual panels.private voidprocessPanelPosition(IvmlDashboardMapper.PanelPosition position, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelB) Turns a panel position into AAS.private voidprocessType(IvmlDashboardMapper.RecordType type, IvmlDashboardMapper.ConnectorInfo influx, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelsB, String influxDb) Turns a resolved record type into AAS.resolveConnector(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Resolves connector information.private StringresolvePanelType(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Resolves the panel type.private StringresolveSemanticIdToUnit(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Resolves the (inherited/refined) semantic id to a display unit.private IvmlDashboardMapper.RecordTyperesolveType(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Resolves an IVML type to dashboard relevant information.
-
Field Details
-
projectFolder
-
factory
private de.iip_ecosphere.platform.support.aas.AasFactory factory -
unitMapping
-
targetMapping
-
displayRows
-
appName
-
appId
-
appVersion
-
panelCount
private transient int panelCount -
aliasType
private transient net.ssehub.easy.varModel.model.datatypes.IDatatype aliasType
-
-
Constructor Details
-
IvmlDashboardMapper
public IvmlDashboardMapper(de.iip_ecosphere.platform.support.aas.AasFactory factory, File projectFolder) Creates a mapper instance.- Parameters:
factory- the AAS factory to use
-
-
Method Details
-
clear
private void clear()Clears this instance for reuse. -
process
public void process(net.ssehub.easy.varModel.confModel.Configuration cfg, de.iip_ecosphere.platform.support.aas.Aas aas, IvmlDashboardMapper.ResultConsumer consumer) throws net.ssehub.easy.varModel.model.ModelQueryException, ExecutionException Processes a given configuration.- Parameters:
cfg- the configuration to processaas- the AAS to hook the dashboard submodel into, may be null if an AAS shall be created, e.g., for JSON exportconsumer- consumer for the result, may be null- Throws:
net.ssehub.easy.varModel.model.ModelQueryException- if accessing the configuration failsExecutionException- if creating AAS parts fails
-
collectDisplayRows
private List<IvmlDashboardMapper.DisplayRow> collectDisplayRows(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Collects the display rows.- Parameters:
var- the (application) variable to get the display rows from- Returns:
- the display rows
-
isNotBlank
Returns whethertextis not blank. Repeated fromStringUtilsas long as plugin loading for this app is not clear.- Parameters:
text- the text to check- Returns:
truefor blank,falseelse
-
isBlank
Returns whethertextis blank. Repeated fromStringUtilsas long as plugin loading for this app is not clear.- Parameters:
text- the text to check- Returns:
truefor blank,falseelse
-
createHeader
private void createHeader(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB) Creates submodel header information.- Parameters:
smB- the parent submodel builder
-
createDisplayRows
private void createDisplayRows(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB) Creates the display rows submodel.- Parameters:
smB- the parent submodel builder
-
createDashboardSpec
private de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder createDashboardSpec(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB) Creates the dashboard specification collection.- Parameters:
smB- the parent submodel builder
-
processNode
private void processNode(IvmlGraphMapper.IvmlGraphNode node, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelsB, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder dbsB, Map<String, String> dbMapping) Processes an IVML graph node, filters influx connectors and transfers the information into individual panels.- Parameters:
node- the node to processpanelsB- the panels (parent) builder
-
processDb
private String processDb(net.ssehub.easy.varModel.confModel.IDecisionVariable impl, IvmlDashboardMapper.ConnectorInfo connInfo, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder dbsB) Processes a database entry.- Parameters:
impl- the service/connector implementationconnInfo- the connector informationdbsB- the databases collection builder- Returns:
- the database uid
-
resolveConnector
private IvmlDashboardMapper.ConnectorInfo resolveConnector(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Resolves connector information.- Parameters:
var- the IVML variable representing the connector, may be null- Returns:
- the resolved connector information, may be null
-
getSemanticId
private String getSemanticId(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String semanticId) Returns a the semantic id from the givenvar.- Parameters:
var- the IVML variablesemanticId- the actual semantic id (do not overwrite if not null)- Returns:
- the retrieved semantic id or
semanticid
-
resolveType
private IvmlDashboardMapper.RecordType resolveType(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Resolves an IVML type to dashboard relevant information.- Parameters:
var- the variable representing the type, may be null- Returns:
- the resolved information, may be null
-
resolvePanelType
Resolves the panel type.- Parameters:
var- the variable to take the panel type/display enum from- Returns:
- the panel type
-
mapSemanticIdToUnit
Resolves the (inherited/refined) semantic id to a display unit.- Parameters:
semId- the semantic id to map- Returns:
- the mapped semantic id
-
resolveSemanticIdToUnit
Resolves the (inherited/refined) semantic id to a display unit.- Parameters:
var- the variable to take the type from- Returns:
- the mapped semantic id
-
processType
private void processType(IvmlDashboardMapper.RecordType type, IvmlDashboardMapper.ConnectorInfo influx, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelsB, String influxDb) Turns a resolved record type into AAS.- Parameters:
type- the record type, may be null or not qualified for dashbordinginflux- the influx connector informationpanelsB- the parent panels builder
-
processLegend
private void processLegend(IvmlDashboardMapper.Legend legend, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelB) Turns a panel legend into AAS.- Parameters:
legend- the legendpanelB- the parent builder
-
processPanelPosition
private void processPanelPosition(IvmlDashboardMapper.PanelPosition position, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder panelB) Turns a panel position into AAS.- Parameters:
position- the positionpanelB- the parent builder
-
createProperty
private void createProperty(de.iip_ecosphere.platform.support.aas.SubmodelElementContainerBuilder parent, String idShort, de.iip_ecosphere.platform.support.aas.Type type, Object value, String description) Creates an AAS property.- Parameters:
parent- the parent builderidShort- the idShorttype- the property typevalue- the property value, may be null, call is ignored thendescription- the description to be added
-
main
Performs the dashboard AAS-JSON instantiation.- Parameters:
args- command line arguments- Throws:
ExecutionException- in case that the VIL instantiation fails, shall not occur here as handled by defaultPlatformInstantiator.InstantiationConfigurerIOException- if files cannot be located/written
-
mainImpl
Main functionality without returning exit code/output of help for re-use. Could be with explicit parameters...- Parameters:
args- command line arguments- Throws:
ExecutionException- in case that the VIL instantiation fails, shall not occur here as handled by defaultPlatformInstantiator.InstantiationConfigurerIOException- if files cannot be located/written
-
getLogger
private static de.iip_ecosphere.platform.support.logging.Logger getLogger()Returns the logger instance.- Returns:
- the logger instance
-
getAasFactory
private static de.iip_ecosphere.platform.support.aas.AasFactory getAasFactory(String aasFactoryPluginId) Returns the AAS factory to use, based onaasFactoryPluginId.- Parameters:
aasFactoryPluginId- the plugin id of the AAS factory to use- Returns:
- the factory to use
-