Search in sources :

Example 21 with HttpContext

use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.

the class GXWebGrid method SetWrapped.

public void SetWrapped(int wrapped) {
    HttpContext httpContext = (HttpContext) this.context.getHttpContext();
    this.wrapped = (wrapped == 1);
    if (!this.wrapped) {
        this.wrapped = httpContext.drawGridsAtServer();
    }
    if (!this.wrapped) {
        this.wrapped = httpContext.getWrapped();
    }
    httpContext.setWrapped(this.wrapped);
}
Also used : HttpContext(com.genexus.internet.HttpContext)

Example 22 with HttpContext

use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.

the class GXWebObjectBase method CheckCmpSecurityAccess.

protected boolean CheckCmpSecurityAccess() {
    boolean[] flag = new boolean[] { false };
    boolean[] permissionFlag = new boolean[] { false };
    String permissionPrefix = IntegratedSecurityPermissionPrefix();
    com.genexus.internet.HttpRequest req = ((HttpContext) ModelContext.getModelContext().getHttpContext()).getHttpRequest();
    if (req == null)
        return false;
    String reqUrl = req.getRequestURL();
    ModelContext modelContext = ModelContext.getModelContext(getClass());
    if (IntegratedSecurityLevel() == SECURITY_LOW || IntegratedSecurityLevel() == SECURITY_GXOBJECT) {
        GXSecurityProvider.getInstance().checksession(-2, modelContext, reqUrl, permissionFlag);
    }
    if (IntegratedSecurityLevel() != SECURITY_LOW && IntegratedSecurityLevel() != SECURITY_GXOBJECT) {
        GXSecurityProvider.getInstance().checksessionprm(-2, modelContext, reqUrl, permissionPrefix, flag, permissionFlag);
    }
    return permissionFlag[0];
}
Also used : ModelContext(com.genexus.ModelContext) HttpContext(com.genexus.internet.HttpContext)

Example 23 with HttpContext

use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.

the class BlobsCleaner method getCurrentSession.

private WebSession getCurrentSession() {
    WebSession session = null;
    com.genexus.internet.HttpContext webContext = (HttpContext) com.genexus.ModelContext.getModelContext().getHttpContext();
    if ((webContext != null) && (webContext instanceof com.genexus.webpanels.HttpContextWeb)) {
        session = webContext.getWebSession();
        setCurrentSessionInUse(session);
    }
    return session;
}
Also used : HttpContext(com.genexus.internet.HttpContext) HttpContext(com.genexus.internet.HttpContext)

Example 24 with HttpContext

use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.

the class GXStaticWebPanel method createFile.

protected void createFile(String fileName) {
    try {
        visitedLinks.put(fileName, "");
        ((HttpContext) context.getHttpContext()).setOutputStream(new BufferedOutputStream(new FileOutputStream(fileName)));
        addMessage("Creating " + fileName + "...");
        this.fileName = fileName;
    } catch (IOException e) {
        throw new RuntimeException(e.getMessage());
    }
}
Also used : FileOutputStream(java.io.FileOutputStream) HttpContext(com.genexus.internet.HttpContext) IOException(java.io.IOException) BufferedOutputStream(java.io.BufferedOutputStream)

Example 25 with HttpContext

use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.

the class WebWrapper method setSource.

public void setSource(GXWebPanel panel) {
    this.panel = panel;
    ModelContext context = panel.getModelContext();
    HttpRequest httpReq = ((HttpContext) context.getHttpContext()).getHttpRequest();
    IHttpServletRequest httpSerReq = ((HttpContext) context.getHttpContext()).getRequest();
    context.setHttpContext(new HttpContextNull());
    ((HttpContext) context.getHttpContext()).setHttpRequest(httpReq);
    ((HttpContext) context.getHttpContext()).setRequest(httpSerReq);
    ((HttpContext) context.getHttpContext()).setContext(context);
    panel.setHttpContext(((HttpContext) context.getHttpContext()));
    panel.getHttpContext().setCompression(false);
    panel.getHttpContext().setBuffered(false);
    panel.getHttpContext().useUtf8 = true;
    panel.getHttpContext().setOutputStream(new java.io.ByteArrayOutputStream());
}
Also used : ModelContext(com.genexus.ModelContext) HttpRequest(com.genexus.internet.HttpRequest) IHttpServletRequest(com.genexus.servlet.http.IHttpServletRequest) ByteArrayOutputStream(java.io.ByteArrayOutputStream) HttpContext(com.genexus.internet.HttpContext) HttpContextNull(com.genexus.internet.HttpContextNull)

Aggregations

HttpContext (com.genexus.internet.HttpContext)30 File (java.io.File)5 WebSession (com.genexus.webpanels.WebSession)4 IOException (java.io.IOException)4 ModelContext (com.genexus.ModelContext)3 GXFile (com.genexus.util.GXFile)3 HttpContextWeb (com.genexus.webpanels.HttpContextWeb)3 com.genexus (com.genexus)2 HttpContextNull (com.genexus.internet.HttpContextNull)2 HttpRequest (com.genexus.internet.HttpRequest)2 BufferedInputStream (java.io.BufferedInputStream)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 URL (java.net.URL)2 SQLException (java.sql.SQLException)2 IExtensionModelContext (com.genexus.common.interfaces.IExtensionModelContext)1 IGxJSONAble (com.genexus.internet.IGxJSONAble)1 GXResult (com.genexus.security.GXResult)1 ServletException (com.genexus.servlet.ServletException)1