Package railo.runtime.type

Examples of railo.runtime.type.Array


        }
        return qry;
    }
   
    private void getResourceProviders(ResourceProvider[] providers,Query qry,Element p, int row,Boolean def) throws PageException {
      Array support=new ArrayImpl();
        String clazz=p.getAttribute("class");
      qry.setAt("scheme",row,p.getAttribute("scheme"));
      qry.setAt("arguments",row,p.getAttribute("arguments"));
      qry.setAt("class",row,clazz);
      for(int i=0;i<providers.length;i++) {
        if(providers[i].getClass().getName().equals(clazz)){
          if(providers[i].isAttributesSupported())support.append("attributes");
                if(providers[i].isModeSupported())support.append("mode");
                qry.setAt("support",row,ListUtil.arrayToList(support, ","));
                qry.setAt("scheme",row,providers[i].getScheme());
                qry.setAt("caseSensitive",row,Caster.toBoolean(providers[i].isCaseSensitive()));
                qry.setAt("default",row,def);
          break;
View Full Code Here


    checkWriteAccess();
    if(!ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG))
      throw new SecurityException("no access to update custom tag setting");
   
    // check
    Array arr = ListUtil.listToArrayRemoveEmpty(extensions, ',');
    ListUtil.trimItems(arr);
    //throw new ApplicationException("you must define at least one extension");
   
   
    // update charset
View Full Code Here

    boolean isListing=false;
   
    // source
    if(source!=null) {
      if(Decision.isArray(source)) {
        Array arr = Caster.toArray(source);
        int len = arr.size();
        for(int i=1;i<=len;i++) {
          docs.add(doc=toPDFDocument(arr.getE(i),password,null));
          doc.setPages(pages);
        }
      }
      else if(source instanceof String) {
        String[] sources = ListUtil.toStringArrayTrim(ListUtil.listToArrayRemoveEmpty((String)source, ','));
View Full Code Here

     */
    public void setRange(String range) throws PageException {
        String errMessage="attribute range has an invalid value ["+range+"], must be string list with numbers";
        String errDetail="Example: [number_from,number_to], [number_from], [number_from,], [,number_to]";
       
        Array arr=ListUtil.listToArray(range,',');
       
        if(arr.size()==1) {
            double from=Caster.toDoubleValue(arr.get(1,null),Double.NaN);
            if(!Decision.isValid(from))throw new ApplicationException(errMessage,errDetail);
            input.setRangeMin(from);
            input.setRangeMax(Double.NaN);
        }
        else if(arr.size()==2) {
            String strFrom=arr.get(1,"").toString().trim();
            double from=Caster.toDoubleValue(strFrom,Double.NaN);
            if(!Decision.isValid(from) && strFrom.length()>0) {
                throw new ApplicationException(errMessage,errDetail);
            }
            input.setRangeMin(from);
           
            String strTo=arr.get(2,"").toString().trim();
            double to=Caster.toDoubleValue(strTo,Double.NaN);
            if(!Decision.isValid(to) && strTo.length()>0) {
                throw new ApplicationException(errMessage,errDetail);
            }
            input.setRangeMax(to);
View Full Code Here

        if(parent==null) throw new ApplicationException("there is no parent tag with name ["+basetag+"]");
       
        Struct thisTag=parent.getThis();
        Object obj=thisTag.get(datacollection,null);
       
        Array array;

        if(obj==null) {
            array=new ArrayImpl(new Object[]{value});
            thisTag.set(datacollection,array);  
        }
        else if(Decision.isArray(obj) && (array=Caster.toArray(obj)).getDimension()==1) {
            array.append(value);
        }
        else {
            array=new ArrayImpl(new Object[]{obj,value});
            thisTag.set(datacollection,array);  
        }
View Full Code Here

      boolean hasMeta=directory instanceof ResourceMetaData;
      if(hasMeta){
        names = new String[]{"name","size","type","dateLastModified","attributes","mode","directory","meta"};
        types=new String[]{"VARCHAR","DOUBLE","VARCHAR","DATE","VARCHAR","VARCHAR","VARCHAR","OBJECT"};
      }
      Array array=null;
      Query query=null;
      Object rtn;
      if(listInfo==LIST_INFO_QUERY_ALL || listInfo==LIST_INFO_QUERY_NAME){
        boolean listOnlyNames=listInfo==LIST_INFO_QUERY_NAME;
        rtn=query=new QueryImpl(
View Full Code Here

    return loadAsArray(pc, name, id);// order is ignored in this case ACF compatibility
  }
 
  @Override
  public Array loadAsArray(PageContext pc, String name, String id) throws PageException {
    Array arr=CommonUtil.createArray();
    Component c = load(pc, name, id);
    if(c!=null)arr.append(c);
    return arr;
  }
View Full Code Here

        }
      }
     
      // array
      else if(CommonUtil.isArray(params)){
        Array arr=CommonUtil.toArray(params);
        Iterator it = arr.valueIterator();
        int index=0;
        SQLItem item;
        RefBoolean isArray=null;
        while(it.hasNext()){
          obj=it.next();
          if(obj instanceof SQLItem) {
            item=(SQLItem) obj;
            obj=item.getValue();
            //HibernateCaster.toHibernateType(item.getType(), null); MUST
            //query.setParameter(index, item.getValue(),type);
          }
          if(meta!=null){
            type = meta.getOrdinalParameterExpectedType(index+1);
            obj=HibernateCaster.toSQL(type, obj,isArray);
            // TOOD can the following be done somehow
            //if(isArray.toBooleanValue())
            //  query.setParameterList(index, (Object[])obj,type);
            //else
              query.setParameter(index, obj,type);
          }
          else
            query.setParameter(index, obj);
          index++;
        }
        if(meta.getOrdinalParameterCount()>index)
          throw ExceptionUtil.createException(this,null,"parameter array is to small ["+arr.size()+"], need ["+meta.getOrdinalParameterCount()+"] elements",null);
      }
    }
   
   
   
View Full Code Here

        obj=ListUtil.listToArray(list, ',');
      }
    }
   
    if(Decision.isArray(obj)) {
      Array arr=Caster.toArray(obj,null);
      java.util.List<Resource> list=new ArrayList<Resource>();
      Iterator<Object> it = arr.valueIterator();
      while(it.hasNext()){
        try  {
          res=toResourceExisting(config,ac,it.next(),onlyDir);
          if(res!=null) list.add(res);
        }
View Full Code Here


  public Object toStruct() {
   
    Resource[] locs = getCfcLocations();
    Array arrLocs=new ArrayImpl();
    if(locs!=null)for(int i=0;i<locs.length;i++){
      arrLocs.appendEL(getAbsolutePath(locs[i]));
    }
    Struct sct=new StructImpl();
    sct.setEL(AUTO_GEN_MAP,this.autogenmap());
    sct.setEL(CATALOG,StringUtil.emptyIfNull(getCatalog()));
    sct.setEL(CFC_LOCATION,arrLocs);
View Full Code Here

TOP

Related Classes of railo.runtime.type.Array

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.