⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linkmgr.java

📁 源码/软件简介: 云网论坛1.1RC国际版是采用JSP开发的集论坛、CMS(网站内容管理系统)、博客、聊天室、商城、交友、语音灌水等于一体的门户式社区。拥有CWBBS ( Cloud Web BBS
💻 JAVA
字号:
package cn.js.fan.module.nav;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import cn.js.fan.cache.jcs.RMCache;
import cn.js.fan.util.ErrMsgException;
import org.apache.log4j.Logger;

public class LinkMgr {
    Logger logger = Logger.getLogger(LinkMgr.class.getName());
    RMCache rmCache;

    public LinkMgr() {
        rmCache = RMCache.getInstance();
    }

    public boolean add(ServletContext application, HttpServletRequest request) throws
            ErrMsgException {
        LinkForm lf = new LinkForm();
        lf.checkAdd(application, request);
        userName = lf.getUserName();

        LinkDb ld = new LinkDb();
        ld.setUrl(lf.getUrl());
        ld.setTitle(lf.getTitle());
        ld.setKind(lf.getKind());
        ld.setUserName(lf.getUserName());
        boolean re = ld.create(lf.fileUpload);
        return re;
    }

    public boolean del(ServletContext application, HttpServletRequest request) throws ErrMsgException {
        LinkForm lf = new LinkForm();
        lf.checkDel(request);

        LinkDb ld = new LinkDb();
        ld = ld.getLinkDb(lf.getId());
        boolean re = ld.del(application.getRealPath("/"));
        return re;
    }

    public boolean move(HttpServletRequest request) throws ErrMsgException {
        LinkForm lf = new LinkForm();
        lf.checkMove(request);

        LinkDb ld = new LinkDb();
        ld = ld.getLinkDb(lf.getId());
        boolean re = ld.move(lf.getDirection());
        return re;
    }

    public boolean modify(ServletContext application, HttpServletRequest request) throws ErrMsgException {
        LinkForm lf = new LinkForm();
        lf.checkModify(application, request);
        userName = lf.getUserName();

        LinkDb ld = new LinkDb();
        ld = ld.getLinkDb(lf.getId());
        ld.setUrl(lf.getUrl());
        ld.setTitle(lf.getTitle());
        ld.setKind(lf.getKind());
        ld.setUserName(lf.getUserName());

        boolean re = ld.save(lf.getFileUpload());
        return re;
    }

    public LinkDb getLinkDb(int id) {
        LinkDb ld = new LinkDb();
        return ld.getLinkDb(id);
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserName() {
        return userName;
    }

    private String userName;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -