Skip to content

Commit 749c749

Browse files
authored
Merge branch 'master' into totp_eo
2 parents 87a3295 + 715fb6f commit 749c749

File tree

354 files changed

+21158
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+21158
-258
lines changed

.github/workflows/Build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
servers: '[
5656
{ "id": "github-genexuslabs", "username": "genexusbot", "password": "${{ secrets.SECURE_TOKEN }}" },
5757
{ "id": "azure-devops", "username": "genexuslabs", "password": "${env.AZURE_ARTIFACTS_TOKEN}" },
58-
{ "id": "ossrh", "username": "${env.MAVEN_USERNAME}", "password": "${env.MAVEN_PASSWORD}" },
58+
{ "id": "central", "username": "${env.MAVEN_USERNAME}", "password": "${env.MAVEN_PASSWORD}" },
5959
{ "id": "gpg.passphrase", "passphrase": "${env.MAVEN_GPG_PASSPHRASE}" }
6060
]'
6161

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ These are the source of the GeneXus Standard Classes for Java, valid since GeneX
44
## Repo Status
55
| Branch | Build | Security
66
|---|---|---
7-
|master |[![](https://github.com/genexuslabs/JavaClasses/workflows/Build/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions?query=workflow%3ABuild+branch%3Amaster)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
8-
|beta |[![](https://github.com/genexuslabs/JavaClasses/workflows/Build/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions?query=workflow%3ABuild+branch%3Abeta)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
7+
|master |[![Build](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
8+
|beta |[![Build](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions/workflows/Build.yml)|[![CodeQL](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml/badge.svg?branch=beta)](https://github.com/genexuslabs/JavaClasses/actions/workflows/codeql-analysis.yml)
99

1010
## Modules
1111

@@ -21,10 +21,16 @@ These are the source of the GeneXus Standard Classes for Java, valid since GeneX
2121
| gxoffice | Formerly Java classes are now separated to be included only when using office.
2222
| gxsearch | Formerly in Java classes are now separated to be included only when using search.
2323
| gxandroidpublisher and javapns | They are necessary for when you have Push Notifications in your old implementation. These are projects that should disappear in the short term.
24-
| android | The standard Android classes. **Note that this is not the full runtime for Android, the full runtime can be created by using the Android Flexible Client project**.
25-
| gxexternalproviders | Implements service provider for IBM Cloud, Google, Azure, Amazon
26-
| gxgeospatial | Geography data type implementation
27-
| gxodata | OData access
24+
| android | The standard Android classes. **Note that this is not the full runtime for Android, the full runtime can be created by using the Android Flexible Client project**.
25+
| gxexternalproviders | Implements service provider for IBM Cloud, Google, Azure, Amazon
26+
| gxgeospatial | Geography data type implementation
27+
| gxodata | OData access
28+
| securityapicommons | SecurityAPI's common module
29+
| gxcryptography | SecurityAPI's GeneXusCryptography module
30+
| gxjwt | SecurityAPI's GeneXusJWT module
31+
| gxxmlsignature | SecurityAPI's GeneXusXmlSignature module
32+
| gxftps | SecurityAPI's GeneXusFTPS module
33+
| gxsftp | SecurityAPI's GeneXusSFTP module
2834
| gamtotp | GAM external object for RFC6238 implementation
2935

3036
The dependencies between the projects are specified in each pom.xml within their directory.

android/src/main/java/com/genexus/db/DataStoreProvider.java

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.sql.SQLException;
44
import java.util.Date;
5+
import java.util.concurrent.locks.ReentrantLock;
56

67
import com.genexus.*;
78
import com.genexus.db.driver.DataSource;
@@ -164,10 +165,54 @@ public void executeBatch(int cursorIdx)
164165
{
165166
execute(cursorIdx, null, false);
166167
}
168+
169+
static ReentrantLock lockExecute = new ReentrantLock();
170+
167171
public synchronized void execute(int cursorIdx, Object[] parms)
168172
{
169-
execute(cursorIdx, parms, true);
170-
}
173+
DataSource ds = getDataSourceNoException();
174+
if(ds!=null && ds.jdbcIntegrity==false)
175+
{
176+
// If the JDBC integrity is disabled (XBASE_TINT), SQLIte is in autocommit mode.
177+
// we need to lock the execute method to avoid concurrency issues.
178+
// for example, the postExecute method (select changes()) cause exception in Android SQLite.
179+
// it happends with execute sql statements like from diferent threads, like using procedures submit.
180+
Cursor cursor = cursors[cursorIdx];
181+
if (cursor instanceof UpdateCursor) // if the cursor is an UpdateCursor, we need to lock the execute method.
182+
{
183+
AndroidLog.debug("execute UpdateCursor cursorIdx : " + cursorIdx);
184+
long timeStampStart = System.currentTimeMillis();
185+
lockExecute.lock();
186+
long timeStampLock = System.currentTimeMillis();
187+
AndroidLog.debug("START execute UpdateCursor afterlock cursorIdx: " + cursorIdx + " Waiting time ms: " + (timeStampLock - timeStampStart));
188+
try
189+
{
190+
// execute the cursor with the parameters.
191+
execute(cursorIdx, parms, true);
192+
}
193+
finally
194+
{
195+
lockExecute.unlock();
196+
}
197+
long timeStampEnd = System.currentTimeMillis();
198+
AndroidLog.debug("END execute UpdateCursor cursorIdx: " + cursorIdx+ " Execute time ms: " + (timeStampEnd - timeStampLock));
199+
}
200+
else
201+
{
202+
// if the cursor is not an UpdateCursor, we can execute it without locking.
203+
long timeStampStart = System.currentTimeMillis();
204+
execute(cursorIdx, parms, true);
205+
long timeStampEnd = System.currentTimeMillis();
206+
AndroidLog.debug("END execute cursorIdx: " + cursorIdx+ " Execute time ms: " + (timeStampEnd - timeStampStart));
207+
}
208+
}
209+
else
210+
{
211+
// default case, we execute the cursor with the parameters.
212+
execute(cursorIdx, parms, true);
213+
}
214+
215+
}
171216

172217
private void execute(int cursorIdx, Object[] parms, boolean preExecute)
173218
{

android/src/main/java/com/genexus/db/ForEachCursor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ public void setTimestamp(int index, java.sql.Timestamp value) throws SQLExceptio
217217
public void setBLOBFile(int index, String fileName) throws SQLException {}
218218
public void setBLOBFile(int index, String fileName, boolean isMultiMedia) throws SQLException {}
219219
public void setBLOBFile(int index, String fileName, boolean isMultiMedia, boolean downloadContent) throws SQLException {}
220+
public void setEmbedding(int index, Float[] value) throws SQLException {}
220221

221222
public void setVarchar(int index, String value, int length, boolean allowsNull) throws SQLException {}
222223
public void setLongVarchar(int index, String value, boolean allowsNull) throws SQLException {}

android/src/main/java/com/genexus/db/SQLAndroidSQLiteHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public class SQLAndroidSQLiteHelper
77
{
8-
private static String clazzFullName = "com.artech.layers.LocalUtils";
8+
private static String clazzFullName = "com.genexus.android.core.layers.LocalUtils";
99

1010
public static void beginTransaction()
1111
{

android/src/main/java/com/genexus/db/driver/GXCallableStatement.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ public byte[] getBytes(int columnIndex) throws SQLException
651651
return stmt.getBytes(columnIndex);
652652
}
653653

654+
public Float[] getGxembedding (int columnIndex) throws SQLException
655+
{
656+
return null;
657+
}
658+
654659
public java.util.UUID getGUID(int columnIndex) throws SQLException
655660
{
656661
if (DEBUG)

android/src/main/java/com/genexus/db/driver/GXPreparedStatement.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,9 @@ else if (file.exists() && !fileNameNew.startsWith(blobBasePath))
13071307
}
13081308
}
13091309
}
1310-
1310+
1311+
public void setEmbedding(int index, Float[] value) throws SQLException{
1312+
}
13111313
public void setBinaryStream(int index, java.io.InputStream value, int length) throws SQLException
13121314
{
13131315
if (DEBUG)

android/src/main/java/com/genexus/db/driver/GXResultSet.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,11 @@ public byte[] getBytes(int columnIndex) throws SQLException
770770
return result.getBytes(columnIndex);
771771
}
772772

773+
public Float[] getGxembedding (int columnIndex) throws SQLException
774+
{
775+
return null;
776+
}
777+
773778
public java.util.UUID getGUID(int columnIndex) throws SQLException
774779
{
775780
java.util.UUID value;

android/src/main/java/com/genexus/internet/HttpContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public void SendState()
414414
}catch(Exception ex){}
415415
writeTextNL("<script type=\"text/javascript\">gx.http.useBase64State=true;</script>");
416416
}
417-
writeText("<div><input type=\"hidden\" name=\"GXState\" value='");
417+
writeText("<div><input type=\"hidden\" name=\"GXState\" data-gtm-ignore='true' value='");
418418
writeTextNL("'" + htmlEndTag(HTMLElement.INPUT) + "</div>");
419419
if (this.formCaption != null && !this.formCaption.equals(""))
420420
{

android/src/main/java/com/genexus/specific/android/AndroidJSONSerialization.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.Map;
1010

1111
public class AndroidJSONSerialization implements IExtensionJSONSerialization {
12+
1213
@Override
1314
public Iterator<Map.Entry<String, Object>> getJSONObjectIterator(JSONObjectWrapper obj) {
1415
Map<String, Object> map = new LinkedHashMap<>();
@@ -24,4 +25,15 @@ public Iterator<Map.Entry<String, Object>> getJSONObjectIterator(JSONObjectWrapp
2425
public JSONTokener getJSONTokener(String s) {
2526
return new AndroidJSONTokenerWrapper(s);
2627
}
28+
29+
@Override
30+
public Map<String, Object> getJSONObjectMap(JSONObjectWrapper obj) {
31+
Map<String, Object> map = new LinkedHashMap<>();
32+
for (Iterator<String> it = obj.keys(); it.hasNext(); ) {
33+
String k = it.next();
34+
map.put(k, obj.get(k)); // add key and value to map result
35+
}
36+
return map;
37+
38+
}
2739
}

0 commit comments

Comments
 (0)