Examples of UserviewDefinition


Examples of org.joget.apps.app.model.UserviewDefinition

       
        //redirect directly to app when only has one userview
        if (resultAppDefinitionList.size() == 1 && !WorkflowUtil.isCurrentUserAnonymous()) {
            AppDefinition appDef = resultAppDefinitionList.iterator().next();
            if (appDef.getUserviewDefinitionList() != null && appDef.getUserviewDefinitionList().size() == 1) {
                UserviewDefinition uv = appDef.getUserviewDefinitionList().iterator().next();
               
                Cookie cookie = cookiesMap.get("all-apps");
                if (cookie != null) {
                    cookie.setValue("");
                    cookie.setPath(request.getContextPath());
                    cookie.setMaxAge(0);
                    response.addCookie(cookie);
                }
           
                return "redirect:/web/mobile/"+appDef.getAppId()+"/"+uv.getId()+"//landing";
            }
        } else {
            Cookie cookie = cookiesMap.get("all-apps");
            if (cookie == null) {
                cookie = new Cookie("all-apps", "true");
View Full Code Here

Examples of org.joget.apps.app.model.UserviewDefinition

        AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
        if (appDef == null) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
        UserviewDefinition userviewDef = userviewDefinitionDao.loadById(userviewId, appDef);
        if (userviewDef == null) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
        String json = userviewDef.getJson();
        Userview userview = userviewService.createUserview(json, null, false, request.getContextPath(), request.getParameterMap(), null, false);
        boolean cacheEnabled = "true".equals(userview.getSetting().getProperty("mobileCacheEnabled"));
        if (!cacheEnabled) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }

        // set response type
        response.setContentType("text/cache-manifest");

        // set expires header
        response.addDateHeader("Expires", 0);

        // generate cache manifest for the app userview
        String contextPath = AppUtil.getRequestContextPath();
        String currentUser = WorkflowUtil.getCurrentUsername();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        String manifest = "CACHE MANIFEST\n"
                + "# " + appDef.getAppId() + " v" + appDef.getVersion() + " " + userviewDef.getId() + " " + userviewDef.getDateModified() + " " + currentUser + " " + cal.getTime() + "\n"
                + "NETWORK:\n"
                + "*\n"
                + "\n"
                + "CACHE:\n"
                + contextPath + "/home/logo.png\n"
                + contextPath + "/home/style.css\n"
                + contextPath + "/js/jquery/themes/ui-lightness/jquery-ui-1.10.3.custom.css\n"
                + contextPath + "/mobile/jqm/jquery.mobile-1.4.0-rc.1.css\n"
                + contextPath + "/mobile/mobile.css\n"
                + contextPath + "/js/jquery/jquery-1.9.1.min.js\n"
                + contextPath + "/js/jquery/jquery-migrate-1.2.1.min.js\n"
                + contextPath + "/js/jquery/ui/jquery-ui-1.10.3.min.js\n"
                + contextPath + "/mobile/jqm/jquery.mobile-1.4.0-rc.1.min.js\n"
                + contextPath + "/mobile/jqm/jquery.cookie.js\n"
                + contextPath + "/mobile/mobile.js\n"
                + contextPath + "/mobile/mobile_util.js\n"
                + contextPath + "/js/json/ui.js\n"
                + contextPath + "/js/json/ui_ext.js\n"
                + contextPath + "/js/json/util.js\n"
                + contextPath + "/mobile/jqm/images/ajax-loader.gif\n"
                + contextPath + "/css/form.css\n"
                + contextPath + "/plugin/org.joget.apps.form.model.Section/js/section.js\n";

        UserviewSetting setting = userview.getSetting();
        String backgroundUrl = setting.getPropertyString("mobileViewBackgroundUrl");
        String logoUrl = setting.getPropertyString("mobileViewLogoUrl");
        if (backgroundUrl != null && !backgroundUrl.trim().isEmpty()) {
            manifest += backgroundUrl + "\n";
        }
        if (logoUrl != null && !logoUrl.trim().isEmpty()) {
            manifest += logoUrl + "\n";
        }

        Collection<UserviewCategory> categories = userview.getCategories();
        for (UserviewCategory cat : categories) {
            Collection<UserviewMenu> menus = cat.getMenus();
            for (UserviewMenu menu : menus) {
                String menuId = userviewService.getMenuId(menu);
                manifest += contextPath + "/web/mobile/" + appDef.getId() + "/" + userviewDef.getId() + "//" + menuId + "\n";
            }
        }

        LogUtil.debug(getClass().getName(), "Request: " + request.getRequestURI());
        // output manifest
View Full Code Here

Examples of org.joget.apps.app.model.UserviewDefinition

        map.addAttribute("appVersion", appDef.getVersion());
        map.addAttribute("key", key);
        map.addAttribute("menuId", menuId);
        //try to support more by not setting mobile view
        //MobileUtil.setMobileView(request, Boolean.TRUE);
        UserviewDefinition userviewDef = userviewDefinitionDao.loadById(userviewId, appDef);
        if (userviewDef != null) {
            String json = userviewDef.getJson();
            Userview userview = userviewService.createUserview(json, menuId, false, request.getContextPath(), request.getParameterMap(), key, false);
            boolean loginRequired = "true".equals(userview.getSetting().getProperty("mobileLoginRequired"));
            if (loginRequired) {
                boolean isAnonymous = WorkflowUtil.isCurrentUserAnonymous();
                if (isAnonymous) {
View Full Code Here

Examples of org.joget.apps.app.model.UserviewDefinition

        AppDefinition appDef = appService.getAppDefinition(appId, version);
        map.addAttribute("appId", appId);
        map.addAttribute("appVersion", appDef.getVersion());
        map.addAttribute("appDefinition", appDef);

        UserviewDefinition userviewDefinition = new UserviewDefinition();
        map.addAttribute("userviewDefinition", userviewDefinition);
        return "console/apps/userviewCreate";
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.