In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Background menus and permissions are the core parts of plug-in (secondary) development, and they are also the most difficult parts to integrate seamlessly. Most systems save menu information to the database, which brings some difficulties to upgrade and maintenance.
The menu and permission information of Jspxcms are stored in the configuration, which is convenient to manage, maintain and upgrade; as long as it is set in a configuration file, the menu, permissions, empowerment and other problems of the system can be seamlessly integrated without the need to modify the code and page.
When developing, you can add the new function menu to any location under any first-level menu according to your needs, or you can add your own first-level menu, and the new first-level menu can also be placed in any location you want.
Menu introduction
Background menu is divided into two levels, such as content management, file management, user rights, system management for the first-level menu, document management, column management, user management, role management for the second-level menu.
The background menu currently does not support three levels.
Configuration file
/ src/main/resources/conf/plugin/plug/menu.yml
Menu configuration files support wildcard loading, configuration files that comply with the rules of classpath:conf/**/menu*.yml will be loaded, and the configuration of other menus in the system is located in / src/main/resources/conf/menu.yml.
The load menu configuration file is loaded by com.jspxcms.core.MenuConfig 's appContext.getResources ("classpath:conf/**/menu*.yml"); code.
First-level menu configuration
There is a level of menu configuration in the / src/main/resources/conf/menu.yml file.
600: name: navigation.plug icon: fa fa-plug perms: nav_plug
600: menu serial number, which determines the position of the first-level menu arrangement. For example, the menu with serial number 500 will be ranked before 600, while the serial number 550 will be between 500 and 600. Note: this serial number must be unique in all menu configuration files. If you already have a menu with 600 serial number, you cannot create a menu with the same serial number, which can be 610 or 558.
Name: name of the navigation.plug menu. Where navigation.plug is the internationalization code, and the corresponding Chinese code is found in the file in the / src/main/resources/messages directory. You can also write directly in Chinese, such as name: my menu.
Icon: fa fa-plug menu icon. Where fa fa-plug is the icon style, please refer to: https://getbootstrap.com/docs/3.3/components/.
Perms: nav_plug weight limit. The first-level menu is usually a virtual menu, which only expands the second-level menu after clicking, and there is no need to access the background, so the permission value can be defined at will, as long as it is not repeated with the original permission value.
Secondary menu configuration
There is a secondary menu configuration in the / src/main/resources/conf/plugin/plug/menu.yml file.
1000: name: resume.management url: plug/resume/list.do perms: plug:resume:list ops:-create@plug:resume:create-copy@plug:resume:copy-edit@plug:resume:edit-save@plug:resume:save-update@plug:resume:update-delete@plug:resume:delete600-1100: name: weixinMenu.management url: plug/weixin_menu/list.do perms: plug:weixin_menu:list ops:-save@plug:weixin_menu:save
600-1000 menu serial number. There are two levels here, so it is a second-level menu, where 600 is the serial number of the first-level menu, which means that the second-level menu belongs to the first-level menu with the serial number 600. 1000 is the serial number of the secondary menu, which determines the location of the secondary menu. This serial number must be unique in the primary menu to which it belongs. Note: the corresponding first-level menu must exist.
Name: name of the resume.management menu. Same as the first-level menu.
Url: plug/resume/list.do menu URL address. Click on the url visited by this menu. This is a relative path based on / cmscp/, so this address is actually / cmscp/plug/resume/list.do. The url address must have a corresponding Controller, otherwise the page will not be found by clicking this menu. Such as @ RequestMapping ("/ plug/resume") and @ RequestMapping ("list.do").
Perms: plug:resume:list menu weight value. This permission value must correspond to the @ RequiresPermissions ("plug:resume:list") of url's Controller method.
Ops: list of button permissions. A module has other permissions in addition to clicking on the menu. For example, after clicking on the menu link of resume management, there are buttons to add, modify and delete resumes.
Create@plug:resume:create button weight limit. Create is an international code. Plug:resume:create is the weight limit and must be consistent with @ RequiresPermissions ("plug:resume:create") in the Controller method. You can also use Chinese directly, such as adding @ plug:resume:create.
Corresponding Java code
Package com.jspxcms.plug.web.back;@Controller@RequestMapping ("/ plug/resume") public class ResumeController {@ RequiresPermissions ("plug:resume:list") @ RequestMapping ("list.do") public String list (...) {. Return "plug/resume/resume_list";} @ RequiresPermissions ("plug:resume:create") @ RequestMapping ("create.do") public String create (...) {. Return "plug/resume/resume_form";}.} menu configuration and rights management
After the menu is configured according to the above steps, the role management function permission tree reads the configuration file without modifying the role management page and code.
This is the end of the article on "how to configure the menu and permissions of jspXCMS". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to configure the menu and permissions of jspXCMS". If you still want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.