Skip to content

Commit 569bffe

Browse files
authored
Merge branch 'master' into queue-api
2 parents 4ace819 + 727e773 commit 569bffe

File tree

37 files changed

+419
-40
lines changed

37 files changed

+419
-40
lines changed

android/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.genexus</groupId>
99
<artifactId>parent</artifactId>
10-
<version>2.6-SNAPSHOT</version>
10+
<version>2.7-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>gxandroid</artifactId>

androidreports/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.genexus</groupId>
99
<artifactId>parent</artifactId>
10-
<version>2.6-SNAPSHOT</version>
10+
<version>2.7-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>gxandroidreports</artifactId>

apacheandroid/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.genexus</groupId>
99
<artifactId>parent</artifactId>
10-
<version>2.6-SNAPSHOT</version>
10+
<version>2.7-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>apacheandroid</artifactId>

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.genexus</groupId>
99
<artifactId>parent</artifactId>
10-
<version>2.6-SNAPSHOT</version>
10+
<version>2.7-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>gxcommon</artifactId>

common/src/main/java/com/genexus/GXRuntime.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.genexus;
22

3+
import com.genexus.util.*;
4+
import java.util.Map;
5+
36
public class GXRuntime {
47
static public short getEnvironment() {
58
return 1; // RuntimeEnvironment.Server
@@ -17,4 +20,30 @@ static public void setExitCode(int value) {
1720
static public int getExitCode() {
1821
return exitCode;
1922
}
23+
24+
public static String GetEnvironmentVariable(String key) {
25+
String value = "";
26+
if (key != null && key.length() > 0){
27+
value = System.getenv(key);
28+
}
29+
return value;
30+
}
31+
public static GXProperties GetEnvironmentVariables() {
32+
33+
Map<String, String> env = System.getenv();
34+
GXProperties gxProperties = new GXProperties();
35+
for (String envName : env.keySet()) {
36+
gxProperties.add(envName,env.get(envName) );
37+
}
38+
return gxProperties;
39+
}
40+
41+
public static boolean HasEnvironmentVariable(String key) {
42+
if (key != null && key.length() > 0){
43+
String value = System.getenv(key);
44+
if (value != null && value.length() > 0)
45+
return true;
46+
}
47+
return false;
48+
}
2049
}

common/src/main/java/com/genexus/ModelContext.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public ModelContext(Class packageClass)
9494
}
9595

9696
SpecificImplementation.Application.setContextClassName(this.packageClass);
97+
98+
if (threadModelContext.get() == null)
99+
threadModelContext.set(this);
97100
try
98101
{
99102
this.staticContentBase = getClientPreferences().getWEB_IMAGE_DIR();
@@ -106,8 +109,6 @@ public ModelContext(Class packageClass)
106109
}
107110
if (httpContext != null)
108111
httpContext.setStaticContentBase(staticContentBase);
109-
if (threadModelContext.get() == null)
110-
threadModelContext.set(this);
111112
}
112113

113114
public ModelContext(ModelContext modelContext)

common/src/main/java/com/genexus/db/BlobUpdateCursor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void postExecuteInsert(AbstractDataStoreProviderBase connectionProvider, Abstrac
8282
IGXPreparedStatement selStmt = SentenceProvider.getPreparedStatement(connectionProvider, mCursorId + BLOB_SEL_ID, blobStmt2, false);
8383

8484
// Seteo el argumento (el rowId) y ejecuto el select
85-
String rowId = ((IGXCallableStatement)mPreparedStatement).getString(cantNoBlobParms + 1);
85+
String rowId = ((IGXCallableStatement)mPreparedStatement).getString(cantNoBlobParms + 1).trim();
8686
selStmt.setString(1, rowId);
8787
IGXResultSet resultSet = (IGXResultSet)selStmt.executeQuery();
8888
resultSet.next();

common/src/main/java/com/genexus/util/EnvVarReader.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.genexus.util;
22

3+
import com.genexus.ModelContext;
4+
35
public class EnvVarReader {
46

57
static String[] m_invalidChars = { ".", "|" };
@@ -12,15 +14,30 @@ public static String getEnvironmentVar(String section, String key, String mapped
1214
}else{
1315
String prefix = ENVVAR_PREFIX;
1416
if (section != null && !section.isEmpty() && section != "Client") {
15-
for (int i = 0; i < m_invalidChars.length; i++)
16-
section = section.replace(m_invalidChars[i], "_");
17+
section = replaceInvalidChars(section);
18+
String realKey = key;
1719
key = String.format("%s%s_%s", prefix, section.toUpperCase(), key.toUpperCase());
20+
String envVar = System.getenv(key);
21+
if (envVar != null)
22+
return envVar;
23+
if (ModelContext.getModelContext() != null) {
24+
section = section.replace(replaceInvalidChars(ModelContext.getModelContext().getPackageName() + "|").toUpperCase(), "");
25+
key = String.format("%s%s_%s", prefix, section.toUpperCase(), realKey.toUpperCase());
26+
}
27+
else
28+
return null;
1829
} else
1930
key = String.format("%s%s", prefix, key.toUpperCase());
2031
return System.getenv(key);
2132
}
2233
}
2334

35+
private static String replaceInvalidChars(String section) {
36+
for (int i = 0; i < m_invalidChars.length; i++)
37+
section = section.replace(m_invalidChars[i], "_");
38+
return section;
39+
}
40+
2441
public static String getEnvironmentValue(String serviceType, String serviceName, String propertyName) {
2542
String envVarName = String.format("%s%s_%s", ENVVAR_PREFIX, serviceType.toUpperCase(), propertyName.toUpperCase());
2643
String value = System.getenv(envVarName);

gxandroidpublisher/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.genexus</groupId>
99
<artifactId>parent</artifactId>
10-
<version>2.6-SNAPSHOT</version>
10+
<version>2.7-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>gxandroidpublisher</artifactId>

gxawsserverless/pom.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.genexus</groupId>
99
<artifactId>parent</artifactId>
10-
<version>2.6-SNAPSHOT</version>
10+
<version>2.7-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>gxawsserverless</artifactId>
@@ -25,6 +25,24 @@
2525
<version>${project.version}</version>
2626
</dependency>
2727

28+
<dependency>
29+
<groupId>${project.groupId}</groupId>
30+
<artifactId>gxcommon</artifactId>
31+
<version>${project.version}</version>
32+
</dependency>
33+
34+
<dependency>
35+
<groupId>${project.groupId}</groupId>
36+
<artifactId>gxwrapperjavax</artifactId>
37+
<version>${project.version}</version>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>${project.groupId}</groupId>
42+
<artifactId>gxwrappercommon</artifactId>
43+
<version>${project.version}</version>
44+
</dependency>
45+
2846
<dependency>
2947
<groupId>com.amazonaws.serverless</groupId>
3048
<artifactId>aws-serverless-java-container-jersey</artifactId>

0 commit comments

Comments
 (0)