Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.CatalogBean


      ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception      
  {
    CatalogForm catalog = (CatalogForm) form;
    SiteBean site = getSiteBean(request);
    CatalogBean bean = CatalogDAO.getCatalogByID(catalog.getId());
    //���sid��catalog_id�Ƿ��Ӧ
    if(bean!=null && bean.getSite().getId()==site.getId()){
      CatalogDAO.deletePermission(catalog.getId(), catalog.getUserid());
    }
    return makeForward(mapping.findForward("catalog-users"), catalog
        .getSid(), "cat_id", catalog.getId());
  }
View Full Code Here


      //��������Լ�
    }
    else{
      SiteBean site = getSiteBean(request);
      //���catalog_id�Ƿ���Ч
      CatalogBean bean = CatalogDAO.getCatalogByID(catalog.getId());
      if(bean==null){
        msgs.add("userid", new ActionMessage("error.catalog_not_found",
            new Integer(catalog.getId())));
      }
      //���sid��catalog_id�Ƿ��Ӧ
      else if(bean.getSite().getId()!=site.getId()){
        msgs.add("userid", new ActionMessage("error.catalog_deny",
            new Integer(catalog.getId())));
      }
      else{
        //�ж��Ƿ��Ѿ�����Ȩ����Ϣ
View Full Code Here

      msgs.add("name", new ActionMessage("error.illegal_glossary"));
    else if(DLOGSecurityManager.IllegalGlossary.existIllegalWord(catalog.getDetail()))
      msgs.add("detail", new ActionMessage("error.illegal_glossary"));
    else{
      SiteBean site = super.getSiteBean(request);
      CatalogBean cbean = new CatalogBean();
      cbean.setName(super.autoFiltrate(site, catalog.getName()));
      if(StringUtils.isNotEmpty(catalog.getDetail())){
        String detail = super.autoFiltrate(site, catalog.getDetail());
        cbean.setDetail(super.filterScriptAndStyle(detail));
      }
      cbean.setType(catalog.getType());
      cbean.setSite(site);
      cbean.setCreateTime(new Date());
      if(catalog.getCatalog()>0){
        cbean.setCatalog(new TypeBean(catalog.getCatalog()));
      }
      try{
        CatalogDAO.create(cbean, catalog.getId(), catalog.getDirection()==1);
      }catch(Exception e){
        msgs.add("catalog", new ActionMessage("error.database", e.getMessage()));
View Full Code Here

      errMsg = getMessage(request, null, "error.illegal_glossary");
    else if(DLOGSecurityManager.IllegalGlossary.existIllegalWord(catalog.getDetail()))
      errMsg = getMessage(request, null, "error.illegal_glossary");
    else {
      try {
        CatalogBean cbean = CatalogDAO.getCatalogByID(catalog.getId());
        cbean.setName(super.autoFiltrate(cbean.getSite(), catalog.getName()));
        if(StringUtils.isNotEmpty(catalog.getDetail())){
          String detail = super.autoFiltrate(cbean.getSite(), catalog.getDetail());
          cbean.setDetail(super.filterScriptAndStyle(detail));
        }
        cbean.setType(catalog.getType());
        int logCount = CatalogDAO.getDiaryCount(catalog.getId(), false,
            DiaryBean.STATUS_NORMAL);
        cbean.setArticleCount(logCount);
       
        //�����������
        if(catalog.getCatalog()>0){
          if(cbean.getCatalog()==null)
            cbean.setCatalog(new TypeBean(catalog.getCatalog()));
          else if(cbean.getCatalog().getId()!=catalog.getCatalog())
            cbean.setCatalog(new TypeBean(catalog.getCatalog()));           
        }
        else if(cbean.getCatalog()!=null){
          cbean.setCatalog(null);
        }
       
        CatalogDAO.flush();
      } catch (Exception e) {
        errMsg = getMessage(request, null, "error.database", e
View Full Code Here

    if(lform.getToCatalog()==-1){
      //move to trash
      CatalogDAO.removeDiary(site, lform.getFromCatalog());
    }
    else if(lform.getToCatalog()>0){
      CatalogBean toCat = CatalogDAO.getCatalogByID(lform.getToCatalog());
      if(toCat!=null && toCat.getSite().getId()==site.getId()){
        CatalogBean fromCat = CatalogDAO.getCatalogByID(lform.getFromCatalog());
        if(fromCat!=null && fromCat.getSite().getId()==site.getId())
          CatalogDAO.moveDiary(site,fromCat,toCat);
      }
    }
    return makeForward(mapping.findForward(CATALOGS), site.getId());
  }
View Full Code Here

        break;
      SiteBean site = super.getSiteBean(request);     
      if (site.getCatalogs().size() > 0)
        break;
     
      CatalogBean cbean = new CatalogBean();
      cbean.setName(catalog);
      cbean.setCreateTime(new Date());
      cbean.setType(CatalogBean.TYPE_GENERAL);
      cbean.setSite(site);
      CatalogDAO.create(cbean, -1, false);
      break;
    }while(true);

    return makeForward(mapping.findForward("addlog"), dform.getSid());
View Full Code Here

        msgs.add("editlog", new ActionMessage("error.access_deny"));
      } else {
        boolean catalog_can_access = false;
        if (diary.getCatalog().getId() != diaryForm.getCatalogId()) {
          SiteBean site = diary.getSite();
          CatalogBean catalog = null;
          // վ�����Է���վ�ڵ��κη���
          if (site.isOwner(loginUser)) {
            catalog = CatalogDAO.getCatalogByID(diaryForm
                .getCatalogId());
            if (catalog.getSite().getId() == site.getId())
              catalog_can_access = true;
          } else {
            // �г��û��ڸ�վ��ɷ��ʵ��ռǷ���
            List catalogs = CatalogDAO.listCatalogs(site, loginUser, true);
            for (int i = 0; catalogs != null && i < catalogs.size(); i++) {
              CatalogBean t_catalog = (CatalogBean) catalogs
                  .get(i);
              if (t_catalog.getId() == diaryForm.getCatalogId()) {
                catalog = t_catalog;
                catalog_can_access = true;
                break;
              }
            }
View Full Code Here

      q.setInteger(0, user.getId());
      perms = q.list();
    }
    Iterator iter = catalogs.iterator();
    while (iter.hasNext()) {
      CatalogBean catalog = (CatalogBean) iter.next();
      // ���ɷ����κ��˶����Է���
      if (catalog.getType() == CatalogBean.TYPE_FREE)
        continue;
      int role = getUserRoleInCatalog(perms, catalog, user);
      if (!maintain) {// �����
        if (catalog.getType() != CatalogBean.TYPE_GENERAL) {
          if (role < 0)
            iter.remove();
        }
      } else {// д�ռ���
        if (catalog.getType() == CatalogBean.TYPE_GENERAL)
          iter.remove();
        else {
          if (role != CatalogPermBean.ROLE_BLOG)
            iter.remove();
        }
View Full Code Here

   */
  public static void create(CatalogBean obj, int pos, boolean up){
    Session ssn = getSession();
    int order_value = 1;
    if (pos > 0) {
      CatalogBean friend = (CatalogBean) ssn.get(CatalogBean.class,
          new Integer(pos));
      order_value = friend.getSortOrder();
    }
    obj.setSortOrder(order_value - (up ? 1 : 0));
    try {
      beginTransaction();
      ssn.save(obj);
View Full Code Here

   * @return
   */
  public CatalogBean catalog(SiteBean site, SessionUserObject user, int cat_id){
    if(site==null || cat_id < 1)
      return null;
    CatalogBean catalog = CatalogDAO.getCatalogByID(cat_id);
    if (catalog != null && catalog.getSite().getId() == site.getId()
        && CatalogDAO.canUserViewThisCatalog(catalog, user))
      return catalog;
    return null;
  }
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.beans.CatalogBean

Copyright © 2018 www.massapicom. 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.