Commit Graph
75 Commits
Author SHA1 Message Date
Jacques Le Roux b0478d13f0 Improved: XML schemas should use predefined boolean type
(OFBIZ-10411)

To define boolean values, some ad-hoc enumeration of "true" and "false" are 
repeatedly used.  Since XML Schema defines a standard boolean datatype it's 
better to use it.

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846727 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 16:38:24 +00:00
Deepak Dixit d358bc4471 Improved: Added missing condition-service in entity-eca.xsd file
(OFBIZ-10220)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830960 13f79535-47bb-0310-9956-ffa450edef68
2018-05-05 10:45:00 +00:00
Deepak Dixit aae3cebccc Improved: Add ability to disable entity eca rule (OFBIZ-9897)
We have enabled flag in EntityEcaRule class, if its set false then entity eca rule will not be execute.
But there is not way to disable entity eca.

We can add enabled flag in Entity ECA definition to disable the existing entity eca rule.

    Add new attribute on entity eca tag named enabled
    Default value will be true for this.
    If user want to disable existing OOTB entity eca rule, then user can define same rule in custom component and set the enabled=false

Also as per current flow if same seca rule is define more then once, system will execute all the rule, ideally it should not execute same rule (same rule, condition and action) if its defined more than one.

Also need to ovride hasCode, equals and toString method for EntityEcaRule, EntityEcaAction and EntityEcaCondition class file.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814160 13f79535-47bb-0310-9956-ffa450edef68
2017-11-03 10:28:05 +00:00
Jacques Le Roux c15fafa454 Documented: Remove unnecessary field types
(OFBIZ-9351)

Removes the reference to id-ne similar field types. They will be removed and
replaced by simple id field types.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1794377 13f79535-47bb-0310-9956-ffa450edef68
2017-05-08 14:16:37 +00:00
Jacques Le Roux 6dbbf2ee8f Fixed: In entitymodel.xsd entity-alias for condition-expr must be required
(OFBIZ-9184)

Currently in the entitymodel.xsd the line

<xs:attribute name="entity-alias" type="xs:string"/>

is wrong, should be

<xs:attribute name="entity-alias" type="xs:string"  use="required"/>

Else in line

this.entityAlias = entityAlias;

in ModelViewEntity.ViewConditionExpr() 

this.entityAlias 

receives null.

All supported branches are concerned


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1779625 13f79535-47bb-0310-9956-ffa450edef68
2017-01-20 14:20:47 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Jacques Le Roux 8dfbe6834c A patch from Pierre Smits for "remove superfluous comment from entity-eca.xsd" https://issues.apache.org/jira/browse/OFBIZ-6724
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1714308 13f79535-47bb-0310-9956-ffa450edef68
2015-11-14 12:41:26 +00:00
Adrian Crum d2e8ad8eea Updated documentation, no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1709339 13f79535-47bb-0310-9956-ffa450edef68
2015-10-19 00:14:48 +00:00
Arun Patidar 3865ff485d [OFBIZ-6171] Applied patch from Pierre Smits for replacing 'Open for Business' references with 'Apache OFBiz'.Thanks Pierre for the contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1706589 13f79535-47bb-0310-9956-ffa450edef68
2015-10-03 14:15:21 +00:00
Jacopo Cappellato 79dd228162 OFBIZ-5146: added support for three new ModelViewEntity functions for the extraction of year, month, day from a date field: extract-year, extract-month, extract-day.
They are mapped to the Standard SQL:2011 EXTRACT function that is already supported by several DBMS including PostgreSQL and MySQL (but not yet Derby).



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1644348 13f79535-47bb-0310-9956-ffa450edef68
2014-12-10 08:25:45 +00:00
Jacopo Cappellato 1bf6f051a5 Based on review and comments from Adrian Crum, re-added the max-worker-pool-size element (that was removed as part of the changes in commit 1627092) but with a new implementation that preserves all the cleanups done in rev. 1627092.
This new implementation should be slightly more flexible but with default setup will end up with the same behavior as before 1627092.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627489 13f79535-47bb-0310-9956-ffa450edef68
2014-09-25 08:55:42 +00:00
Jacopo Cappellato adc41ad5bf Moved the thread pool executor object from GenericDAO to the DatabaseUtil class where it was actually used: this change simplifies the API and allows to shutdown the pool when it is no more needed.
Removed a series of methods that are no more needed after this refactoring or were not used.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627092 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 17:04:20 +00:00
Jacopo Cappellato c00fc92699 Merged framework-api-cleanup branch into trunk.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1620538 13f79535-47bb-0310-9956-ffa450edef68
2014-08-26 09:16:52 +00:00
Jacopo Cappellato 4f4f95092c OFBIZ-4283: miscellaneous enhancements to give more control in the configuration of the DBCP connection pool. Thanks to Philippe Mouawad for the initial contribution that I have used as a starting point for a different implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1613431 13f79535-47bb-0310-9956-ffa450edef68
2014-07-25 13:19:59 +00:00
Adam Heath 5bc5c4151f Change encrypt=true fields to no longer have a pre-pended salt value.
This is done by just setting the length of salt bytes to 0, but still
having a length byte prepended.

