com.psddev.dari.db.Query.getState()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中com.psddev.dari.db.Query.getState方法的一些代码示例,展示了Query.getState的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getState方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:getState

Query.getState介绍

暂无

代码示例

代码示例来源:origin: perfectsense/dari

private List<NameValuePair> createParameters(String action, Query<?> query) {
  List<NameValuePair> params = new ArrayList<NameValuePair>();
  params.add(new BasicNameValuePair(ACTION_PARAMETER, action));
  String database = getRemoteDatabase();
  if (database != null) {
    params.add(new BasicNameValuePair(DATABASE_PARAMETER, database));
  }
  if (query != null) {
    Map<String, Object> queryMap = query.getState().getSimpleValues();
    convertTypeIdToName(queryMap);
    params.add(new BasicNameValuePair(QUERY_PARAMETER, ObjectUtils.toJson(queryMap)));
  }
  return params;
}

代码示例来源:origin: perfectsense/dari

return ((Query<?>) value).getState().getSimpleValues(withTypeNames);

代码示例来源:origin: perfectsense/dari

private Query<?> createQuery(Database database, WebPageContext context) {
  String queryString = context.param(String.class, WebDatabase.QUERY_PARAMETER);
  Object queryObject = ObjectUtils.fromJson(queryString);
  if (!(queryObject instanceof Map)) {
    throw new DatabaseException(database, String.format(
        "Invalid query string! (%s)", queryString));
  }
  @SuppressWarnings("unchecked")
  Map<String, Object> queryMap = (Map<String, Object>) queryObject;
  convertTypeNameToId(database.getEnvironment(), queryMap);
  Query<?> query = Query.fromAll();
  query.getState().putAll(queryMap);
  query.using(database);
  return query;
}

代码示例来源:origin: perfectsense/brightspot-cms

"class", "button",
"href", page.cmsUrl(CreateWorkStream.PATH,
    "query", ObjectUtils.toJson(selection.createItemsQuery().getState().getSimpleValues()),
    "selectionId", selection.getId()),
"target", "newWorkStream");

代码示例来源:origin: perfectsense/brightspot-cms

String queryString = page.param(String.class, "query");
query = Query.fromAll();
query.getState().setValues((Map<String, Object>) ObjectUtils.fromJson(queryString));

代码示例来源:origin: perfectsense/brightspot-cms

@Override
protected void doService(ToolPageContext page) throws IOException, ServletException {
  Search search = new Search(page);
  Renderer renderer = new Renderer(page, search);
  renderer.render();
  String pageId = page.createId();
  Query<?> query;
  try {
    query = search.toQuery(page.getSite());
  } catch (IllegalArgumentException | Query.NoFieldException error) {
    return;
  }
  State queryState = query.getState();
  queryState.put("cms.ui.search", search.getState().getSimpleValues());
  page.writeStart("div", "id", pageId);
  page.writeEnd();
  page.writeStart("script", "type", "text/javascript");
    page.writeRaw("var $page = $('#").writeRaw(pageId).writeRaw("'),");
        page.writeRaw("$frame = $page.closest('.queryField_frames > .frame'),");
        page.writeRaw("$field = $.data($frame[0], 'query-$field'),");
        page.writeRaw("$input = $field.find('input');");
    page.writeRaw("$input.val('");
    page.writeRaw(page.js(ObjectUtils.toJson(queryState.getSimpleValues())));
    page.writeRaw("');");
    page.writeRaw("$input.change();");
  page.writeEnd();
}

代码示例来源:origin: perfectsense/brightspot-cms

"target", "workStreamCreate",
    "href", page.cmsUrl("/createWorkStream",
        "query", ObjectUtils.toJson(query.getState().getSimpleValues())));
  page.writeHtml("New Work Stream");
page.writeEnd();

相关文章