|
@@ -14,9 +14,7 @@ Element core = ?
|
|
|
|
|
|
String scd_location = "models/SimpleClassDiagrams"
|
|
|
String core_location = "models/CoreFormalism"
|
|
|
-String core_tm_location = "models/CoreFormalism_TypeMapping"
|
|
|
String core_model_location = "models/core"
|
|
|
-String core_model_tm_location = "models/core_TypeMapping"
|
|
|
|
|
|
Void function main():
|
|
|
// Initialize the Core Formalism
|
|
@@ -27,14 +25,15 @@ Void function main():
|
|
|
String admin_user
|
|
|
String nobody_group
|
|
|
String instance_of
|
|
|
+ String core_formalism
|
|
|
Element scd
|
|
|
|
|
|
scd = initialize_SCD(scd_location)
|
|
|
|
|
|
// Create the Model itself and make public
|
|
|
- core = instantiate_model(import_node(core_location))
|
|
|
- export_node(core_model_location, core["model"])
|
|
|
- export_node(core_model_tm_location, core["type_mapping"])
|
|
|
+ core_formalism = import_node(core_location)
|
|
|
+ core = instantiate_model(core_formalism)
|
|
|
+ export_node(core_model_location, core)
|
|
|
|
|
|
// Switch all new users to the user_function
|
|
|
// This accesses the bootstrap level, so do not change this unless you know what you are doing
|
|
@@ -98,7 +97,7 @@ Void function main():
|
|
|
instantiate_attribute(core, core_formalism_model, "location", core_location)
|
|
|
instantiate_attribute(core, core_formalism_model, "permissions", "221")
|
|
|
instance_of = instantiate_link(core, "instanceOf", "", core_formalism_model, scd_model)
|
|
|
- instantiate_attribute(core, instance_of, "type_mapping", ???)
|
|
|
+ instantiate_attribute(core, instance_of, "type_mapping", core_formalism["type_mapping"])
|
|
|
|
|
|
// Make necessary links for the formalism to the owners
|
|
|
instantiate_link(core, "group", "", core_formalism_model, admin_group)
|
|
@@ -125,18 +124,18 @@ Void function main():
|
|
|
// Note that if there are no admin users left, it will be very difficult to manage, as nobody will have admin permissions!
|
|
|
return !
|
|
|
|
|
|
-Void function get_full_model(model_id : String):
|
|
|
+Element function get_full_model(model_id : String):
|
|
|
Element m
|
|
|
Element all_links
|
|
|
String choice
|
|
|
|
|
|
m = create_node()
|
|
|
- all_links = allOutgoingAssociations(core, model_id, "instanceOf")
|
|
|
+ all_links = allOutgoingAssociationInstances(core, model_id, "instanceOf")
|
|
|
|
|
|
if (read_nr_out(all_links) != 1):
|
|
|
log("WARNING: multiple instanceOf relations were detected for this model; picking one at random!")
|
|
|
|
|
|
- choice = set_pop(allOutgoingAssociations(core, model_id, "instanceOf"))
|
|
|
+ choice = set_pop(allOutgoingAssociationInstances(core, model_id, "instanceOf"))
|
|
|
|
|
|
dict_add(m, "model", import_node(read_attribute(core, model_id, "location")))
|
|
|
dict_add(m, "type_mapping", read_attribute(core, choice, "type_mapping"))
|
|
@@ -252,10 +251,7 @@ Element function user_function():
|
|
|
exec(root["core/core_algorithm.alc"]["initializers"])
|
|
|
|
|
|
// Load in a hard-reference to the previously created model
|
|
|
- core = create_node()
|
|
|
- dict_add(core, "model", import_node(core_model_location))
|
|
|
- dict_add(core, "metamodel", import_node(scd_location))
|
|
|
- dict_add(core, "type_mapping", import_node(core_model_tm_location))
|
|
|
+ core = import_node(core_model_location)
|
|
|
|
|
|
output("Log on as which user?")
|
|
|
username = input()
|
|
@@ -446,9 +442,8 @@ Void function user_function_skip_init(user_id : String):
|
|
|
if (get_model_id(name) == ""):
|
|
|
// Model doesn't exist yet
|
|
|
output("Waiting for model constructors...")
|
|
|
- m = get_full_model(type_id)
|
|
|
|
|
|
- new_model = construct_model_raw(m)
|
|
|
+ new_model = construct_model_raw(get_full_model(type_id))
|
|
|
|
|
|
model_create(new_model, name, user_id, type_id, "Model")
|
|
|
output("Model upload success!")
|