def createReferenceFromCompound(self, cobj): cname, content = self.getCompoundContent(cobj) # If compnode exists simply update content if self.compounds.get_compnode(cname): return(2) for asset in content: for entity in content[asset]: result = self.createReference(asset, entity) self.compounds.restore_attributes(result, content[asset][entity]) self.compounds.connect_to_compnode(cname, result) # Generate new asset map projectAssetMapGeneration.generateAssetMap() return(0)
def createReferenceFromCompound(self, cobj): content = self.compounds.read_content(cobj.get_source()) cname = self.compounds.compnode_name(cobj.compound_name) if self.compounds.get_compnode(cname): print('WARNING: Compnode exists %s'%cname) print('Updating will be supported soon.') return(True) for asset in content: for entity in content[asset]: result = self.createReference(asset, entity) self.compounds.restore_attributes(result, content[asset][entity]) self.compounds.connect_to_compnode(cname, result) # Generate new asset map projectAssetMapGeneration.generateAssetMap() return(False)