Examples of Bbs


Examples of kr.or.javacafe.board.domain.Bbs

 
  @RequestMapping(value = "/list/BBS_ID/{bbsId}", method = RequestMethod.GET)
  public String list(@RequestParam(value = "single", required = false, defaultValue = "") String single, String page, @PathVariable String bbsId, HttpServletRequest request, Model model) {
   
    // 게시판 관리 정보
    Bbs objBbsInfo = boardBO.getBbsInfo(bbsId);
   
    // 게시판 권한 정보
    String strRoleRead = "";
    String strRoleWrite = "";   
    User objUserInfo = RoleUtil.getUserInfo();
    if (objUserInfo == null) {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", "G0");
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", "G0");
    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 목록 조회시 [읽기권한]이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleRead == "") throw new UsernameNotFoundException("목록 조회시 접근한 게시판에 Read 권한이 존재하지않습니다.");


    // 게시판 정보
    Article article = new Article();
    article.setBbsId(bbsId);

    // Page 정보
    if (page == null) page = "1";
    if (page.equals("")) page = "1";

    int totalRows = boardBO.getListArticleCount(article);
    int rowRange = m_intRowRange;
    int pageRange = m_intPageRange;
    int pageNum = Integer.parseInt(page);
    String pageURL = "/board/list/BBS_ID/" + bbsId;

    PagingHelper pHelper = PagingHelper.instance;
    pHelper.init(totalRows, rowRange, pageRange, pageNum);

    String pageHTML = pHelper.getPagingHTML(single, pageURL);

    int startNum = pHelper.getStartRownum();
    int endNum = pHelper.getEndRownum();

   
    logger.info("시작 idx : "+startNum);
    logger.info("끝 idx : "+endNum);
    article.setStartBbsThread(startNum);
    article.setEndBbsThread(rowRange);
    List<Article> objArticleList = boardBO.listArticle(article);

   
    logger.info("시작 idx : "+startNum);
    logger.info("끝 idx : "+endNum);
    logger.info("size     :   "+objArticleList.size());
   
    model.addAttribute("boardRoleRead", strRoleRead);
    model.addAttribute("boardRoleWrite", strRoleWrite);
    model.addAttribute("single", single);
   
    model.addAttribute("objBbsInfo", objBbsInfo);
    model.addAttribute("objArticleList", objArticleList);
    model.addAttribute("pageHTML", pageHTML);
    model.addAttribute("page", page);
   
    if (!objBbsInfo.getCdCatId().equals("")) {
      // 게시판 카테고리 정보가 존재할 경우 카테고리 정보를 보여준다.
      model.addAttribute("boardCatgList", codeCategoryBO.listCodeCategoryForCombo(objBbsInfo.getCdCatId()));     
    }
     

    if (objBbsInfo.getBbsTypeCd().equals("FAQ"))
    {
      // FAQ 타입의 게시판일 경우 관리자만 편집가능
      return "board/faq";
    }
    else
View Full Code Here

Examples of kr.or.javacafe.board.domain.Bbs

 
  @RequestMapping(value = "/view/BBS_ID/{bbsId}/ATC_NO/{atcNo}", method = RequestMethod.GET)
  public String view(@RequestParam(value = "single", required = false, defaultValue = "") String single, String page, @PathVariable String bbsId, @PathVariable String atcNo, HttpServletRequest request, Model model) {
   
    // 게시판 관리 정보
    Bbs objBbsInfo = boardBO.getBbsInfo(bbsId);

    // 게시판 권한 정보
    String strRoleRead = "";
    String strRoleWrite = "";   
    User objUserInfo = RoleUtil.getUserInfo();
    if (objUserInfo == null) {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", "G0");
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", "G0");
    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 내용 조회시 [읽기권한]이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleRead == "") throw new UsernameNotFoundException("내용 조회시 접근한 게시판에 Read 권한이 존재하지않습니다.");


    // 게시판 정보
    Article article = new Article();
    article.setBbsId(bbsId);

    // Page 정보
    if (page == null) page = "1";
    if (page.equals("")) page = "1";
    int totalRows = boardBO.getListArticleCount(article);
    int rowRange = m_intRowRange;
    int pageRange = m_intPageRange;
    int pageNum = Integer.parseInt(page);
    String pageURL = "/board/list/BBS_ID/" + bbsId;

    PagingHelper pHelper = PagingHelper.instance;
    pHelper.init(totalRows, rowRange, pageRange, pageNum);

    String pageHTML = pHelper.getPagingHTML(single, pageURL);
   
    int startNum = pHelper.getStartRownum();
    int endNum = pHelper.getEndRownum();

    Article objViewArticle = null;
    Article objNextArticle = null;
    Article objPrevArticle = null;

    article.setStartBbsThread(startNum);
    article.setEndBbsThread(endNum);
    List<Article> objArticleList = boardBO.listArticle(article);
    for (int i = 0; i < objArticleList.size(); i++) {
      if (objArticleList.get(i).getAtcNo() == new Integer(atcNo)) {
       
        objViewArticle = objArticleList.get(i);
        boardBO.hitArticle(new Integer(atcNo));
       
        if (i > 0)
          objNextArticle = objArticleList.get(i - 1);
       
        if (i < (objArticleList.size() - 1))
          objPrevArticle = objArticleList.get(i + 1);
      }
    }


    // 사용자 정보
    String strId = "";
    if (objUserInfo != null) strId = objUserInfo.getId();
   
    // 권한정보
    String strAuth = "";
    if (objUserInfo != null) {
      strAuth = objUserInfo.getRoleGrpId();
    }
   
    model.addAttribute("userRole", strAuth);
    model.addAttribute("boardRoleRead", strRoleRead);
    model.addAttribute("boardRoleWrite", strRoleWrite);
    model.addAttribute("single", single);
   
    model.addAttribute("objBbsInfo", objBbsInfo);
    model.addAttribute("objArticleList", objArticleList);
    model.addAttribute("pageHTML", pageHTML);
    model.addAttribute("page", page);
    model.addAttribute("objViewArticle", objViewArticle);
    model.addAttribute("objNextArticle", objNextArticle);
    model.addAttribute("objPrevArticle", objPrevArticle);
    model.addAttribute("userId", strId);

    if (!objBbsInfo.getCdCatId().equals("")) {
      // 게시판 카테고리 정보가 존재할 경우 카테고리 정보를 보여준다.
      model.addAttribute("boardCatgList", codeCategoryBO.listCodeCategoryForCombo(objBbsInfo.getCdCatId()));     
    }
   
    return "board/view";
  }
View Full Code Here

Examples of kr.or.javacafe.board.domain.Bbs

  @RequestMapping(value = "/add/BBS_ID/{bbsId}", method = RequestMethod.GET)
  public String add(@RequestParam(value = "single", required = false, defaultValue = "") String single, @RequestParam(value = "atcNo", required = false, defaultValue = "") String atcNo, @PathVariable String bbsId, HttpServletRequest request, Model model) {


    // 게시판 관리 정보
    Bbs objBbsInfo = boardBO.getBbsInfo(bbsId);

    // 게시판 권한 정보
    String strRoleRead = "";
    String strRoleWrite = "";   
    User objUserInfo = RoleUtil.getUserInfo();
    if (objUserInfo == null) {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", "G0");
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", "G0");
    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 내용 추가시 [쓰기권한]이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleWrite == "") throw new UsernameNotFoundException("내용 작성시 접근한 게시판에 Write 권한이 존재하지않습니다.");

    // 사용자 정보
    String strId = "";
    if (objUserInfo != null) strId = objUserInfo.getId();

    Article article = null;
    if (atcNo.equals("")) {
      // 신규 등록
      article = new Article();
      article.setBbsId(bbsId);
      article.setRegrEmpNo(strId);
      article.setRegIp(request.getRemoteAddr());
      article.setModIp(request.getRemoteAddr());
    } else {
      // 답글 등록
      article = boardBO.viewArticle(new Integer(atcNo));
    }

   
    model.addAttribute("userRole", objUserInfo.getRoleGrpId());
    model.addAttribute("boardRoleRead", strRoleRead);
    model.addAttribute("boardRoleWrite", strRoleWrite);
    model.addAttribute("single", single);
   
    model.addAttribute("objBbsInfo", objBbsInfo);
    model.addAttribute("article", article);

    if (!objBbsInfo.getCdCatId().equals("")) {
      // 게시판 카테고리 정보가 존재할 경우 카테고리 정보를 보여준다.
      model.addAttribute("boardCatgList", codeCategoryBO.listCodeCategoryForCombo(objBbsInfo.getCdCatId()));     
    }

    return "board/add";
  }
View Full Code Here

Examples of kr.or.javacafe.board.domain.Bbs

  @RequestMapping(value = "/json/BBS_ID/{bbsId}", method = RequestMethod.GET)
  @ResponseBody
  public Map jsonBoardList(@RequestParam(value = "single", required = false, defaultValue = "") String single, String page, @PathVariable String bbsId, HttpServletRequest request, Model model) {
   
    // 게시판 관리 정보
    Bbs objBbsInfo = boardBO.getBbsInfo(bbsId);
   
    // 게시판 권한 정보
    String strRoleRead = "";
    String strRoleWrite = "";   
    User objUserInfo = RoleUtil.getUserInfo();
    if (objUserInfo == null) {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", "G0");
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", "G0");
    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 목록 조회시 [읽기권한]이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleRead == "") throw new UsernameNotFoundException("목록 조회시 접근한 게시판에 Read 권한이 존재하지않습니다.");


    // 게시판 정보
    Article article = new Article();
    article.setBbsId(bbsId);

    // Page 정보
    if (page == null) page = "1";
    if (page.equals("")) page = "1";

    int totalRows = boardBO.getListArticleCount(article);
    int rowRange = m_intRowRange;
    int pageRange = m_intPageRange;
    int pageNum = Integer.parseInt(page);
    String pageURL = "/board/list/BBS_ID/" + bbsId;

    PagingHelper pHelper = PagingHelper.instance;
    pHelper.init(totalRows, rowRange, pageRange, pageNum);

    String pageHTML = pHelper.getPagingHTML(single, pageURL);

    int startNum = pHelper.getStartRownum();
    int endNum = pHelper.getEndRownum();

    article.setStartBbsThread(startNum);
    article.setEndBbsThread(endNum);
    List<Article> objArticleList = boardBO.listArticle(article);

    Map objMap = new HashMap();

    objMap.put("boardRoleRead", strRoleRead);
    objMap.put("boardRoleWrite", strRoleWrite);
    objMap.put("single", single);
   
    objMap.put("objBbsInfo", objBbsInfo);
    objMap.put("objArticleList", objArticleList);
    objMap.put("pageHTML", pageHTML);
    objMap.put("page", page);
   
    if (!objBbsInfo.getCdCatId().equals("")) {
      // 게시판 카테고리 정보가 존재할 경우 카테고리 정보를 보여준다.
      objMap.put("boardCatgList", codeCategoryBO.listCodeCategoryForCombo(objBbsInfo.getCdCatId()));     
    }
     
    return objMap;
 
View Full Code Here

Examples of kr.or.javacafe.board.domain.Bbs

  @RequestMapping(value = "/json/BBS_ID/{bbsId}/ATC_NO/{atcNo}", method = RequestMethod.GET)
  @ResponseBody
  public Map jsonBoardView(@RequestParam(value = "single", required = false, defaultValue = "") String single, String page, @PathVariable String bbsId, @PathVariable String atcNo, HttpServletRequest request, Model model) {

    // 게시판 관리 정보
    Bbs objBbsInfo = boardBO.getBbsInfo(bbsId);

    // 게시판 권한 정보
    String strRoleRead = "";
    String strRoleWrite = "";   
    User objUserInfo = RoleUtil.getUserInfo();
    if (objUserInfo == null) {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", "G0");
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", "G0");
    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 내용 조회시 [읽기권한]이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleRead == "") throw new UsernameNotFoundException("내용 조회시 접근한 게시판에 Read 권한이 존재하지않습니다.");


    // 게시판 정보
    Article article = new Article();
    article.setBbsId(bbsId);

    // Page 정보
    if (page == null) page = "1";
    if (page.equals("")) page = "1";
    int totalRows = boardBO.getListArticleCount(article);
    int rowRange = m_intRowRange;
    int pageRange = m_intPageRange;
    int pageNum = Integer.parseInt(page);
    String pageURL = "/board/list/BBS_ID/" + bbsId;

    PagingHelper pHelper = PagingHelper.instance;
    pHelper.init(totalRows, rowRange, pageRange, pageNum);

    String pageHTML = pHelper.getPagingHTML(single, pageURL);
   
    int startNum = pHelper.getStartRownum();
    int endNum = pHelper.getEndRownum();

    Article objViewArticle = null;

    article.setStartBbsThread(startNum);
    article.setEndBbsThread(endNum);
    List<Article> objArticleList = boardBO.listArticle(article);

    // 사용자 정보
    String strId = "";
    if (objUserInfo != null) strId = objUserInfo.getId();
   
    // 권한정보
    String strAuth = "";
    if (objUserInfo != null) {
      strAuth = objUserInfo.getRoleGrpId();
    }
   
    Map objMap = new HashMap();
   
    objMap.put("userRole", strAuth);
    objMap.put("boardRoleRead", strRoleRead);
    objMap.put("boardRoleWrite", strRoleWrite);
    objMap.put("single", single);
   
    objMap.put("objBbsInfo", objBbsInfo);
    objMap.put("objArticleList", objArticleList);
    objMap.put("pageHTML", pageHTML);
    objMap.put("page", page);
    objMap.put("objViewArticle", objViewArticle);
    objMap.put("userId", strId);

    if (!objBbsInfo.getCdCatId().equals("")) {
      // 게시판 카테고리 정보가 존재할 경우 카테고리 정보를 보여준다.
      objMap.put("boardCatgList", codeCategoryBO.listCodeCategoryForCombo(objBbsInfo.getCdCatId()));     
    }
   
    return objMap;
  }
View Full Code Here

Examples of kr.or.javacafe.board.domain.Bbs

      ServletContext sc = ((HttpServletRequest) pageContext.getRequest()).getSession().getServletContext();
      WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(sc);    
     
      BoardDAO boardDAO = (BoardDAO)ctx.getBean("boardDAOImpl");

      Bbs param = new Bbs();
      param.setBbsId(bbsId);
      Bbs bbs = boardDAO.selectBbs(param);
     
      return bbs.getBbsNm();
    }
   
    return "";
  }
