public MenuPageInfo() { /* * Returns the object used to check whether this page can be accessed or not.<br> * It's used to hide the pages that cannot be accessed from the left menu.<br> * This method is invoked only if the page happens to be a {@link GeoServerSecuredPage}. * <p>If you do override this method, make sure to override the authorizer grabbing * method in the page as well</p> * @return */ setAuthorizer(GeoServerSecuredPage.DEFAULT_AUTHORIZER); } public void setCategory(Category category){
public void populateItem(ListItem item){ MenuPageInfo info = (MenuPageInfo)item.getModelObject(); BookmarkablePageLink link = new BookmarkablePageLink("link", info.getComponentClass()); link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null))); link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null))); item.add(link); } }
/** * Splits up the pages by category, turning the list into a map keyed by category * * @param pages */ private Map<Category, List<MenuPageInfo>> splitByCategory(List<MenuPageInfo> pages) { Collections.sort(pages); HashMap<Category, List<MenuPageInfo>> map = new HashMap<Category, List<MenuPageInfo>>(); for (MenuPageInfo page : pages) { Category cat = page.getCategory(); if (!map.containsKey(cat)) map.put(cat, new ArrayList<MenuPageInfo>()); map.get(cat).add(page); } return map; }
public void populateItem(ListItem<MenuPageInfo> item) { MenuPageInfo info = item.getModelObject(); BookmarkablePageLink<Page> link = new BookmarkablePageLink<>("link", info.getComponentClass()); link.add( AttributeModifier.replace( "title", new StringResourceModel( info.getDescriptionKey(), (Component) null, null))); link.add( new Label( "link.label", new StringResourceModel( info.getTitleKey(), (Component) null, null))); item.add(link); } });
/** * Splits up the pages by category, turning the list into a map keyed by category * @param pages * @return */ private Map<Category,List<MenuPageInfo>> splitByCategory(List<MenuPageInfo> pages){ Collections.sort(pages); HashMap<Category,List<MenuPageInfo>> map = new HashMap<Category,List<MenuPageInfo>>(); for (MenuPageInfo page : pages){ Category cat = page.getCategory(); if (!map.containsKey(cat)) map.put(cat, new ArrayList<MenuPageInfo>()); map.get(cat).add(page); } return map; }
public MenuPageInfo() { /* * Returns the object used to check whether this page can be accessed or not.<br> * It's used to hide the pages that cannot be accessed from the left menu.<br> * This method is invoked only if the page happens to be a {@link GeoServerSecuredPage}. * <p>If you do override this method, make sure to override the authorizer grabbing * method in the page as well</p> * */ setAuthorizer(GeoServerSecuredPage.DEFAULT_AUTHORIZER); }