Add a feature to allow for certain fields to actually have a salt
prefix.  This is enabled by setting encrypt=salt in the entity
definition.

This change is slightly incompatible with existing code.  Old database
values will continue to be decrypted correctly.  However, newly
encrypted values will no longer have a salt prepended, while originally
they would.  This shouldn't be a problem in practice.

This change, along with the previous commit, finally allow for direct
lookup of encrypted values.  However, already stored values will not be
found.  To fix those, each database row will have to be read in by
ofbiz, then immediately written back out.

This is part two to completely fix OFBIZ-5959:
Person.socialSecurityNumber can't be used for findByAnd.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1604968 13f79535-47bb-0310-9956-ffa450edef68
2014-06-24 00:23:23 +00:00
Jacques Le Roux d7782d5fb9 Completes OFBIZ-5648 - Extend primary keys, removes trailing blanks
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1597273 13f79535-47bb-0310-9956-ffa450edef68
2014-05-24 09:51:48 +00:00
Jacques Le Roux 79365e65da Completes OFBIZ-5648 - Extend primary keys, by adding XSD documentation about current restrictions
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1597270 13f79535-47bb-0310-9956-ffa450edef68
2014-05-24 09:14:22 +00:00
Jacques Le Roux 3d458932c5 A slightly modified patch from Leon for "sequence-bank-size attributes does not work anymore" https://issues.apache.org/jira/browse/OFBIZ-5429
No matter how I set "sequence-bank-size" for an entity (in my example, its "EntityAuditLog"), the bank size is always default value "10".
It seems that this feature was lost by a serials update of revision 922724 to 922733 submitted by doogie.

jleroux: This thread http://markmail.org/message/ifosqek74gqtv7fz trace the root cause
Leon's fix is safe from a concurrency perspective. I just added a check on SequenceBank.maxBankSize and put some doc in the XSD

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1551744 13f79535-47bb-0310-9956-ffa450edef68
2013-12-17 22:45:20 +00:00
Adrian Crum 771000f8f0 Allow redefinition of view entities. XML schema change only - implementation exists already.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530976 13f79535-47bb-0310-9956-ffa450edef68
2013-10-10 13:41:45 +00:00
Jacques Le Roux 251558ca8c Better to have this in doc than in a comment
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1520249 13f79535-47bb-0310-9956-ffa450edef68
2013-09-05 08:23:59 +00:00
Jacques Le Roux 8ca89fc25d Reverts r1482796 and comments about no current implementation rather than removing attributes
Thanks to Jacopo's comment in dev ML

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482911 13f79535-47bb-0310-9956-ffa450edef68
2013-05-15 15:38:43 +00:00
Jacques Le Roux 3abb2933d6 When I moved XA Pool to the Attic I forgot to remove these XA Pool specific attributes. They were now misleading.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482796 13f79535-47bb-0310-9956-ffa450edef68
2013-05-15 12:50:54 +00:00
Adam Heath 158bc8b1de FEATURE: Allow for passwords in entityengine.xml to come from an
external passwords.properties file; nothing actually uses this yet,
however.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482056 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:04:51 +00:00
Jacques Le Roux a59da36f7a A patch from Shi Jinghai for "Support MySQL and Postgres's LIMIT and OFFSET options" https://issues.apache.org/jira/browse/OFBIZ-4346
Change the existing code to support the different syntax variations, and add an attribute to the datasource element in the entityengine.xml file so that the proper variation can be chosen for each database.
Inspired by Moqui code. Test successful


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1422221 13f79535-47bb-0310-9956-ffa450edef68
2012-12-15 11:20:13 +00:00
Adrian Crum ca716388f8 Added a new attribute to the entity definition - "redefinition" - which will suppress "Entity is defined more than once" warnings.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362772 13f79535-47bb-0310-9956-ffa450edef68
2012-07-18 05:42:24 +00:00
Jacopo Cappellato f6fc46c679 Removed default value for the attribute for inline-jdbc used to specify an XA wrapper class: it was set to a specific implementation (Enhydra).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1344999 13f79535-47bb-0310-9956-ffa450edef68
2012-06-01 07:10:39 +00:00
Adam Heath f1be0a1e0c FEATURE: Add key-encrypting-key support; this is to bring ofbiz *much*
closer to PCI compliance.  This key handler is *still* not active.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334257 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:37:06 +00:00
Jacques Le Roux a79e90da46 Closes OFBIZ-4663 ERROR in log file when starting OFBiz, debug-xa-resources is commented in entityengine.xml
Oops... forgot the other files in previous commit

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1234015 13f79535-47bb-0310-9956-ffa450edef68
2012-01-20 17:21:41 +00:00
Jacques Le Roux f02692f632 A patch from Philippe Mouawad "Set TransactionUtil#debugResources default value to false and make it configurable" https://issues.apache.org/jira/browse/OFBIZ-4293
debugResources is true which creates a DebugXAResource (that creates an Exception) , it should be false and made an option for debuging

