def delete_domain(domain_name): if db.domain_exists(domain_name): domain_content_connector = factory.get_entity_data_connector() db.remove_domain(domain_name) domain_content_connector.delete_domain_items(domain_name) return json.dumps(dict(success=True)) return json.dumps(dict(success=False))
def delete_domain(team_id, domain_id): tangelo.log("deleting domain: " + str(domain_id)) domain_content_connector = factory.get_entity_data_connector() domain_content_connector.delete_domain_items(domain_id) tangelo.log("delted features") db.remove_domain(domain_id) tangelo.log("delted meta data") return json.dumps(dict(success=True))
def delete_domain(*args, **kwargs): domain_name = kwargs.get("domain_name") for key in kwargs.keys(): tangelo.log(key) if db.domain_exists(domain_name): domain_content_connector = factory.get_entity_data_connector() db.remove_domain(domain_name) domain_content_connector.delete_domain_items(domain_name) return json.dumps(dict(success=True)) else: return json.dumps(dict(success=False))
def upload_file(team_id, name, description, features): # tangelo.log("Loading new domain: ") # tangelo.log(name) # tangelo.log(description) # tangelo.log(features) domain_id = db.add_new_domain(team_id, name, description) domain_content_connector = factory.get_entity_data_connector() try: domain_content_connector.add_new_domain_items(domain_id, features) except: db.remove_domain(domain_id) raise finally: domain_content_connector.close() newdomain = dict(id=domain_id, name=name, description=description) # tangelo.log("loaded new domain") # tangelo.log(newdomain) return json.dumps(newdomain)
def upload_file(team_id, name, description, features): #tangelo.log("Loading new domain: ") #tangelo.log(name) #tangelo.log(description) #tangelo.log(features) domain_id = db.add_new_domain(team_id, name, description) domain_content_connector = factory.get_entity_data_connector() try: domain_content_connector.add_new_domain_items(domain_id, features) except: db.remove_domain(domain_id) raise finally: domain_content_connector.close() newdomain = dict(id=domain_id, name=name, description=description) #tangelo.log("loaded new domain") #tangelo.log(newdomain) return json.dumps(newdomain)