# --------------------------------------------------------------------------------------------------------- # Author : Ulrich Carmesin # Source : gitea.ucarmesin.de # --------------------------------------------------------------------------------------------------------- """ spontanes Fliegengewicht, das aus einer der folgenden Contexte gebodlet wird. step: hier als umzusetzende Technik artefact: hier als umzusetzende Technik bei init oder collect component: als Superklasse zwecks Ererben fehlernder Attribute environment: als Superklasse zwecks Ererben fehlernder Attribute in den jeweiligen technischen Elternklassenv werden die Attribute gesammelt und bei der Ausfuehrung komprimmiert. Die so zusammen gesammelten Konfigurationen werden der jeweilgen Funktionsklasse uebergeben. """ import os import basic.constants as B import model.entity import tools.path_const as P import tools.data_tool import tools.data_const as D TABLE_NAME = tools.data_tool.getSingularKeyword(B.DATA_NODE_TOPICS) """ system-name for this entity """ FIELD_ID = "toid" FIELD_NAME = D.FIELD_NAME LIST_FIELDS = [FIELD_ID, FIELD_NAME] """ list of object-attributes """ LIST_NODES = [] LIST_SUBTABLES = {} component = "" environment = "" topic = "" # """ one of B.LIST_TOPIC_NODES """ type = "" # """ one of the implemented Tools """ class Topic(model.entity.Entity): name = "" type = "" attributes = "" environment = "" component = "" def __init__(self, job, environment, component, name=""): """ to be initialized by readSpec """ self.job = job self.environment = environment self.component = component def read_entity(self, job, name): """ reads the entity from the file-system :param job: :param name: :return: """ config = self.getConfig(job, P.KEY_BASIC, B.SUBJECT_VARIANTS, "") def getFieldList(self): """ returns a list of scalar attributes :return: LIST_FIELDS """ return LIST_FIELDS def getNodeList(self): """ returns a list of sub-nodes - which can be persisted in a clob-field :return: LIST_NODES """ return LIST_NODES def getSubtableList(self): """ returns a list of sub-tables :return: LIST_SUBTABLES """ return LIST_SUBTABLES def getName(self): """ returns the name - maybe build from other attributes :return: """ return self.name def getIDName(self): """ it returns the name as unique-id - maybe build from few attributes :return: """ return self.name