Package org.joget.apps.userview.model

Examples of org.joget.apps.userview.model.UserviewMenu


                    Collection<UserviewMenu> menus = new ArrayList<UserviewMenu>();
                    for (int j = 0; j < menusArray.length(); j++) {
                        try {
                            //set menu
                            JSONObject menuObj = (JSONObject) menusArray.get(j);
                            UserviewMenu menu = (UserviewMenu) pluginManager.getPlugin(menuObj.getString("className"));
                           
                            // check for mobile support
                            boolean isMobileView = MobileUtil.isMobileView();
                            if (isMobileView && (menu instanceof MobileElement) && !((MobileElement)menu).isMobileSupported()) {
                                // mobile not supported, skip this menu
                                continue;
                            }
           
                            menu.setProperties(PropertyUtil.getPropertiesValueFromJson(menuObj.getJSONObject("properties").toString()));
                            menu.setRequestParameters(requestParameters);
                            menu.setUserview(userview);
                            String mId = getMenuId(menu);
                            menu.setProperty("menuId", mId);

                            if (preview) {
                                menu.setUrl(contextPath + "/web/console/app/" + appId + "/" + appVersion + "/userview/builderPreview/" + userview.getPropertyString("id") + "/" + mId);
                            } else {
                                menu.setKey(key);
                                String prefix = "/web/userview/";
                               
                                if (embed) {
                                    prefix = "/web/embed/userview/";
                                }
                               
                                menu.setUrl(contextPath + prefix + appId + "/" + userview.getPropertyString("id") + "/" + ((key != null) ? URLEncoder.encode(key, "UTF-8") : "") + "/" + mId);
                            }

                            //set Current, if current menu id is empty, search the 1st valid menu
                            if ((("".equals(menuId) || menuId == null) && userview.getCurrent() == null && menu.isHomePageSupported())
                                    || (menuId != null && menuId.equals(mId))) {
                                userview.setCurrent(menu);
                                userview.setCurrentCategory(category);
                            }
                           
                            //set home menu Id
                            if (userview.getPropertyString("homeMenuId") == null || userview.getPropertyString("homeMenuId").isEmpty() && menu.isHomePageSupported()) {
                                userview.setProperty("homeMenuId", mId);
                            }

                            menus.add(menu);
                        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.joget.apps.userview.model.UserviewMenu

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.