Package com.jeecms.cms.entity.main

Examples of com.jeecms.cms.entity.main.CmsModelItem


    sb.append(" order by bean.priority asc,bean.id asc");
    return find(sb.toString(), modelId, isChannel);
  }

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


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

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

    return dao.getList(modelId, isChannel, hasDisabled);
  }

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

    }
  }

  public void updatePriority(Integer[] wids, Integer[] priority,
      String[] label, Boolean[] single, Boolean[] display) {
    CmsModelItem item;
    for (int i = 0, len = wids.length; i < len; i++) {
      item = findById(wids[i]);
      item.setLabel(label[i]);
      item.setPriority(priority[i]);
      item.setSingle(single[i]);
      item.setDisplay(display[i]);
    }
  }
View Full Code Here

    }
  }

  public CmsModelItem update(CmsModelItem bean) {
    Updater<CmsModelItem> updater = new Updater<CmsModelItem>(bean);
    CmsModelItem entity = dao.updateByUpdater(updater);
    entity.emptyToNull();
    return entity;
  }
View Full Code Here

    entity.emptyToNull();
    return entity;
  }

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

  public String edit(Integer id, HttpServletRequest request, ModelMap model) {
    WebErrors errors = validateEdit(id, request);
    if (errors.hasErrors()) {
      return errors.showErrorPage(model);
    }
    CmsModelItem item = manager.findById(id);
    model.addAttribute("cmsModelItem", item);
    return "item/edit";
  }
View Full Code Here

  private List<CmsModelItem> getItems(CmsModel model, boolean isChannel,
      String[] fields, String[] labels, Integer[] dataTypes,
      Integer[] prioritys, Boolean[] singles, Boolean[] displays) {
    List<CmsModelItem> list = new ArrayList<CmsModelItem>();
    CmsModelItem item;
    for (int i = 0, len = fields.length; i < len; i++) {
      if (!StringUtils.isBlank(fields[i])) {
        item = new CmsModelItem();
        item.setCustom(false);
        item.setModel(model);
        item.setChannel(isChannel);

        item.setField(fields[i]);
        item.setLabel(labels[i]);
        item.setPriority(prioritys[i]);
        item.setDataType(dataTypes[i]);
        item.setSingle(singles[i]);
        item.setDisplay(displays[i]);

        list.add(item);
      }
    }
    return list;
View Full Code Here

  private boolean vldExist(Integer id, WebErrors errors) {
    if (errors.ifNull(id, "id")) {
      return true;
    }
    CmsModelItem entity = manager.findById(id);
    if (errors.ifNotExist(entity, CmsModelItem.class, id)) {
      return true;
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.main.CmsModelItem

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.