码迷,mamicode.com
首页 > 其他好文 > 详细

金甲防线服务项目笔记:菜单和初始化

时间:2017-09-07 20:27:11      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:long   bsp   number   tty   用户组   白名单   gen   技术   jsp   

1、首先数据库jdbc配置:config路径下,配置jdbc,数据库名:jjfxxin,账户:root,密码:123456

技术分享

2、菜单初始化设置:

技术分享

//3.5.4服务中心-->应用商城-->正版序列号管理
Resource genuineSerialNumberManagement = new Resource("正版序列号管理", "正版序列号管理", "正版序列号管理", "sys_icon.png", "sys", "link", "genuineSerialNumberManagementAction_listUI.do", Integer.valueOf(30504), Integer.valueOf(3), createTime, updateTime, appstoreResource);
this.resourceDao.save(genuineSerialNumberManagement);
this.resourceDao.save(new Resource("添加序列号", "添加序列号", "添加序列号", "sys_system_add.png", "sys", "operate", "genuineSerialNumberManagementAction_addUI.do", Integer.valueOf(3050401), Integer.valueOf(4), createTime, updateTime, genuineSerialNumberManagement));
this.resourceDao.save(new Resource("修改序列号", "修改序列号", "修改序列号", "sys_system_add.png", "sys", "operate", "genuineSerialNumberManagementAction_editUI.do", Integer.valueOf(3050402), Integer.valueOf(4), createTime, updateTime, genuineSerialNumberManagement));
this.resourceDao.save(new Resource("删除序列号", "删除序列号", "删除序列号", "sys_system_add.png", "sys", "operate", "genuineSerialNumberManagementAction_delete.do", Integer.valueOf(3050403), Integer.valueOf(4), createTime, updateTime, genuineSerialNumberManagement));
this.resourceDao.save(new Resource("导入规则库", "导入规则库", "导入规则库", "sys_system_add.png", "sys", "operate", "genuineSerialNumberManagementAction_importUI.do", Integer.valueOf(3050404), Integer.valueOf(4), createTime, updateTime, genuineSerialNumberManagement));
this.resourceDao.save(new Resource("导出规则库", "导出规则库", "导出规则库", "sys_system_add.png", "sys", "operate", "genuineSerialNumberManagementAction_export.do", Integer.valueOf(3050405), Integer.valueOf(4), createTime, updateTime, genuineSerialNumberManagement));

代表层级下的子级目录等。

3、然后struts配置

     <!-- 用户组管理 -->
        <action name="userGroupAction_*" class="userGroupAction" method="{1}">
            <result name="{1}">/WEB-INF/pages/userGroupAction/{1}.jsp</result>
            <result name="toList" type="redirectAction">/userGroupAction_listUI.do</result>
        </action>
        <!-- 正版序列号管理 -->
        <action name="genuineSerialNumberManagementAction_*" class="genuineSerialNumberManagementAction" method="{1}">
            <result name="{1}">/WEB-INF/pages/genuineSerialNumberManagementAction/{1}.jsp</result>
            <result name="toList" type="redirectAction">/genuineSerialNumberManagementAction_listUI.do</result>
        </action>

4、在domain目录下新建xml和对应的实体类文件

技术分享      和      技术分享

XML里面对应数据库字段:table表示会新建的数据库表的名字

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="com.vrv.paw.domain">
    <class name="GenuineSerialNumberManagement" table="vrv_paw_genuineSerialNumberManagement">
        <cache usage="transactional" />
        <id name="id" column="id" type="integer">
            <generator class="native" />
        </id>
        <property name="softId" type="integer"/>
        <property name="version" type="string" length="255" />
        <property name="serialNumber" type="string" length="255" />
        <property name="softDisplayName" type="string" length="64" />
        <property name="type" type="integer"/>
    </class>
</hibernate-mapping>

数据库字段:

技术分享

实体类文件对应XML里面的设置的属性和其get和set方法:此处注意:get/set方法最好用eclipse自动生成,自己写有时候错了,不容易找到问题

package com.vrv.paw.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

public class GenuineSerialNumberManagement<T> implements Serializable {
    
    private static final long serialVersionUID = -8509177078853219369L;
    //序号
    private Integer id;
    //软件id号
    private Integer softId;
    //版本号
    private String version;
    //序列号
    private String serialNumber;
    //软件名
    private String softDisplayName;
    //黑白名单类型
    private Integer type;
    
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Integer getSoftId() {
        return softId;
    }
    public void setSoftId(Integer softId) {
        this.softId = softId;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public String getSerialNumber() {
        return serialNumber;
    }
    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }
    public String getSoftDisplayName() {
        return softDisplayName;
    }
    public void setSoftDisplayName(String softDisplayName) {
        this.softDisplayName = softDisplayName;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }

    public GenuineSerialNumberManagement() {
        super();
    }
    public GenuineSerialNumberManagement(Integer softId, String version, String serialNumber, String softDisplayName,
            Integer type) {
        this.softId = softId;
        this.version = version;
        this.serialNumber = serialNumber;
        this.softDisplayName = softDisplayName;
        this.type = type;
    }
    
}

5、数据库初始化:

技术分享

删除该表,并重新建一个空表,运行项目初始化。

6、授权:

初始化之后菜单暂时并不会出现我们设置的菜单,还需要该项目授权

技术分享

授权之后将生成的menu.properties文件拷贝覆盖原先的文件即可出现设置的菜单项。

技术分享

 

金甲防线服务项目笔记:菜单和初始化

标签:long   bsp   number   tty   用户组   白名单   gen   技术   jsp   

原文地址:http://www.cnblogs.com/goloving/p/7491498.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!