use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.
the class GXGridStateHandler method loadGridState.
public void loadGridState() {
HttpContext httpContext = (HttpContext) context.getHttpContext();
HttpRequest httpRequest = httpContext.getHttpRequest();
if (GXutil.strcmp(httpRequest.getMethod(), "GET") == 0) {
WebSession session = httpContext.getWebSession();
state = new SdtGridState(context);
state.fromJSonString(session.getValue(gridName));
runVarsFromState();
dirty = true;
}
}
use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.
the class PDFReportItext method GxSetDocName.
public void GxSetDocName(String docName) {
this.docName = docName.trim();
if (this.docName.indexOf('.') < 0)
this.docName += ".pdf";
if (!new File(docName).isAbsolute()) {
// Si el nombre del documento es relativo, veo si hay que agregarle el outputDir
String outputDir = props.getGeneralProperty(Const.OUTPUT_FILE_DIRECTORY, "").replace(alternateSeparator, File.separatorChar).trim();
if (!outputDir.equalsIgnoreCase("") && !outputDir.equalsIgnoreCase(".")) {
if (!outputDir.endsWith(File.separator)) {
outputDir += File.separator;
}
new File(outputDir).mkdirs();
this.docName = outputDir + this.docName;
} else {
if (ModelContext.getModelContext() != null) {
HttpContext webContext = (HttpContext) ModelContext.getModelContext().getHttpContext();
if ((webContext != null) && (webContext instanceof HttpContextWeb)) {
outputDir = com.genexus.ModelContext.getModelContext().getHttpContext().getDefaultPath() + File.separator;
this.docName = outputDir + this.docName;
}
}
}
}
if (this.docName.indexOf('.') < 0)
this.docName += ".pdf";
if (DEBUG)
DEBUG_STREAM.println("GxSetDocName: '" + this.docName + "'");
}
use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.
the class JavaModelContextExtension method setTimeZone.
public Boolean setTimeZone(ModelContext model, String sTz) {
HttpContext httpContext = (HttpContext) model.getHttpContext();
sTz = CommonUtil.rtrim(sTz);
TimeZone tz = TimeZone.getTimeZone(sTz);
Boolean ret = tz.getID().equals(sTz);
if (ret) {
model.setCurrentTimeZone(tz);
httpContext.webPutSessionValue("GXTimezone", tz.getID());
}
return ret;
}
use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.
the class JavaModelContextExtension method initializeSubmitSession.
private static void initializeSubmitSession(ModelContext oldContext, ModelContext newContext) {
HttpContext httpCtx = (HttpContext) oldContext.getHttpContext();
HttpContext newHttpCtx = (HttpContext) newContext.getHttpContext();
if (httpCtx != null && newHttpCtx != null) {
com.genexus.webpanels.WebSession ws = newHttpCtx.getWebSession();
for (int i = 0; i < copyKeys.length && ws != null; i++) {
Object value = httpCtx.getSessionValue(copyKeys[i]);
if (value != null) {
ws.setValue(copyKeys[i], value.toString());
}
}
}
}
use of com.genexus.internet.HttpContext in project JavaClasses by genexuslabs.
the class JavaModelContextExtension method getTimeZone.
public String getTimeZone(ModelContext context) {
String TZ = null;
HttpContext httpContext = (HttpContext) context.getHttpContext();
if (context != null)
TZ = (String) httpContext.getSessionValue("GXTimezone");
if (TZ != null && !TZ.equals(""))
setTimeZone(context, (String) TZ);
if (context.getCurrentTimeZone() == null)
context.setCurrentTimeZone(_getClientTimeZone(context));
return context.getCurrentTimeZone().getID();
}
Aggregations