View Full Code Here

Examples of kr.or.javacafe.board.domain.Bbs

  @RequestMapping(value = "/edit/BBS_ID/{bbsId}/ATC_NO/{atcNo}", method = RequestMethod.GET)
  public String edit(@RequestParam(value = "single", required = false, defaultValue = "") String single, @PathVariable String bbsId, @PathVariable String atcNo, HttpServletRequest request, Model model) {

    // 게시판 관리 정보
    Bbs objBbsInfo = boardBO.getBbsInfo(bbsId);
   
    // 게시판 권한 정보
    String strRoleRead = "";
    String strRoleWrite = "";   
    User objUserInfo = RoleUtil.getUserInfo();
    if (objUserInfo == null) {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", "G0");
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", "G0");
    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 내용 수정시 [쓰기권한]이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleWrite == "") throw new UsernameNotFoundException("내용 수정시 접근한 게시판에 Read 권한이 존재하지않습니다.");

    // 게시판 정보
    Article article = boardBO.viewArticle(new Integer(atcNo));
    article.setModIp(request.getRemoteAddr());

    // 사용자 정보
    String strId = "";
    if (objUserInfo != null) strId = objUserInfo.getId();

    model.addAttribute("userRole", objUserInfo.getRoleGrpId());
    model.addAttribute("boardRoleRead", strRoleRead);
    model.addAttribute("boardRoleWrite", strRoleWrite);
    model.addAttribute("single", single);
   
    model.addAttribute("objBbsInfo", objBbsInfo);
    model.addAttribute("article", article);
    model.addAttribute("userId", strId);

    if (!objBbsInfo.getCdCatId().equals("")) {
      // 게시판 카테고리 정보가 존재할 경우 카테고리 정보를 보여준다.
      model.addAttribute("boardCatgList", codeCategoryBO.listCodeCategoryForCombo(objBbsInfo.getCdCatId()));     
    }
   
    return "board/edit";
  }
View Full Code Here

Examples of kr.or.javacafe.board.domain.Bbs

  @RequestMapping(value = "/remove/BBS_ID/{bbsId}/ATC_NO/{atcNo}", method = RequestMethod.GET)
  public String remove(@RequestParam(value = "single", required = false, defaultValue = "") String single, @PathVariable String bbsId, @PathVariable String atcNo, Model model) throws IOException {

    // 게시판 관리 정보
    Bbs objBbsInfo = boardBO.getBbsInfo(bbsId);
   
    // 게시판 권한 정보
    String strRoleRead = "";
    String strRoleWrite = "";   
    User objUserInfo = RoleUtil.getUserInfo();
    if (objUserInfo == null) {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", "G0");
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", "G0");
    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 내용 삭제시 쓰기권한이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleWrite == "") throw new UsernameNotFoundException("내용 삭제시 접근한 게시판에 Read 권한이 존재하지않습니다.");

    // REAL 디렉토리 파일 삭제
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.