Commit Graph

18 Commits

Author SHA1 Message Date
Saulo José Gil 2b4a2be5a2
IDEMPIERE-4842 Easier model registration (#893)
* IDEMPIERE-4842 Easier model registration

- Change from https://github.com/atteo/classindex to
https://github.com/classgraph/classgraph, remove annotation processor
config.

- Change service.ranking of DefaultModelFactory to -1 and
service.ranking of AnnotationBasedModelFactory to 0. This give
AnnotationBasedModelFactory higher priority over DefaultModelFactory and
allow plugins to have higher priority over AnnotationBasedModelFactory
with server.ranking of 1 (the common practise before the introduction of
AnnotationBasedModelFactory).

- Added resultset constructor to MTree. This is to allow the use of
MTree with model factory.

- Remove classindex annotation from org.adempiere.base.Model and X_*
model classes.

- Added unit test for table to model class mapping

- AnnotationBasedModelFactory: Change from using annotation processor to
runtime annotation scanning using the classgraph library. The default
setting scans all the X_* model class and travels the inheritance
hierarchy to discover the M* model class. Plugin needs to create a
subclass of AnnotationBasedModelFactory and register it as an OSGi
component to scan the plugin's annotated model classes (the plugin's
custom AnnotationBasedModelFactory component should have service.ranking
> 0).

* IDEMPIERE-4842 Easier model registration

minor refinement

* Minor changes

