Package railo.runtime

Examples of railo.runtime.ComponentWrap


          config.getTagMapping().getPageSource(filename):
          config.getServerTagMapping().getPageSource(filename);
     
      Page p = ps.loadPage(pc);
      ComponentImpl c = ComponentLoader.loadComponent(pc, p, ps, filename, true,true);
      ComponentWrap cw = ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE,c);
      Struct meta = Caster.toStruct( cw.get(KeyConstants._metadata,null),null);

      // TODO handle all metadata here and make checking at runtime useless
      if(meta!=null) {
       
        // parse body
View Full Code Here


    try {
      ci = ComponentUtil.toComponentAccess(c);
    } catch (ExpressionException ee) {
      throw new ConverterException(ee.getMessage());
    }
    ComponentWrap cw = new ComponentWrap(Component.ACCESS_PRIVATE,ci)
       
     
      sb.append(goIn());
        try {
          sb.append("evaluateComponent('"+c.getAbsName()+"','"+ComponentUtil.md5(ci)+"',{");
    } catch (Exception e) {
      throw toConverterException(e);
    }
   
    boolean doIt=false;
    Object member;
      {
     
      Iterator<Entry<Key, Object>> it = cw.entryIterator();
          deep++;
          Entry<Key, Object> e;
          while(it.hasNext()) {
              e = it.next();
              member = e.getValue();
View Full Code Here

   */
  private String _serializeComponent(Component component, Map<Object,String> done) throws ConverterException {
    StringBuffer sb=new StringBuffer();
    ComponentAccess ca;
    try {
      component=new ComponentWrap(Component.ACCESS_PRIVATE, ca=ComponentUtil.toComponentAccess(component));
    } catch (ExpressionException e1) {
      throw toConverterException(e1);
    }
    boolean isPeristent=ca.isPersistent();
   
View Full Code Here

     * @param done
     * @throws ConverterException
     */
    private void _serializeComponent(PageContext pc,Set test,Component component, StringBuffer sb, boolean serializeQueryByColumns, Set<Object> done) throws ConverterException {
      try {
      ComponentWrap cw = ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE,component);
        _serializeStruct(pc,test,cw, sb, serializeQueryByColumns,false,done);
    }
      catch (ExpressionException e) {
      throw toConverterException(e);
    }
View Full Code Here

   */
  private String _serializeComponent(Component component, Set<Object> done) throws ConverterException {
    StringBuffer sb=new StringBuffer();
    ComponentAccess ca;
    try {
      component=new ComponentWrap(Component.ACCESS_PRIVATE, ca=ComponentUtil.toComponentAccess(component));
    } catch (ExpressionException e1) {
      throw toConverterException(e1);
    }
    boolean isPeristent=ca.isPersistent();
   
View Full Code Here

    return component;
  }

  public Object getCustom(Key key) {
    try {
      ComponentWrap cw=ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE, component);
      return cw.get(key,null);
    }
    catch (Throwable t) {}
   
    return null;
  }
View Full Code Here

    public static Object toRailoType(PageContext pc, Object value) throws PageException {
      pc=ThreadLocalPageContext.get(pc);
      if(pc!=null && value instanceof Pojo) {
        try{
          ComponentAccess c = ComponentUtil.toComponentAccess(pc.loadComponent(value.getClass().getName()));
          ComponentWrap cw=ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE,c);
       
          // delete this scope data members
            Collection.Key[] keys = cw.keys();
            Object member;
            for(int i=0;i<keys.length;i++) {
              member = cw.get(keys[i]);
              if(member instanceof UDF) continue;
                    cw.removeEL(keys[i]);
            }
           
           
            Property[] props = c.getProperties(false);
            Property prop;
            for(int i=0;i<props.length;i++){
              prop=props[i];
              try{
                cw.set(pc, KeyImpl.init(prop.getName()), toRailoType(pc,Reflector.callGetter(value, prop.getName())));
              }
              catch(PageException pe){
                pe.printStackTrace();
              }
            }
View Full Code Here

   
    if(cfc!=null){
      sct.setEL(KeyConstants._component, cfc.getPageSource().getDisplayPath());
     
      try {
        ComponentWrap cw=ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE, cfc);
        Iterator<Key> it = cw.keyIterator();
        Collection.Key key;
        Object value;
            while(it.hasNext()) {
                key=it.next();
                value=cw.get(key);
                if(suppressFunctions && value instanceof UDF) continue;
                if(!sct.containsKey(key))sct.setEL(key, value);
        }
      }
      catch (PageException e) {e.printStackTrace();}
View Full Code Here

  }
  public static void setInternalState(Component comp, Struct sctThis, Struct sctVariables) throws PageException {
   
    // this 
    // delete this scope data members
    ComponentWrap cw = ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE,comp);
    Collection.Key[] cwKeys = CollectionUtil.keys(cw);
    Object member;
    for(int i=0;i<cwKeys.length;i++) {
      member = cw.get(cwKeys[i]);
      if(member instanceof UDF) continue;
            cw.removeEL(cwKeys[i]);
    }
   
    // set this scope data members
    Iterator<Entry<Key, Object>> it = sctThis.entryIterator();
    Entry<Key, Object> e;
View Full Code Here

    String name = Caster.toString(attrFilename.getDefaultValue());
    boolean isWeb = Caster.toBooleanValue(attrIsWeb.getDefaultValue());
    InitFile source = CFTagCore.createInitFile(pc, isWeb, filename);
   
    Component cfc = ComponentLoader.loadComponent(pc,null,source.getPageSource(), source.getFilename().substring(0,source.getFilename().length()-(pc.getConfig().getCFCExtension().length()+1)), false,true);
        ComponentWrap cw=ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE, cfc);
    Struct metadata=Caster.toStruct(cw.get("metadata",null),null,false);
   
   
    Struct sct=new StructImpl();
    sct.set("nameSpaceSeperator",tld.getNameSpaceSeparator());
    sct.set("nameSpace",tld.getNameSpace());
View Full Code Here

TOP

Related Classes of railo.runtime.ComponentWrap

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.