package net.atos.entng.wiki;

import net.atos.entng.wiki.controllers.WikiController;
import net.atos.entng.wiki.service.WikiRepositoryEvents;

import org.entcore.common.http.BaseServer;
import org.entcore.common.http.filter.ShareAndOwner;
import org.entcore.common.mongodb.MongoDbConf;
import org.entcore.common.user.RepositoryHandler;

public class Wiki extends BaseServer {

	public final static String WIKI_COLLECTION = "wiki";

	@Override
	public void start() {
		super.start();

		// Subscribe to events published for transition
		vertx.eventBus().registerHandler("user.repository",
				new RepositoryHandler(new WikiRepositoryEvents()));

		addController(new WikiController(WIKI_COLLECTION));
		MongoDbConf.getInstance().setCollection(WIKI_COLLECTION);
		setDefaultResourceFilter(new ShareAndOwner());
	}

}

@@ -533,85 +533,27 @@
 n%0A%09%09
-vertx.eventBus().registerHandler(%22user.repository%22,%0A%09%09%09%09new RepositoryHandler
+setRepositoryEvents
 (new
@@ -576,17 +576,16 @@
 vents())
-)
 ;%0A%0A%09%09add

refactor repositoryEvents loading