Skip to content

Commit

Permalink
Merge branch 'adempiere:develop' into experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih authored Dec 16, 2022
2 parents 638ad1a + e0dd4a5 commit 21b7407
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 154 deletions.
50 changes: 1 addition & 49 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
postgres:
# Docker Hub image
# Ubuntu 22.04 supports only Postgres 14.5
image: postgres:14.5
image: postgres:15
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
Expand Down Expand Up @@ -81,61 +81,13 @@ jobs:
uses: ./.github/actions/adempiere-build
with:
nodbrestore: false
# env:
# ACTION_BUILD_DIR: ${{ github.action_path }}
# POSTGRES_HOST: localhost
# # The default PostgreSQL port
# POSTGRES_PORT: 5432
# run: |
# echo $ACTION_BUILD_DIR
# echo $GITHUB_REF
# echo $GITHUB_HEAD_REF
# echo $GITHUB_BASE_REF
# echo ${{ github.ref }}
# echo "Current ant version: $(ant -version)"
# echo "Installing ant version 1.10.10"
# wget --no-check-certificate https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.10-bin.tar.gz
# tar -xzf apache-ant-1.10.10-bin.tar.gz
# export ANT_HOME=`pwd`/apache-ant-1.10.10
# export PATH=${ANT_HOME}/bin:$PATH
# export ADEMPIERE_HOME=$GITHUB_WORKSPACE/adempiere/Adempiere
# echo $ANT_HOME
# echo $PATH
# echo $(ant -version)
# echo $ADEMPIERE_HOME
# # ANT performs build, install and database restore
# ant build

# Build ADempiere with ant, if there are no changes in XML files
- name: Build Adempiere without database restore...
if: steps.changed-files.outputs.xml-files == 'false'
uses: ./.github/actions/adempiere-build
with:
nodbrestore: true
# env:
# ACTION_BUILD_DIR: ${{ github.action_path }}
# POSTGRES_HOST: localhost
# # The default PostgreSQL port
# POSTGRES_PORT: 5432
# run: |
# echo $ACTION_BUILD_DIR
# echo $GITHUB_REF
# echo $GITHUB_HEAD_REF
# echo $GITHUB_BASE_REF
# echo ${{ github.ref }}
# echo "Current ant version: $(ant -version)"
# echo "Installing ant version 1.10.10"
# wget --no-check-certificate https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.10-bin.tar.gz
# tar -xzf apache-ant-1.10.10-bin.tar.gz
# export ANT_HOME=`pwd`/apache-ant-1.10.10
# export PATH=${ANT_HOME}/bin:$PATH
# export ADEMPIERE_HOME=$GITHUB_WORKSPACE/adempiere/Adempiere
# echo $ANT_HOME
# echo $PATH
# echo $(ant -version)
# echo $ADEMPIERE_HOME
# # ANT performs only build & install. No database restore.
# ant build -Dnodbrestore=true

- name: Upload Binary Files
uses: actions/upload-artifact@v3
Expand Down
44 changes: 15 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
# This workflow contains a single job called "build"
publish:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
image: postgres:15
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
Expand All @@ -36,7 +36,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Ensure a compatible version of java is used
- name: Setup Java JDK
Expand All @@ -45,32 +45,12 @@ jobs:
java-version: '11'
java-package: jdk

