def add_mashup_entities_from_mashuptrail(self, mashuptrail): added_entry_keys = set() inv_tag_map = {} tagMap = mashuptrail.getTagMap() tags = tagMap.keys() if len(tags) > 0: tags.sort() for tag in tags: version_id = tagMap[tag] inv_tag_map[version_id] = tag action = mashuptrail.actionMap[version_id] mashup = mashuptrail.getMashup(version_id) mashup.name = tag #make sure we identify a mashup by its version mashup.id = action.id entity_key = (mashuptrail.id,version_id) self.mshp_entity_map[entity_key] = \ self.create_mashup_entity(mashuptrail.id, mashup, action) added_entry_keys.add(entity_key) # get thumbnail for the workflow it points thumb_version = mashuptrail.vtVersion thumbnail = self.vistrail.get_thumbnail(thumb_version) if thumbnail is not None: cache = ThumbnailCache.getInstance() path = cache.get_abs_name_entry(thumbnail) if path: entity = ThumbnailEntity(path) mshp_entity = self.mshp_entity_map[entity_key] mshp_entity.children.append(entity) entity.parent = mshp_entity return inv_tag_map
def add_mashup_entity(self, mashuptrail, version_id, tag=None): if not hasattr(self.vistrail, 'mashups'): return if mashuptrail not in self.vistrail.mashups: return action = mashuptrail.actionMap[version_id] mashup = mashuptrail.getMashup(version_id) if tag: mashup.name = tag mashup.id = action.id entity_key = (mashuptrail.id,version_id) self.mshp_entity_map[entity_key] = \ self.create_mashup_entity(mashuptrail.id, mashup, action) # get thumbnail for the workflow it points thumb_version = mashuptrail.vtVersion thumbnail = self.vistrail.get_thumbnail(thumb_version) if thumbnail is not None: cache = ThumbnailCache.getInstance() path = cache.get_abs_name_entry(thumbnail) if path: entity = ThumbnailEntity(path) mshp_entity = self.mshp_entity_map[entity_key] mshp_entity.children.append(entity) entity.parent = mshp_entity return self.mshp_entity_map[entity_key]
def add_workflow_entity(self, version_id): if version_id not in self.vistrail.actionMap: return action = self.vistrail.actionMap[version_id] tag = None if self.vistrail.has_tag(version_id): tag = self.vistrail.get_tag(version_id) try: workflow = self.vistrail.getPipeline(version_id) except: import traceback debug.critical("Failed to construct pipeline '%s'" % (tag if tag else version_id), traceback.format_exc()) workflow = self.vistrail.getPipeline(0) if tag: workflow.name = tag # if workflow already exists, we want to update it... # spin through self.children and look for matching # workflow entity? # self.children.append(WorkflowEntity(workflow)) self.wf_entity_map[version_id] = \ self.create_workflow_entity(workflow, action) # get thumbnail thumbnail = self.vistrail.get_thumbnail(version_id) if thumbnail is not None: cache = ThumbnailCache.getInstance() path = cache.get_abs_name_entry(thumbnail) if path: entity = ThumbnailEntity(path) self.wf_entity_map[action.id].children.append(entity) entity.parent = self.wf_entity_map[action.id] return self.wf_entity_map[version_id]
def add_mashup_entities_from_mashuptrail(self, mashuptrail): added_entry_keys = set() inv_tag_map = {} tagMap = mashuptrail.getTagMap() tags = tagMap.keys() if len(tags) > 0: tags.sort() for tag in tags: version_id = tagMap[tag] inv_tag_map[version_id] = tag action = mashuptrail.actionMap[version_id] mashup = mashuptrail.getMashup(version_id) mashup.name = tag #make sure we identify a mashup by its version mashup.id = action.id entity_key = (mashuptrail.id, version_id) self.mshp_entity_map[entity_key] = \ self.create_mashup_entity(mashuptrail.id, mashup, action) added_entry_keys.add(entity_key) # get thumbnail for the workflow it points thumb_version = mashuptrail.vtVersion thumbnail = self.vistrail.get_thumbnail(thumb_version) if thumbnail is not None: cache = ThumbnailCache.getInstance() path = cache.get_abs_name_entry(thumbnail) if path: entity = ThumbnailEntity(path) mshp_entity = self.mshp_entity_map[entity_key] mshp_entity.children.append(entity) entity.parent = mshp_entity return inv_tag_map
def add_mashup_entity(self, mashuptrail, version_id, tag=None): if not hasattr(self.vistrail, 'mashups'): return if mashuptrail not in self.vistrail.mashups: return action = mashuptrail.actionMap[version_id] mashup = mashuptrail.getMashup(version_id) if tag: mashup.name = tag mashup.id = action.id entity_key = (mashuptrail.id, version_id) self.mshp_entity_map[entity_key] = \ self.create_mashup_entity(mashuptrail.id, mashup, action) # get thumbnail for the workflow it points thumb_version = mashuptrail.vtVersion thumbnail = self.vistrail.get_thumbnail(thumb_version) if thumbnail is not None: cache = ThumbnailCache.getInstance() path = cache.get_abs_name_entry(thumbnail) if path: entity = ThumbnailEntity(path) mshp_entity = self.mshp_entity_map[entity_key] mshp_entity.children.append(entity) entity.parent = mshp_entity return self.mshp_entity_map[entity_key]
def add_workflow_entity(self, version_id): if version_id not in self.vistrail.actionMap: return action = self.vistrail.actionMap[version_id] tag = None if self.vistrail.has_tag(version_id): tag = self.vistrail.get_tag(version_id) try: workflow = self.vistrail.getPipeline(version_id) except: import traceback debug.critical( "Failed to construct pipeline '%s'" % (tag if tag else version_id), traceback.format_exc()) workflow = self.vistrail.getPipeline(0) if tag: workflow.name = tag # if workflow already exists, we want to update it... # spin through self.children and look for matching # workflow entity? # self.children.append(WorkflowEntity(workflow)) self.wf_entity_map[version_id] = \ self.create_workflow_entity(workflow, action) # get thumbnail thumbnail = self.vistrail.get_thumbnail(version_id) if thumbnail is not None: cache = ThumbnailCache.getInstance() path = cache.get_abs_name_entry(thumbnail) if path: entity = ThumbnailEntity(path) self.wf_entity_map[action.id].children.append(entity) entity.parent = self.wf_entity_map[action.id] return self.wf_entity_map[version_id]
def add_parameter_exploration_entity(self, pe): if not hasattr(self.vistrail, 'parameter_explorations'): return self.pe_entity_map[pe.name] = \ self.create_parameter_exploration_entity(pe) # get thumbnail for the workflow it points thumbnail = self.vistrail.get_thumbnail(pe.action_id) if thumbnail is not None: cache = ThumbnailCache.getInstance() path = cache.get_abs_name_entry(thumbnail) if path: entity = ThumbnailEntity(path) pe_entity = self.pe_entity_map[pe.name] pe_entity.children.append(entity) entity.parent = self return self.pe_entity_map[pe.name]