Package io.lumify.miniweb.handlers

Examples of io.lumify.miniweb.handlers.StaticResourceHandler


    }

    public void registerCss(String cssResourceName) {
        String resourcePath = "/css" + cssResourceName;
        if (devMode) {
            get(resourcePath, new StaticResourceHandler(this.getClass(), cssResourceName, "text/css"));
            pluginsCssResources.add(resourcePath);
        } else {
            pluginsCssResourceHandler.appendResource(cssResourceName);
        }
    }
View Full Code Here


    @Override
    public void init(WebApp app, ServletContext servletContext, Handler authenticationHandler) {

        app.get("/jsc/io/lumify/termsOfUse/terms-of-use.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/termsOfUse/terms-of-use.hbs", "text/html"));

        app.registerJavaScript("/io/lumify/termsOfUse/terms-of-use-plugin.js");
        app.registerResourceBundle("/io/lumify/termsOfUse/messages.properties");
        app.get(TERMS_OF_USE_PATH, TermsOfUse.class);
        app.post(TERMS_OF_USE_PATH, TermsOfUse.class);
View Full Code Here

import javax.servlet.ServletContext;

public class X509IdentityWebAppPlugin implements WebAppPlugin {
    @Override
    public void init(WebApp app, ServletContext servletContext, Handler authenticationHandler) {
        StaticResourceHandler jsHandler = new StaticResourceHandler(this.getClass(), "/x509/authentication.js", "application/javascript");
        StaticResourceHandler loginTemplateHandler = new StaticResourceHandler(this.getClass(), "/x509/templates/login.hbs", "text/plain");
        StaticResourceHandler lessHandler = new StaticResourceHandler(this.getClass(), "/x509/less/login.less", "text/plain");

        app.registerJavaScript("/x509/logout.js");
        app.registerCss("/x509/css/logout.css");

        app.get("/logout.html", new StaticResourceHandler(this.getClass(), "/x509/logout.html", "text/html"));
        app.get("/jsc/configuration/plugins/authentication/authentication.js", jsHandler);
        app.get("/jsc/configuration/plugins/authentication/templates/login.hbs", loginTemplateHandler);
        app.get("/jsc/configuration/plugins/authentication/less/login.less", lessHandler);

        app.post(AuthenticationHandler.LOGIN_PATH, InjectHelper.getInstance(X509IdentityAuthenticationHandler.class));
View Full Code Here

        Class<? extends Handler> authenticationHandlerClass = authenticationHandler.getClass();
        Class<? extends Handler> csrfHandlerClass = LumifyCsrfHandler.class;


        app.get("/jsc/io/lumify/opennlpDictionary/web/templates/add.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/opennlpDictionary/web/templates/add.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/opennlpDictionary/web/list-plugin.js");
        app.registerJavaScript("/io/lumify/opennlpDictionary/web/add-plugin.js");

        app.get("/admin/dictionary", authenticationHandlerClass, csrfHandlerClass, AdminPrivilegeFilter.class, AdminDictionary.class);
        app.get("/admin/dictionary/concept", authenticationHandlerClass, csrfHandlerClass, AdminPrivilegeFilter.class, AdminDictionaryByConcept.class);
View Full Code Here

import javax.servlet.ServletContext;

public class UsernamePasswordWebAppPlugin implements WebAppPlugin {
    @Override
    public void init(WebApp app, ServletContext servletContext, Handler authenticationHandler) {
        StaticResourceHandler jsHandler = new StaticResourceHandler(this.getClass(), "/username-password/authentication.js", "application/javascript");
        StaticResourceHandler loginTemplateHandler = new StaticResourceHandler(this.getClass(), "/username-password/templates/login.hbs", "text/plain");
        StaticResourceHandler lessHandler = new StaticResourceHandler(this.getClass(), "/username-password/less/login.less", "text/plain");

        app.get("/jsc/configuration/plugins/authentication/authentication.js", jsHandler);
        app.get("/jsc/configuration/plugins/authentication/templates/login.hbs", loginTemplateHandler);
        app.get("/jsc/configuration/plugins/authentication/less/login.less", lessHandler);
View Full Code Here

    public void init(WebApp app, ServletContext servletContext, Handler authenticationHandler) {
        Class<? extends Handler> authenticationHandlerClass = authenticationHandler.getClass();
        Class<? extends Handler> csrfHandlerClass = LumifyCsrfHandler.class;

        app.get("/jsc/io/lumify/web/importExportWorkspaces/import.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/importExportWorkspaces/import.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/web/importExportWorkspaces/import-plugin.js");
        app.registerResourceBundle("/io/lumify/web/importExportWorkspaces/messages.properties");

        app.get("/jsc/io/lumify/web/importExportWorkspaces/export.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/importExportWorkspaces/export.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/web/importExportWorkspaces/export-plugin.js");

        app.get("/admin/workspace/export", authenticationHandlerClass, csrfHandlerClass, AdminPrivilegeFilter.class, Export.class);
        app.post("/admin/workspace/import", authenticationHandlerClass, csrfHandlerClass, AdminPrivilegeFilter.class, Import.class);
    }
View Full Code Here

    }

    public void registerJavaScript(String scriptResourceName) {
        String resourcePath = "/js" + scriptResourceName;
        if (devMode) {
            get(resourcePath, new StaticResourceHandler(this.getClass(), scriptResourceName, "application/javascript"));
            pluginsJsResources.add(resourcePath);
        } else {
            pluginsJsResourceHandler.appendResource(scriptResourceName);
        }
    }
View Full Code Here

        config.setConfigurables(this.googleConfig, "oauth.google");
    }

    @Override
    public void init(WebApp app, ServletContext servletContext, Handler authenticationHandler) {
        StaticResourceHandler jsHandler = new StaticResourceHandler(this.getClass(), "/oauth/authentication.js", "application/javascript");
        StaticResourceHandler lessHandler = new StaticResourceHandler(this.getClass(), "/oauth/less/oauth.less", "text/plain");
        StaticResourceHandler loginTemplateHandler = new StaticResourceHandler(this.getClass(), "/oauth/templates/login.hbs", "text/plain");

        app.get("/jsc/configuration/plugins/authentication/authentication.js", jsHandler);
        app.get("/jsc/configuration/plugins/authentication/templates/login.hbs", loginTemplateHandler);
        app.get("/jsc/configuration/plugins/authentication/less/oauth.less", lessHandler);
        app.get("/jsc/configuration/plugins/authentication/img/twitter.png", new StaticResourceHandler(this.getClass(), "/oauth/img/twitter.png", "image/png"));
        app.get("/jsc/configuration/plugins/authentication/img/google.png", new StaticResourceHandler(this.getClass(), "/oauth/img/google.png", "image/png"));

        app.get("/oauth/twitter", new Twitter(this.twitterConfig, this.userRepository));
        app.get("/oauth/google", new Google(this.googleConfig, this.userRepository));
    }
View Full Code Here

    public void init(WebApp app, ServletContext servletContext, Handler authenticationHandler) {
        Class<? extends Handler> authenticationHandlerClass = authenticationHandler.getClass();
        Class<? extends Handler> csrfHandlerClass = LumifyCsrfHandler.class;

        app.get("/jsc/io/lumify/web/devTools/less/vertex-editor.less",
                new StaticResourceHandler(getClass(), "/io/lumify/web/devTools/less/vertex-editor.less", "text/less"));
        app.get("/jsc/io/lumify/web/devTools/templates/vertex-editor.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/devTools/templates/vertex-editor.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/web/devTools/vertex-editor-plugin.js");
        app.registerResourceBundle("/io/lumify/web/devTools/messages.properties");

        app.get("/jsc/io/lumify/web/devTools/templates/requeue.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/devTools/templates/requeue.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/web/devTools/requeue-plugin.js");

        app.get("/jsc/io/lumify/web/devTools/templates/ontology-upload.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/devTools/templates/ontology-upload.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/web/devTools/ontology-upload-plugin.js");

        app.get("/jsc/io/lumify/web/devTools/templates/ontology-edit.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/devTools/templates/ontology-edit.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/web/devTools/ontology-edit-plugin.js");

        app.get("/jsc/io/lumify/web/devTools/templates/user.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/devTools/templates/user.hbs", "text/html"));
        app.get("/jsc/io/lumify/web/devTools/templates/user-details.hbs",
                new StaticResourceHandler(getClass(), "/io/lumify/web/devTools/templates/user-details.hbs", "text/html"));
        app.registerJavaScript("/io/lumify/web/devTools/user-plugin.js");

        app.post("/user/auth/add", authenticationHandlerClass, csrfHandlerClass, AdminPrivilegeFilter.class, UserAddAuthorization.class);
        app.post("/user/auth/remove", authenticationHandlerClass, csrfHandlerClass, AdminPrivilegeFilter.class, UserRemoveAuthorization.class);
        app.post("/user/delete", authenticationHandlerClass, csrfHandlerClass, AdminPrivilegeFilter.class, UserDelete.class);
View Full Code Here

import javax.servlet.ServletContext;

public class UsernameOnlyWebAppPlugin implements WebAppPlugin {
    @Override
    public void init(WebApp app, ServletContext servletContext, Handler authenticationHandler) {
        StaticResourceHandler jsHandler = new StaticResourceHandler(this.getClass(), "/username-only/authentication.js", "application/javascript");
        StaticResourceHandler loginTemplateHandler = new StaticResourceHandler(this.getClass(), "/username-only/templates/login.hbs", "text/plain");
        StaticResourceHandler lessHandler = new StaticResourceHandler(this.getClass(), "/username-only/less/login.less", "text/plain");

        app.get("/jsc/configuration/plugins/authentication/authentication.js", jsHandler);
        app.get("/jsc/configuration/plugins/authentication/templates/login.hbs", loginTemplateHandler);
        app.get("/jsc/configuration/plugins/authentication/less/login.less", lessHandler);
View Full Code Here

TOP

Related Classes of io.lumify.miniweb.handlers.StaticResourceHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.