Examples of QueryParameter


Examples of freenet.client.tools.QueryParameter

  /** Sends a request */
  private void sendRequest() {
    // Only send if running
    if (running == true) {
      sentRequest = FreenetRequest.sendRequest(UpdaterConstants.notificationPath, new QueryParameter("requestId", FreenetJs.requestId), new RequestCallback() {
        @Override
        public void onResponseReceived(Request request, Response response) {
          FreenetJs.log("AJAX response:success:" + (response.getText().startsWith(UpdaterConstants.SUCCESS) ? "true" : "false"));
          if (response.getText().startsWith(UpdaterConstants.SUCCESS)) {
            // If success, then notify the UpdateManager
View Full Code Here

Examples of freenet.client.tools.QueryParameter

    // If the user closes the window, it sends a leaving message
    Window.addWindowClosingHandler(new ClosingHandler() {
      @Override
      public void onWindowClosing(ClosingEvent event) {
        isPushingCancelledExpected = true;
        FreenetRequest.sendRequest(UpdaterConstants.leavingPath, new QueryParameter("requestId", requestId));
        cm.closeConnection();
      }
    });
    // Exports some method for external use
    // It is not needed, but may come handy in the future
View Full Code Here

Examples of freenet.client.tools.QueryParameter

  public static final void log(String msg) {
    try {
      // Only log id debug is enabled
      if (isDebug) {
        // Write the log back to the server
         try{ FreenetRequest.sendRequest(UpdaterConstants.logWritebackPath, new QueryParameter("msg",requestId+":"+(logCounter++)+":"+urlEncode(msg))); }catch(Exception e){
        
         }
        // Write the log to the console
        nativeLog(msg);
        // Write the log to the page
View Full Code Here

Examples of freenet.client.tools.QueryParameter

  public void updated(String message) {
    // Identifies the element
    String elementId = message;
    FreenetJs.log("DefaultUpdateManager updated:elementid:" + elementId);
    // Sends a request asking for data for the updated element
    FreenetRequest.sendRequest(UpdaterConstants.dataPath, new QueryParameter[] { new QueryParameter("requestId", FreenetJs.requestId),
        new QueryParameter("elementId", elementId) }, new UpdaterRequestCallback(elementId));
    // Notifies the listeners
    for (IUpdateListener l : listeners) {
      l.onUpdate();
    }
  }
View Full Code Here

Examples of freenet.client.tools.QueryParameter

        hideElement.addMouseDownHandler(new MouseDownHandler() {
          @Override
          public void onMouseDown(MouseDownEvent event) {
            // Only send a request if the message is originated from the server
            if (m.getAnchor() != null) {
              FreenetRequest.sendRequest(UpdaterConstants.dismissAlertPath, new QueryParameter("anchor", m.getAnchor()), new RequestCallback() {
                @Override
                public void onResponseReceived(Request request, Response response) {
                  // When a response is got, the server is already removed the message. We can remove it too safely
                  removeMessage(m);
                }
View Full Code Here

Examples of org.apache.metamodel.query.QueryParameter

        data.close();
    }

    public void testCompiledQueryParameterInWhereClause() throws Exception {
        DataContext dc = getDataContext();
        QueryParameter param1 = new QueryParameter();
        CompiledQuery compiledQuery = dc.query().from(table1).select("name").where(COLUMN_CONTRIBUTOR_COUNTRY)
                .eq(param1).compile();
        try {
            assertEquals(1, compiledQuery.getParameters().size());
            assertSame(param1, compiledQuery.getParameters().get(0));
View Full Code Here

Examples of org.apache.metamodel.query.QueryParameter

    }

    public void testCompiledQueryParameterInSubQuery() throws Exception {
        final DataContext dc = getDataContext();

        final QueryParameter param1 = new QueryParameter();
        final Query subQuery = dc.query().from(table1).select("name").where(COLUMN_CONTRIBUTOR_COUNTRY).eq(param1)
                .toQuery();

        final FromItem subQueryFromItem = new FromItem(subQuery);
        final Query query = new Query().select(new SelectItem(subQuery.getSelectClause().getItem(0), subQueryFromItem))
View Full Code Here

Examples of org.apache.metamodel.query.QueryParameter

        Connection connection = getTestDbConnection();
        JdbcDataContext dataContext = new JdbcDataContext(connection,
                new TableType[] { TableType.TABLE, TableType.VIEW }, null);
        Schema schema = dataContext.getSchemaByName(dataContext.getDefaultSchemaName());

        QueryParameter queryParameter = new QueryParameter();

        Query q = new Query();
        Table table = schema.getTables()[0];
        q.select(table.getColumns());
        q.from(table, "a");
View Full Code Here

Examples of org.apache.metamodel.query.QueryParameter

        final JdbcDataContext dataContext = new JdbcDataContext(ds,
                new TableType[] { TableType.TABLE, TableType.VIEW }, null);

        final JdbcCompiledQuery compiledQuery = (JdbcCompiledQuery) dataContext.query().from("CUSTOMERS")
                .select("CUSTOMERNAME").where("CUSTOMERNUMBER").eq(new QueryParameter()).compile();

        assertEquals(0, compiledQuery.getActiveLeases());
        assertEquals(0, compiledQuery.getIdleLeases());

        final String compliedQueryString = compiledQuery.toSql();
View Full Code Here

Examples of org.apache.metamodel.query.QueryParameter

      }
      if (!inlineValues) {
        if (isPreparedParameterCandidate(whereItem)) {
          // replace operator with parameter
          whereItem = new FilterItem(whereItem.getSelectItem(),
              whereItem.getOperator(), new QueryParameter());
        }
      }
      final String whereItemLabel = queryRewriter
          .rewriteFilterItem(whereItem);
      sb.append(whereItemLabel);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.