Package railo.runtime.type

Examples of railo.runtime.type.QueryImpl


        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
   
    private void doGetRunningThreads() throws PageException {
      railo.runtime.type.Query qry=new QueryImpl(new String[]{"Id","Start","Timeout","ThreadType","StackTrace","TagContext",
            "Label","RootPath","ConfigFile","URL"},0,"query");
       
       
        if(type==TYPE_WEB){
          fillGetRunningThreads(qry,pageContext.getConfig());
View Full Code Here


    /**
     * @throws PageException
     *
     */
    private void doGetTLDs() throws PageException {
      railo.runtime.type.Query qry=new QueryImpl(
          new String[]{"displayname","namespace","namespaceseparator","shortname","type","description","uri","elclass","source"},
          new String[]{"varchar","varchar","varchar","varchar","varchar","varchar","varchar","varchar","varchar"},
          0,"tlds");
      

        TagLib[] libs = config.getTLDs();
        for(int i=0;i<libs.length;i++) {
          qry.addRow();
          qry.setAt("displayname", i+1, libs[i].getDisplayName());
          qry.setAt("namespace", i+1, libs[i].getNameSpace());
          qry.setAt("namespaceseparator", i+1, libs[i].getNameSpaceSeparator());
          qry.setAt("shortname", i+1, libs[i].getShortName());
          qry.setAt("type", i+1, libs[i].getType());
          qry.setAt("description", i+1, libs[i].getDescription());
          qry.setAt("uri", i+1, Caster.toString(libs[i].getUri()));
          qry.setAt("elclass", i+1, libs[i].getELClass());
          qry.setAt("source", i+1, StringUtil.emptyIfNull(libs[i].getSource()));
        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

    /**
     * @throws PageException
     *
     */
    private void doGetFLDs() throws PageException {
        railo.runtime.type.Query qry=new QueryImpl(
          new String[]{"displayname","namespace","namespaceseparator","shortname","description","uri","source"},
          new String[]{"varchar","varchar","varchar","varchar","varchar","varchar","varchar"},
          0,"tlds");
      

        FunctionLib[] libs = config.getFLDs();
        for(int i=0;i<libs.length;i++) {
          qry.addRow();
          qry.setAt("displayname", i+1, libs[i].getDisplayName());
          qry.setAt("namespace", i+1, "");// TODO support for namespace
          qry.setAt("namespaceseparator", i+1, "");
          qry.setAt("shortname", i+1, libs[i].getShortName());
          qry.setAt("description", i+1, libs[i].getDescription());
          qry.setAt("uri", i+1, Caster.toString(libs[i].getUri()));
          qry.setAt("source", i+1, StringUtil.emptyIfNull(libs[i].getSource()));
        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }

    private void doGetRemoteClientUsage() throws PageException {
        railo.runtime.type.Query qry=new QueryImpl(
          new String[]{"code","displayname"},
          new String[]{"varchar","varchar"},
          0,"usage");
        Struct usages = config.getRemoteClientUsage();
        //Key[] keys = usages.keys();
        Iterator<Entry<Key, Object>> it = usages.entryIterator();
        Entry<Key, Object> e;
        int i=-1;
        while(it.hasNext()) {
          i++;
          e = it.next();
          qry.addRow();
          qry.setAt(KeyConstants._code, i+1, e.getKey().getString());
          qry.setAt(KeyConstants._displayname, i+1, e.getValue());
          //qry.setAt("description", i+1, usages[i].getDescription());
        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

   
   
   
    private void doGetJars() throws PageException {
      Resource lib = config.getConfigDir().getRealResource("lib");
    railo.runtime.type.Query qry=new QueryImpl(new String[]{"name","source"},new String[]{"varchar","varchar"},0,"jars");
      
    if(lib.isDirectory()){
      Resource[] children = lib.listResources(new ExtensionResourceFilter(new String[]{".jar",".zip"},false,true));
      for(int i=0;i<children.length;i++){
        qry.addRow();
        qry.setAt("name", i+1, children[i].getName());
        qry.setAt("source", i+1, children[i].getAbsolutePath());
      }
    }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

        if(isQueryBean(value)) {
          QueryBean qb = (QueryBean) value;
            String[] strColumns = qb.getColumnList();
            Object[][] data = qb.getData();
            int recorcount=data.length;
            Query qry=new QueryImpl(strColumns,recorcount,"QueryBean");
            QueryColumn[] columns=new QueryColumn[strColumns.length];
            for(int i=0;i<columns.length;i++) {
              columns[i]=qry.getColumn(strColumns[i]);
            }
           
            int row;
            for(row=1;row<=recorcount;row++) {
              for(int i=0;i<columns.length;i++) {
View Full Code Here

    Query qry=null;
    DumpData[] items;
    for(int r=0;r<drs.length;r++){
      dr=drs[r];
      items = dr.getItems();
      if(qry==null)qry=new QueryImpl(toColumns(items),drs.length,"data");
      for(int c=1;c<=items.length;c++){
        qry.setAtEL("data"+c, r+1, toCFML(items[c-1],object,hasReference));
      }
      qry.setAtEL("highlight", r+1, new Double(dr.getHighlightType()));
     
View Full Code Here

     * @return all messages from inbox
     * @throws MessagingException
     * @throws IOException
     */
    public Query getMails(String[] messageNumbers, String[] uids, boolean all) throws MessagingException, IOException {
    Query qry = new QueryImpl(all ? _fldnew : _flddo, 0, "query");
    Folder folder = _fldelse.getFolder("INBOX");
    folder.open(Folder.READ_ONLY);
    try {
      getMessages(qry,folder, uids, messageNumbers, startrow, maxrows,all);
    }
View Full Code Here

        if(!ArrayUtil.isEmpty(locks))
          strLocks=" open locks at this time ("+List.arrayToList(locks, ", ")+").";
    */
   
    // Requests
    Query req=new QueryImpl(new Collection.Key[]{KeyConstants._web,KeyConstants._uri,START_TIME,KeyConstants._timeout}, 0, "requests");
    sct.setEL(KeyConstants._requests, req);
   
    // Template Cache
    Query tc=new QueryImpl(new Collection.Key[]{KeyConstants._web,ELEMENTS,KeyConstants._size}, 0, "templateCache");
    sct.setEL(KeyImpl.init("templateCache"), tc);
   
    // Scopes
    Struct scopes=new StructImpl();
    sct.setEL(KeyConstants._scopes, scopes);
    Query app=new QueryImpl(new Collection.Key[]{KeyConstants._web,KeyConstants._application,ELEMENTS,KeyConstants._size}, 0, "templateCache");
    scopes.setEL(KeyConstants._application, app);
    Query sess=new QueryImpl(new Collection.Key[]{KeyConstants._web,KeyConstants._application,USERS,ELEMENTS,KeyConstants._size}, 0, "templateCache");
    scopes.setEL(KeyConstants._session, sess);

    // Query
    Query qry=new QueryImpl(new Collection.Key[]{KeyConstants._web,KeyConstants._application,START_TIME,KeyConstants._sql}, 0, "requests");
    sct.setEL(QUERIES, qry);
   
    // Locks
    Query lck=new QueryImpl(new Collection.Key[]{KeyConstants._web,KeyConstants._application,KeyConstants._name,START_TIME,KeyConstants._timeout,KeyConstants._type}, 0, "requests");
    sct.setEL(LOCKS, lck);

    // Loop webs
    ConfigWebImpl web;
    Struct pcs;
    PageContextImpl _pc;
    int row,openConnections=0;
    CFMLFactoryImpl factory;
    ActiveQuery[] queries;
    ActiveQuery aq;
    ActiveLock[] locks;
    ActiveLock al;
    for(int i=0;i<webs.length;i++){
     
      // Loop requests
      web=(ConfigWebImpl) webs[i];
      factory=(CFMLFactoryImpl)web.getFactory();
      pcs = factory.getRunningPageContexts();
      Iterator<Object> it = pcs.valueIterator();
      while(it.hasNext()){
        _pc = (PageContextImpl) it.next();
        if(_pc.isGatewayContext()) continue;
       
        // Request
        row = req.addRow();
        req.setAt(KeyConstants._web, row, web.getLabel());
        req.setAt(KeyConstants._uri, row, getPath(_pc.getHttpServletRequest()));
        req.setAt(START_TIME, row, new DateTimeImpl(pc.getStartTime(),false));
        req.setAt(KeyConstants._timeout, row, new Double(pc.getRequestTimeout()));
       
        // Query
        queries = _pc.getActiveQueries();
        if(queries!=null) {
          for(int y=0;y<queries.length;y++){
            aq=queries[y];
            row = qry.addRow();
            qry.setAt(KeyConstants._web, row, web.getLabel());
            qry.setAt(KeyConstants._application, row, _pc.getApplicationContext().getName());
            qry.setAt(START_TIME, row, new DateTimeImpl(web,aq.startTime,true));
            qry.setAt(KeyConstants._sql, row, aq.sql);
          }
        }
       
        // Lock
        locks = _pc.getActiveLocks();
        if(locks!=null) {
          for(int y=0;y<locks.length;y++){
            al=locks[y];
            row = lck.addRow();
            lck.setAt(KeyConstants._web, row, web.getLabel());
            lck.setAt(KeyConstants._application, row, _pc.getApplicationContext().getName());
            lck.setAt(KeyConstants._name, row, al.name);
            lck.setAt(START_TIME, row, new DateTimeImpl(web,al.startTime,true));
            lck.setAt(KeyConstants._timeout, row, Caster.toDouble(al.timeoutInMillis/1000));
            lck.setAt(KeyConstants._type, row, al.type==LockManager.TYPE_EXCLUSIVE?"exclusive":"readonly");
          }
        }
      }
      openConnections+=web.getDatasourceConnectionPool().openConnections();

View Full Code Here

              if(!StringUtil.isEmpty(custom2))columns.append("custom2");
              if(!StringUtil.isEmpty(custom3))columns.append("custom3");
              if(!StringUtil.isEmpty(custom4))columns.append("custom4");
             
            // populate query with a single row
                qv=new QueryImpl(columns,1,"query");
                // body
                qv.setAt(KeyConstants._key, 1, key);
                key="key";

                // body
View Full Code Here

TOP

Related Classes of railo.runtime.type.QueryImpl

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.