# Build ADempiere with ant
- name: Build Adempiere ...
env:
ACTION_BUILD_DIR: ${{ github.action_path }}
POSTGRES_HOST: localhost
# The default PostgreSQL port
POSTGRES_PORT: 5432
run: |
echo $ACTION_BUILD_DIR
echo $GITHUB_REF
echo $GITHUB_HEAD_REF
echo $GITHUB_BASE_REF
echo ${{ github.ref }}
echo "Current ant version: $(ant -version)"
echo "Installing ant version 1.10.10"
wget --no-check-certificate https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.10-bin.tar.gz
tar -xzf apache-ant-1.10.10-bin.tar.gz
export ANT_HOME=`pwd`/apache-ant-1.10.10
export PATH=${ANT_HOME}/bin:$PATH
export ADEMPIERE_HOME=$GITHUB_WORKSPACE/adempiere/Adempiere
echo $ANT_HOME
echo $PATH
echo $(ant -version)
echo $ADEMPIERE_HOME
ant build
# Create Artifact for Download
# Build ADempiere with ant, if there are changes in XML files
- name: Build Adempiere with database restore...
uses: ./.github/actions/adempiere-build
with:
nodbrestore: false

- name: Upload zip
uses: skx/github-action-publish-binaries@master
env:
Expand All @@ -96,6 +76,12 @@ jobs:
with:
args: 'install/build/*.tar.gz.MD5'
- name: Upload Seed (Database)
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_ACCESS }}
with:
args: 'adempiere/Adempiere/data/Adempiere_pg.dmp'
- name: Upload Compressed Seed (Database)
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_ACCESS }}
Expand Down
2 changes: 1 addition & 1 deletion base/src/org/compiere/model/GridTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ private int setCurrentRow (int newCurrentRow, boolean fireEvents)
* @return current row
*/
public void setCurrentRow(int row){
setCurrentRow(row, false);
setCurrentRow(row, true);
}


Expand Down
3 changes: 1 addition & 2 deletions tools/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@
<zipfileset src="lib/poi-ooxml-3.17.jar">
<patternset refid="manifest.exclude" />
</zipfileset>
<!-- CGLib -->
<zipfileset src="lib/cglib.jar">
<zipfileset src="lib/byte-buddy-1.12.19.jar">
<patternset refid="manifest.exclude" />
</zipfileset>
<!-- Open Forecast -->
Expand Down
Binary file added tools/lib/byte-buddy-1.12.19.jar
Binary file not shown.
54 changes: 27 additions & 27 deletions zkwebui/WEB-INF/src/org/adempiere/webui/ServerContextCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,42 @@
*****************************************************************************/
package org.adempiere.webui;

import org.adempiere.webui.session.ServerContext;

import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Properties;

import org.adempiere.webui.session.ServerContext;

import net.sf.cglib.proxy.InvocationHandler;

/**
* Intercaptor for Server context properties that delegate to the threadlocal instance
* @author Low Heng Sin
*
* @author Low Heng Sin
* @author Victor Perez Juarez . [email protected] e-Evolution
* #4021 [Bug Report] Replace obsolete library cglib.jar not compatible with JDK 11 or > https://github.com/adempiere/adempiere/issues/4021
*/
public class ServerContextCallback implements InvocationHandler, Serializable {
/**
*
*/
private static final long serialVersionUID = 6708635918931322152L;
/**
*
*/
private static final long serialVersionUID = 6708635918931322152L;

public synchronized Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
Properties context = ServerContext.getCurrentInstance();
//optimize for the 2 most common access
if (method.getName().equals("getProperty")) {
Class<?>[] types = method.getParameterTypes();
if (types != null && types.length == 1 && types[0] == String.class &&
args != null && args.length == 1 && args[0] instanceof String) {
return context.getProperty((String)args[0]);
}
else if (types != null && types.length == 2 && types[0] == String.class &&
types[1] == String.class && args != null && args[0] instanceof String &&
args[1] instanceof String)
return context.getProperty((String)args[0], (String)args[1]);
}
Method m = context.getClass().getMethod(method.getName(), method.getParameterTypes());
return m.invoke(context, args);
}
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
Properties context = ServerContext.getCurrentInstance();
//optimize for the 2 most common access
if (method.getName().equals("getProperty")) {
Class<?>[] types = method.getParameterTypes();
if (types != null && types.length == 1 && types[0] == String.class &&
args != null && args.length == 1 && args[0] instanceof String) {
return context.getProperty((String) args[0]);
} else if (types != null && types.length == 2 && types[0] == String.class &&
types[1] == String.class && args != null && args[0] instanceof String &&
args[1] instanceof String)
return context.getProperty((String) args[0], (String) args[1]);
}
Method m = context.getClass().getMethod(method.getName(), method.getParameterTypes());
return m.invoke(context, args);
}

}
32 changes: 26 additions & 6 deletions zkwebui/WEB-INF/src/org/adempiere/webui/ZkContextProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,43 @@
*****************************************************************************/
package org.adempiere.webui;

