Package railo.runtime.type

Examples of railo.runtime.type.Struct




  private static void createXMLMappingManyToMany(Component cfc,PropertyCollection propColl,Element clazz, PageContext pc,Property prop,DatasourceConnection dc, SessionFactoryData data) throws PageException {
    Element el = createXMLMappingXToMany(propColl,clazz, pc, cfc,prop,data);
    Struct meta = prop.getDynamicAttributes();
    Document doc = CommonUtil.getDocument(clazz);
    Element m2m = doc.createElement("many-to-many");
    el.appendChild(m2m);
   
    // link
    setLink(cfc,prop,el,meta,true,data);
   
    setForeignEntityName(cfc,prop, meta, m2m,true,data);

        // order-by
    String str = toString(cfc,prop,meta,"orderby",data);
    if(!Util.isEmpty(str,true))m2m.setAttribute("order-by", str);
   
    // column
    str=toString(cfc,prop,meta,"inversejoincolumn",data);
   
    // build fkcolumn name
    if(Util.isEmpty(str,true)) {
      Component other = loadForeignCFC(pc, cfc, prop, meta,data);
      if(other!=null){
        boolean isClass=Util.isEmpty(other.getExtends());
        // MZ: Recursive search for persistent mappedSuperclass properties
        Property[] _props=getProperties(pc,other,dc,meta,isClass, true,data);
        PropertyCollection _propColl = splitJoins(cfc,new HashMap<String, PropertyCollection>(), _props,data);
        _props=_propColl.getProperties();
       
        Struct m;
        Property _prop=null;
        for(int i=0;i<_props.length;i++){
          m = _props[i].getDynamicAttributes();
          // fieldtype
          String fieldtype = CommonUtil.toString(m.get(FIELDTYPE,null),null);
          if("many-to-many".equalsIgnoreCase(fieldtype)) {
            // linktable
            String currLinkTable=CommonUtil.toString(meta.get(LINK_TABLE,null),null);
            String othLinkTable=CommonUtil.toString(m.get(LINK_TABLE,null),null);
            if(currLinkTable.equals(othLinkTable)) {
              // cfc name
              String cfcName=CommonUtil.toString(m.get(CFC,null),null);
              if(cfc.equalTo(cfcName)){
                _prop=_props[i];
              }
            }
          }
View Full Code Here




  private static void createXMLMappingOneToMany(Component cfc,PropertyCollection propColl,Element clazz, PageContext pc,Property prop, SessionFactoryData data) throws PageException {
    Element el = createXMLMappingXToMany(propColl,clazz, pc, cfc,prop,data);
    Struct meta = prop.getDynamicAttributes();
    Document doc = CommonUtil.getDocument(clazz);
    Element x2m;
   
   
        // order-by
View Full Code Here

 
 
 
 
  private static Element createXMLMappingXToMany(PropertyCollection propColl,Element clazz, PageContext pc,Component cfc,Property prop, SessionFactoryData data) throws PageException {
    final Struct meta = prop.getDynamicAttributes();
    Document doc = CommonUtil.getDocument(clazz);
    Element el=null;
   
   
   
View Full Code Here

    String str=prop==null?null:toString(cfc,prop,prop.getDynamicAttributes(),"fkcolumn",data);
    if(!Util.isEmpty(str))
      return str;
   
    // no local defintion, get from Foreign enity
    Struct meta = prop.getDynamicAttributes();
    String type=toString(cfc,prop,meta,"fieldtype",false,data);
    String otherType;
    if("many-to-one".equalsIgnoreCase(type))     otherType="one-to-many";
    else if("one-to-many".equalsIgnoreCase(type))   otherType="many-to-one";
    else return createM2MFKColumnName( cfc, prop, propColl,data);
View Full Code Here




  private static void createXMLMappingManyToOne(Element clazz, PageContext pc,Component cfc,Property prop, PropertyCollection propColl, SessionFactoryData data) throws PageException {
    Struct meta = prop.getDynamicAttributes();
    Boolean b;
   
    Document doc = CommonUtil.getDocument(clazz);
    clazz=getJoin(clazz);
   
View Full Code Here

      }
    }
  }

  private static void createXMLMappingTimestamp(Element clazz, PageContext pc,Component cfc,Property prop,SessionFactoryData data) throws PageException {
    Struct meta = prop.getDynamicAttributes();
    String str;
    Boolean b;
   

    Document doc = CommonUtil.getDocument(clazz);
View Full Code Here




  private static void createXMLMappingVersion(Element clazz, PageContext pc,Component cfc,Property prop,SessionFactoryData data) throws PageException {
    Struct meta = prop.getDynamicAttributes();
   
    Document doc = CommonUtil.getDocument(clazz);
    Element version = doc.createElement("version");
    clazz.appendChild(version);
   
   
    version.setAttribute("name",prop.getName());
   
    // column
    String str = toString(cfc,prop,meta,"column",data);
    if(Util.isEmpty(str,true)) str=prop.getName();
    version.setAttribute("column",formatColumn(str,data));
   
     // access
      str=toString(cfc,prop,meta,"access",data);
    if(!Util.isEmpty(str,true))version.setAttribute("access", str);
   
    // generated
    Object o=meta.get(GENERATED,null);
    if(o!=null){
      Boolean b = CommonUtil.toBoolean(o,null);
      str=null;
      if(b!=null) {
        str=b.booleanValue()?"always":"never";
View Full Code Here

    setParam(hpb);
  }

  @Override
  public int doEndTag() throws PageException {
      Struct cfhttp=new StructImpl();
    cfhttp.setEL(ERROR_DETAIL,"");
    pageContext.setVariable(result,cfhttp);

    // because commons
    PrintStream out = System.out;
        try {
View Full Code Here

      cfhttp.set(HTTP_VERSION,(httpMethod.getStatusLine().getHttpVersion()));
     
    //responseHeader
      Header[] headers = httpMethod.getResponseHeaders();
      StringBuffer raw=new StringBuffer(httpMethod.getStatusLine().toString()+" ");
      Struct responseHeader = new StructImpl();
      Array setCookie = new ArrayImpl();
     
          for(int i=0;i<headers.length;i++) {
            Header header=headers[i];
            //print.ln(header);
           
            raw.append(header+" ");
            if(header.getName().equalsIgnoreCase("Set-Cookie"))
              setCookie.append(header.getValue());
            else {
                //print.ln(header.getName()+"-"+header.getValue());
              Object value=responseHeader.get(KeyImpl.getInstance(header.getName()),null);
              if(value==null) responseHeader.set(KeyImpl.getInstance(header.getName()),header.getValue());
              else {
                  Array arr=null;
                  if(value instanceof Array) {
                      arr=(Array) value;
                  }
                  else {
                      arr=new ArrayImpl();
                      responseHeader.set(KeyImpl.getInstance(header.getName()),arr);
                      arr.appendEL(value);
                  }
                  arr.appendEL(header.getValue());
              }
            }
           
            // Content-Type
            if(header.getName().equalsIgnoreCase("Content-Type")) {
              mimetype=header.getValue();
              if(mimetype==null)mimetype=NO_MIMETYPE;
            }
           
            // Content-Encoding
            if(header.getName().equalsIgnoreCase("Content-Encoding")) {
              contentEncoding=header.getValue();
            }
           
          }
          cfhttp.set(RESPONSEHEADER,responseHeader);
          responseHeader.set(STATUS_CODE,new Double(httpMethod.getStatusCode()));
          responseHeader.set(EXPLANATION,(httpMethod.getStatusText()));
          if(setCookie.size()>0)responseHeader.set(SET_COOKIE,setCookie);
         
      // is text
          boolean isText=
            mimetype == null || 
            mimetype == NO_MIMETYPE || HTTPUtil.isTextMimeType(mimetype);
View Full Code Here

    el.setAttribute(prefix+"log-max-file-size", Caster.toString(maxfilesize));
  }


  public void updateRemoteClientUsage(String code, String displayname) {
    Struct usage = config.getRemoteClientUsage();
    usage.setEL(code, displayname);
   
    Element extensions=_getRootElement("remote-clients");
    extensions.setAttribute("usage", toStringURLStyle(usage));   
   
  }
View Full Code Here

TOP

Related Classes of railo.runtime.type.Struct

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.