Package com.jeecms.cms.entity.assist

Examples of com.jeecms.cms.entity.assist.CmsAdvertising


  @SuppressWarnings("unchecked")
  public void execute(Environment env, Map params, TemplateModel[] loopVars,
      TemplateDirectiveBody body) throws TemplateException, IOException {
    Integer id = DirectiveUtils.getInt(PARAM_ID, params);
    CmsAdvertising ad = null;
    if (id != null) {
      ad = cmsAdvertisingMng.findById(id);
    }
    Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
        params);
View Full Code Here


  @RequestMapping(value = "/ad.jspx")
  public String ad(Integer id, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    if (id != null) {
      CmsAdvertising ad = cmsAdvertisingMng.findById(id);
      model.addAttribute("ad", ad);
    }
    FrontUtils.frontData(request, model, site);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_CSI, TPL_AD);
View Full Code Here

    CmsSite site = CmsUtils.getSite(request);
    WebErrors errors = validateEdit(id, request);
    if (errors.hasErrors()) {
      return errors.showErrorPage(model);
    }
    CmsAdvertising cmsAdvertising = manager.findById(id);
    model.addAttribute("cmsAdvertising", cmsAdvertising);
    model.addAttribute("attr", cmsAdvertising.getAttr());
    model.addAttribute("adspaceList", cmsAdvertisingSpaceMng.getList(site
        .getId()));
    model.addAttribute("pageNo", pageNo);
    return "advertising/edit";
  }
View Full Code Here

  private boolean vldExist(Integer id, Integer siteId, WebErrors errors) {
    if (errors.ifNull(id, "id")) {
      return true;
    }
    CmsAdvertising entity = manager.findById(id);
    if (errors.ifNotExist(entity, CmsAdvertising.class, id)) {
      return true;
    }
    if (!entity.getSite().getId().equals(siteId)) {
      errors.notInSite(CmsAdvertising.class, id);
      return true;
    }
    return false;
  }
View Full Code Here

    return dao.getList(adspaceId, enabled);
  }

  @Transactional(readOnly = true)
  public CmsAdvertising findById(Integer id) {
    CmsAdvertising entity = dao.findById(id);
    return entity;
  }
View Full Code Here

    bean.getAttr().putAll(attr);
    return bean;
  }

  public CmsAdvertising deleteById(Integer id) {
    CmsAdvertising bean = dao.deleteById(id);
    return bean;
  }
View Full Code Here

    }
    return beans;
  }

  public void display(Integer id) {
    CmsAdvertising ad = findById(id);
    if (ad != null) {
      ad.setDisplayCount(ad.getDisplayCount() + 1);
    }
  }
View Full Code Here

      ad.setDisplayCount(ad.getDisplayCount() + 1);
    }
  }

  public void click(Integer id) {
    CmsAdvertising ad = findById(id);
    if (ad != null) {
      ad.setClickCount(ad.getClickCount() + 1);
    }
  }
View Full Code Here

    }
    return find(f);
  }

  public CmsAdvertising findById(Integer id) {
    CmsAdvertising entity = get(id);
    return entity;
  }
View Full Code Here

    getSession().save(bean);
    return bean;
  }

  public CmsAdvertising deleteById(Integer id) {
    CmsAdvertising entity = super.get(id);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.assist.CmsAdvertising

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.