jleroux: see comments in Jira 4282 for more

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1226234 13f79535-47bb-0310-9956-ffa450edef68
2012-01-01 11:27:10 +00:00
Erwan de Ferrieres 4162e44a47 A patch from Youssef Khaye - OFBIZ-4573 - complex-alias does not allow to do (discountPercent * 100) as stated in xsd
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1205156 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 20:41:14 +00:00
Adam Heath 7e99311694 FEATURE: Add field-set feature to entity engine. You can now
put different fields into different field sets, and when you select any
field in a particular set, all fields in that set will be fetched.  This
also cascades upwards thru views, including alias-all and alias.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139922 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 19:19:06 +00:00
Adam Heath 1af60a7143 FEATURE: Add a thread pool to GenericHelper; this is per datasource.
Nothing makes use of this yet.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139700 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 02:50:49 +00:00
Jacques Le Roux 5c8fbb779d Fix the comment of the not-null attribute (field element)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1100729 13f79535-47bb-0310-9956-ffa450edef68
2011-05-08 13:01:30 +00:00
Scott Gray c9ec4ae824 Add inline-jdbc attribute idle-maxsize for greater control over the max idle connections that should remain in the pool. Previously it was always set to half of pool-maxsize (and still defaults to this value)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1076114 13f79535-47bb-0310-9956-ffa450edef68
2011-03-02 06:31:38 +00:00
Jacques Le Roux f28b0343e1 A patch from Deyan "Allow attributes enable-lock, no-auto-stamp, auto-clear-cache, never-cache and sequence-bank-size in <extend-entity> tag in entitydef.xml fields " (https://issues.apache.org/jira/browse/OFBIZ-3882) - OFBIZ-3882
Allow attributes
enable-lock
no-auto-stamp
auto-clear-cache
never-cache
sequence-bank-size

in <extend-entity> tag in entitydef.xml fiels

Example: <extend-entity entity-name="Person" enable-lock="true" sequence-bank-size="1" />

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1062863 13f79535-47bb-0310-9956-ffa450edef68
2011-01-24 16:33:16 +00:00
Andrew Zeneski 0c211fb4e9 implemented option to specific a specific entity should NOT be checked; no columns are to be updated and ignore any warning about fields, relations, keys, etc. This is useful when an entity is defined based on a database view; the view may not (or probably will not) appear in the table meta data and any attempt to auto-create the entity will (or should) fail.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1042792 13f79535-47bb-0310-9956-ffa450edef68
2010-12-06 21:07:48 +00:00
Adrian Crum e4b686c9dc Removed validate element from fieldtype*.xml files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959708 13f79535-47bb-0310-9956-ffa450edef68
2010-07-01 16:11:10 +00:00
Adrian Crum 6ad531be48 Some work on the entity engine:
1. Removed the conversion framework from the entity engine. Type conversions should be done higher up in the stack. The basic pattern is the same, but instead of each ModelFieldType containing a converter instance, it now contains a JdbcValueHandler instance. The JdbcValueHandler performs the same task as the original switch statement - in effect each ModelFieldType contains its own piece of the switch statement.

2. Added two new field types: byte[] and Object. Originally, the Blob field type was a catch-all for multiple Java data types. This change disambiguates the field's contents.

This has been tested on Advantage, Derby, and MySQL. It should be completely backward compatible. I will be monitoring the dev mailing list closely for any problems.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@959470 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 23:27:24 +00:00
Jacques Le Roux f65c6e12bf A patch from Bob Morley "Support for order by nulls first/last " (https://issues.apache.org/jira/browse/OFBIZ-3740) - OFBIZ-3740
This patch provides the fundamentals to resolve an issue where the sorting of null values were inconsistent (sometimes sorting first and other times sorting last). Specifically, this patch allows one to create an order-by clause via any of the order-by elements of "-myField NULLS LAST" where this text parses out the - (as descending) and the "nulls last".

Since not all databases support the "nulls" argument on an order by clause (it was introduced as part of the OLAP support specification) , our entity-engine.xml file allows each data source to indicate if it has this support. If the support does not exist and nulls first/last is specified, the sql that is generated uses native sql to simulate the nulls first/last intent. At this time, the derby, postgres, and oracle databases are marked to use the nulls first grammar.

Right now, if you do not specify "NULLS XXX" in the field-name for the order-by it makes no change whatsever (naturally this assumption could be changed to have a default).

It should be noted, that my intent here was ultimately to "properly" model the order by into something whose xml representation could look something like ...
<entity-order-by field-name="fieldName" ascending="true" nulls-first="true" />

Divesh Dutta added a comment - 07/May/10 01:44 AM HI Bob, This patch works as expected for derby, postgres, and oracle databases as you have already mentioned. Cant we have some generic solution which supports all the databases. Or we can have some conditional code, where we can check which datasource is being used, and then generate the sql accordingly. Please let me know your views on this.

Bob Morley added a comment - 07/May/10 08:07 AM
Hi Divesh,
I added a more detailed description in the forum thread; but in brief this is a generic solution which supports all databases which generates the sql accordingly. What this patch does not do is apply a standard default order for all databases; it just adds support for one to dictate how they want the nulls sorted.
For example, when one sets the order-by they can set it to "lastName DESC NULLS FIRST" which should apply to all databases.


The thread Bob was referring above ends at http://markmail.org/message/47z7fwtawehuem6b


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@950901 13f79535-47bb-0310-9956-ffa450edef68
2010-06-03 07:39:19 +00:00
Adam Heath 4488c44a32 Add support for UPPER and LOWER functions in index fields.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@948440 13f79535-47bb-0310-9956-ffa450edef68
2010-05-26 14:22:21 +00:00
Erwan de Ferrieres e2f65a76a3 Adding dependent-on on extend-entity (OFBIZ-3303)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@916646 13f79535-47bb-0310-9956-ffa450edef68
2010-02-26 11:17:26 +00:00
Andrew Zeneski 77ca6da64d extend-entity can now override the default-resource-name attribute
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@916049 13f79535-47bb-0310-9956-ffa450edef68
2010-02-24 23:59:58 +00:00
Adam Heath db585f5d95 Oops, shouldn't have checked these 2 lines in.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821577 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 19:04:08 +00:00
Adam Heath 11df2b159a Make 2 reusable schema types, boolean, and aggregate-function.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821576 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 19:01:44 +00:00
Adam Heath 5a30fec5d9 Bother, forgot to allow default-resource-name at the top level.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@821406 13f79535-47bb-0310-9956-ffa450edef68
2009-10-03 20:05:58 +00:00
Jacques Le Roux e8f9dec801 Changed DBCP parameter name at Jacopo's request (consistent with OFBiz style)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@817194 13f79535-47bb-0310-9956-ffa450edef68
2009-09-21 08:48:49 +00:00
Jacques Le Roux e8874a4bf9 Allow to set timeBetweenEvictionRunsMillis for each DB type from entityengine.xml. Keep default value at 600000 (10 min)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@817082 13f79535-47bb-0310-9956-ffa450edef68
2009-09-20 19:14:41 +00:00
David E. Jones d83da9a32a Added some notes on additional things to add
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@792394 13f79535-47bb-0310-9956-ffa450edef68
2009-07-09 04:28:27 +00:00
David E. Jones bc8b260f8d Some cleanups of the design for the entity-condition stuff; I should have reviewed and cleaned up this XSD more before doing the last commit as there are a number of things that did not work and are not useful in this context from the entity-condition patterns used in the widgets and simple-methods; the implementation is not updated yet for these changes but will be soon; while not all of the changes here are supported yet the ones that are removed were things that did not work anyway; in the mean time feedback on the design is welcome
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@792116 13f79535-47bb-0310-9956-ffa450edef68
2009-07-08 12:41:04 +00:00
David E. Jones 7e981d3cb3 Added ability to specify an entity-condition as part of a view-entity in order to encapsulate a full query definition in a view-entity
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@790472 13f79535-47bb-0310-9956-ffa450edef68
2009-07-02 06:43:50 +00:00