import net.bytebuddy.implementation.InvocationHandlerAdapter;
import org.adempiere.webui.session.SessionManager;
import org.compiere.util.ContextProvider;

import java.util.Properties;

import net.sf.cglib.proxy.Enhancer;
import static net.bytebuddy.matcher.ElementMatchers.any;


import org.adempiere.webui.session.SessionManager;
import org.compiere.util.ContextProvider;

/**
*
* @author Low Heng Sin
* @author Victor Perez Juarez . [email protected] e-Evolution
* #4021 [Bug Report] Replace obsolete library cglib.jar not compatible with JDK 11 or > https://github.com/adempiere/adempiere/issues/4021
*
*/
public class ZkContextProvider implements ContextProvider {

private final static ServerContextCallback callback = new ServerContextCallback();
private final static Properties context = (Properties) Enhancer.create(Properties.class, callback);

private final static ServerContextCallback callback = new ServerContextCallback();

private final static Properties context;

static {
try {
context = (new net.bytebuddy.ByteBuddy()
.subclass(java.util.Properties.class)
.method(any())
.intercept(InvocationHandlerAdapter.of(callback))
.make()
.load(ZkContextProvider.class.getClassLoader())
.getLoaded()).newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}

/**
* Get server context proxy
*/
Expand Down
31 changes: 15 additions & 16 deletions zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
* @author e-Evolution , [email protected]
* <li>Implement embedded or horizontal tab panel https://adempiere.atlassian.net/browse/ADEMPIERE-319
* <li>New ADempiere 3.8.0 ZK Theme Light https://adempiere.atlassian.net/browse/ADEMPIERE-320
* <li>[Bug Report] Quick Entry not working when the icon is pushed #4023 https://github.com/adempiere/adempiere/issues/4023</>
*
*/
public class GridPanel extends Borderlayout implements EventListener
Expand Down Expand Up @@ -123,7 +124,7 @@ public class GridPanel extends Borderlayout implements EventListener

// The following fields require package or protected level of
// visibility for testing
Grid listbox = new Grid();
Grid listbox;
GridTabRowRenderer renderer;
AbstractADWindowPanel windowPanel;

Expand All @@ -148,7 +149,16 @@ public GridPanel()
public GridPanel(int windowNo)
{
this.windowNo = windowNo;

listbox = new Grid();

listbox.addEventListener(Events.ON_FOCUS, this);
listbox.setOddRowSclass(null);
south = new South();
this.appendChild(south);

center = new Center();
center.appendChild(listbox);
this.appendChild(center);
}

/**
Expand All @@ -157,23 +167,12 @@ public GridPanel(int windowNo)
*/
public void init(GridTab gridTab)
{
if (init && !gridTab.isQuickEntry()) return;

if (pageSize < 0)
pageSize = getSysConfigPageSizeOrDefault(100);
modeless = getSysConfigModelessOrDefault(false);

if (init && !gridTab.isQuickEntry()) return;

listbox.addEventListener(Events.ON_FOCUS, this);
listbox.setOddRowSclass(null);

south = new South();
this.appendChild(south);

center = new Center();
center.appendChild(listbox);
this.appendChild(center);



this.gridTab = gridTab;
tableModel = gridTab.getTableModel();

Expand Down
Loading

0 comments on commit 21b7407

Please sign in to comment.