|
@@ -2418,120 +2418,119 @@ Void function new_task():
|
|
|
current_user_id = get_user_id("admin")
|
|
|
create_folders(user_id, "users/" + username)
|
|
|
current_user_id = user_id
|
|
|
- break!
|
|
|
+
|
|
|
+ // Can continue as we are logged on now!
|
|
|
else:
|
|
|
output("Not the same password!")
|
|
|
- else:
|
|
|
- if (check_login(user_id)):
|
|
|
- break!
|
|
|
- else:
|
|
|
- output("Wrong password!")
|
|
|
-
|
|
|
- String cmd
|
|
|
- String result
|
|
|
-
|
|
|
- current_user_id = user_id
|
|
|
+ continue!
|
|
|
+ elif (bool_not(check_login(user_id))):
|
|
|
+ output("Wrong password!")
|
|
|
+ continue!
|
|
|
|
|
|
- output("Welcome to the Model Management Interface v2.0!")
|
|
|
- output("Use the 'help' command for a list of possible commands")
|
|
|
+ String cmd
|
|
|
+ String result
|
|
|
|
|
|
- while (True):
|
|
|
- cmd = input()
|
|
|
- if (cmd == "help"):
|
|
|
- output(cmd_help())
|
|
|
- elif (cmd == "model_add"):
|
|
|
- output(cmd_model_add(single_input("Model type?"), single_input("Model name?"), single_input("Model textual representation?")))
|
|
|
- elif (cmd == "model_move"):
|
|
|
- output(cmd_model_move(single_input("Model name?"), single_input("New location?")))
|
|
|
- elif (cmd == "process_execute"):
|
|
|
- output(cmd_process_execute(single_input("Process to execute?"), dict_input("Model bindings to use?")))
|
|
|
- elif (cmd == "process_signature"):
|
|
|
- output(cmd_process_signature(single_input("Process to query?")))
|
|
|
- elif (cmd == "transformation_between"):
|
|
|
- output(cmd_transformation_between(dict_input("Source signature?"), dict_input("Target signature?")))
|
|
|
- elif (cmd == "model_render"):
|
|
|
- output(cmd_model_render(single_input("Model name?"), single_input("Mapper name?"), single_input("Rendered name?")))
|
|
|
- elif (cmd == "model_rendered"):
|
|
|
- output(cmd_model_rendered(single_input("Model name?"), single_input("Mapper name?")))
|
|
|
- elif (cmd == "transformation_execute"):
|
|
|
- output(cmd_transformation_execute(single_input("Transformation name?"), dict_input("Source models?"), dict_input("Target models?"), single_input("Tracability model?")))
|
|
|
- elif (cmd == "verify"):
|
|
|
- result = cmd_verify(single_input("Model name?"), single_input("Metamodel name?"))
|
|
|
- if (result != ""):
|
|
|
- output(result)
|
|
|
- elif (cmd == "model_overwrite"):
|
|
|
- output(cmd_model_overwrite(single_input("Model name?"), single_input("Metamodel name?")))
|
|
|
- elif (cmd == "model_modify"):
|
|
|
- output(cmd_model_modify(single_input("Model name?"), single_input("Metamodel name?")))
|
|
|
- elif (cmd == "model_delete"):
|
|
|
- output(cmd_model_delete(single_input("Model name?")))
|
|
|
- elif (cmd == "model_list"):
|
|
|
- output(cmd_model_list(single_input("Location?")))
|
|
|
- elif (cmd == "model_list_full"):
|
|
|
- output(cmd_model_list_full(single_input("Location?")))
|
|
|
- elif (cmd == "read_permissions"):
|
|
|
- output(cmd_read_permissions(single_input("Location?")))
|
|
|
- elif (cmd == "transformation_add_MANUAL"):
|
|
|
- output(cmd_transformation_add_MANUAL(dict_input("Source models?"), dict_input("Target models?"), single_input("Operation name?")))
|
|
|
- elif (cmd == "transformation_add_AL"):
|
|
|
- output(cmd_transformation_add_AL(dict_input("Source models?"), dict_input("Target models?"), single_input("Operation name?")))
|
|
|
- elif (cmd == "transformation_add_MT"):
|
|
|
- output(cmd_transformation_add_MT(dict_input("Source models?"), dict_input("Target models?"), single_input("Operation name?")))
|
|
|
- elif (cmd == "permission_modify"):
|
|
|
- output(cmd_permission_modify(single_input("Model name?"), single_input("Permissions?")))
|
|
|
- elif (cmd == "permission_owner"):
|
|
|
- output(cmd_permission_owner(single_input("Model name?"), single_input("New owning user?")))
|
|
|
- elif (cmd == "permission_group"):
|
|
|
- output(cmd_permission_group(single_input("Model name?"), single_input("New owning group?")))
|
|
|
- elif (cmd == "group_create"):
|
|
|
- output(cmd_group_create(single_input("New group name?")))
|
|
|
- elif (cmd == "group_delete"):
|
|
|
- output(cmd_group_delete(single_input("Group name?")))
|
|
|
- elif (cmd == "group_owner_add"):
|
|
|
- output(cmd_group_owner_add(single_input("Group name?"), single_input("User name?")))
|
|
|
- elif (cmd == "group_owner_delete"):
|
|
|
- output(cmd_group_owner_delete(single_input("Group name?"), single_input("User name?")))
|
|
|
- elif (cmd == "group_join"):
|
|
|
- output(cmd_group_join(single_input("Group name?"), single_input("User name?")))
|
|
|
- elif (cmd == "group_kick"):
|
|
|
- output(cmd_group_kick(single_input("Group name?"), single_input("User name?")))
|
|
|
- elif (cmd == "group_list"):
|
|
|
- output(cmd_group_list())
|
|
|
- elif (cmd == "admin_promote"):
|
|
|
- output(cmd_admin_promote(single_input("User name?")))
|
|
|
- elif (cmd == "admin_demote"):
|
|
|
- output(cmd_admin_demote(single_input("User name?")))
|
|
|
- elif (cmd == "service_register"):
|
|
|
- output(cmd_service_register(single_input("Service name?")))
|
|
|
- elif (cmd == "user_password"):
|
|
|
- output(cmd_user_password(single_input("User name?"), single_input("New password?")))
|
|
|
- elif (cmd == "transformation_read_signature"):
|
|
|
- output(cmd_transformation_signature(single_input("Transformation name?")))
|
|
|
- elif (cmd == "verbose"):
|
|
|
- set_verbose(True)
|
|
|
- elif (cmd == "quiet"):
|
|
|
- set_verbose(False)
|
|
|
- elif (cmd == "user_logout"):
|
|
|
- output("Success")
|
|
|
- // TODO fix: just do a continue in the loop
|
|
|
- elif (cmd == "exit"):
|
|
|
- output("Success")
|
|
|
- sleep(5)
|
|
|
- // TODO break the loop (FIX)
|
|
|
- return !
|
|
|
- elif (cmd == "folder_create"):
|
|
|
- output(cmd_folder_create(single_input("Folder name?")))
|
|
|
- elif (cmd == "add_conformance"):
|
|
|
- output(cmd_conformance_add(single_input("Model name?"), single_input("Metamodel name?")))
|
|
|
- elif (cmd == "service_poll"):
|
|
|
- // TODO
|
|
|
- cmd = "FAIL"
|
|
|
- elif (cmd == "model_types"):
|
|
|
- output(cmd_model_types(single_input("Model name?")))
|
|
|
- elif (cmd == "AL_text"):
|
|
|
- output(cmd_AL_text(single_input("Code location?")))
|
|
|
- else:
|
|
|
- output("Unknown command: " + cmd)
|
|
|
+ current_user_id = user_id
|
|
|
+
|
|
|
+ output("Welcome to the Model Management Interface v2.0!")
|
|
|
+ output("Use the 'help' command for a list of possible commands")
|
|
|
+
|
|
|
+ while (True):
|
|
|
+ cmd = input()
|
|
|
+ if (cmd == "help"):
|
|
|
+ output(cmd_help())
|
|
|
+ elif (cmd == "model_add"):
|
|
|
+ output(cmd_model_add(single_input("Model type?"), single_input("Model name?"), single_input("Model textual representation?")))
|
|
|
+ elif (cmd == "model_move"):
|
|
|
+ output(cmd_model_move(single_input("Model name?"), single_input("New location?")))
|
|
|
+ elif (cmd == "process_execute"):
|
|
|
+ output(cmd_process_execute(single_input("Process to execute?"), dict_input("Model bindings to use?")))
|
|
|
+ elif (cmd == "process_signature"):
|
|
|
+ output(cmd_process_signature(single_input("Process to query?")))
|
|
|
+ elif (cmd == "transformation_between"):
|
|
|
+ output(cmd_transformation_between(dict_input("Source signature?"), dict_input("Target signature?")))
|
|
|
+ elif (cmd == "model_render"):
|
|
|
+ output(cmd_model_render(single_input("Model name?"), single_input("Mapper name?"), single_input("Rendered name?")))
|
|
|
+ elif (cmd == "model_rendered"):
|
|
|
+ output(cmd_model_rendered(single_input("Model name?"), single_input("Mapper name?")))
|
|
|
+ elif (cmd == "transformation_execute"):
|
|
|
+ output(cmd_transformation_execute(single_input("Transformation name?"), dict_input("Source models?"), dict_input("Target models?"), single_input("Tracability model?")))
|
|
|
+ elif (cmd == "verify"):
|
|
|
+ result = cmd_verify(single_input("Model name?"), single_input("Metamodel name?"))
|
|
|
+ if (result != ""):
|
|
|
+ output(result)
|
|
|
+ elif (cmd == "model_overwrite"):
|
|
|
+ output(cmd_model_overwrite(single_input("Model name?"), single_input("Metamodel name?")))
|
|
|
+ elif (cmd == "model_modify"):
|
|
|
+ output(cmd_model_modify(single_input("Model name?"), single_input("Metamodel name?")))
|
|
|
+ elif (cmd == "model_delete"):
|
|
|
+ output(cmd_model_delete(single_input("Model name?")))
|
|
|
+ elif (cmd == "model_list"):
|
|
|
+ output(cmd_model_list(single_input("Location?")))
|
|
|
+ elif (cmd == "model_list_full"):
|
|
|
+ output(cmd_model_list_full(single_input("Location?")))
|
|
|
+ elif (cmd == "read_permissions"):
|
|
|
+ output(cmd_read_permissions(single_input("Location?")))
|
|
|
+ elif (cmd == "transformation_add_MANUAL"):
|
|
|
+ output(cmd_transformation_add_MANUAL(dict_input("Source models?"), dict_input("Target models?"), single_input("Operation name?")))
|
|
|
+ elif (cmd == "transformation_add_AL"):
|
|
|
+ output(cmd_transformation_add_AL(dict_input("Source models?"), dict_input("Target models?"), single_input("Operation name?")))
|
|
|
+ elif (cmd == "transformation_add_MT"):
|
|
|
+ output(cmd_transformation_add_MT(dict_input("Source models?"), dict_input("Target models?"), single_input("Operation name?")))
|
|
|
+ elif (cmd == "permission_modify"):
|
|
|
+ output(cmd_permission_modify(single_input("Model name?"), single_input("Permissions?")))
|
|
|
+ elif (cmd == "permission_owner"):
|
|
|
+ output(cmd_permission_owner(single_input("Model name?"), single_input("New owning user?")))
|
|
|
+ elif (cmd == "permission_group"):
|
|
|
+ output(cmd_permission_group(single_input("Model name?"), single_input("New owning group?")))
|
|
|
+ elif (cmd == "group_create"):
|
|
|
+ output(cmd_group_create(single_input("New group name?")))
|
|
|
+ elif (cmd == "group_delete"):
|
|
|
+ output(cmd_group_delete(single_input("Group name?")))
|
|
|
+ elif (cmd == "group_owner_add"):
|
|
|
+ output(cmd_group_owner_add(single_input("Group name?"), single_input("User name?")))
|
|
|
+ elif (cmd == "group_owner_delete"):
|
|
|
+ output(cmd_group_owner_delete(single_input("Group name?"), single_input("User name?")))
|
|
|
+ elif (cmd == "group_join"):
|
|
|
+ output(cmd_group_join(single_input("Group name?"), single_input("User name?")))
|
|
|
+ elif (cmd == "group_kick"):
|
|
|
+ output(cmd_group_kick(single_input("Group name?"), single_input("User name?")))
|
|
|
+ elif (cmd == "group_list"):
|
|
|
+ output(cmd_group_list())
|
|
|
+ elif (cmd == "admin_promote"):
|
|
|
+ output(cmd_admin_promote(single_input("User name?")))
|
|
|
+ elif (cmd == "admin_demote"):
|
|
|
+ output(cmd_admin_demote(single_input("User name?")))
|
|
|
+ elif (cmd == "service_register"):
|
|
|
+ output(cmd_service_register(single_input("Service name?")))
|
|
|
+ elif (cmd == "user_password"):
|
|
|
+ output(cmd_user_password(single_input("User name?"), single_input("New password?")))
|
|
|
+ elif (cmd == "transformation_read_signature"):
|
|
|
+ output(cmd_transformation_signature(single_input("Transformation name?")))
|
|
|
+ elif (cmd == "verbose"):
|
|
|
+ set_verbose(True)
|
|
|
+ elif (cmd == "quiet"):
|
|
|
+ set_verbose(False)
|
|
|
+ elif (cmd == "user_logout"):
|
|
|
+ output("Success")
|
|
|
+ break!
|
|
|
+ elif (cmd == "exit"):
|
|
|
+ output("Success")
|
|
|
+ sleep(5)
|
|
|
+ return !
|
|
|
+ elif (cmd == "folder_create"):
|
|
|
+ output(cmd_folder_create(single_input("Folder name?")))
|
|
|
+ elif (cmd == "add_conformance"):
|
|
|
+ output(cmd_conformance_add(single_input("Model name?"), single_input("Metamodel name?")))
|
|
|
+ elif (cmd == "service_poll"):
|
|
|
+ // TODO
|
|
|
+ cmd = "FAIL"
|
|
|
+ elif (cmd == "model_types"):
|
|
|
+ output(cmd_model_types(single_input("Model name?")))
|
|
|
+ elif (cmd == "AL_text"):
|
|
|
+ output(cmd_AL_text(single_input("Code location?")))
|
|
|
+ else:
|
|
|
+ output("Unknown command: " + cmd)
|
|
|
|
|
|
// We never get here!
|
|
|
return !
|