Co-authored-by: hengsin <hengsin@gmail.com>
2021-09-22 22:42:51 +08:00
Saulo José Gil 602e450a93
IDEMPIERE-4842 Easier model registration (#877)
* Preliminary support for automatic model class registration

Model classes can be tagged with a new @Model annotation that allows for
easy/fast class scanning/registration, based on the ClassIndex library.
The list of annotated model classes is generated at compile time, thus
reducing reflection reliance to a bare minimum.

NOTE: Eclipse uses its own Java compiler which is not strictly standard
compliant and requires extra configuration. In Java Compiler ->
Annotation Processing -> Factory Path you need to add ClassIndex jar
file

* Annotation based model factory

* Improve classloader determination for annotation scanning

ClassIndex default annotation scanning method determines the classloader
to be used by calling Thread.currentThread().getContextClassLoader(),
which should not be used in an OSGi environment.

* Enable ClassIndex's annotation processor under Eclipse

Make sure annotation processing is enabled at Module Properties -> Java
Compiler -> Annotation Processing

* Refactoring annotation-based model class detection

Eliminated the need of annotating M* classes, by using ClassIndex's
@IndexSubclasses annotation.

* Minor change

* Minor changes

* Creation of AbstractModelFactory

* Documentation

* Make AnnotationBasedModelFactory extend AbstractModelFactory

* IDEMPIERE-4842 Easier model registration

- add annotation processor jdt settings
- fix @Component annotation for AnnotationBasedModelFactory
- fix generated x_* class missing "org.atteo.classindex.IndexSubclasses"
import

* Expose ClassIndex lib to other bundles

* Updated model classes

Co-authored-by: hengsin <hengsin@gmail.com>
2021-09-18 13:35:57 +08:00
hengsin ae5a665dd8
IDEMPIERE-4933 Platform update for 9.x (#857)
* IDEMPIERE-4933 Platform update for 9.x

- WIP

* IDEMPIERE-4933 Platform update for 9.x

- project to repackaged some osgi bundles from maven

* IDEMPIERE-4933 Platform update for 9.x

- Fix target platform error

* IDEMPIERE-4933 Platform update for 9.x

* IDEMPIERE-4933 Platform update for 9.x

- minor eclipse setting fix
2021-09-04 16:12:10 +02:00
hengsin a79be8aad8
IDEMPIERE-4749 Allow to use OAuth2 libraries on plugins (#668)
* IDEMPIERE-4749 Allow to use OAuth2 libraries on plugins

- move oauth libraries and dependency to target platform
- require Tycho 2.3.0+ and Eclipse 2021-03+

* IDEMPIERE-4749 Allow to use OAuth2 libraries on plugins

Fix launch configuration.
2021-04-28 14:59:50 +02:00
Carlos Ruiz 5f2d71347d
IDEMPIERE-3101 implement OAuth2 for mail (gmail, outlook and other mail system) (#593)
* IDEMPIERE-3101 implement OAuth2 for mail (gmail, outlook and other mail system)

WIP - initial version working on zk with google apps mail using OAuth2 Authorization Code Flow and Client Type = web application

* Enable imap reading with OAuth2 in RequestEMailProcessor
* Simplify the code - tested plain and OAuth2 can use the same methods
* Add +SCOPE parameter to AddAuthorizationForm according to IDEMPIERE-4713
* Rename the form AddAuthorizationMailForm to AddAuthorizationForm as is now more generic

* IDEMPIERE-4713
* Rename migration scripts to make it newer than IDEMPIERE-4713
* Add list of scopes attended by a credential
* Change form to accept other scopes, if no scope parameter is passed, then a list is shown, change the menu to fix the EMail scope
* Add MAuthorizationAccount.refreshAndGetAccessToken
* Add translation for messages

* make call generic oauth, avoid using specific google API

* Tests with microsoft as OAuth2 provider
* Add record for microsoft as provider
* Increase size of tokens
* Define mandatory and secure columns
* Update refresh token when it comes on the refresh call
* Revoke endpoint is optional

* Change the approach to a process instead of a form (WIP)
* Implement servlet to process the OAuth2 code

* Solve context suggestion from hengsin

* Implement the form in an automatic popup approach for running on zkwebui

* i18n - add translations for all messages that are shown to user
* on the form opted for click to avoid the problem with browsers forbidding popups
* clean spaces and tabs on line endings

* avoid logging and copy of the secure columns

* Fix problem reported by @d-ruiz about hidden NPE when SMTP Authentication is disabled

* Add writing to AD_PInstance_Para and AD_PInstance_Log the results of processing the servlet
* Control to avoid using the same authorization URL twice
2021-03-06 11:49:39 +01:00
Carlos Ruiz 8103ab0732 IDEMPIERE-4604 Release 8.2
Change references to new version
Create new migration folder
2020-12-20 10:15:20 +01:00
Carlos Ruiz 210e54b05f IDEMPIERE-4521 Release 8.1 - RC
Change versions in pom and manifest files
2020-11-03 21:59:12 +01:00
hengsin d79c6de5e5 IDEMPIERE-4202 Remove java web start code and libraries 2020-03-10 18:20:04 +08:00
Carlos Ruiz 64eadf1822 release 7.1 process - set version in configuration files 2019-11-21 23:28:48 +01:00
Carlos Ruiz f5e6beb8b7 hg merge release-6.2 (merge release6.2 into default) 2019-04-11 15:51:04 +02:00
Heng Sin Low bf2b531267 IDEMPIERE-3946 Upgrade to Tycho 1.4.0 2019-04-11 20:22:24 +08:00
Carlos Ruiz d28c1e682d Integrate contribution from TrekGlobal - developed by Heng Sin Low and Elaine Tan
1007781 Fix barcode text bug
1009003 add QR Code as Barcode Type for Print Formats
1006829 Add "Print Barcode Text" flag to print format item. Fix wrong scaling for barcode image. Fix barcode print format item doesn't respect max height.
IDEMPIERE-3948 Implement QRCode support in report engine
IDEMPIERE-1854 Barcode issue: Code Missing from barcodes in Code 128 B
IDEMPIERE-1838 Adding UPC-A barcode support in print format and adding setting fonts from print format item
2019-04-10 17:57:08 +02:00
Carlos Ruiz 9487335169 Preparing release 6.2 - upgrade versions 2019-01-05 23:56:28 +01:00
hieplq f3db098703 IDEMPIERE-3808:collect info to move idempiere to jdk-11 (jdk intenal package)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367431
implement to don't use intenal package
2018-12-31 04:04:22 +07:00
Carlos Ruiz 7eeb4a8463 More versioning for 6.1 2018-11-04 18:32:21 -02:00
hieplq 69c91e1111 IDEMPIERE-3798:Move iDempiere default branch to openjdk 10 (build by tycho issue)
https://bugs.eclipse.org/bugs/show_bug.cgi
https://bugs.eclipse.org/bugs/show_bug.cgi?id=537016

1. use latest jdt for support jdk10

2. tycho resolve dependency to javax.activation, javax.xml.bind from jdk, but jdk don't public it.
eclipse resolve by get highest version from com.sun.activation.javax.activation, jaxb-api
so need use Require-Bundle to force tycho choose com.sun.activation.javax.activation

2.1 if keep both import javax.activation and Require-Bundle com.sun.activation.javax.activation with get bellow exception on tycho but org.adempiere.base don't have this issue
[ERROR] /home/hieplq/1Dev/project/native/idempiere-dev-11/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultFeedbackService.java:[16]
[ERROR] 	import javax.activation.DataSource;
[ERROR] 	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The type 'DataSource' is not API (restriction on classpath entry '/home/hieplq/.m2/repository/p2/osgi/bundle/com.sun.activation.javax.activation/1.2.0/com.sun.activation.javax.activation-1.2.0.jar')

3. pass --add-exports for org.adempiere.base, install, server and swing
2018-10-25 23:59:10 +07:00
hieplq b2fa99b192 IDEMPIERE-3798:Move iDempiere default branch to openjdk 10 (update lib)
update jetty to 12
update almost library to latest version
change org.eclipse.jdt.core.compiler.batch to org.eclipse.jdt.core
change javax.management.j2ee-api to org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec, reduce dependency and correct dependency of activeMQ
javax.activation to com.sun.activation.javax.activation
lib for service will take from library instea of jdk
groovy to date
2018-10-23 09:36:53 +07:00
hieplq 9482f02dec IDEMPIERE-3531:add maven tycho configuration 2018-02-10 16:42:06 +07:00