private void createTopic(JSONObject topic, Map mapTopicIds, long topicmapId) throws JSONException {
TopicModel model = new TopicModel(topic);
ViewProperties viewProps = new ViewProperties(topic.getJSONObject("view_props"));
long origTopicId = model.getId();
Topic newTopic = dms.createTopic(model);
long topicId = newTopic.getId();
mapTopicIds.put(origTopicId, topicId);
topicmapsService.addTopicToTopicmap(topicmapId, topicId, viewProps);
}
private void createAssociation(JSONObject association, Map mapTopicIds, long topicmapId) {
AssociationModel assocModel = new AssociationModel(association);
RoleModel role1 = assocModel.getRoleModel1();
role1.setPlayerId(mapTopicIds.get(role1.getPlayerId()));
RoleModel role2 = assocModel.getRoleModel2();
role2.setPlayerId(mapTopicIds.get(role2.getPlayerId()));
Association newAssociation = dms.createAssociation(assocModel);
long assocId = newAssociation.getId();
topicmapsService.addAssociationToTopicmap(topicmapId, assocId);
}