@ -10,9 +10,7 @@ import de.srsoftware.configuration.JsonConfig;
import de.srsoftware.tools.ColorLogger ;
import de.srsoftware.tools.ColorLogger ;
import de.srsoftware.umbrella.bookmarks.BookmarkApi ;
import de.srsoftware.umbrella.bookmarks.BookmarkApi ;
import de.srsoftware.umbrella.company.CompanyModule ;
import de.srsoftware.umbrella.company.CompanyModule ;
import de.srsoftware.umbrella.core.ModuleRegistry ;
import de.srsoftware.umbrella.core.Util ;
import de.srsoftware.umbrella.core.Util ;
import de.srsoftware.umbrella.core.api.WikiService ;
import de.srsoftware.umbrella.core.exceptions.UmbrellaException ;
import de.srsoftware.umbrella.core.exceptions.UmbrellaException ;
import de.srsoftware.umbrella.documents.DocumentApi ;
import de.srsoftware.umbrella.documents.DocumentApi ;
import de.srsoftware.umbrella.items.ItemApi ;
import de.srsoftware.umbrella.items.ItemApi ;
@ -27,12 +25,11 @@ import de.srsoftware.umbrella.time.TimeModule;
import de.srsoftware.umbrella.translations.Translations ;
import de.srsoftware.umbrella.translations.Translations ;
import de.srsoftware.umbrella.user.UserModule ;
import de.srsoftware.umbrella.user.UserModule ;
import de.srsoftware.umbrella.web.WebHandler ;
import de.srsoftware.umbrella.web.WebHandler ;
import de.srsoftware.umbrella.wiki.WikiModule ;
import java.io.File ;
import java.io.File ;
import java.io.IOException ;
import java.io.IOException ;
import java.net.InetSocketAddress ;
import java.net.InetSocketAddress ;
import java.util.concurrent.Executors ;
import java.util.concurrent.Executors ;
import de.srsoftware.umbrella.wiki.WikiModule ;
import org.json.JSONObject ;
import org.json.JSONObject ;
public class Application {
public class Application {
@ -62,27 +59,26 @@ public class Application {
var server = HttpServer . create ( new InetSocketAddress ( port ) , 0 ) ;
var server = HttpServer . create ( new InetSocketAddress ( port ) , 0 ) ;
var registry = new ModuleRegistry ( ) ;
new Translations ( ) . bindPath ( "/api/translations" ) . on ( server ) ;
new Translations ( registry ) . bindPath ( "/api/translations" ) . on ( server ) ;
new MessageSystem ( config ) ;
new MessageSystem ( registry , config ) ;
new UserModule ( config ) . bindPath ( "/api/user" ) . on ( server ) ;
new UserModule ( registry , config ) . bindPath ( "/api/user" ) . on ( server ) ;
new TagModule ( config ) . bindPath ( "/api/tags" ) . on ( server ) ;
new TagModule ( registry , config ) . bindPath ( "/api/tags" ) . on ( server ) ;
new BookmarkApi ( config ) . bindPath ( "/api/bookmark" ) . on ( server ) ;
new BookmarkApi ( registry , config ) . bindPath ( "/api/bookmark" ) . on ( server ) ;
new CompanyModule ( config ) . bindPath ( "/api/company" ) . on ( server ) ;
new CompanyModule ( registry , config ) . bindPath ( "/api/company" ) . on ( server ) ;
new CompanyLegacy ( config ) . bindPath ( "/legacy/company" ) . on ( server ) ;
new CompanyLegacy ( registry , config ) . bindPath ( "/legacy/company" ) . on ( server ) ;
new DocumentApi ( config ) . bindPath ( "/api/document" ) . on ( server ) ;
new DocumentApi ( registry , config ) . bindPath ( "/api/document" ) . on ( server ) ;
new ItemApi ( config ) . bindPath ( "/api/items" ) . on ( server ) ;
new ItemApi ( registry , config ) . bindPath ( "/api/items" ) . on ( server ) ;
new UserLegacy ( config ) . bindPath ( "/legacy/user" ) . on ( server ) ;
new UserLegacy ( registry , config ) . bindPath ( "/legacy/user" ) . on ( server ) ;
new NotesLegacy ( config ) . bindPath ( "/legacy/notes" ) . on ( server ) ;
new NotesLegacy ( registry , config ) . bindPath ( "/legacy/notes" ) . on ( server ) ;
new MarkdownApi ( ) . bindPath ( "/api/markdown" ) . on ( server ) ;
new MarkdownApi ( registry ) . bindPath ( "/api/markdown" ) . on ( server ) ;
new NoteModule ( config ) . bindPath ( "/api/notes" ) . on ( server ) ;
new NoteModule ( registry , config ) . bindPath ( "/api/notes" ) . on ( server ) ;
new ProjectModule ( config ) . bindPath ( "/api/project" ) . on ( server ) ;
new ProjectModule ( registry , config ) . bindPath ( "/api/project" ) . on ( server ) ;
new ProjectLegacy ( config ) . bindPath ( "/legacy/project" ) . on ( server ) ;
new ProjectLegacy ( registry , config ) . bindPath ( "/legacy/project" ) . on ( server ) ;
new TaskModule ( config ) . bindPath ( "/api/task" ) . on ( server ) ;
new TaskModule ( registry , config ) . bindPath ( "/api/task" ) . on ( server ) ;
new TaskLegacy ( ) . bindPath ( "/legacy/task" ) . on ( server ) ;
new TaskLegacy ( registry , config ) . bindPath ( "/legacy/task" ) . on ( server ) ;
new TimeModule ( config ) . bindPath ( "/api/time" ) . on ( server ) ;
new TimeModule ( registry , config ) . bindPath ( "/api/time" ) . on ( server ) ;
new WebHandler ( ) . bindPath ( "/" ) . on ( server ) ;
new WebHandler ( registry ) . bindPath ( "/" ) . on ( server ) ;
new WikiModule ( config ) . bindPath ( "/api/wiki" ) . on ( server ) ;
new WikiModule ( registry , config ) . bindPath ( "/api/wiki" ) . on ( server ) ;
server . setExecutor ( Executors . newFixedThreadPool ( threads ) ) ;
server . setExecutor ( Executors . newFixedThreadPool ( threads ) ) ;
server . start ( ) ;
server . start ( ) ;