[deepamehta-devel] Creating Topics programmatically as part of Migrations

Malte Reißig mre at deepamehta.de
Sa Nov 24 18:44:53 CET 2012


Dear developers,

I would like to understand how I am able to create new (custom) topics
programmatically while being able to edit these instances later on
through the webclient (while being logged in as e.g. "admin").

As I dont have a custom workspace in use, as the normal prerequisite I
associated all my custom topicTypes with the default workspace
DeepaMehta ("de.workspaces.deepamehta"). BTW: It would be nice if a
plugin could define some sort of default "Workspace" for all it's own
Topic- and AssociatonTypes.

Furthermore I related all newly created instances to the default
workspace through executing the following command in my Migration:

<code>

dms.createAssociation(new AssociationModel("dm4.core.aggregation",
    new TopicRoleModel(newTopic.getId(), "dm4.core.whole"),
    new TopicRoleModel("de.workspaces.deepamehta", "dm4.core.part")
), null);

</code>

Can one see if there's anything wrong with it, or explain if there is
something different I was not aware of yet? What else needs to be done
to not import topics which are editing wise "locked" contents.

Thankful for your help.

Greetings,
Malte




Mehr Informationen über die Mailingliste devel