Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.SiteBean


  {
    SiteForm f_site = (SiteForm)form;
    super.validateClientId(request, f_site);
    ActionMessages msgs = new ActionMessages();
   
    SiteBean site = super.getSiteBean(request);
    if(site!=null){
      //TODO: ���Ƴ���
      // Diary
      if (StringUtils.isEmpty(f_site.getDiaryName()))
        site.setDiary(null);
      else
        site.setDiary(super.autoFiltrate(site, f_site.getDiaryName()));
      site
          .getFunctionStatus()
          .setDiary(
              (f_site.getStatusDiary() == 1) ? FunctionStatus.STATUS_NORMAL
                  : FunctionStatus.STATUS_CLOSED);
      // Photo
      if (StringUtils.isEmpty(f_site.getPhotoName()))
        site.setPhoto(null);
      else
        site.setPhoto(super.autoFiltrate(site, f_site.getPhotoName()));
      site
          .getFunctionStatus()
          .setPhoto(
              (f_site.getStatusPhoto() == 1) ? FunctionStatus.STATUS_NORMAL
                  : FunctionStatus.STATUS_CLOSED);
      // Music
      if (StringUtils.isEmpty(f_site.getMusicName()))
        site.setMusic(null);
      else
        site.setMusic(super.autoFiltrate(site, f_site.getMusicName()));
      site
          .getFunctionStatus()
          .setMusic(
              (f_site.getStatusMusic() == 1) ? FunctionStatus.STATUS_NORMAL
                  : FunctionStatus.STATUS_CLOSED);
      // BBS
      if (StringUtils.isEmpty(f_site.getForumName()))
        site.setForum(null);
      else
        site.setForum(super.autoFiltrate(site, f_site.getForumName()));
      site
          .getFunctionStatus()
          .setForum(
              (f_site.getStatusForum() == 1) ? FunctionStatus.STATUS_NORMAL
                  : FunctionStatus.STATUS_CLOSED);
      // Guestbook
      if (StringUtils.isEmpty(f_site.getGuestbookName()))
        site.setGuestbook(null);
      else
        site.setGuestbook(super.autoFiltrate(site, f_site
            .getGuestbookName()));
      site
          .getFunctionStatus()
          .setGuestbook(
              (f_site.getStatusGuestbook() == 1) ? FunctionStatus.STATUS_NORMAL
                  : FunctionStatus.STATUS_CLOSED);
     
      site.setLastTime(new Date());
      try{
        SiteDAO.updateSite(site);
      }catch(Exception e){
        context().log("Update site's functions failed.", e);
        msgs.add("site", new ActionMessage("error.database", e.getMessage()));
View Full Code Here


    try{
      site_id = Integer.parseInt(args[0]);
    }catch(Exception e){}
    System.out.println("============== Press any key to begin upgrade to site #"+site_id+" =================");
    System.in.read();
    site = new SiteBean(site_id);

    URL xml = Main.class.getResource("old_hibernate.cfg.xml");
    old_hb = Hibernate.init(xml.getPath());
    xml = Main.class.getResource("new_hibernate.cfg.xml");
    new_hb = Hibernate.init(xml.getPath());
View Full Code Here

    //ci.setMobile(RequestUtils.getRequestMobile(request));
    ubean.setContactInfo(ci);

    ubean.setSex(getSex());

    SiteBean site = null;
    // ���վ���Ƿ���Ч
    if (getSid() > 0)
      site = SiteDAO.getSiteByID(getSid());
    ubean.setSite(site);
View Full Code Here

  protected ActionForward doDeleteCatalogUser(ActionMapping mapping,
      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 if(catalog.getUserid()== loginUser.getId()){
      //��������Լ�
    }
    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

    else if(DLOGSecurityManager.IllegalGlossary.existIllegalWord(catalog.getName()))
      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));
View Full Code Here

  protected ActionForward doMoveToCatalog(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception
  {
    CatalogForm lform = (CatalogForm)form;
    SiteBean site = getSiteBean(request);
    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

      if(loginUser.getOwnSiteId()==site_id){
        msg = super.getMessage(request, null, "error.cannot_add_myself");
        break;
      }
      //�ж��û��ĸ��������Ƿ���Ч
      SiteBean toSite = super.getSiteByID(loginUser.getOwnSiteId());
      if(toSite==null){
        msg = super.getMessage(request, null, "error.site_not_available");
        break;
      }
      //��������Ƿ��Ѿ�����
      if(LinkDAO.isInnerSiteExists(toSite, site_id)){
        msg = super.getMessage(request, null, "error.link_already_exist");
        break;
      }
      //�������
      SiteBean friendSite = super.getSiteByID(site_id);
      if(friendSite==null){
        msg = super.getMessage(request, null, "error.site_not_available");
        break;
      }
      LinkBean lbean = new LinkBean();
      lbean.setSiteId(toSite.getId());
      lbean.setCreateTime(new Date());
      lbean.setTitle(friendSite.getFriendlyName());
      lbean.setType(LinkBean.TYPE_INNER);
      lbean.setUrl(s_site_id);
      LinkDAO.create(lbean, 0, false);
      msg = super.getMessage(request, null, "link.added");
      break;
View Full Code Here

    }
    else if(StringUtils.isEmpty(lform.getUrl())){
      msg = super.getMessage(request, null, "error.link_url_empty");
    }
    else{
      SiteBean site = getSiteBean(request);
      LinkBean lbean = LinkDAO.getLinkByID(lform.getId());
      if(lbean!=null && lbean.getSiteId()==site.getId()){
        lbean.setTitle(lform.getTitle());
        lbean.setUrl(lform.getUrl());
        lbean.setType(lform.getType());
        lbean.setStatus(lform.getStatus());
        try{
View Full Code Here

      if(loginUser.getOwnSiteId()<=0){
        msg = getMessage(request, null, "error.user_not_have_a_site");
        break;
      }
      //�ж��û��ĸ��������Ƿ���Ч
      SiteBean toSite = super.getSiteByID(loginUser.getOwnSiteId());
      if(toSite==null){
        msg = super.getMessage(request, null, "error.site_not_available");
        break;
      }
      MusicBean mbean = MusicDAO.getMusicByID(mid);
      if(mbean!=null && mbean.getSite().getId()==mform.getSid())
      {
        MusicBean music = new MusicBean();
        music.setCreateTime(new Date());
        music.setMusicBox(null);
        music.setAlbum(mbean.getAlbum());
        music.setSinger(mbean.getSinger());
        music.setSite(new SiteBean(loginUser.getOwnSiteId()));
        music.setTitle(mbean.getTitle());
        music.setUrl(mbean.getUrl());
        music.setWord(mbean.getWord());
        MusicDAO.addMusic(music);
        msg = getMessage(request, null, "music.collected", music.getTitle());
View Full Code Here

TOP

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

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.