예제 #1
0
  @Override
  public void read(Object arg) {
    // TODO Auto-generated method stub
    UrlClassList ucl = UrlClassList.getInstance();
    setRoot("classify_action_url", ucl.read("classify_action"));

    int offset = 0;

    if (page != 0) {
      offset = (page - 1) * Limit;
    }

    String format =
        "select id,pid,name,ctime,displays,(select name from "
            + DB_HOR_PRE
            + "classify h where h.id=c.pid ) as pname from "
            + DB_HOR_PRE
            + "classify c where "
            + UserPermi()
            + " order by id desc  limit %d offset %d";
    String sql = String.format(format, Limit, offset);

    List<Map<String, Object>> res;

    try {
      res = FetchAll(sql);
      setRoot("classify_list", res);
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    SetPage();
  }
예제 #2
0
  private void SetPage() {
    Page p = new Page();
    UrlClassList ucl = UrlClassList.getInstance();

    int t = Tol();

    String page_html = p.s_page(ucl.read(SliceName(stdClass)), t, page, Limit, "");

    setRoot("Page", page_html);
    setRoot("edit_url", ucl.read("classify_action"));
    setRoot("add_url", ucl.create("classify_action"));
    // setRoot("remove_url", ucl.remove("mongo_db_edit_action"));
    setRoot("classify_action_url", ucl.read("classify_action"));
  }