Package railo.runtime.config

Examples of railo.runtime.config.ConfigWeb


  public void setBody(String body) {
    this.body=body;
  }

  public byte[] render(Dimension dimension,double unitFactor, PageContext pc,boolean generateOutlines) throws PageException, IOException {
    ConfigWeb config = pc.getConfig();
    PDF pd4ml = new PDF(config);
    pd4ml.generateOutlines(generateOutlines);
    pd4ml.enableTableBreaks(true);
    pd4ml.interpolateImages(true);
    // MUSTMUST DO NOT ENABLE, why this was disabled
View Full Code Here


    }
    return baos.toByteArray();
  }

  private void content(PDF pd4ml, PageContext pc, OutputStream os) throws PageException, IOException {
    ConfigWeb config = pc.getConfig();
    pd4ml.useTTF("java:fonts", fontembed);
   
    // body
      if(!StringUtil.isEmpty(body,true)) {
        // optimize html
        URL base = getBase(pc);
        try {
          body=beautifyHTML(new InputSource(new StringReader(body)),base);
      }catch (Throwable t) {}
     
        pd4ml.render(body, os,base);
     
      }
      // srcfile
      else if(srcfile!=null) {
        if(StringUtil.isEmpty(strCharset))strCharset=pc.getConfig().getResourceCharset();
       
      // mimetype
      if(StringUtil.isEmpty(strMimetype)) {
        String mt = ResourceUtil.getMimeType(srcfile,null);
        if(mt!=null) setMimetype(mt);
      }
      InputStream is = srcfile.getInputStream();
        try {
         
          URL base = new URL("file://"+srcfile);
          if(!localUrl){
            //PageContext pc = Thread LocalPageContext.get();
           
              String abs = srcfile.getAbsolutePath();
              String contract = ContractPath.call(pc, abs);
              if(!abs.equals(contract)) {
                base=HTTPUtil.toURL(CGIImpl.getDomain(pc.getHttpServletRequest())+contract,true);
              }

          }
         
          //URL base = localUrl?new URL("file://"+srcfile):getBase();
          render(pd4ml, is,os,base);
      }
        catch (Throwable t) {}
        finally {
          IOUtil.closeEL(is);
        }
      }
      // src
      else if(src!=null) {
        if(StringUtil.isEmpty(strCharset))strCharset="iso-8859-1";
        URL url = HTTPUtil.toURL(src,true);
     
      // set Proxy
      if(StringUtil.isEmpty(proxyserver) && config.isProxyEnableFor(url.getHost())) {
        ProxyData pd = config.getProxyData();
        proxyserver=pd==null?null:pd.getServer();
        proxyport=pd==null?0:pd.getPort();
        proxyuser=pd==null?null:pd.getUsername();
        proxypassword=pd==null?null:pd.getPassword();
      }
View Full Code Here

  public void init(StorageScopeEngine engine) {
    super.init(engine);
  }

  protected void _clean() {
    ConfigWeb config = engine.getFactory().getConfig();
    DataSource[] datasources = config.getDataSources();
    for(int i=0;i<datasources.length;i++){
     
      if((datasources[i]).isStorage()) {
        try {
          clean(config,datasources[i]);
View Full Code Here

  private void _doEndTag(Struct cfhttp) throws PageException, IOException  {
    BasicHttpParams params = new BasicHttpParams();
      DefaultHttpClient client = HTTPEngine4Impl.createClient(params,redirect?HTTPEngine.MAX_REDIRECT:0);
     
     
      ConfigWeb cw = pageContext.getConfig();
      HttpRequestBase req=null;
      HttpContext httpContext=null;
    //HttpRequestBase req = init(pageContext.getConfig(),this,client,params,url,port);
      {
        if(StringUtil.isEmpty(charset,true)) charset=cw.getWebCharset();
        else charset=charset.trim();
       
       
      // check if has fileUploads 
        boolean doUploadFile=false;
View Full Code Here

    boolean pcCreated=false;
    PageContext pc = ThreadLocalPageContext.get();
    // MUST this is just a workaround
    if(pc==null){
      pcCreated=true;
      ConfigWeb config = (ConfigWeb) ThreadLocalPageContext.getConfig();
      Pair[] parr = new Pair[0];
      pc=ThreadUtil.createPageContext(config, DevNullOutputStream.DEV_NULL_OUTPUT_STREAM, "localhost", "/","", new Cookie[0], parr, parr, new StructImpl());
    }
   
    // reading fails for serialized data from Railo version 4.1.2.002
View Full Code Here

   

    private Page loadPhysical(PageContext pc,Page page) throws PageException {
      if(!mapping.hasPhysical()) return null;
     
      ConfigWeb config=pc.getConfig();
      PageContextImpl pci=(PageContextImpl) pc;
      if((mapping.getInspectTemplate()==ConfigImpl.INSPECT_NEVER || pci.isTrusted(page)) && isLoad(LOAD_PHYSICAL)) return page;
      Resource srcFile = getPhyscalFile();
     
      /*{
 
View Full Code Here

public final class CFImportTag extends CFTag {

   
  @Override
  public void initFile() throws PageException {
    ConfigWeb config = pageContext.getConfig();
       
    String[] filenames=CustomTagUtil.getFileNames(config, getAppendix());// = appendix+'.'+config.getCFMLExtension();
       
   
    String strRealPathes=attributesScope.remove("__custom_tag_path").toString();
    String[] realPathes=ListUtil.listToStringArray(strRealPathes, File.pathSeparatorChar);
      for(int i=0;i<realPathes.length;i++){
        if(!StringUtil.endsWith(realPathes[i],'/'))realPathes[i]=realPathes[i]+"/";
      }
     
      // MUSTMUST use cache like regular ct
    // page source
      PageSource ps;
      for(int rp=0;rp<realPathes.length;rp++){
        for(int fn=0;fn<filenames.length;fn++){
              ps=((PageContextImpl)pageContext).getRelativePageSourceExisting(realPathes[rp]+filenames[fn]);
              if(ps!=null){
                source=new InitFile(ps,filenames[fn],filenames[fn].endsWith('.'+config.getCFCExtension()));
                return;
              }
      }
      }
     
View Full Code Here

    try {
      p.threadCall(pc, threadIndex);
    }
    catch (Throwable t) {
      if(!Abort.isSilentAbort(t)) {
        ConfigWeb c = pc.getConfig();
        if(c instanceof ConfigImpl) {
          ConfigImpl ci=(ConfigImpl) c;
          LogAndSource log = ci.getThreadLogger();
          if(log!=null)log.error(this.getName(), ExceptionUtil.getStacktrace(t,true));
        }
View Full Code Here

public class IsVideoFile {

  public static boolean call(PageContext pc, String path) throws PageException {
    try {
      ConfigWeb config = pc.getConfig();
      VideoExecuter ve = VideoUtilImpl.createVideoExecuter(config);
      ve.info(config,new VideoInputImpl(Caster.toResource(pc,path, true)));
    }
    catch (Exception e) {
     
View Full Code Here

public final class ExpandPath implements Function {

  private static final long serialVersionUID = 6192659914120397912L;

  public static String call(PageContext pc , String realPath) throws PageException {
    ConfigWeb config=pc.getConfig();
    realPath=realPath.replace('\\','/');

        String contextPath = pc.getHttpServletRequest().getContextPath();
        if ( !StringUtil.isEmpty( contextPath ) && realPath.startsWith( contextPath ) ) {
            boolean sws=StringUtil.startsWith(realPath, '/');
View Full Code Here

TOP

Related Classes of railo.runtime.config.ConfigWeb

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.