Author SHA1 Message Date
Jacques Le Roux 32d4f793fa Improved: Unable to upload a file through ecommerce (OFBIZ-12636)
Allows to check for only CSV files. This is not used OOTB in OFBiz.

Thanks: Sachin for report and confirmation it's OK
2022-07-20 17:22:28 +02:00
Jacques Le Roux e4b383cd88 Fixed: Integration tests fail with Postgres DB (OFBIZ-12666)
This fixes testUpdateFixedAssetMaintAndWorkEffort. It works in both Derby and
Postgres

Thanks: Johannes Schreiber for report
2022-07-18 08:37:50 +02:00
Jacques Le Roux 1052d9a983 Fixed: Update Solr and Lucene from 8.11.1 to 8.11.2 for security reason (OFBIZ-12656)
There was fixed security issues in Solr:
https://lists.apache.org/thread/wn9wkmx1ogbf00hj78y2xt3l0bo15ob9
Not in Lucene, but we need sync between them:
https://lists.apache.org/thread/olf2bhqy1ws9f0kp9nb8zs6g5dcl89l5
2022-06-22 11:55:12 +02:00
Pierre Smits 60f2664441 Fixed: AssetMaint not accessible by user with 'VIEW' permission (OFBIZ-12485) (#71)
Currently the AssetMaint application is not accessible by a user with the VIEW permission, as demonstrated with userLoginId = 'auditor'.

Modfied: AssetMaintSecurityGroupDemoData.xml: added SecurityGroupPermission record
2022-05-12 20:09:10 +02:00
Nicolas Malin 0a635267e5 Fixed: Request createWorkEffortPartyAssign generates an error (OFBIZ-12556)
The request createWorkEffortPartyAssign is called after submitting the form AddWorkEffortPartyAssign, when the user wants to add a party to a project. This raise an error because it removed from workeffort component after the screen dynamising
Thanks to Pierre Smith for raise this issue and Martin Naumann for the fix patch
2022-04-22 11:59:22 +02:00
Jacques Le Roux 68c7a4107d Improved: projectView doesn't show the newly created project after creation ( (OFBIZ-12601)
"Previously" the project creation directly lead to the ProjectView screen within
the context of the newly created project. In this way users were able to
directly add e.g. resources to the newly created project without selecting it
again within the FindProject screen. Within the patch provided I just copied the
success handling from the updateProject request mapping which seems to restore
the initial functionality again.

jleroux: Even if I don't know to what to compare in past, I indeed see no
reasons to not do so.

Thanks: Sixty One for the patch
2022-04-20 09:38:06 +02:00
Jacques Le Roux 2f2a448d71 Fixed: Solr requires application/x-www-form-urlencoded (OFBIZ-12600)
Solr plugin fires exception on create/update of a product.

1.) enable eca in solrconfig.properties: solr.eca.enabled=true
2.)  enable all eca in eecas.xml
3.) start ofbiz
4.) update or create a product (go to product and save it)
the error is fired.

Thanks: Ingo Wolfmayr for report
2022-04-14 15:46:17 +02:00
Jacques Le Roux 656b9c20c7 Fixed: Test run was unsuccessful because of failing solr tests (OFBIZ-12595)
The previous commit for OFBIZ-12594 was only working on Windows. On *nix OSs
there is no way to reliably get "--test" String from java.class.path property.

Also the previous fix was brittle because relying only on 1 space separating
words.

This fix puts in the SolrDispatchFilter system property at the beginning of the
4 Solr tests and removes it at end of them. That presence can reliably be tested
in ControlFilter that is called before SolrDispatchFilter. It allows to bypass
SecurityUtil::containsFreemarkerInterpolation that would else change the
parameters content type that must be application/x-www-form-urlencoded.
content

Thanks: Tom Pietsch for report and Mart Naum for confirmation
2022-04-13 14:47:03 +02:00
Jacques Le Roux f29c84c052 Improved: Remove deprecation warning by removing direct call to Class::newInstance
Class.newInstance() has a flaw, in which any Throwable from the constructor is
thrown unchecked. It was deprecated in Java 9, but not marked for removal.
It shows as a deprecation warning when compiling OfBiz with Java 11.

Thanks: Heinz Kabutz for reporting and initially committing 0e6732b. This
completes in plugins and all will we backported
2022-04-01 11:07:33 +02:00
Benjamin Jugl bef13b56ef Fixed: Setting VIEW_INDEX to 0 in ForumScreens.xml when not initialized (OFBIZ-11429) 2022-02-22 23:19:21 +01:00
Jacques Le Roux 1edb5f71ed Fixed: placeholder text has been implemented but seems to do nothing (OFBIZ-12548)
Adding this to a form in a widget/somethingForms.xml file:

<field name="description" title="${uiLabelMap.CommonDescription}"
required-field="true"><text placeholder="This is placeholder text"/></field>

Does not throw a error, but when the form is displayed, no placeholder text
appears.  I've checked the html code in the browser to confirm that it wasn't
white placeholder text on a white background, and it does not define the
placeholder property in the generated html.

Are there any cases where placeholder text does work?  If so, it would be nice
if a working example could be added somewhere (like someone in ofbiz,
or maybe in the "example" plugin)

Thanks: ddev for report and spotting the missed commit of
OFBIZ-5341-Example.patch in OFBIZ-5341
2022-02-01 08:49:49 +01:00
Jacques Le Roux 35af177893 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (adds a space in LICENSE file) to test the RAT Buildbot
config
2021-12-31 19:44:47 +01:00
Jacques Le Roux 9d491ca801 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (remove a space in LICENSE file) to test the RAT Buildbot
config
2021-12-31 16:32:43 +01:00
Jacques Le Roux 02b243eede Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (adds a space in LICENSE file) to test a change in new
Buildbot config

Incremental changes are really necessary and it's a pain (no syntax checker) :/
2021-12-28 17:03:06 +01:00
Jacques Le Roux a5b5e5055f Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (removes a space in LICENSE file) to test a change in new
Buildbot config
2021-12-28 12:51:33 +01:00
Jacques Le Roux 7e4dc9a353 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes a typo automatically put in by
https://github.com/apache/ofbiz-tools/blob/master/wiki-files/OFBizJavaFormatter.xml
I have not the guts to change that :/ Maybe later...
2021-12-28 11:42:33 +01:00
Jacques Le Roux b3a0b8344c Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In GitHubEvents::gitHubRedirect and LinkedInEvents::linkedInRedirect  random
object created and used only once.

Fixes a typo for MESSAGE_LABLES

Adds a FIXME in OFBizCasAuthenticationHandler::OFBizCasAuthenticationHandler.
It's only an "empty" constructor supposed to "initializes some required member
variables". I see nothing happening here and it's never called, remove it?
2021-12-28 09:42:32 +01:00
Jacques Le Roux 424b238582 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (adds a space in LICENSE file) to test a change in new
Buildbot config
2021-12-27 15:46:47 +01:00
Jacques Le Roux 82c5a574fb Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
I wrote in previous commit:
"uses <<private static final SecureRandom SECURE_RANDOM = new SecureRandom();>>
in classes:
PaymentGatewayServices
ValueLinkApi
ContactMechServices
ProductStoreWorker
DesCrypt
HashCrypt
EntityCrypto
ContextFilter.java
Despite doing so SpotButs still reports the same error for those classes.
As it's obviously an error I prefer to not excludes those cases that will maybe
not be reported in a future version of SpotButs in Eclipse. For instance they
are not reported at all in previous version (4.5.1) but are in 4.5.2"

Actually it turn out to be that I needed to remove the SpotBugs markers.
SpotBugs is mischievous. Sometimes just when fixing a report in a file it
automatically updates the tree of reports, most of the time not. Sometimes you
don't need to remove the SpotBugs markers. Just running again clears the tree of
reports.

Anyway I was inspired to not exclude the reported cases for the classes above.
They no longer appear, but a new one popped up (or I missed it previously but
I doubt) in SampleHtmlThread::run.

This fixes it and it no longer appears when just running SpotBugs again,
go figure...
2021-12-26 15:26:33 +01:00
Jacques Le Roux ac6acf03a3 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Random object created and used only once in
OFBizCasAuthenticationHandler.rand(int, int)
SampleHtmlThread.run()

This code creates a java.util.Random object, uses it to generate one random
number, and then discards the Random object. This produces mediocre quality
random numbers and is inefficient. If possible, rewrite the code so that the
Random object is created once and saved, and each time a new random number is
required invoke a method on the existing Random object to obtain it.

If it is important that the generated Random numbers not be guessable, you must
not create a new Random for each random number; the values are too easily
guessable. You should strongly consider using a java.security.SecureRandom
instead (and avoid allocating a new SecureRandom for each random number needed).

Rank: Troubling (14), confidence: High
Pattern: DMI_RANDOM_USED_ONLY_ONCE
Type: DMI, Category: BAD_PRACTICE (Bad practice)
2021-12-26 13:32:04 +01:00
Jacques Le Roux efb113250d Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In ReportEncoder::createString == should not be used but equals should
2021-12-26 13:23:49 +01:00
Jacques Le Roux 57ef5c81d3 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Before analysing issues with apiKey and baseUrl static vars, just better formatting
More to test a change in Buildbot config actually
2021-12-24 11:32:16 +01:00
Jacques Le Roux 537a4591e2 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
We don't fear collisions for "servletContext". It's only initialised by
contextInitialized() and then only read before being destroyed by
contextDestroyed()

Also initialises servletContextto null
2021-12-23 17:13:54 +01:00
Jacques Le Roux 1eeb4026e6 Improved: fixes an indentation 2021-12-22 09:19:12 +01:00
Jacques Le Roux 921fee3c0c Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In OFBizActiveDirectoryAuthenticationHandler class, fixes a possible NPE:

Immediate dereferencement of the result of readLine()
(NP_IMMEDIATE_DEREFERENCE_OF_READLINE)

The result of invoking readLine() is immediately dereferenced. If there are no
more lines of text to read, readLine() will return null and dereferencing that
will generate a null pointer exception.
2021-12-21 14:19:40 +01:00
Jacques Le Roux 55c7d157f5 Fixed: Update Solr and Lucene to address several CVEs (including Log4j) (OFBIZ-12464)
Solr and Lucene 8.11.1 are now available in Maven Central
2021-12-18 17:01:56 +01:00
Jacques Le Roux c5539184e0 Improved: no functional change, just fix 2 JavaDoc (no real pb just syntax) 2021-12-18 11:47:13 +01:00
Jacques Le Roux a02c8ba350 Fixed: Update Solr and Lucene to address several CVEs (including Log4j) (OFBIZ-12464)
Solr is not yet available on Maven :/

We will also need to update Tika, and I guess the list will continue...
2021-12-17 05:14:19 +01:00
Jacques Le Roux 4f26a91aec Fixed: Update Solr and Lucene to address several CVEs (including Log4j) (OFBIZ-12464)
See SOLR-15843 and
https://solr.apache.org/guide/8_11/solr-upgrade-notes.html
https://solr.apache.org/docs/8_11_1/changes/Changes.html#v8.11.1.bug_fixes

Also fixes luceneMatchVersion in solrconfig.xml, was forgotten last times
And clarifies comments about that
2021-12-16 17:18:14 +01:00
Jacques Le Roux 8d4aebb836 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In OFBizActiveDirectoryAuthenticationHandler class, removes the feeding of an unused
var ctx

In OFBizLdapAuthenticationHandler class, removes the feeding of an unused var ctx

In AbstractReportThread class, fixes few typos
2021-12-16 17:08:38 +01:00
Michael Brohl f33ff27059 Fixed: Typo in debug log message. 2021-12-15 16:53:09 +01:00
Jacques Le Roux 5a69c225af Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Simple JavaDoc formatting in AbstractReportThread

Fixes 3 REC_CATCH_EXCEPTION bugs in EbayOrderServices and 1 in
ImportOrdersFromEbay, ie:
<<This method uses a block try-catch that catches
Exception objects, but Exception is never fired in this block, and
RuntimeException is not explicitly intercepted.
It is a common mistake to say that
try / catch (Exception e) is the same as many
try / catch, but this twist also intercepts
RuntimeException, hiding potential bugs.>>

Also some formatting and useless comments removed in both classes.
2021-12-11 15:39:03 +01:00
Jacques Le Roux 576d5534a2 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In AbstractPricatParser::writeCommentsToFile fixes a possible null
dereferencement
Fixes 2 JavaDoc issues
2021-12-10 10:26:42 +01:00
Jacques Le Roux 7b78e25f31 Improved: better JavaDoc 2021-12-10 08:49:12 +01:00
Jacques Le Roux 21c9f0fda9 Improved: add a log error message in AbstractPricatParser::getCellContents
When there are no cells to get content from
2021-12-10 08:11:58 +01:00
Jacques Le Roux b5cad1d5e1 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In PricatParseExcelHtmlThread::storePricatFile try to fixes a possible null
dereferencement but does not work (weird).
The error is NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

In OpenApiUtil::getSchemaForEntity fixes a possible null dereferencement
2021-12-09 11:59:29 +01:00
Jacques Le Roux 1f0cca7fa4 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Renames BirtEngineServlet class to OfbizBirtEngineServlet, because it shadowed
the simple name of it superclass.
It can be exceptionally confusing, create lots of situations in which you have
to look at import statements to resolve references and creates many
opportunities to accidentally define methods that do not override methods
in their superclasses.

Also remove trailing spaces in OpenApiUtil class
2021-12-05 12:59:59 +01:00
Jacques Le Roux cf086a2b47 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In GitHubEvents::gitHubRedirect, random object created and used only once.

This code creates a java.util.Random object, uses it to generate one random
number, and then discards the Random object. This produces mediocre quality
random numbers and is inefficient. If possible, rewrite the code so that the
Random object is created once and saved, and each time a new random number is
required invoke a method on the existing Random object to obtain it.
Also fixes 2 Javadoc errors

In SampleHtmlThread, uses SecureRandom rather than Random class

In LinkedInEvents::linkedInRedirect, uses SecureRandom rather than Random class
Also fixes 2 Javadoc errors
2021-12-05 09:55:08 +01:00
Jacques Le Roux 923b42c2da Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings in
EbayHelper::createPayment,
AbstractPricatParser::writeCommentsToFile
SolrProductSearch::getSideDeepCategories
WebPosEvents::getProductType
2021-12-05 09:55:08 +01:00
Michael Brohl 421e0e7994 Fixed: REST-API Plugin: Remove errors and warnings in generated openapi
documentation (OFBIZ-12426)

This fixes the following errors and warnings which are displayed by the
Swagger Editor (editor.swagger.io) when reading the generated openapi
documentation:

Errors fixed
* "Header parameters named "Authorization" are ignored. Use the
`securitySchemes` and `security` sections instead to define
authorization."
* "Structural error at paths./....parameters.0 should have either a
`schema` or `content` property"
the generated parameters from the service definition now have schema
entries generated
* the same applies to the WWW-Authenticate header in the responses

Warnings fixed

* "Header parameters named "Accept" are ignored. The values for the
"Accept" header are defined by `responses.<code>.content.<media-type>`."
2021-12-01 17:58:20 +01:00
Jacques Le Roux 51501fe7e3 Improved: Upgrade Solr and Lucene to 8.11 (OFBIZ-12388)
https://solr.apache.org/docs/8_11_0/changes/Changes.html
2021-11-17 19:08:18 +01:00
Jacques Le Roux 002bb61b6e Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Return with post increment does not work, pre increment does

Thanks: Spotbugs
2021-11-17 08:16:14 +01:00
Pierre Smits f91339b576 Improved: Dutch labels for Ecommerce UI (OFBIZ-12378) (#69)
added:
Dutch tranlations for various labels in EcommerceUiLabels.xml
2021-11-12 12:52:12 +01:00
Jacques Le Roux 97fe0058a8 Fixed: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
additional-methods.min.js was missing, forgot previously

Unrelated to plugins, but I also tried to use jquery-ui-dist from node
https://www.npmjs.com/package/jquery-ui-dist despite I knew it was less secure
https://www.cvedetails.com/vulnerability-list/vendor_id-6538/product_id-31126/Jquery-Jquery-Ui.html
But it missed at least the lookup icon in Helveticus.

I'll check later when https://www.npmjs.com/package/jquery-ui-dist will provide
a more secure version.

Also in ecommerceI found this error in js console: : "$.timepicker is undefined"
I did not find the reason. Anyway it seems not used in ecommerce.
2021-11-11 11:26:02 +01:00
Jacques Le Roux b542a38b18 Reverted: work related to PartyRole handling initiated with (OFBIZ-5980)
Currently OFBiz is broken and hard to fix. You can't even create an order !

Revert "Improved: visibility of expire button (OFBIZ-12362) (#331)"
This reverts commit e3b125ef4cb4247233097f3e00f28b10773d708c.

Revert "(OFBIZ-5980) Improvement: PartyRole record(s) expiration/revocation (#330)"
This reverts commit a8ab2be55a96a1aeccc4c07887ebbb4d25b2cc28.

Revert "Improved: seed data (OFBIZ-12355) (#328)"
This reverts commit b204b867b40787dbcc5a17a30c1d22ade1a422cc.

Revert "Reverted: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)"
This reverts commit 85e066deb358404b4681c148ba0d296e481bf666.

Revert "Reverted: damn I did not revert the right push :/"
This reverts commit b867b2a89fe36bb7e02b24814b2fb2fc2683f1c4.

Revert "(OFBIZ-5980) Improvement: PartyRole record(s) expiration/revocation (#325)"
This reverts commit 8ed2252df82be226d99d97250c659a1f8e3211fe.

Revert "Reverted: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)"
This reverts commit 5b5e03f71b6f94ca3c4a1a1526681634835527a5.

Revert "Improved: Have the ability to revoke (expire) roles of a party (OFBIZ-5980)"
This reverts commit 46f7ee91d3355b3e10a5b2732797591c748a27dd.

Revert "Improved: seed data (OFBIZ-12353) (#324)"
This reverts commit fade92bb57d23333dd648bbab456c23cdb517787.
2021-11-08 20:42:03 +01:00
Pierre Smits a03567363b Improved: party roles (OFBIZ-5980) (#68)
updated data set regarding party roles
2021-10-30 16:39:45 +02:00
Jacques Le Roux 7ab9d05412 Improved: Handle remaining checkstyle errors (OFBIZ-12169)
Fixes wrong methods names in EntityFunction class
Forgot the plugins while working on smthg else :/
2021-10-17 11:42:38 +02:00
Nicolas Malin 553472c052 Fixed: Replace hardcoded label 'Popular categories' (OFBIZ-12323)
Labellise the 'Popular categories' title by adding an EcommerceBestSelling label and replace traduction by 'Best Selling' to avoid confusion with catalog category type 'Most Popular (one)'.

Thanks: Charles STELTZLEN
2021-09-28 16:51:00 +02:00
Nicolas Malin 7b37304043 Fixed: ecommerce head title, no ':' if no title or titleProperty (OFBIZ-12326)
When the page title is empty, avoid the ':' in the navigator tabs title for Ecommerce

Thanks: Charles STELTZLEN
2021-09-28 16:35:14 +02:00
Nicolas Malin 20e00c82a3 Fixed: Add to cart is not working for products with selectable features (OFBIZ-11970)
Two issues were present, first was due to incorrect markup and the second was due to ajax request and response view of the additem request.
In additem request last saved view or the view of the last request is rendered on successful operation and in this case the last request/view is the one which is used to render UOM dropdown.

Thanks: Akash Jain and Ravi Lodhi
2021-09-28 14:11:52 +02:00
Nicolas Malin 209f15f2b6 Fixed: Incorrect price for selected variant shown (OFBIZ-12236)
When the webshop (ecommerce component) has been set up for retail (B2C), with the tax setting 'Show prices with VAT tax included' set to 'Y' in store 9000 the appropriat Tax Auth Geo and Tax Auth set in store 9000 the flag 'Include Tax In Price' set to 'Y' for the Tax Auth the price for a virtual product is shown including VAT.

However, for a selected variant the price shown is without VAT

Thanks: Pierre Smits to raise this issue and Priya Sharma for solved it
2021-09-27 16:28:19 +02:00
Jacques Le Roux a6364a8afa Improved: Remove Docbook parts now useless since Ascidoc is used for online help (OFBIZ-12327)
At https://markmail.org/message/inoihmcon37wq5zz I suggested:

If I'm not wrong, we no longer use Docbook anywhere. So I suggest to remove it
from:

1. cmssite component, where it was used by the online help, now assured by
    Asciidoc. BTW, for whom it could concern, I noticed that anchors jumping
    in adoc files does not work in online help
2. docbook.dtd in content component only used by the cmssite component
3. docbook.css in themes, I'm not sure that still useful there
2021-09-25 10:32:53 +02:00
Jacques Le Roux 48156518c9 Improved: Adds the HTML <input> accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)
Removes unused OOTB TextImage.ftl
Explain the script in ViewProfile.ftl
"Accepts" CSV files in SamplePricat.ftl
2021-09-21 17:47:20 +02:00
Jacques Le Roux ff03ec248a Fixed: The Solr version included in OFBiz has an SSRF vulnerability (CVE-2021-27905) (OFBIZ-12316)
This post-auth security issue was reported to the security team by weinull orz
<weinull@outlook.com> As he suggested the solution is to update Solr to its last
version (8.9.0)

This solution contains a (justified) rant!

Thanks: weinull orz
2021-09-15 10:20:45 +02:00
Charles 2218d9f9a1 Replace summary label by common one 2021-09-08 09:53:10 +02:00
Jacques Le Roux 9d4c9fcaff Improved: Update build.gradle to the latest dependencies (OFBIZ-12311)
The tests fails locally but it makes no sense, trying w/ BUilbot...
2021-09-06 10:05:40 +02:00
Jacques Le Roux 30ec649c57 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Fixes last bugs
2021-08-06 18:29:43 +02:00
Jacques Le Roux 229b9b9ca1 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Another fake change in .sonarcloud.properties to test setting changes in
GitHub sonarQBE UI
2021-08-06 18:22:16 +02:00
Jacques Le Roux 874c830fbb Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Fixes few bugs
2021-08-06 18:16:41 +02:00
Jacques Le Roux eee69f91c5 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Fixes a possible http issue (not a big deal)
2021-08-06 17:47:21 +02:00
Jacques Le Roux 4f4328bf61 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Another fake change in .sonarcloud.properties to test setting changes in
GitHub sonarQBE UI
2021-08-06 17:16:45 +02:00
Jacques Le Roux 0606714363 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Another fake change in .sonarcloud.properties to test setting changes in
GitHub sonarQBE UI
2021-08-06 17:11:33 +02:00
Jacques Le Roux 69eea73ba2 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Fake change in .sonarcloud.properties to test setting changes in sonarQBE
following
https://sonarcloud.io/documentation/advanced-setup/analysis-scope/
and
https://sonarcloud.io/project/settings?category=exclusions&id=apache_ofbiz-plugins

1st step, maybe others will be needed...
2021-08-06 17:04:14 +02:00
Jacques Le Roux 190e816364 Fixed: Add http to https redirect rule for ofbiz.apache.org (OFBIZ-10590)
This prevented to run the stable demo, hence the next, weirdly the trunk had
not this problem. Anyway better safe than sorry... Maybe related to Gradle
version or rather libs loaded?

The reason why the stable (and old) demos were not running is because the
EntitySaxReaderTests did not pass
2021-07-20 07:47:25 +02:00
Jacques Le Roux 6106277bb4 Improved: Add global web.xml to simplify session timeout configuration (OFBIZ-12255)
Currently, session timeout is configured in apps separately, but session is
shared globally, so the smallest one take effects, and it will not take effect
separately for different apps.

Then it is both inconvenient and confusing to increase session timeout value,
as all values in those files need to be updated.

A global web.xml is needed, to simplify session timeout configuration.

Thanks: Xin Wang
2021-06-22 08:52:44 +02:00
Jacques Le Roux af63249c4e Improved: removes mention of Birt in plugins LICENSE file
We no longer embed files from Birt project. For years now we use Gradle to load
org.eclipse.birt.runtime:viewservlets:4.5.0 that is only "loaded at runtime"
2021-06-17 18:34:26 +02:00
Jacques Le Roux e51dccb9bb Fixed: Empty field is reflecting on Contact list section on Profile Page (OFBIZ-10386)
Steps to generate:

Open https://demo-trunk.ofbiz.apache.org/ecomseo/viewprofile

On the profile page, Go down to Contact list
Empty fields are displaying before Verify Subscription button

Expected: The field should have some specifications to be filled up

Thanks: Archana Asthana for report, Devanshu Vyas for suggestion, Praveen Patil
for patch and Thirumurugan for confirming
2021-05-29 15:47:21 +02:00
Jacques Le Roux 88152045de Improved: Adds swagger-ui in LICENSE file 2021-05-15 23:50:23 +02:00
Jacques Le Roux dbfa4f0ca0 Improved: Handle remaining checkstyle errors (OFBIZ-12169)
This handles the "'(' should be on the previous line?" rule of MethodParamPad

Actually not completely, because there are still some cases that can't be
handled by changing code, notably when a casting is necessary. I believe there
is an error in checkstyle code. I'll discuss that in dev ML before sending
checkstyle team a report.
2021-05-04 10:35:12 +02:00
Girish Vasmatkar 510239a5f2 Improved: Added CORS filter for the rest-api (OFBIZ-12220).
Thanks Alexander Gepting for the contribution.
2021-04-06 11:16:52 +05:30
Girish Vasmatkar 45e246bce0 Improved: Added CORS filter for the rest-api (OFBIZ-12220).
Thanks Alexander Gepting for the contribution.
2021-04-06 10:37:03 +05:30
Jacques Le Roux a3438121d8 Improved: Comment out the SOAP and HTTP engines (OFBIZ-12212)
The SOAP and HTTP engines are open doors to security issues.
At https://markmail.org/message/pgtjyh23bazq4s2w I proposed to comment them out
as we did for RMI in the past.
Of cause it must be clearly documented how to use them if needed.

Here is the email content:

    After the recent fix for the CVE-2021-26295[1] we discussed with the security
    team about the opportunity need to comment out the SOAP and HTTP engines
    like we did in the past for RMI[2], this obviously for security reason.

    [1] OFBIZ-12167 "Adds a blacklist (to be
    renamed soon to denylist) in Java serialisation (CVE-2021-26295)"
    [2] OFBIZ-6942 "Comment out RMI related
    code because of the Java deserialization issue [CVE-2016-2170] "

I just put a small comment in webtools and scrumm controllers, it should be
enough.

The tests pass
2021-03-29 13:29:58 +02:00
Michael Brohl 57d24425df Improved: Updates swagger ui version to 3.45.1, moves and updates README
(OFBIZ-12207)
2021-03-28 23:55:51 +02:00
Michael Brohl 5eb003e1a6 Improved: Updates Redoc version and makes it locally available
(OFBIZ-12207)

The reference was chanegd from cdn-hosted version to a locally saved
version to avoid integrity check mechanism and making it possible to
track the used version in the README.
2021-03-28 23:55:51 +02:00
Michael Brohl 66055a731a Improved: Fixes sonarcloud error by using the resource integrity feature
for embedding external redoc javascript file (OFBIZ-12197)
2021-03-27 10:45:17 +01:00
Michael Brohl 84d705373f Improved: Fixes html bugs spotted by sonarcloud (OFBIZ-12197) 2021-03-27 10:45:17 +01:00
Michael Brohl b5c6a17024 Improved: Corrects asciidoc levels and follows one-sentence-per-line
rule (OFBIZ-12197)
2021-03-27 10:45:17 +01:00
Michael Brohl 1a6e4f8294 Improved: Removes "ofbiz" prefix from files and folders, code cleanup
(OFBIZ-12197)
2021-03-27 10:45:17 +01:00
Michael Brohl 107b26b66c Improved: Remove ofbiz prefix from files and folders (OFBIZ-12197)
Renames ofbiz-rest-impl to rest-api.
2021-03-27 10:45:17 +01:00
Devanshu Vyas c6704e90c3 Fixed: Error message is displayed when user clicks on create link after the user quick chechout and user is not logged in (OFBIZ-12188)
Added missing UtilHttp class import statement
Thanks: Arpit Mor for reporting the issue and Sourabh Punyani for providing the fix.
2021-03-27 14:12:58 +05:30
Girish Vasmatkar c257243fc0 Fixed: Incorrect Display Name for the Swagger component corrected (OFBIZ-12197) 2021-03-17 18:26:48 +05:30
Jacques Le Roux cf1cb40479 Documented: fixes ldap documentation
It was no up to date, only in R16 the plugins was not enabled

Only trunk as so far AsciiDoc documentation
2021-03-11 10:41:26 +01:00
holivier 32508bd437 Documented: ordered component documentation in the same order than application menu (OFBIZ-12166) 2021-03-10 18:38:33 +01:00
Jacques Le Roux 3ade20a4f8 Improved: Add JAX-RS capabilities (Jersey)
The real name of ofbiz is OFBiz. This renames it in descriptions.
It also renames the webapp title from Ofbiz-rest-jersey to Rest-jersey.
We know it's in OFBiz.
2021-03-01 11:23:48 +01:00
Jacques Le Roux 35a2eca9b4 Fixed: Exception error on ecommerce portal while trying to register new user
(OFBIZ-)

Missing import statement in the groovy script on the new customer registration
page.

Thanks: Pradeep Choudhary
2021-02-27 14:08:42 +01:00
Jacques Le Roux 2b6da24f7e Fixed: Error while uploading file in Ecommerce Profile's File Manager (OFBIZ-10746)
On uploading File in Ecommerce Profile's File Manager,

"The following required parameter is missing:
[IN] [uploadPartyContentFile.partyContentTypeId]" error is displaying.

Steps to regenerate the issue:
    Open Ecommerce on Ofbiz.
    Login with any user.
    Go to Profile.
    Navigate down to File Manager.
    Select Purpose.
    Seletct Mime Type
    Click upload.

Thanks: Aishwary Shrivastava for report, Priya Sharma fir the fix
2021-02-21 19:20:05 +01:00
Michael Brohl 8a3d230ba6 Improved: Removes obsolete comment (OFBIZ-12171) 2021-02-16 21:21:34 +01:00
Wiebke Pätzold 0474982534 Improved: if else construct must use parentheses (OFBIZ-12169) 2021-02-15 17:27:01 +01:00
Wiebke Pätzold 9465c20566 Improved: Adds newline at the end of the file (OFBIZ-12169) 2021-02-15 17:27:01 +01:00
Michael Brohl 3bfac03158 Improved: Declare classes final as suggested by checkstyle (OFBIZ-12169) 2021-02-15 17:27:01 +01:00
Jacques Le Roux e964d61724 Improved: Default ordering of webapps titles in main menu (OFBIZ-12166)
This 1st step sorts the plugins. We need to discuss more...
2021-02-14 21:12:52 +01:00
Michael Brohl 40096fd964 Improved: Switch from jCenter to mavenCentral to handle the jCenter
shutdown (OFBIZ-12171)

See comments in framework build.gradle for details.
2021-02-13 17:07:24 +01:00
Deepak Dixit 9cb1101e3f Fixed: Fitering on StatusId in FindTask does not work (#55)
(OFBIZ-10914)
2021-02-12 15:38:41 +05:30
Deepak Dixit 73876cdb14 Removed HelpData file entries from ofbiz-component.xml (#54) 2021-02-12 12:46:59 +05:30
Pawan Verma 728354a0cb Fixed: Visit disabling causes NullPointerException on ecomm groovy script(OFBIZ-12173)
Used UtilHttp.getSessionId() instead of visit to get session Id.

Thanks: Giulio, Jacopo and Deepak.
2021-02-12 09:25:01 +05:30
Jacques Le Roux f9069945ad Improved: Rename some connoted words like blacklist and whitelist (OFBIZ-12168)
Renames respectively blacklist and whitelist to denylist and allowlist in
several places.

Renames masters and slaves to mains and replicas in solrconfig.xml inherited
from the Apache Solr version we use. The slave word is still used at
https://cwiki.apache.org/confluence/display/solr/SolrConfigXml referenced from
solrconfig.xml

There are still a lot of master word which can be replaced by main, but not in
contexts where slave is also used. I'll discuss that on dev ML again...
2021-02-09 09:55:43 +01:00
Deepak Dixit 2c1696e827 Updated code to fix no suitable method found for create(int) error (OFBIZ-12100) 2021-01-04 14:49:27 +05:30
Jacques Le Roux 7bdbaa338b Fixed: Issue: Displaying company and product information at product backlog, subcomponent of Scrum Application
(OFBIZ-)

Steps to regenerate:
    Navigate to Applications
    Scrum
    Click on '+ Add product'
    Enter: Company and Product Owner
    Product Name
    Description

Issue: the information given in 4, 5, 6 steps are not displayed at the
Product backlog (view product) screen.

Thanks: Dikpal Kanungo for report and Anushi Gupta for the fix
2020-12-28 11:53:42 +01:00
James Yong d45c377339 Improved: Change inline style to class for wait-spinner (OFBIZ-12095)
Inline style not encouraged by Content Security Policy
2020-12-19 17:49:08 +08:00
Jacques Le Roux 78bc570ac8 Reverted: "Improved: Hyperlink target-type attribute is deprecated and should be replaced by url-mode (OFBIZ-12091)"
This reverts commit 17eb2e4cf7bfba4e6a6b62117aa8d64cd5774c5e.

It does not work when using <<target="javascript:........>>
I could change those cases but it's easier and safer to simply revert back to
target-type!

Thanks: James for report
2020-12-18 11:04:16 +01:00
Jacques Le Roux 40d7c57662 Improved: Update build.gradle to the latest dependencies (OFBIZ-12092)
I crossed new issues with plugins:

I tried to update Solr and Lucene to 8.7.0 but crossed issues (compilation and
Eclipse classpath)

Same for Jersey with 3.0.0 version
2020-12-17 18:44:33 +01:00
Jacques Le Roux 4d34c9d43f Improved: Hyperlink target-type attribute is deprecated and should be replaced by url-mode (OFBIZ-12091)
Same for sub-hyperlink, forgot the plugins with 17eb2e4cf7bfba4e6a6b62117aa8d64cd5774c5e
2020-12-15 09:16:40 +01:00
Jacques Le Roux 4bf7288f24 Improved: use a label for "uploadedFile" in form widgets
ie
<field name="uploadedFile" title="${uiLabelMap.ContentFile}">
instead of only
<field name="uploadedFile">
2020-12-08 17:17:52 +01:00
Jacques Le Roux e84c7ada87 Fixed: Lucene TopScoreDocCollector::create wrong call the 2 in Search.groovy scripts (OFBIZ-12087)
I guess it's due to an update of Lucene, easy fix
2020-12-07 13:20:18 +01:00
Jacques Le Roux 0718b63544 * Fixed: Secure the uploads (OFBIZ-12080)
2020/08/10 the OFBiz security team received a security report by Harshit Shukla
<harshit.shukz@gmail.com>, roughly it was (quoting part of it to simplify):

<<I have identified a Remote Code Execution (RCE) Vulnerability. The reason
behind this RCE is lack of file extension check at
catalog/control/UploadCategoryImage?productCategoryId=CATALOG1_BEST_SELL&pload_file_type=category>>

Using this post-auth RCE in OFBiz demos, Harshit was able to get some AWS
credentials by uploading a webshell (based on [0]).
By security, it was then decided by the Infra and OFBiz security teams to shut
down the demos.

After discussing the elements reported with Mark J Cox (VP of ASF security team)
we in common decided that no CVE was necessary.
2020-12-01 08:49:25 +01:00
Saurabh Dixit f25852fef2 Fixed: Product summary cards don't have uniform height. (OFBIZ-11910) (#46)
Done following:
1. Used bootstrap card-deck to equalize the height/width of all the product summary cards.

Reference:
https://v4-alpha.getbootstrap.com/components/card/#card-decks

Thanks Guys: Alex Bodnaru for report and suggestion, Saurabh Dixit for the patch, and Daniel Watford for the test
2020-11-30 10:39:32 +01:00
Girish Vasmatkar 9d6a73f1d2 Improved: Added Root Resource class to list all available endpoints.
This means https://localhost:8443/rest should now return a JSON representing all deployed endpoints. (OFBIZ-11328)
2020-11-28 18:48:33 +05:30
holivier cf28c487ba Documented: Synchronize wiki page End User Documentation (OFBIZ-12059)
- Add assetm.adoc with only overview for plugin assetmaint
- Completed projectmgr overview
2020-11-16 17:06:03 +01:00
Girish Vasmatkar 53518c46d6 Added ASL2 headers to REDOC file (OFBIZ-11328) 2020-11-11 06:47:07 +05:30
holivier 2f6b0f19a3 Documented: remove from plugin cmssite link to document genereted from docbook help files 2020-10-26 18:45:19 +01:00
holivier eebd368718 Documented: migration to help system using asciidoc files (OFBIZ-11587)
Remove all related help docbook files
2020-10-26 16:06:44 +01:00
Girish Vasmatkar 8a430c48a1 Improved: Changed webapp name for API docs to 'docs' and add redoc.html for rendering OpenAPI spec using Redoc(OFBIZ-11328) 2020-10-24 18:45:02 +05:30
holivier 30aa0132e6 Documented: migration to help system using asciidoc files (OFBIZ-11587)
Add <set field=helpAnchor... in CommonScreens for plugins where it's
not present. With this commit all OFBiz plugins application help go to the html
generated from asciidoc files
2020-10-23 18:34:33 +02:00
Girish Vasmatkar dd27ea556c Improved: extract path parameters from declared path in rest.xml and add path parameters to OpenAPI(OFBIZ-11328) 2020-10-14 21:00:03 +05:30
Girish Vasmatkar 88de8cd845 Improved: Wrapped serviceIn query parameter schema in content to allow url encoding of values in Swagger UI(OFBIZ-11328) 2020-10-14 12:20:31 +05:30
Girish Vasmatkar 30bb85fb2b Improved: Updated swagger-ui to v3.35.1(OFBIZ-11328) 2020-10-13 13:10:05 +05:30
Girish Vasmatkar 583d0a64ee Implemented: Addes a new 'publish' attribute to API element allowing a specific API to be disabled from publishing(OFBIZ-11328) 2020-10-13 08:36:34 +05:30
Girish Vasmatkar 8bb8fee36f Fixed: inParams is not listed in OpenAPI spec if the service does not define any IN attributes(OFBIZ-11328) 2020-10-12 15:58:05 +05:30
Girish Vasmatkar c092a5714f Improved: Service required parameters now show as required in OpenAPI schema as required (OFBIZ-11328) 2020-10-12 12:25:54 +05:30
Jacques Le Roux 7276348269 Fixed: Wrong quote marks (OFBIZ-11972)
Thanks: Alex Bodnaru
2020-10-06 16:01:18 +02:00
holivier 36601854f2 fixed: asciidoc attribute imagesDir should not be in the header 2020-10-06 13:54:18 +02:00
Jacques Le Roux 77b9733cf6 Improved: Redundant line in themes (OFBIZ-OFBIZ-11997)
Removes the duplicated line in ecommerce theme and format correctly in multiflex

Thanks: Alex Bodnaru for report
2020-10-06 12:26:13 +02:00
holivier c8f0123845 fixed: title-logo-image should be in header so without blank line
Now OFBiz-Logo is print in pdf
2020-10-05 12:44:11 +02:00
Girish Vasmatkar c4c2a28741 Improved: Added a method to extract path parameters from paths declared in REST DSL.(OFBIZ-11328) 2020-10-05 09:58:47 +05:30
Jacques Le Roux 908db34449 Fixed: Flexible reports use an old noNamespaceSchemaLocation (OFBIZ-12039)
While working on using flexible reports during this discussion
(https://markmail.org/message/qgebmemkqb6ddgzw)
I found this kind of errors in log:

XmlFileLoader: File Internal Content process error. Line: 20. Error message:
TargetNamespace.2: Expecting no namespace, but the schema document has a target
 namespace of 'http://ofbiz.apache.org/Widget-Form'.

Turned out that it was due to an old use of noNamespaceSchemaLocation when
dynamically creating forms.

The fix is to use the same definition than in current forms.

Thanks: Georg Potthast for starting the discussion
2020-10-04 11:26:27 +02:00
Jacques Le Roux 180ddef270 Fixed: Complete Birt Flexible Reports documentation (OFBIZ-9188)
Removes "NOTE: This feature will begin to be officially available with the
R17.12 branch first release"
2020-10-03 11:09:46 +02:00
Girish Vasmatkar 1c25201d7e Improved: Moved service inParams check in service filer and addded more improvements in its handling. Service call cab be made without passing in inParams for services that don't have any IN attribute(OFBIZ-11328) 2020-10-03 08:12:43 +05:30
holivier 70180cf254 Improved: change asciidoc Image directory convention for plugins (OFBIZ-12035)
* for birt component,
    * move all images to images/birt directory
    * change in birt.adoc imagesdir to ./images/birt
2020-10-02 16:55:46 +02:00
holivier f152d031cb Improved: solve Error messages when generating HTML and PDF file from
AsciiDoc files (OFBIZ-11893)

minor corrections after framework corrections
2020-10-02 11:47:07 +02:00
Girish Vasmatkar 9b92939318 Improved: Changed display name for OFBiz Rest APIs on swagger(OFBIZ-11328) 2020-10-02 09:35:58 +05:30
Jacques Le Roux 6c9c0d6e36 Fixed: Javadoc issues (OFBIZ-11328) 2020-10-01 23:03:54 +02:00
Girish Vasmatkar e30634fba1 Implemented: Exception Mapper for GenericServiceException.
> Improved: Cleaned up code for exception handling and moved the code to ErrorUtil. Still some improvements needed. (OFBIZ-11328)
2020-10-01 22:36:35 +05:30
Girish Vasmatkar f45a295061 Improved: specialized exception class added for Service Not Found. Also, changed returned status code for service not exportable or action not defined(OFBIZ-11328) 2020-10-01 11:22:16 +05:30
Girish Vasmatkar 8545cfebb2 Fixed: Allowing auth token validation to take place all the time even for auth=true services. Disable it only when header is absent(OFBIZ-11328) 2020-10-01 00:01:43 +05:30
Girish Vasmatkar 3b66ae1abe Improved: Added Method Not Allowed API response for service resource openapi(OFBIZ-11328) 2020-09-30 22:38:44 +05:30
holivier 19a97b5819 Documented: ofbiz-plugins / Example, migration of docbook help files
to asciidoc, forgot on previous commit to add example in
plugins-user-manual (OFBIZ-11587)
2020-09-28 14:13:40 +02:00
Girish Vasmatkar 1361c3cdaf Improved: Updated code to bypass auth for services having auth=false
2. Implemented ServiceValidationFilter to return various HTTP responses based on request's context(OFBIZ-11328)
2020-09-26 14:30:47 +05:30
Suraj Khurana 364613e310 Improved: Minor Formatting changes only, removed some unused spaces. 2020-09-26 12:22:02 +05:30
James Yong 9c40c67e7a Improved: Open FTL File from browser (OFBIZ-12018)
Add request map for ecommerce
2020-09-25 22:25:15 +08:00
holivier 66070a6bc1 Documented: ofbiz-plugins / Example, migration of docbook help files
to asciidoc
(OFBIZ-11587)

example.adoc and example_main.adoc created
Help link now point to the html file generated from the asciidoc files

In the global Help Docbook index tree, change Example help page to a
short page with a link to the new help

Remove docbook help files for example
HELP_EXAMPLE_docbook.xml has not been migrate because it's replace by
the existing documentation_guidelines.adoc
2020-09-24 18:09:10 +02:00
Jacques Le Roux 8ced392fde Fixes few JavaDoc issues 2020-09-24 11:00:45 +02:00
Jacques Le Roux a4fb6d22ee Fixed: Add support to read and register resources defined in XML DSL(OFBIZ-11995)
Fixes a JavaDoc issue and while at it replaces
  // TODO Auto-generated catch block
  e.printStackTrace();
by
  Debug.logError(e, MODULE);
2020-09-24 06:59:30 +02:00
Girish Vasmatkar 0d8a5f0275 Improved: Cleaned up OpenAPI Tags generation logic.
Fixed: Issue with OpenAPI generation if service being mapped to an operation does not exist(OFBIZ-11328)
2020-09-23 16:58:19 +05:30
Girish Vasmatkar d2e34ebe10 Improved: Added Consumes for non-GET methods(OFBIZ-11328) 2020-09-23 15:55:11 +05:30
Girish Vasmatkar 78c5d25331 Revered changes do for implementing ordered map as those changes are not in framework yet(OFBIZ-11328) 2020-09-23 15:29:27 +05:30
Girish Vasmatkar 65969e5ebb Improved: Added Content-Type and Accept headers in OpenAPI definitions generated (OFBIZ-11328) 2020-09-23 14:53:50 +05:30
Girish Vasmatkar 7f7eee6eb4 Improved: Added 422 and 400 errors to the OpenAPI(OFBIZ-11328) 2020-09-21 18:57:28 +05:30
Girish Vasmatkar 43d4c0bd98 Improved: Error handling for the response and added new error 422 (Unprocessable Entity) to handle validation errors(OFBIZ-11995) 2020-09-21 17:02:24 +05:30
Girish Vasmatkar fc0a447a2e Improved: Added response status for UNPROCESSABLE_ENTITY to conform to rfc4918(OFBIZ-11328) 2020-09-19 10:10:45 +05:30
Girish Vasmatkar e31fd640fd Improved: Added support for publishing/unpublishing a resource and conditional auth support
2.Implemented: Added schema file for REST XML DSL
2020-09-17 17:39:07 +05:30
Girish Vasmatkar 5bcb7af25a Implemented: Added support for other HTTP methods for exportable services endpoints.
2. Added Messages class holding keys for the error and success messages. The keys will be referenced in UiLabels XMLs (OFBIZ-11995)
2020-09-17 15:32:33 +05:30
Girish Vasmatkar 7a92f0640a Implemented: Added service definition and implementation to generate JWT auth token(OFBIZ-11995) 2020-09-17 11:41:07 +05:30
Girish Vasmatkar 6ac1f28491 Implemented: Add support to read and register resources defined in XML DSL(OFBIZ-11995) 2020-09-16 18:21:27 +05:30
Girish Vasmatkar 85e76a3997 Implemented: OpenAPI generation for resources configured using XML DSL(OFBIZ-11995) 2020-09-16 13:10:46 +05:30
Girish Vasmatkar 476b42a15d Implemented: Added support to read Rest XML DSL definitions(OFBIZ-11995) 2020-09-15 20:07:20 +05:30
Jacques Le Roux 6ac7dc934a Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
We have a lot of "do nothing" in Java code. In case of catch we should at least
have Debug.logError(e, MODULE); and maybe an explanation in the comment.
2020-09-15 15:25:08 +02:00
Girish Vasmatkar 93f5b6f4fb Improved: Corrected formatting(OFBIZ-11995) 2020-09-15 17:57:37 +05:30
Girish Vasmatkar dabca1e416 Improved: Structural changes in the OpenAPI reader to allow for reading resources defined in XML schema(OFBIZ-11995) 2020-09-15 16:58:55 +05:30
Girish Vasmatkar 2a85d30fdd Fixed: javadoc generation error fixed. Dereferenced 'Service' link (OFBIZ-11995) 2020-09-15 15:49:32 +05:30
girishvasmatkar 290f0b8af9 Model classes added corresponding to REST XMl schema (#42) 2020-09-15 13:35:50 +05:30
Jacques Le Roux b1c98eee47 Improved: display/selection of unit of measure is broken/plugins (OFBIZ-11993)
Better code

Thanks: Alex
2020-09-14 07:57:26 +02:00
Suraj Khurana dc20b79324 Improved: Added missing Javadocs for some methods, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
Thanks Jacques for review.
2020-09-13 11:26:48 +05:30
Suraj Khurana f21eda4542 Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in plugins component.
(OFBIZ-11963)
Also made some related checkstyle code enhancements. Thanks Jacques for review.
2020-09-12 11:57:19 +05:30
holivier 94e77248e5 Documented: migrate help link to asciidoc user manual for Plugin
Scrum (OFBIZ-11587)

All files have been migrated to asciidoc format and help link now point
to the html file generated from the asciidoc files

In the global Help Docbook index tree, change Scrum help page to a
short page with a link to the new help

Remove docbook help files for Scrum
2020-09-10 19:02:24 +02:00
holivier e314fc7c99 Documented: ofbiz-plugins / Scrum, migration of docbook help files
to asciidoc
(OFBIZ-11587)

scrum.adoc created and re-organize adoc files to have them similar to
menu name and menu items order
2020-09-10 16:48:10 +02:00
Girish Vasmatkar 42192da7d3 Improved: Added 400 for POST requests with no request body(OFBIZ-11328) 2020-09-10 10:36:44 +05:30
Girish Vasmatkar 964a5d075b Fixed: Service In schema reference for GET services(OFBIZ-11328) 2020-09-07 23:45:08 +05:30
Girish Vasmatkar 72458a1ef2 Improved: Return 400 when 'inParams' query parameter is missing
Fixed: Corrected service request in schema location referrence in OpenAPI schema file(OFBIZ-11328).
2020-09-07 16:13:42 +05:30
Suraj Khurana f47525331e Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-09-04 12:28:11 +05:30
Suraj Khurana 26ddcc0c8e Improved: Corrected line is longer than 150 characters checkstyle issues in plugins component.
(OFBIZ-11921)
Also fixed some other extra space and naming related checkstyle issues observed.
Thanks Jacques for review.
2020-09-04 12:27:09 +05:30
Girish Vasmatkar 310a2a58ef Improved: Added default api responses for each service operation
2. Modified certain method signatures for better readability.
2020-09-02 10:42:41 +05:30
Akash Jain 6a7136ada4 Fixed: Error on removing scrum members (OFBIZ-7249)
Thanks, Anurag Chandak for report.
2020-09-01 15:11:34 +05:30
Suraj Khurana 079f34e8fd Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-09-01 15:08:22 +05:30
Suraj Khurana 46e0857e90 Fixed: Typo in class name.
(OFBIZ-11978)
Thanks Alex Bodnaru for reporting and providing the patch.
2020-09-01 15:05:35 +05:30
Girish Vasmatkar fb8cae5df4 Fixed: Issue with service out schema for nested attributes (OFBIZ-11328) 2020-08-31 23:32:40 +05:30
Suraj Khurana 6dfc3c19e7 Improved: Corrected some extra spaces and naming conventions related checkstyle issues.
(OFBIZ-11921)
Also fixed some access modifiers for some private class members. Thanks Jacques Le Roux for review.
2020-08-31 20:01:25 +05:30
Girish Vasmatkar 0f8ca8cbcc Fixed: Removed unncessary check for userLogin claim
2. Modified code to return 401 instead of 403 in case JWT auth fails.
(OFBIZ-11328)
2020-08-31 16:51:08 +05:30
Girish Vasmatkar 3174bd92ec Fixed: Issue with checking Authentication Scheme(OFBIZ-11328) 2020-08-31 16:23:29 +05:30
Jacques Le Roux bf60a20d9d Fixed: display/selection of unit of measure is broken/plugins (OFBIZ-11993)
Allows selection of uom for multiple products on the same web page

Thanks: Alex
2020-08-31 10:08:37 +02:00
Girish Vasmatkar fabb323a53 Improved: Added Enum for HTTP Auth Schemes(OFBIZ-11328) 2020-08-31 11:28:10 +05:30
Akash Jain 3b9fbffc6d Improved: Fix Literals comparisons with variable to avoid NPE (OFBIZ-11929)
Thanks, Devanshu Vyas for your contribution.
2020-08-30 17:22:44 +05:30
Jacques Le Roux 9892828d56 Fixed: multiflex css is linking to wrong location (OFBIZ-11977)
Thanks: Alex
2020-08-30 11:18:38 +02:00
Jacques Le Roux b049b93b55 Improved: Update information in README.md files from removed pages in wiki 2020-08-29 17:37:33 +02:00
Jacques Le Roux b9a3be3e1e Reverted: "Improved: Have a readme in every component (OFBIZ-6243)"
This reverts commit 598cf6c27d.

An Apache URL is much easier to have (NO bad idea, does not show like the
camo.githubusercontent.com link does, cache control issue on ASF servers?)
2020-08-29 13:53:36 +02:00
Jacques Le Roux 598cf6c27d Improved: Have a readme in every component (OFBIZ-6243)
An Apache URL is much easier to have
2020-08-29 13:48:57 +02:00
Jacques Le Roux 9bf5e044f7 Improved: Have a readme in every component (OFBIZ-6243)
Not sure why we have this problem (according to
https://docs.github.com/en/github/authenticating-to-github/about-anonymized-image-urls
could be to missing cache control in our site server)

As I was fed up not viewing the OFBIz logo anywhere, and mostly in GH,
but just in browser at https://ofbiz.apache.org/images/ofbiz_logo.png
and I noticed I was viewing it well locally at
https://github.com/apache/ofbiz-framework/tree/trunk/themes/rainbowstone
so decided to use this URL everywhere rather!
2020-08-29 13:36:23 +02:00
Jacques Le Roux 7d140f3e27 Improved: Have a readme in every component (OFBIZ-6243)
This preludes the move of content of README.md files into the asciidoc
documentation

Updates the link to OFBiz-logo.png (also in ReportDesignGenerator.java)
Removes deprecated information related to Svn, Jira and Confluence
We will move the wiki pages to wiki attic with OFBIZ-11619
2020-08-29 11:52:35 +02:00
Jacques Le Roux c8d22ed72a Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
All final data members of the class must match this naming pattern
'^[A-Z][A-Z0-9](_[A-Z0-9]+)$'

I added the changes in CommonScreens.xml but forgot to push this one in ecommerce
2020-08-28 09:38:31 +02:00
Suraj Khurana 33d4d6c915 Improved: Corrected class names, method names, data members of class and variables names in plugins component.
(OFBIZ-11926)
Also corrected some formatting and line length related checkstyle issues.
2020-08-26 21:42:06 +05:30
Akash Jain 27c1bbed7e Improved: Additional images not showing correctly on product detail page (OFBIZ-11981) 2020-08-25 21:37:20 +05:30
Akash Jain d4a41e39ef Fixed: Distorted Final Checkout Review page when Credit card is selected as Payment option (OFBIZ-11920)
Thanks, Rashi Dhagat for reporting
2020-08-25 20:55:31 +05:30
James Yong 1c9f2ab9c6 Improved: multi-block attribute for html-template tag (OFBIZ-11686)
Not important to track server hits for getJs request
2020-08-25 21:58:26 +08:00
Jacques Le Roux 031a16026d Improved: enclose productsummary list in div.row to better use the screen/plugins (OFBIZ-11979)
It's not about div.row only, in productdetail, the reason field was outside the
summary box.

I've moved the reason inside the summary box, as a generic parameter, highlightLabel.

Thanks: Alex Bodnaru
2020-08-25 09:04:23 +02:00
Jacques Le Roux ba565306ad Improved: removes a duplicated price for PEPPERS-G
PriceServices |I| There is more than one DEFAULT_PRICE with the currencyUomId
USD and productId PEPPERS-G, using the latest found with price: 1.000
2020-08-24 18:22:44 +02:00
girishvasmatkar dce5c976f7 Added support to read children attributes of the service for rendering openapi spec (#40) 2020-08-23 11:58:19 +05:30
Pawan Verma 5545b13b13 Improved: Replace .size() == 0 with isEmpty() in Java files(OFBIZ-11944)
Thanks, priya for the report and patch and jacques for the review.
2020-08-22 19:18:38 +05:30
pritambkute 964a0790a9 Fixed: issue with return service. Alsoo, done improvements to auth service to handle more errors.(OFBIZ-11837) (#39) 2020-08-22 18:57:32 +05:30
Jacques Le Roux 809d2ce300 Improved: bootstrap-bundle*.js contains bootstrap*.js (OFBIZ-11969)
Non-bundle is redundant, with performance hit.

I also replaced in multiflex theme

Thanks: Alex Bodnaru
2020-08-22 11:08:59 +02:00
James Yong 429c9b4acd Improved: Move page-specific script links to html template (OFBIZ-11799)
Use importLibrary js function to load jstree and cookies js at ProductCategories.ftl
2020-08-22 15:53:53 +08:00
Suraj Khurana 1207d24062 Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in plugins component.
(OFBIZ-11963)
Also made some related checkstyle code enhancements.
Thanks jacques for finalizing Javadoc pattern during this effort.
2020-08-22 13:22:19 +05:30
Girish Vasmatkar 2841acfb81 Fixed: OpenApi mapping for Integer.
Improved: Added missing OpenApi mapping for BigInteger.(OFBIZ-11328)
2020-08-21 16:06:32 +05:30
Girish Vasmatkar ad4bb6ec86 Improved: Added missing OpenApi mapping for Boolean and Java Collection types(OFBIZ-11328) 2020-08-21 15:44:03 +05:30
Suraj Khurana 403fc39d7f Improved: Added missing Javadocs for some methods, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
This is done for plugins component. Also corrected some variables as per naming convention best practices.
Thanks Jacques for review.
2020-08-17 12:29:08 +05:30
Girish Vasmatkar bcfa194edf Fixed: Removed HELP and LICENSE files 2020-08-15 23:41:05 +05:30
girishvasmatkar 13e465109b Implemented: (OFBIZ-11328) Added a new component to provide REST capabilities to OFBiz. (#35)
* First commit with REST support for exportable services

* Update README.adoc

* Updated Terms of Service and Contact email address for OpenApi

* Added a new BasicAuthFilter to generate JWT API token

* Updated README

* Removed README.md

* Fixed checkstyle error
2020-08-14 21:38:23 +05:30
James Yong 76b5ef7932 Improved: Move page-specific script links to html template (OFBIZ-11799)
Moved OpenLayer js and css to html template
Tested on https://localhost:8443/partymgr/control/PartyGeoLocation?partyId=DemoCustomer
2020-08-13 22:27:36 +08:00
Priya SharmaandPriya Sharma 01e2e16681 Improved: Move 'SecurityPermission' data to seed data files (OFBIZ-10575) (#38)
Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
2020-08-11 16:01:46 +02:00
James Yong 2989420294 Fixed: Unable to add product to cart in ecommence (OFBIZ-11899)
Incorrect markup in ConfigProductDetail.ftl affected jsoup (when multi-block=true) to parse and output the file correctly. Let me know if not fixed.

Thanks: Jacques for reporting
2020-08-09 22:09:25 +08:00
Jacques Le Roux 882246204e Improved: Can't enter decimals when ordering on ecommerce (OFBIZ-11899)
I found the reason of this regression. It's due to
https://gitbox.apache.org/repos/asf?p=ofbiz-plugins.git;h=a802ae0

This reverts Suraj's workaround and the change in ConfigProductDetail.ftl by
commit a802ae0. I'll ask James to fix the root of the issue in OFBIZ-11706.
2020-08-09 08:41:25 +02:00
Jacques Le Roux 5366f7d85e Improved: Can't enter decimals when ordering on ecommerce (OFBIZ-11899)
In stable demo, and R18 locally, you can order a half pizza, that's no longer
possible in trunk demo.

Moreover you can't use the Add button in trunk, And if you use the Config button
then it orders. There must be a mix between the 2 buttons, maybe the reason
why we can't no longer enter decimals in trunk...

Suraj: Added a patch with some refactoring of js code and used form attribute to
get quantity value for addform.
This might work with the provided patch but I think a better solution could be
through markup. Also, due to some time constraints, I was not able to dig deep
into how it is working in another branch.

It's a workaround that we can use to continue over OFBIZ-11916.
But I don't like that we have both add_amount and quantity fields out of the
addform form. Actually as I explained at https://markmail.org/message/lnz57yzj3uywcr2y
I don't even understand how this is possible since the FTL source sounds correct...

Thanks: Suraj for the temporary workaround
2020-08-08 16:59:15 +02:00
Priya Sharma 04b8809124 Improved: Removed unused imports from Java files for fixing checkstyle errors
(OFBIZ-11930)
Thanks: Priya Sharma
2020-08-07 18:55:50 +05:30
Priya Sharma fb7bdda1ef Improved: Remove unused imports from Java files (OFBIZ-11930) (#36)
Improved: Remove unused imports from Java files
(OFBIZ-11930)
Thanks: Priya Sharma
2020-08-06 19:49:45 +05:30
Akash Jain 7f462731de Improved: Status ID checkbox for FindTask and FindTimeSheet forms (OFBIZ-11936) 2020-08-04 22:57:24 +05:30
Akash Jain aa2bfde7cc Fixed: Product link on Order confirmation page is not responding (OFBIZ-11735)
Thanks, Rashi Dhagat for reporting.
2020-08-03 18:10:24 +05:30
Suraj Khurana b65d9c94df Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-08-03 10:08:06 +05:30
Suraj Khurana 30f796146c Improved: Corrected some line is longer than 150 characters checkstyle issues. Also fixed some extra spaces and naming conventions related checkstyle issues.
(OFBIZ-11921)
2020-08-03 10:07:16 +05:30
Jacques Le Roux 68e603fb4b Fixed: getJs unknown in Webpos (OFBIZ-11932)
R17 is not affected
2020-08-01 13:08:53 +02:00
Pawan Verma b7ef54d494 Improved: Inconsistent String Comparisons(OFBIZ-9254)
There are some inconsistencies in the code for string comparison statusId.equals(PRUN_COMPLETED) whereas it should be written as PRUN_COMPLETED.equals(statusId) cause the former can throw NullPointerException if the variable found to be NULL.

Thanks: Devanshu for your contribution.
2020-07-30 17:02:52 +05:30
Suraj Khurana 743c627f40 Improved: Corrected all incorrect indentation level issues in plugins component, also fixed some case indentation checkstyle issues.
(OFBIZ-11922)
2020-07-26 21:07:45 +05:30
Suraj Khurana 4b88493e1b Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-07-25 13:49:34 +05:30
Suraj Khurana 78801df453 Improved: Updated case indentation to 0 for all switch statements in plugins component. Also done formatting changes as per checkstyle best practices.
(OFBIZ-11904)
2020-07-25 13:48:25 +05:30
Jacques Le Roux dc55cb4746 Improved: Update markup of Quick Checkout Page according Bootstrap v4.0.0 (OFBIZ-10136)
Fixes a typo
2020-07-25 09:57:39 +02:00
Aditya Sharma cfba1f3fe2 Fixed: ui for the product summary in promotion product list (OFBIZ-11906)
The product summary in the row is too slim, leaving 75% of the place unused.
Added CSS that forces to take 100% width
Thanks Alex Bodnaru for reporting and providing the patch
2020-07-24 16:06:33 +05:30
holivier d349811a26 Documented: migrate help link to asciidoc user manual for Plugin
ProjectMgr (OFBIZ-11587)

All files have been migrated to asciidoc format and help link now point
to the html file generated from the asciidoc files

In the global Help Docbook index tree, change Project help page to a
short page with a link to the new help

Remove docbook help files for PROJECTMGR
2020-07-22 19:26:24 +02:00
holivier 8d6c36b624 Documented: ofbiz-plugins / ProjectMgr, migration of docbook help files
to asciidoc, most of files have been directly included in
project-mgr.adoc. (OFBIZ-11587)
2020-07-22 19:21:29 +02:00
holivier cb502cae03 Documented: ofbiz-plugins / MyPortal, remove docbook migrated to
asciidoc (only a short introduction) (OFBIZ-11587)
2020-07-22 18:08:18 +02:00
holivier 2a7ea475d3 Documented: ofbiz-plugins / MyPortal, migration for the Help docbook
file to asciidoc (only a short introduction) (OFBIZ-11587)

add in _include directory, two portlet help coming from other components
(commonext and workeffort)
2020-07-22 18:08:18 +02:00
Jacques Le Roux 9c87fb85b1 Improved: Update build.gradle to the latest dependencies (OFBIZ-11903)
See
https://cwiki.apache.org/confluence/display/OFBIZ/About+OWASP+Dependency+Check
for libs not upgraded.
2020-07-21 10:42:14 +02:00
Suraj Khurana 51cb1d7958 Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-07-21 12:29:01 +05:30
Suraj Khurana 22ccc6801f Improved: Corrected some single line statements to fix checkstyle issues, also removed some remaining extra spaces from code to avoid checkstyle erros in plugins component.
(OFBIZ-11886)
2020-07-21 12:28:45 +05:30
Jacques Le Roux a0f7e77e77 Improved: Use Error.ftl everywhere it's not yet used (OFBIZ-11890)
Removes all error*.jsp reference, no longer used
2020-07-20 19:27:23 +02:00
holivier 1d41025097 Documented: ofbiz-plugins / msgGateway, remove docbook file without
migrate them to asciidoc (contain only a title)
(OFBIZ-11587)
2020-07-20 16:12:02 +02:00
holivier cb082af513 Documented: migrate help link to asciidoc user manual for Plugin
BIRT (OFBIZ-11587)

All files have been migrated to asciidoc format and help link now point
to the html file generated from the asciidoc files

In the global Help Docbook index tree, change BIRT help page to a short
page with a link to the new help

Remove docbook help files for BIRT
2020-07-20 16:08:36 +02:00
holivier bf48bcb098 Documented: ofbiz-plugins / Birt, review existing adoc and migration for
Help docbook file to asciidoc (OFBIZ-11587)

* add license in each file, and remove trailing space
* better numberer list management
* add section Birt in Ofbiz user screen with help migrated file
2020-07-20 15:54:00 +02:00
holivier a321e5f49f Documented: migrate help link to asciidoc user manual for Plugin
EbayStore (OFBIZ-11587)

All files have been migrated to asciidoc format and help link now point
to the html file generated from the asciidoc files

In the global Help Docbook index tree, remove all points about
EbayStore and add a short page with a link to the new help

Remove docbook help files for EbayStore
2020-07-20 15:45:35 +02:00
holivier 0d8efd4a1b Documented: ofbiz-plugins / ebayStore, migration for Help docbook file
to asciidoc (OFBIZ-11587)

- ebay-store.adoc  include directly some content and call (with include)
other files
2020-07-20 15:00:15 +02:00
holivier b76ee41197 Documented: migrate help link to asciidoc developer manual for Plugins
dedicated for developer (OFBIZ-11587)

create file plugins-developer-manual, which will include all include
plugins for developer.

The file plugin-developer-manual is include in developer-manual
2020-07-20 12:52:14 +02:00
holivier 8f57d0c87f Documented: migrate help link to asciidoc user manual for Plugin Ebay
(OFBIZ-11587)

All files have been migrated to asciidoc format and help link now point
to the html file generated from the asciidoc files

In the global Help Docbook index tree, remove all points about
Ebay and add a short page with a link to the new help

Remove docbook help files for Ebay
2020-07-20 12:44:13 +02:00
holivier 7ecfaebc72 Documented: ofbiz-plugins / ebay, migration for Help docbook file to
asciidoc
(OFBIZ-11587)

- ebay.adoc call (with include) other files
2020-07-20 11:48:40 +02:00
Jacques Le Roux a905d459bd Improved: Rename a few map files (OFBIZ-11882)
Renames a few files to suppress warnings in the browser console.

Thanks: Alex Bodnaru
2020-07-19 16:04:18 +02:00
Jacques Le Roux 899d3061fe Improved: Use Error.ftl everywhere it's not yet used (OFBIZ-11890)
The ecommerce and webpos controller missed an errorpage reference.
All other controllers either use directly the common-controller or indirectly by
including controller/s that include the common-controller
2020-07-18 11:15:18 +02:00
Suraj Khurana 2144763bc0 Improved: Corrected all checkstyle formatting issues: 'typecast' is not followed by whitespace in plugins component.
(OFBIZ-11887)
2020-07-18 12:26:04 +05:30
Jacques Le Roux df8b8213ff Improved: User Error.ftl everywhere it's not yet used (OFBIZ-11890)
Those are no longer needed, replaced by error.ftl
2020-07-16 17:14:42 +02:00
Jacques Le Roux a50442d121 Improved: User Error.ftl everywhere it's not yet used (OFBIZ-11890)
At https://markmail.org/message/n76cchtriexxmgm7 I asked

Why having the ftl handlers only in webtools controller? BTW it makes the XSD
documentation awkward because it speaks about the ftl handlers being in
handlers-controller.xml
Why not using error.ftl in common-controller.xml instead of error.jsp?
Same question for plugins.

And answered

I believe we could change all that and definitely get rid of error.jsp
(error.ftl is already in all supported releases branches)
2020-07-15 20:56:23 +02:00
holivier 647e10377b Documented: ofbiz-framework /framework, migration for
SingleSignOn-docbook files to asciidoc
(OFBIZ-11587)

- SingleSignOn with LDAP: move to plugin LDAP and include in
developer-manual in deployment section
2020-07-14 21:18:14 +02:00
Suraj Khurana e7ead3697f Improved: Corrected all checkstyle formatting issues: Line has trailing spaces in plugins component.
(OFBIZ-11880)
Thanks Jacques for review.
2020-07-13 14:14:42 +05:30
Suraj Khurana b18669cddc Improved: Corrected checkstyle formatting issues, 'is preceded/not preceded with whitespace' for plugins component.
(OFBIZ-11874)
This fixes following checkstyle issues:
'{' is not preceded with whitespace.

'{' is not followed by whitespace.

'}' is not followed by whitespace.

'}' is not preceded with whitespace.

'typecast' is not followed by whitespace.

'try' is not followed by whitespace.

';' is preceded with whitespace.
2020-07-11 14:27:09 +05:30
Pawan Verma 845de6eb63 Fixed: Send me this every month link is not working in order items section(OFBIZ-10891)
Thanks, Ashish for the report, Vivek for lookup and Amit for the patch.
2020-07-11 10:30:54 +05:30
Suraj Khurana 6f264947c7 Improved: Corrected all checkstyle issues related to succeeding space for comma in plugins directory.
(OFBIZ-11805)
Thanks Jacques and Ritesh Kumar for review.
2020-07-09 12:02:54 +05:30
Suraj Khurana f8e17a5b00 Improved: Corrected remaining ', is not followed by whitespace' checkstyle errors in plugin component.
(OFBIZ-11805)
2020-07-07 14:59:53 +05:30
Suraj Khurana 40ddf41c1a Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-07-06 15:28:28 +05:30
Suraj Khurana c24db772c9 Improved: Corrected all 'if is not followed by whitespace' checkstyle errors. Also corrected few ', is not followed by whitespace' checkstyle errors.
(OFBIZ-11805)
Thanks Jacques Le Roux and Ritesh Kumar for review.
2020-07-06 15:28:07 +05:30
Jacques Le Roux 2cbb7bd278 Improved: No need to do anything if there is no person
Possible bug found while checking 17.12.04
2020-07-04 12:14:49 +02:00
Jacques Le Roux c2925a43a4 Improved: Adds plugin for integration of 1st Data payment gateway (OFBIZ-11837)
Adds missing ASL2 license headers
2020-07-03 15:07:18 +02:00
Jacques Le Roux 8ca14ec910 Fixed: BigDecimal casting in Groovy (OFBIZ-11862)
Sometimes use wrong type castings for BigDecimal:

I have observed that for typecasting in groovy, we have used the wrong coding
pattern like

(BigDecimal) 0
It should be like
0 as BigDecimal

Note that this does not apply to decimal because in case of decimal, the default
type is always BigDecimal in Groovy.

Thanks: Pritam Kute for spotting the issue in OFBIZ-11843
2020-06-30 15:31:27 +02:00
Jacques Le Roux d5a2fe0696 Fixed: Adding new plugin for integration of First Data payment gateway with Apache OFBiz. (OFBIZ-11837)
Comments out FirstDataDemoData.xml loading because it makes fail
auto-accounting-transaction-tests-sales

Thanks: Pritam Kute for the lead on data error
2020-06-29 11:17:07 +02:00
d931dfb9c9 Improved: Use GroovyBaseScript's makeValue utility methods in each Groovy files (OFBIZ-11779) (#33)
* Improved: Use GroovyBaseScript's makeValue utility methods in each Groovy files(OFBIZ-11779)

* Improved: Removed extra bracket added accidentally. (OFBIZ-11779)

* Update bi/groovyScripts/DimensionServices.groovy

Co-authored-by: Nicolas Malin <nmalin@apache.org>

Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
Co-authored-by: Nicolas Malin <nmalin@apache.org>
2020-06-28 01:24:52 +05:30
Pawan Verma 8f14af21c5 Improved: Replace Collection.sort() with List.sort().(OFBIZ-11830) 2020-06-28 01:22:17 +05:30
Pawan Verma 2e415638b2 Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)
Since Java 1.7, when defining generic types it is unnecessary to redefine those types in the constructor when it is already done in the declared type.
2020-06-28 01:06:04 +05:30
Pawan Verma 1f97f89bae Improved: Merge identical catch blocks in single catch block(OFBIZ-11827)
In Java SE 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.

Thanks: Jacques for the review.
2020-06-27 11:24:33 +05:30
Pawan Verma 7680c0d3ab Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 2020-06-25 18:14:11 +05:30
Jacques Le Roux 0e1510701a Fixed: Add missing license header 2020-06-25 09:23:50 +02:00
Pritam Kute df753f80b2 Adding new plugin for integration of First Data payment gateway with Apache OFBiz. (OFBIZ-11837) 2020-06-24 17:40:55 +05:30
Pawan Verma 57fd870878 Improved: Replace anonymous types with lambda expressions(OFBIZ-11833) 2020-06-24 14:11:38 +05:30
Jacques Le Roux 17c42bcddc Fixed: Error while uploading file in Ecommerce Profile's File Manager (OFBIZ-10746)
This is only fixing the UI where you did not see the file to upload you selected

There is still an issue to upload the file

Thanks: Priya Sharma for testing
2020-06-23 14:54:53 +02:00
Pawan Verma 32f3e468da Improved: Replace try-finally with try with resources(OFBIZ-11826)
Set checkstyleMain.maxErrors to 26678 (-4)

Thanks: Jacques for the review.
2020-06-22 21:37:00 +05:30
Pawan Verma 8dd7f30247 Improved: Replace for-loop with forEach loop(OFBIZ-11829)
Also modified some checkstyle issues.

Set checkstyleMain.maxErrors to 26684 (-61)

Thanks: Jacques for the review.
2020-06-22 21:19:40 +05:30
Jacques Le Roux 670c08e7a3 Improved: Use a .asf.yaml file for more information in OFBiz GitHub repos
Same for ofbiz-plugins than for ofbiz-framework, not enough place for details
2020-06-22 08:36:05 +02:00
Priya SharmaandPriya Sharma 3fe12199d3 Improved: Convert FixedAssetMaintTests.xml to groovy (OFBIZ-11444) (#29)
* [Improved] Convert FixedAssetMaintTests.xml to groovy
Done the following
- Removed the xml tests file
- Updated the test suite mappings to point to the groovy test file
- Added Groovy implementation for all the test cases in FixedAssetMaintTests.xml

(OFBIZ-11444)

* [Improved]: Removed the userlogin fetching logic as the userlogin is already available in the groovy context. (OFBIZ-11444)

Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
2020-06-16 10:49:02 +05:30
Suraj Khurana b4bdfcdf92 Improved: Changed dependency of decimals, rounding static variables as per best practices in ebay component. (#28)
* Improved: Changed dependency of decimals, rounding static variables as per best practices in ebay component.
(OFBIZ-11804)
2020-06-13 14:42:35 +05:30
Priya SharmaandPriya Sharma dd1d408bc8 [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug (OFBIZ-11762) (#24)
* [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug (OFBIZ-11762)

* [Improved]: Updated all ocurances where we only needed to pass the throwable object, without a message
- We have now added one more utility method to handle these cases. (OFBIZ-11762)

Co-authored-by: Priya Sharma <priya.sharma@example.com>
2020-06-08 13:39:42 +02:00
Suraj Khurana 9c447f2486 Improved: Enforce noninstantiability to LdapLoginWorker, OFBizSolrLoginWorker class. (#23)
(OFBIZ-11747)

Made class as final, added private constructor and made static variables as private.
2020-06-07 10:55:56 +05:30
Suraj Khurana b08fa4a944 Improved: Enforce noninstantiability to FinAccountHelper Class. (#22)
(OFBIZ-11723)

Made class as final, added private constructor, also made data members as private, defined getter and changed related occurrences.
2020-06-05 13:14:11 +05:30
Aditya Sharma 12e9f087a4 Improved: Breadcrumbs should be shown on all the pages of eCommerce application
(OFBIZ-2584)
Right now in OOTB eCommerce application breadcrumbs are only shown for catalog pages. It should be available on other pages too.

Added breadcrumb for ContactUs and Anonymous ContactUs page

Thanks Pranay Pandey for reporting the issue and Aishwary Shrivastava for providing the patch
2020-06-02 19:20:59 +05:30
Jacques Le Roux a133199830 Improved: adds pull_request_template.md (OFBIZ-11722) 2020-05-31 09:18:47 +02:00
Suraj Khurana ae31c01fa7 Improved: Change resources with proper naming convention in all plugin components.
(OFBIZ-11739)
Also, made MODULE as private data member of class instead of public. Thanks Jacques for review.
2020-05-29 13:14:02 +05:30
Suraj Khurana 2c65f7d17b Improved: Improved: Added UI labels for success/error messages for scrum component.
(OFBIZ-7696)
Thanks Deepak Nigam for reporting and Sourabh Punyani for the patch.
2020-05-24 13:09:47 +05:30
Suraj Khurana ade15ec80a Improved: Improvement of Quick Add screen according to new bootstrap framework.
(OFBIZ-11386)
Thanks Nitish Mishra for reporting and providing the patch.
2020-05-23 11:03:37 +05:30
Suraj Khurana 7aa38a284b Improved: UI markup Improvement of Inline promotion screen according to latest bootstrap.
(OFBIZ-11397)
Thanks Nitish Mishra for reporting and providing the patch.
2020-05-23 10:50:32 +05:30
Suraj Khurana 9c6838ef0b Improved: Refactor simple methods names as per naming convention best practices. (#20)
(OFBIZ-11700)
2020-05-23 10:34:37 +05:30
Pawan Verma 9c369dc489 Improved: Expansion of form widget field disabled atrribute with xsd improvement (#21)
(OFBIZ-10432)

Added disabled attribute support in ModelFormField with xs: boolean type
Removed specific field level disabled attribute support for CheckField and TextField
Modified existing usage of the disabled attribute as per new implementation.
Added new DisabledFieldExampleForm under Form Widget Examples for all the fields with disabled attributes.

Thanks: Rishi for the report and Taher, Gil and Jacques for the feedback
2020-05-19 17:37:19 +05:30
James Yong e7f587d8af Improved: Apply multi-block attr to each application (OFBIZ-11706)
Fix regression
2020-05-16 19:40:27 +08:00
Suraj Khurana 9428ee9579 Improved: Updated service name and removed duplicate service. (#16)
* Improved: Updated service name and removed duplicate service.
(OFBIZ-11616)

Please check dependent PR (https://github.com/apache/ofbiz-framework/pull/88) for more details.
2020-05-16 13:47:16 +05:30
James Yong 2e937378f4 Improved: Apply multi-block attr to each application (OFBIZ-11706)
Fix regression
2020-05-16 15:12:28 +08:00
James Yong ca5e6b45f1 Improved: Apply multi-block attr to each application (OFBIZ-11706)
For remaining plugin applications.
2020-05-16 13:37:43 +08:00
James Yong a802ae0a02 Improved: Apply multi-block attr to each application (OFBIZ-11706)
For eCommerce application.
2020-05-16 12:31:24 +08:00
Pierre Smits 071240205f Fixed: Application 'ismgr' doesn't show up
(OFBIZ-11704)

fixed: app-bar-display (from 'false' to 'true'
added: OFBTOOLS to base-permission
2020-05-14 14:13:01 +02:00
Pawan Verma b7baeb2b5f Fixed: Improve the buttons on edit credit card page
(OFBIZ-10975)

Thanks: Sourabh and Suraj for your contribution.
2020-05-10 14:11:38 +05:30
Pierre Smits bd50c1417b Improved: move demo data from optional plugin to base application
(OFBIZ-6110)

removed: marketing component related data in ecommerce plugin
removed: reference to marketing demo data in component.xml of ecommerce plugin
2020-05-05 15:51:20 +02:00
Pierre Smits c46a9c4db2 Improved: demo data regardng rental assets
(OFBIZ-10862)

updated fixed assets
2020-05-05 13:42:55 +02:00
Jacques Le Roux 2c98bc3835 reverted: CLONE - Use only HTTPS in OFBiz
(OFBIZ-11643)

Reverted, this needs more work
2020-05-04 13:22:10 +02:00
Jacques Le Roux 40143e6dba Fixed: CLONE - Use only HTTPS in OFBiz
(OFBIZ-11643)

When doing OFBIZ-6849 I forgot to take care of the https attribute of the
security element used in controllers.

It's not used anymore since we used HTTPS everywhere but in request listed in
http.request-map.list property of url.properties. It's even enforced by HSTS for
requests that are not listed in this property.

This removes the https attribute and removes its usage in in controllers.
2020-05-04 13:10:29 +02:00
Pawan Verma f572e74e7e Improved: Used utility provided by OFBizTestCase class for userLogin instead of fetching from DB test cases also removed unused fetching of userLogin in some cases
(OFBIZ-11618)
2020-04-30 22:01:29 +05:30
Jacques Le Roux ba246299d9 Improved: Convert testSendOrderChangeNotification to Groovy
(OFBIZ-11233)

In the XML version we were sending note (Test note) and comments
(Test Comments) as well in serviceCtx, but in the converted version we are
not sending these fields.

Thanks: Suraj for spotting it and alerting me on dev ML
2020-04-27 18:47:12 +02:00
Jacques Le Roux 1cacb15000 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11603)

I tried to update to Groovy 3 but got a compile issue with commons-cli.
I did not dig further.
2020-04-21 12:00:32 +02:00
Jacques Le Roux 208ef1b1be Improved: replaces module by MODULE everywhere 2020-04-06 12:14:23 +02:00
Jacques Le Roux aa26d8f0cf Adds the meta CSRF token for Ajax 2020-04-04 18:22:26 +02:00
Jacques Le Roux cf272a9750 Improved: POC for CSRF Token
(OFBIZ-11306)

There is no need to change it in common-controller because, apart the ecommerce
application, there are no applications that requires an anonymous flow.
It should be only changed in ecommerce controller.
2020-04-04 18:22:26 +02:00
Pawan Verma 6b0c188f5a Fixed: Product Images not rendering on One Page Checkout
(OFBIZ-11400)

Thanks: Archana Asthana for the report and Devanshu Vyas for the patch.
2020-03-28 15:47:12 +05:30
Jacques Le Roux 492dcb9208 Improved: fixes a typo due to OFBIZ-11030
Thanks: Pierre Smits for spotting it
2020-03-26 16:11:09 +01:00
Jacques Le Roux 417c3e4243 Improved: formatting
Implemented:
Documented:
Completed:
Reverted:
Fixed:

(OFBIZ-)
Explanation
Thanks:
2020-03-26 16:09:22 +01:00
Jacques Le Roux a8d3781cc6 Fixed: Convert DimensionServices.xml minilang to groovy
(OFBIZ-10948)

Now correctly creates the CurrencyDimension using currency.uomId
No need for delegator.setNextSeqId(), looking at (now removed)
DimensionServices.xml confused me.

Thanks: Pierre Smits for report
2020-03-21 19:36:39 +01:00
Pawan Verma 38112fb346 Fixed: prepareProductDimensionData does not load correct fields in ProductDimension
(OFBIZ-11465)

Thanks: Pierre Smits for your contribution.
2020-03-21 17:23:05 +05:30
Jacques Le Roux d267d161e0 Fixed: Ensure that the SameSite attribute is set to 'strict' for all cookies.
(OFBIZ-11470)

As reported by OWASP ZAP:
A cookie has been set without the SameSite attribute, which means that the
cookie can be sent as a result of a 'cross-site' request. The SameSite attribute
is an effective counter measure to cross-site request forgery, cross-site script
inclusion, and timing attacks.

The solution was not obvious in OFBiz for 2 reasons:

1. There is no HttpServletResponse::setHeader. So we need to use a filter
  (SameSiteFilter) and even that is not enough because of 2:
2. To prevent session fixation we force Tomcat to generates a new jsessionId,
ultimately put in cookie, in LoginWorker::login. So we need to add a call to
SameSiteFilter::addSameSiteCookieAttribute in
UtilHttp::setResponseBrowserDefaultSecurityHeaders.
2020-03-20 17:51:00 +01:00
Jacques Le Roux cca9d4d783 Improved: "auth" should be true for all the request url used for Application
components

(OFBIZ-4956)

Put back getAssociatedStateList requesdt in ecommerce to auth="false" to allow
the anonymous flow

Thanks: Deepak for spotting an reporting the issue (twice, inadvertently I
removed the complete file, I have no ideas how I did that :/)
2020-03-17 11:38:52 +01:00
Jacques Le Roux 350571deaa Fixed: Convert DimensionServices.xml minilang to groovy
(OFBIZ-10948)

There is a bug with loadCurrencyDimension in DimensionServices.groovy
It shows when running quickInitDataWarehouse.

The problem is this Minilang expression is missing in DimensionServices.groovy:
<sequenced-id sequence-name="CurrencyDimension" field="currencyDim.dimensionId"/>

Adding
  delegator.setNextSeqId(currencyDim)
is enough.
2020-03-17 08:49:05 +01:00
Jacques Le Roux 9f87efe7ba Improved: "auth" should be true for all the request url used for Application
components

(OFBIZ-4956)

Put back getAssociatedStateList requesdt in ecommerce to auth="false" to allow
the anonymous flow

Thanks: Deepak for spotting an reporting the issue
2020-03-16 11:31:48 +01:00
Jacques Le Roux e4388ba7c4 Improved: no functional change
Follows the "How to apply the Apache License to your work" section at
https://www.apache.org/licenses/LICENSE-2.0
2020-03-14 12:33:13 +01:00
Jacques Le Roux e72e1348c1 Improved: "auth" should be true for all the request url used for Application
components

(OFBIZ-4956)

Currently there are some URLs present in application components with
auth="false". So anyone can hit these URLs and access these resources without
authorization.

I think all the URLs should be secure with auth="true"

Thanks: Amardeep Singh Jhajj for report and initial fix
2020-03-14 08:49:54 +01:00
Jacques Le Roux 7a0386a68c Implemented: have a license
(OFBIZ-11451)

Fixes missing sections in LICENCE and adds NOTICE

I have also removed the plugins prefix in "URIs" because we are under plugins

Thanks: Jacopo for spotting missing sections
2020-03-14 08:29:22 +01:00
Michael Brohl b50d949376 Improved: Convert FactServices.xml minilang to groovy.
(OFBIZ-11030)

Thanks Pierre Smits for reporting and Sebastian Berg for providing the
patch.
2020-03-13 17:44:51 +01:00
Michael Brohl d5731824c2 Implemented: Remove the user login security question.
(OFBIZ-11244)

Thanks Wiebke Pätzold for providing the patch.
2020-03-13 17:35:45 +01:00
Michael Brohl 652050c9b9 Improved: Added Eclipse bin folder to gitignore. 2020-03-13 17:34:48 +01:00
Pierre Smits 57d709bc55 Implemented: have a license
(OFBIZ-11451)
2020-03-13 15:37:45 +01:00
Jacques Le Roux 4afe6031a7 Merge pull request #7 from priyasharma1/OFBIZ-10948
Improved: Convert DimensionServices.xml minilang to groovy (OFBIZ-10948)
2020-03-09 16:36:42 +01:00
Priya Sharma d5d0623e55 Update: The entity operator as the XML service used these instead of the current ones.
- Thanks Jacques for the catch. (OFBIZ-19048)
2020-03-09 20:45:11 +05:30
Priya Sharma fd902848e8 [Improved] : Converted the Dimension Service to groovy
- Deleted the old mini-lang service file
- Updated the service definitions with the new groovy methods
- Added a new file with the groovy implementation (with minor enhancement) of all the Dimension services
As the services deal with lists, there could be scenarios where the enterprise comprises of several thousand products, and so used the EntityListIterator instead of fetching the entire list.
2020-03-06 17:31:04 +05:30
Suraj Khurana b678615904 Improved: Added all the service level error messages for missing required field for plugins/ebay component.
(OFBIZ-7471)

Thanks Jagpreet for reporting and Anushi Gupta for the patch.
2020-03-02 12:56:13 +05:30
Suraj Khurana 2de8058af8 Fixed: Unable to remove items from onePageCheckout screen of e-commerce.
(OFBIZ-10800)

Thanks Arpit Mor for reporting and Dhaval Wagela for the patch.
2020-03-02 12:18:52 +05:30
Jacques Le Roux 6d031fe2db Merge pull request #6 from PierreSmits/OFBIZ-10561
Improved: AssetMaint labels (OFBIZ-10561
2020-02-28 15:44:58 +01:00
akash 019cc010fc Improvement: Dropdown/facet at Reports under 'Sale Orders By Channel' is not working fine
(OFBIZ-10624)

Thanks, Ritesh Kumar and Dikpal Kanungo for your contribution.
2020-02-22 18:33:02 +05:30
Suraj Khurana a73712b17a Fixed: Billing Information UI getting distorted.
(OFBIZ-10980)

Thanks Padmavati Rawat for reporting and Sourabh Punyani for the patch.
2020-02-22 17:14:19 +05:30
akash 21e4a7299d Improvement: Print and Export of ViewFacilityInventoryByProduct report into new window
(OFBIZ-10526)

Thanks, Sourabh Punyani and Pierre Smits for your contribution.
2020-02-22 16:48:26 +05:30
Jacques Le Roux a42ac97ce9 Fixed: replaceFirst sensible to variable pattern
(OFBIZ-11396)

When using variable pattern with replaceFirst you may cross issues if the
pattern contains specific tokens. For instance on Windows with the path
"C:\projectsASF\Git\ofbiz-framework/" you have inside the token "\p" which has
a special meaning.
2020-02-22 07:43:13 +01:00
akash c6067e44cc Improvement: Quantity and Add to Cart button showing twice on Compare Products page
(OFBIZ-10665)

Thanks, Ritesh Kumar and Dikpal Kanungo for your contribution.
2020-02-22 11:31:58 +05:30
Pierre Smits 8173afed0f Improved: AssetMaint labels
(OFBIZ-10561)

removed: unused labels
2020-02-20 11:44:03 +01:00
Jacques Le Roux 7525177800 Improved: no functional change
This file inadvertently slipped in with a previous commit, it's not needed.
2020-02-19 14:07:04 +01:00
Jacques Le Roux e5e7567798 Fixed: The "stream" request-map in ecommerce and commonext controllers
requires authentication
(OFBIZ-11349)

Thanks: Michael for reporting a possible issue when only commenting the "stream"
request-map in commonext controller. And Jacopo to suggest to require
authentication (after suggesting to comment out)

It should be also noted that when the CSRF defense implementation will be in
place, all XSS vulnerabilities w/o authentication will not longer be possible.
Because then all requests shall contains a CSRF token.
2020-02-19 13:55:35 +01:00
Jacques Le Roux c004c8f00b Improved: Temporarily comment out the "stream" request-map in ecommerce
controller for security reason
(OFBIZ-11348)

No functional change, simply amend the comment
2020-02-14 10:22:15 +01:00
Jacques Le Roux 57de034e1c Fixed: Temporarily comment out the "stream" request-map in ecommerce controller
for security reason
(OFBIZ-11348)

A vulnerability has been reported to the OFBiz security team. We were able to
quickly and quietly fix it in supported versions, but in the ecommerce component.
To be able to release the 17.12.01 version with this vulnerability fixed we need
to temporarily comment out the "stream" request-map in ecommerce controller.
We will later fix the specific issue in ecommerce to put back the functionnalities
allowed by the "stream" request-map in ecommerce controller.
2020-02-13 06:50:51 +01:00
Jacques Le Roux dbde1204e9 Improved: no functional change
This was added for OFBIZ-9198 but was superfluous since the same is already in
the included ecommerce controller
2020-02-12 16:26:43 +01:00
Aditya Sharma 6f17e2253e Merge pull request #5 from adityasharma7/OFBIZ-11333
Implemented: Cookie Consent In E-Commerce
2020-02-11 13:56:15 +05:30
Aditya Sharma 031fb51255 Implemented: Cookie Consent In E-Commerce
(OFBIZ-11333)
Implemented internationalisation by initialising the plugin in header.ftl and using uiLabels for title, message and labels.
Thanks Michael Brohl for your inputs
2020-02-11 11:21:32 +05:30
Aditya Sharma e8021b7ede Implemented: Cookie Consent In E-Commerce
(OFBIZ-11333)
The Cookie Law is a piece of privacy legislation that requires websites to get consent from visitors to store or retrieve any information on their computer, smartphone or tablet. It was designed to protect online privacy, by making consumers aware of how information about them is collected and used online, and give them a choice to allow it or not.

The EU Cookie Legislation began as a directive from the European Union. Some variation on the policy has since been adopted by all countries within the EU.

The EU Cookie Legislation requires 4 actions from website owners who use cookies:
1. When someone visits your website, you need to let them know that your site uses cookies.
2. You need to provide detailed information regarding how that cookie data will be utilized.
3. You need to provide visitors with some means of accepting or refusing the use of cookies in your site.
4. If they refuse, you need to ensure that cookies will not be placed on their machine.

Used bsgdprcookies plugin to implement the feature. Thanks Deepak Nigam for initiating and providing initial patch. Thanks Deepak Nigam, Pierre Smits, Michael Brohl, Jacques Le Roux and Swapnil M Mane for inputs.
2020-02-10 11:46:58 +05:30
Aditya Sharma 985840046a Improved: no functional change
Added .gitignore file
2020-02-10 10:42:34 +05:30
Nicolas Malin 04b2c4c28a Fixed: Error when initialize billFromParty from groovy context in loadSalesOrderItemFact service
After the conversion from bsh to groovy, the script that resolve
billFromParty need to propage the value on context Map to be available
on minilang context
2020-02-06 13:03:18 +01:00
Pawan Verma 90e5f7deff Fixed: service 'loadSalesOrderItemFact' has hard coded currencyUomId
(OFBIZ-11033)

Used PartyAccountingPreference.baseCurrencyUomId instead of hard coded USD.

Thanks: Pierre Smits for your contribution.
2020-01-30 18:55:01 +05:30
Pawan Verma ccb6219954 Implemented: Have a Country Dimension
(OFBIZ-10954)

Added new CountryDimension entity in olap.

Thanks: Pierre Smits for your contribution.
2020-01-30 14:45:25 +05:30
akash 61ad77166b Fixed: User is unable to create return.
(OFBIZ-10850)
Thanks, Ashish and Ankush Upadhyay for your contribution.
2020-01-25 18:31:23 +05:30
Jacques Le Roux 15750b9d5a Fixed: User should not be directed to main page after adding product to cart
from showcart page
(OFBIZ-11223)

    Navigate to URL: https://demo-trunk.ofbiz.apache.org/ecomseo/
    Click on View Cart at top-right of the page (User will be directed to showcart page)
    Enter product number (Eg: GZ-2644)
    Enter quantity
    Click on add to cart

Product is added to the cart but user is directed to main page of ecommerce. 


Thanks: Arpit Mor for report, Sourabh Punyani for the fix
2020-01-25 10:57:15 +01:00
Pawan Verma 0c6a80ac69 Fixed: Corrected file path for ProcessPaymentSettings.groovy
(OFBIZ-11324)
2020-01-25 11:41:45 +05:30
James Yong ffb54c2180 Fixed: processorder is submitted as GET instead of POST
(OFBIZ-11319)

During checkout of shopping cart, it is observed that the processorder of the form action is submitted as GET which is incorrect.

Thanks: Jacques for the review
2020-01-13 22:31:10 +08:00
James Yong 7cbc4b6d79 Improved: Add 'controlPath' attribute to 'ofbizUrl' freemarker macro
(OFBIZ-11317)

Adding the controlPath attribute to allow the controls by ofbizUrl to support uri to other OFBiz web application.

Thanks: Jacques for the review
2020-01-12 22:34:39 +08:00
Jacques Le Roux 95deb6f87f Improved: no functional change
(OFBIZ-INFRA-19550)

Buildbot build triggered by another project

This to test the ofbiz-plugins (only) trigger
2019-12-17 11:33:22 +01:00
Mathieu Lirzin 1158664ba3 Fixed: Add XML declaration in “web.xml” files (OFBIZ-6993)
These declarations avoid SAXParseException traceback when parsing web.xml
the first time in WebappUtil.parseWebXmlFile

A schema conformance issue has been fixed in ecommerce “web.xml”.
2019-12-07 22:52:30 +01:00
Jacques Le Roux f435521da9 No functional change
Just re-adds a line to fix INFRA-19505
2019-11-30 07:29:13 +01:00
Jacques Le Roux 30cbad0392 No functional change
Just adds a line to check that a sole plugins commit triggers the
frameworl-plugins Buildbot build
2019-11-29 15:56:09 +01:00
Mathieu Lirzin c0db78c750 Fixed: Use correct package name for ‘OrderNotificationTests.groovy’
This test belongs to the ‘ecommerce’ plugin not to the ‘order’ plugin.
2019-11-26 00:03:18 +01:00
Jacopo Cappellato e49b345808 Fixed: Add missing view permissions checks to various screens. 2019-11-15 19:24:22 +01:00
Jacques Le Roux 045f97b956 Fixed: Link in verification email for Newsletter gives security error
(OFBIZ-9804)

Changes ContactListEmailTemplate.ftl to also use GET. 
Because we dont' want a form to ask, but only to hide parameters.
See details in Jira.

Handles the emails also in ecomseo after OFBIZ-11278

I have still to see why I get this message at the end of the process:
"Invalid verify code for the New Product Announcements"
ie when using the link in the last (3rd) email:
"Subscribe Contact List New Product Announcements"
This will be another Jira..!
2019-11-10 10:59:01 +01:00
Jacques Le Roux 35c1dacdb1 Fixed: double forward slashes in ecommerce emails
(OFBIZ-2618)

I reopened this issue because while working on OFBIZ-9804 I found that
since maybe r1052457 some baseEcommerceSecureUrl in screens like 
ContactListSubscribeEmail are not working anymore.
While at it I remove the commented out lines
2019-11-09 23:07:31 +01:00
Jacques Le Roux 25733c0981 Create .sonarcloud.properties 2019-11-04 09:25:14 +01:00
Jacques Le Roux 3ec8fc30f4 Improved: no functional change
We use HSTS but anyway replaces HTTP by HTTPS in some data. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1869102 13f79535-47bb-0310-9956-ffa450edef68
2019-10-29 09:17:36 +00:00
Jacques Le Roux 448d820b93 Adds a specific TortoiseSVN commit log header
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1869101 13f79535-47bb-0310-9956-ffa450edef68
2019-10-29 09:16:09 +00:00
Jacques Le Roux d35a26937b Fixed: Move OrderNotificationTests.groovy from order to ecommerce
(OFBIZ-11255)

Fixes the errors in framework only tests, order and ecommerce suites tests pass


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1868591 13f79535-47bb-0310-9956-ffa450edef68
2019-10-18 13:16:39 +00:00
Jacques Le Roux 229027647f Fixed: EditExample always update status, because current Status not shown
(OFBIZ-11230)

In the EditExample Form, the drop-down is populates with the Valid change status 
only. So current status is not in the list and the status print in the drop-down 
is the next authorized. I want to modify exampleName or exampleType, I go to 
editExample and change what I want and validate. The problem is status is also 
changed!

There are 12 other same or similar cases. For the first of them (in FinAccount) 
there is the same bug: when I change FinAccount Name, status change too. If I 
add current="first-in-list" in the tag drop-down it works 

jleroux: Quote is a peculiar case due to OFBIZ-7337 which was a wrong fix
 
Thanks: Oliver for the analysis and the fix 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1868545 13f79535-47bb-0310-9956-ffa450edef68
2019-10-17 12:19:33 +00:00
Jacques Le Roux 23dbe19690 Improved: Upgrade Tomcat from 9.0.26 to 9.0.27
(OFBIZ-11249)

Forgot a plugin, as ever :/

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1868544 13f79535-47bb-0310-9956-ffa450edef68
2019-10-17 12:18:00 +00:00
Jacques Le Roux 682f3438f3 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11245)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1868194 13f79535-47bb-0310-9956-ffa450edef68
2019-10-09 14:06:47 +00:00
Jacques Le Roux fbbd9d893f Improved: no functional change
In r1868022 I added the POS_SALES_CHANNEL was suggested in OFBIZ-10965. Actually
that was wrong. Tt's already in PosTypeData.xml though with a wrong sequenceId

This fixes it


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1868023 13f79535-47bb-0310-9956-ffa450edef68
2019-10-05 14:23:17 +00:00
Jacques Le Roux 63962f306a Fixed: Issue with "User name filed" while creating the new user
(OFBIZ-11226)

Steps to regenerate:

    Open URL https://demo-trunk.ofbiz.apache.org
    2. Click on the "Register" button for creating a new customer
    3. Enter all the mandatory details for the registring a new customer
    4. Enter the user name with a dot (.), for example: "demo.user"
    5. Click on the "Save" button

Actual: Error message "Username can only have letters, digits and the _- 
        characters" is displaying on the screen.

Expected: Dot (.) should be also allowed in validation rules when we enter user 
name manually with a dot (.)

Thanks: Vedansh Tiwari for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1867849 13f79535-47bb-0310-9956-ffa450edef68
2019-10-01 17:32:02 +00:00
Jacques Le Roux 9274944a43 Fixed: Freemarker error on reviewProduct page on storefront
(OFBIZ-11108)

Steps to regenerate:
1)Navigate to https://demo-trunk.ofbiz.apache.org/ecommerce/control/main
2) User should not be logged in
3) Click on any product
4) Click on Be The First To Review This Product! link
5) FTL error for the null check is occurring

Thanks: Minal Phalak for the patch and Suraj for review

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1867717 13f79535-47bb-0310-9956-ffa450edef68
2019-09-29 09:43:42 +00:00
Jacques Le Roux 433fa628f5 Improved: UI issue on ecommerce Product page
(OFBIZ-10884)

Navigate to demo-trunk ecom
Click on Product titled as Enchiladas, It redirects to the product page
On the Product page, Multiple horizontal lines are displayed 

Thanks: Garima jain for report, Sourabh Punyani for initial patch and Jayesh 
Agrawal for updated patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1867712 13f79535-47bb-0310-9956-ffa450edef68
2019-09-29 09:31:59 +00:00
Jacques Le Roux 6b3267d2cf Improved: no functional change
Small change in tsvn log template

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1867711 13f79535-47bb-0310-9956-ffa450edef68
2019-09-29 09:29:40 +00:00
Pawan Verma 9a33a3cc1e Implemented: Improve add to compare screen with latest bootstrap framework
(OFBIZ-10968)

Thanks, Nitish Mishra for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1867662 13f79535-47bb-0310-9956-ffa450edef68
2019-09-28 10:14:24 +00:00
Nicolas Malin 0572dfa89d Improved: Any ecommerce user has the ability to reset anothers password (including admin) via "Forget Your Password"
(OFBIZ-4361)

Update ecommerce plugin to use the forget passord process with jwtToken :
  * Add jwtToken managment on update password page
  * Change changepassword to passwordChange on controller for align with common-controller



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1867647 13f79535-47bb-0310-9956-ffa450edef68
2019-09-27 19:25:08 +00:00
Pawan Verma 09095590a8 Improved: Replaced hard coded PDF instead of uiLabel on various places
(OFBIZ-11169)
 
Replaced hard coded PDF instead of uiLabel on various places use CommonUilable instead.
 
Thanks: Komal Dayle for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1865854 13f79535-47bb-0310-9956-ffa450edef68
2019-08-24 15:06:14 +00:00
Pawan Verma e5077bed41 Fixed: Scrum parties don't have partyTypeId set
(OFBIZ-11013)
Added missing partyTypeId data for the Scrum Parties.

Thanks: Pierre Smits for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1865828 13f79535-47bb-0310-9956-ffa450edef68
2019-08-24 09:32:41 +00:00
Mathieu Lirzin af4b7336c9 Improved: Remove redundant "dtd" directory from classpath
(OFBIZ-11161)

the "dtd" directories are already present as resources distributed
inside OFBiz jar, so there is no need to augment the classpath to find
the XML schema inside those directories.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1865797 13f79535-47bb-0310-9956-ffa450edef68
2019-08-24 00:30:34 +00:00
Jacques Le Roux 7d79da3b4c Fixed: <description> of <visual-theme> in Theme.xml does not work
(OFBIZ-9867)

There is no str:label in UelFunctions class but util:label
Missed theses files in previous commit (damn plugins)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1865398 13f79535-47bb-0310-9956-ffa450edef68
2019-08-18 15:16:12 +00:00
Jacques Le Roux 5d53e28b6d Fixed: Issue loading solr component (JNDI timeout)
(OFBIZ-11156)

We need to provide a JNDI environment property for Solr to load faster

Fixes previous commit where I hastily harcoded in jndi.properties file

Used a system property which can be used to define a JNDI environment 
property

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1865347 13f79535-47bb-0310-9956-ffa450edef68
2019-08-17 11:34:01 +00:00
Jacques Le Roux 6a30378f06 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11151)
We can update Guava to v28: 
https://mvnrepository.com/artifact/org.apache.solr/solr-core/8.2.0.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1865336 13f79535-47bb-0310-9956-ffa450edef68
2019-08-17 07:01:55 +00:00
Jacques Le Roux 4f19b762f3 Improved: Update build.gradle to the latest dependencies
(OFBIZ-11151)

Like for OFBIZ-10922 some updates were not possible. Please refer to the Jira 
for more information

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1864973 13f79535-47bb-0310-9956-ffa450edef68
2019-08-12 15:03:03 +00:00
Aditya Sharma 3747e3d283 Fixed: Check embedded Javascript libs vulnerabilities using retire.js
(OFBIZ-10678)
For solving CVE-2018-14041, Bootstrap upgraded to latest 4.3.1
Thanks Jacques Le Roux for the reviews

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1863839 13f79535-47bb-0310-9956-ffa450edef68
2019-07-27 06:48:11 +00:00
Mathieu Lirzin 5ae9892e4e Improved: Inline ‘UtilGenerics#checkList’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1863492 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:22:24 +00:00
Mathieu Lirzin 31fa95fd91 Improved: Inline ‘UtilGenerics#checkMap’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1863491 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:21:23 +00:00
Mathieu Lirzin 5154931f4f Improved: Inline ‘UtilGenerics#checkSet’
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1863490 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:20:16 +00:00
Mathieu Lirzin 6e211a7c2a Improved: Use ‘UtilGenerics#checkCollection’ when possible
(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1863488 13f79535-47bb-0310-9956-ffa450edef68
2019-07-20 16:17:32 +00:00
Mathieu Lirzin 237a2fc8f7 Improved: Do not use ‘UtilMisc#toList’
(OFBIZ-11140)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1863390 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 13:38:49 +00:00
Jacques Le Roux 82f440a4a1 Improved: Navigate from a domain to another with automated signed in
authentication
(OFBIZ-10307)

Currently the CORS demonstration in example component is useless.
This tooltip allows local users to test it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1862538 13f79535-47bb-0310-9956-ffa450edef68
2019-07-04 08:14:05 +00:00
Jacques Le Roux 6ed67067c7 Fixed: Error message is displayed when user having space in username logs
in at ecommerce
(OFBIZ-10671)

Steps to regenerate:
 # Open URL: [https://demo-trunk.ofbiz.apache.org/ecommerce/control/main]
 # Click on register in header section
 # Provide all the mandatory information but provide a user name such that is 
    contains a space (like: Walter White or Jesse Pinkman)
 # Click on save button

Actual: When user clicks on save button then he is redirected to main page of 
ecommerce and an error message is displayed. 
Similarly when user with space in username tries to login, error message is 
displayed. 

Praven: Added standard regex for username allowed alphabets, numbers, and _-
jleroux: actually "-" was  missing in the regepx definition.

Thanks: Arpit Mor for report and Praveen Sharma for the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1862466 13f79535-47bb-0310-9956-ffa450edef68
2019-07-03 13:30:28 +00:00
Mathieu Lirzin a0fd98c02d Improved: Use ‘ServletRequest#getServletContext’ when possible
(OFBIZ-11129)

Avoid unecessary casts by using ‘ServletRequest#getServletContext’
instead of ‘ServletRequest#getAttribute’. This method is available
since Servlet specification 3.0.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1862296 13f79535-47bb-0310-9956-ffa450edef68
2019-06-28 23:06:05 +00:00
Jacques Le Roux 280e24a57b Fixed: Last Categories section is blank
(OFBIZ-10858)

Fixes typos in descriptions

Thanks: Priya Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1861986 13f79535-47bb-0310-9956-ffa450edef68
2019-06-24 10:31:11 +00:00
Jacques Le Roux 363643717c Fixed: Last Categories section is blank
(OFBIZ-10858)

Issue 1:
1. Open https://demo-trunk.ofbiz.apache.org/ecomseo
2. Click on a category from the Categories section
3. Refresh the page
Actual:
1. Last Categories is blank
2. If we refresh the page then only the search category visible with the last 
row blank with a bullet.

Issue 2:
1. Open https://demo-trunk.ofbiz.apache.org/ecomseo
2. Click on a category from the Categories section
3. Again, open the https://demo-trunk.ofbiz.apache.org/ecomseo in the new tab
Actual: 1st row is blank with searched categories

As per the initial observation, the issue persists for some specific categories 
like Dropship Products, Account Activation and Services.
For all other categories, the last categories section is populated correctly. 
So there could be some issue with the data.

jleroux: on Priya warning I modified the descriptions

Thanks: Rashi Dhagat for reporting, Priya Sharma for the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1861904 13f79535-47bb-0310-9956-ffa450edef68
2019-06-23 09:09:00 +00:00
Jacques Le Roux acad8b02d8 Improved: Ecommerce image distorted in trunk demo main page
(OFBIZ-11095)

Due to recent bootstrap changes, ecommerce image is distorted in trunk demo main 
page

Thanks: Nitish Mishra

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1861867 13f79535-47bb-0310-9956-ffa450edef68
2019-06-22 14:01:03 +00:00
Suraj Khurana 72014e0d4f Improved: Request details are overlapping with language and cart summary.
(OFBIZ-10739)
Thanks Ashish Sharma for reporting and Ashish Kumar Pandey for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1861863 13f79535-47bb-0310-9956-ffa450edef68
2019-06-22 12:21:21 +00:00
Swapnil Mane 1e106e0c78 Fixed: UI issue on the Contact Us page of ecommerce application
(OFBIZ-11061)

Steps to regenerate:

1. Navigate to https://demo-trunk.ofbiz.apache.org/ecomseo/
2. Click on Login
3. Enter valid username and password
4. Click on login button
5. Click on Contact Us

Actual: From, subject and message label are not displayed properly on some resolution.

Note: This issue is resolution specific if you are unable to generate the issue then increase the resolution of your screen or zoom in the page on browser

Thanks:  Arpit Mor for reporting and Sasikant Biswal for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1861824 13f79535-47bb-0310-9956-ffa450edef68
2019-06-22 09:10:39 +00:00
Jacques Le Roux b6c99b8921 Improved: Update Tomcat to 9.0.21
(OFBIZ-11102)

Mostly because of various concurrency and stability fixes for HTTP/2 as reported 
in the official announcement

Once again missed to commit in example/build.gradle

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1861262 13f79535-47bb-0310-9956-ffa450edef68
2019-06-13 14:21:48 +00:00
Mathieu Lirzin 60a8a7e900 Improved: Add missing ‘static’ modifier for private methods
(OFBIZ-11098)

In order to make it clear when a method is not depending on the
internal state of an object, it is a good practice to declare it as
static.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860939 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 12:36:52 +00:00
Jacques Le Roux 4ccff48b44 Improved: no functional change, adds missing license headers
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860902 13f79535-47bb-0310-9956-ffa450edef68
2019-06-09 13:08:08 +00:00
Suraj Khurana 7dce2fcedc Fixed: Blank page appears after using Tell-A-Friend functionality while adding item to cart.
(OFBIZ-10885)
Thanks Ravi Lodhi for reporting and Nitish Mishra for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860801 13f79535-47bb-0310-9956-ffa450edef68
2019-06-08 06:23:35 +00:00
Deepak Dixit f00bccf762 Fixed: Wrong page title displayed on contact us page of ecommerce
(OFBIZ-11062)
Thanks Arpit Mor and Ayushi Rathod for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860648 13f79535-47bb-0310-9956-ffa450edef68
2019-06-05 09:44:35 +00:00
Jacques Le Roux f3c3271d12 Improved: Use Groovy Truth instead of UtilValidate Class in Groovy
(OFBIZ-11064)

As we all know, Groovy is a powerful language with great built-in functions. 
Groovy Truth[1] is one of them, which is not used properly in our code base. 
We have used UtilValidate Class to validate arguments for Empty or NotEmpty, 
which can easily be done in groovy with built-in functionality[1].
 
Current Code: if (UtilValidate.isNotEmpty(locations)) { ... }
Groovy Built-in Code: if (locations) { ... }
 
[1] - http://groovy-lang.org/semantics.html#Groovy-Truth
 
We need to careful for some points while we change this:
Like:
maxRetry = 0
if (!maxRetry)
{  // Not set, use a default  maxRetry = -1 }

Because groovy evaluates zero to be false, it wouldn't be possible to set
maxRetry to zero.  So it's best not to use groovy truth for null-checks on
numbers in some cases. 
 
Thanks: Pawan Verma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860051 13f79535-47bb-0310-9956-ffa450edef68
2019-05-26 10:36:16 +00:00
Mathieu Lirzin cfea3ca859 Improved: Use the ‘@Override’ annotation
(OFBIZ-10939)

The ‘@Override’ annotation helps readers understand that the method at
hand is overriding a super class or implementing an interface.
Additionally it allows the compiler to check if the methods annotated
with ‘@Override’ are actually implementing an abstract method.

Using that annotation makes ‘@see foo.bar.ParentClass#myMethod’
comments useless, so those they have been removed for the newly
annotated methods.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860028 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 23:44:25 +00:00
Mathieu Lirzin 3d63441ae7 Improved: Remove useless imports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860027 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 23:43:45 +00:00
Mathieu Lirzin 0650a16d3b Improved: Remove useless null check
(OFBIZ-10054)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860026 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 23:42:50 +00:00
Mathieu Lirzin 9354ac2997 Improved: Remove redundant type declarations
(OFBIZ-10937)

Since Java 1.7, when defining generic types it is unnecessary to
redefine those types in the constructor when it is already done in the
declared type.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1860025 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 23:42:00 +00:00
Suraj Khurana f915292fdb Fixed: Product image not scaling properly on ecommerce at different screen resolution.
(OFBIZ-10880)
Thanks Arpit Mor for reporting and Praveen Sharma for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1859914 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 07:20:21 +00:00
Suraj Khurana 642cc40eb3 Fixed: Unable to find any product in Quick Add functionality.
(OFBIZ-10978)
Thanks Vivek Bisen for providing the patch, Pawan Verma and Jacques Le Roux for review.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1859906 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 05:02:06 +00:00
Jacques Le Roux 2fb77f84f1 Fixed: Services allow arbitrary HTML for parameters with allow-html set to "safe"
(OFBIZ-5254)

Once again forgot to commit this changes in plugins :/

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1859893 13f79535-47bb-0310-9956-ffa450edef68
2019-05-24 17:15:04 +00:00
Jacques Le Roux b5adaeee94 Fixed: massPrintOrders service does not work
(OFBIZ-11049)

This problem was similar to what was resolved by r1806237 for OFBIZ-9138.

This fixes it by using the same solution than in r1806237. If the visual theme 
is unknown in the the service  context  get the default theme from 
general.properties using ThemeFactory::resolveTheme.

sendPrintFromScreen, createFileFromScreen, sendBirtMail, getXslFo and 
printReportPdf (in example) were concerned


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1859735 13f79535-47bb-0310-9956-ffa450edef68
2019-05-22 16:41:04 +00:00
Jacques Le Roux 94c278ed63 Fixed: Touch F8 in webpos does not work and generate an error
(OFBIZ-11010)

Adds missing data for POS_SALES_CHANNEL fix this issue, was removed in r1754402.

Thanks: Pawan Verma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1859012 13f79535-47bb-0310-9956-ffa450edef68
2019-05-09 14:32:35 +00:00
Jacques Le Roux 8697d231bc Improved: Missing uiLabel for Create New on CMS Content Find Screen
(OFBIZ-11005)

Thank to Pawan Verma who spotted also ProjectMgrNotesCreateNew and removed it from 
NoteInfo.ftl. I also removed ProjectMgrNotesCreateNew from ProjectMgrUiLabels.xml

Thanks: Pawan Verma 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858517 13f79535-47bb-0310-9956-ffa450edef68
2019-05-02 06:49:50 +00:00
Jacques Le Roux ad14f70944 Improved: Missing uiLabel for Create New on CMS Content Find Screen
(OFBIZ-11005)

Steps to regenerate:
    Go to https://demo-trunk.ofbiz.apache.org/content/control/CMSContentFind
    Find missing uiLabel for Create New, showing as CommonCreateNew.

jleroux: This is related with OFBIZ-9905, we decided to use only CommonCreate
This do that and fix others which were missing in OFBIZ-9905

Thanks: Pawan Verma for report, Suraj for comment


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858516 13f79535-47bb-0310-9956-ffa450edef68
2019-05-02 06:44:47 +00:00
Suraj Khurana e011aa5572 Improved: Updated code occurences of marital status in e-commerce as per recent changes done for it in trunk.
(OFBIZ-10921)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858479 13f79535-47bb-0310-9956-ffa450edef68
2019-05-01 12:18:50 +00:00
Jacques Le Roux 992ed5d7c0 Fixed: Unknown request [images]; this request does not exist or cannot be
called directly.
(OFBIZ-10895)

This error happens in many occasions:
Inside another request (eg LookupProduct)
Of after a request (eg login)

It shows only in log and have no effect on UI. Notably the new feature normally 
showing an error message in trunk (OFBIZ-10753) does not shows

It happens in all supported releases. IIRW it always happened, only URLs like 
https://demo-trunk.ofbiz.apache.org/images/defaultImage.jpg work. 
But here it's different because we don't need to call 
https://demo-trunk.ofbiz.apache.org/images by hand to get the issue in log.

So it's not very bad since it's has no side effects, just weird and annoying. 
Because it might hide something undetected yet...

This issue does not appear in R15, a good place to test is for instance 
ordermgr/control/request. 
There cal.gif is called by /images/cal.gif and it works (the images appears) 
but in more recent versions the call is also done to 
/ordermgr/control/images/cal.gif where it fails. 
This 1st appears in ControlFilter in the stack trace.

As said Deepak Dixit:
I think we need to fix the image url in css file, it should start with /images, 
else browser append this in request info. There is nothing related to java or 
tomcat code. 

This is a 1st commit for the errors I already reported and I'm sure about

Thanks: Deepak 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858444 13f79535-47bb-0310-9956-ffa450edef68
2019-04-30 16:23:56 +00:00
Jacopo Cappellato 2df8887cb4 Fixed: improved the configuration for the "add forum message" form (the source
tab is not needed in the ecommerce application).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858435 13f79535-47bb-0310-9956-ffa450edef68
2019-04-30 14:47:31 +00:00
Jacques Le Roux d30c1733c5 Reverted: Refactor boolean returns from methods
(OFBIZ-10725)

Revert an error in previous commit (r1858350)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858351 13f79535-47bb-0310-9956-ffa450edef68
2019-04-29 09:20:10 +00:00
Jacques Le Roux c91becf3b2 Improved: Refactor boolean returns from methods
(OFBIZ-10725)

I was wondering if we should close. I just had a look and using this regexp:

if \(.*\) \{\R.*return true;

 I found
* 60 matches in applications
* 138 in framework
* 4 in plugins
I only checked the 1st two in applications and they really match

While at it this improves 3 of the 4 in plugins (the other is in a loop)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858350 13f79535-47bb-0310-9956-ffa450edef68
2019-04-29 09:09:20 +00:00
Rishi Solanki 15266ea769 Improved: Rename custom component for SMS gateway integration. Removed unused file.
(OFBIZ-10973)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858323 13f79535-47bb-0310-9956-ffa450edef68
2019-04-28 12:05:58 +00:00
Rishi Solanki 26849529b3 Improved: Rename custom component for SMS gateway integration. Move the permission data to demo data as it should not be consider as seed.
(OFBIZ-10973)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858318 13f79535-47bb-0310-9956-ffa450edef68
2019-04-28 11:49:56 +00:00
Rishi Solanki cad41b4496 Improved: Rename custom component for SMS gateway integration. Change more refereneces from msg91 to msggateway.
(OFBIZ-10973)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858315 13f79535-47bb-0310-9956-ffa450edef68
2019-04-28 11:01:54 +00:00
Jacques Le Roux 07a0de688d Fixed: Remove link is not working in shopping list
(OFBIZ-10967)

Steps to reproduce
1. Login with valid username and password.
2. Navigate to ecommerce.
2.1 Adds product/s to the cart
2.2 Add it/them in a shopping list.
4. Navigate to shopping list section.
5. Click on link “Remove"
Expected Result: Product should be removed from shopping list.
Actual Result: Remove link is not working.

jleroux: OFBIZ-7291 broke it. That can be tested on old demo (R13)
Fixed by using a simple submit field

Thanks: Ashish Sharma for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858312 13f79535-47bb-0310-9956-ffa450edef68
2019-04-28 10:51:46 +00:00
Rishi Solanki 332686244b Improved: Rename custom component for SMS gateway integration. Change main decorator location and app bar display setting.
(OFBIZ-10973)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858311 13f79535-47bb-0310-9956-ffa450edef68
2019-04-28 10:25:19 +00:00
Rishi Solanki 76d4d6b2a7 Improved: Rename custom component for SMS gateway integration. Rename files and references, also rename the webapp from msg91 to msggateway.
(OFBIZ-10973)
Thanks to Pritam and Swapnil Mane for this improvement

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858308 13f79535-47bb-0310-9956-ffa450edef68
2019-04-28 10:18:00 +00:00
Rishi Solanki 1128cbc881 Improved: Rename custom component for SMS gateway integration. Rename files and references, few more will be coming after this commit.
(OFBIZ-10973)
Thanks to Pritam for this improvement

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858307 13f79535-47bb-0310-9956-ffa450edef68
2019-04-28 07:19:00 +00:00
Suraj Khurana 62c2ce7ce6 Fixed: Shortkeys missing on WebPOS.
(OFBIZ-10961)
It was broken after jQuery update on rev #1850712.
Thanks Padmavati Rawat for reporting and Rohit Koushal for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858289 13f79535-47bb-0310-9956-ffa450edef68
2019-04-27 16:36:43 +00:00
Suraj Khurana 0bb4d1cb57 Fixed: FindTask does not allow for all statuses possible to be selected.
(OFBIZ-10913)
Thanks Pierre Smits for repoting, Deepak Dixit for comments/findings and Pawan Verma for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858285 13f79535-47bb-0310-9956-ffa450edef68
2019-04-27 16:12:04 +00:00
Rishi Solanki 442a358732 Improved: Rename custom component for SMS gateway integration. Rename the component name, will change the inner occrances in next commit.
(OFBIZ-10973)
Thanks to Jacques for notifying for this improvement

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858279 13f79535-47bb-0310-9956-ffa450edef68
2019-04-27 13:47:10 +00:00
Deepak Dixit 7a2bed084b Improved: UI issue on ecommerce main page
(OFBIZ-10849)
1. Navigate to demo-trunk ecom
2. Scroll the page and see the last category section in the right column of the screen.
3. The last category section seems to be distorted because of the empty list Screenshot attached for the same.

The patch contains the following:
- Fixed the category section rendering.

- Improved the markup of survey section of the main page.
- Improved the UI/UX of view cart screen 

Thanks  Garima jain  and Nitish Mishra for  your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858265 13f79535-47bb-0310-9956-ffa450edef68
2019-04-27 11:42:32 +00:00
Suraj Khurana 987888ed49 Fixed: Can't set (expected) start and end date of project when creating a project.
(OFBIZ-10927)
Thanks Pierre Smits for reporting, Pawan Verma for the patch and Jacques for review.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858244 13f79535-47bb-0310-9956-ffa450edef68
2019-04-27 06:41:46 +00:00
Suraj Khurana 90c06a42b0 Improved: Use code128 instead of code39 for barcode generation.
(OFBIZ-10896)
Currently, we are using code39 to generate barcodes but there are some limitations of code39 as it only able to encrypt letters from A to Z, digits from 0 to 9 and an additional set of special characters – “. $ % + – / *”.
Thanks Pawan Verma for reporting, analysis and providing the patch. Thanks everyone else for providing their inputs during discussion on Dev ML.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858243 13f79535-47bb-0310-9956-ffa450edef68
2019-04-27 06:18:17 +00:00
Jacques Le Roux 3238d53ecf Improved: Java code contains unnecessary semicolons
(OFBIZ-10936)

Oops in previous commit missed that it's a Java not Groovy file :/

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858223 13f79535-47bb-0310-9956-ffa450edef68
2019-04-26 18:51:09 +00:00
Jacques Le Roux 94e4c3f48a Improved: Java code contains unnecessary semicolons
(OFBIZ-10936)

Loosely related: Groovy code don't even needs them :)

Thanks: Mathieu for creating the Jira

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858220 13f79535-47bb-0310-9956-ffa450edef68
2019-04-26 18:09:39 +00:00
Jacques Le Roux 6332aa5205 Fixed: Ensure html verbosity is following general setup
(OFBIZ-10940)

Currently the configuration of the Birt and Scrum component does not follow the 
- de facto - standard of having the html code reference the OFBiz widget and 
templates. 
See [1] vs [2]
[1] view-source:https://demo-trunk.ofbiz.apache.org/birt/control/main
[2] view-source:https://demo-trunk.ofbiz.apache.org/accounting/control/main

Thanks: Pierre Smits

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1858141 13f79535-47bb-0310-9956-ffa450edef68
2019-04-25 14:27:36 +00:00
Jacques Le Roux 0f45353684 Improved: no functional change
Removes unused PrepareLocalesForDropDown.groovy

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1857622 13f79535-47bb-0310-9956-ffa450edef68
2019-04-16 06:26:47 +00:00
Jacques Le Roux 7865fec6b6 Fixed: Update Tomcat to 9.0.18 due to CVE-2019-0232
(OFBIZ-10920)

CVE-2019-0232 Apache Tomcat Remote Code Execution on Windows

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
Apache Tomcat 9.0.0.M1 to 9.0.17
Apache Tomcat 8.5.0 to 8.5.39
Apache Tomcat 7.0.0 to 7.0.93

Description:
When running on Windows with enableCmdLineArguments enabled, the CGI
Servlet is vulnerable to Remote Code Execution due to a bug in the way
the JRE passes command line arguments to Windows. The CGI Servlet is
disabled by default. The CGI option enableCmdLineArguments is disabled
by default in Tomcat 9.0.x (and will be disabled by default in all
versions in response to this vulnerability). For a detailed explanation
of the JRE behaviour, see Markus Wulftange's blog [1] and this archived
MSDN blog [2].

Mitigation:
Users of affected versions should apply one of the following mitigations:
- Ensure the CGI Servlet initialisation parameter enableCmdLineArguments
    is set to false
- Upgrade to Apache Tomcat 9.0.18 or later when released
- Upgrade to Apache Tomcat 8.5.40 or later when released
- Upgrade to Apache Tomcat 7.0.93 or later when released
This announcement is being made before the releases are available as the
change to fix this issue is obviously security related.

Credit:
This issue was identified by an external security researcher and
reported to the Apache Tomcat security team via the bug bounty program
sponsored by the EU FOSSA-2 project.


jleroux: actually Tomcat 9.0.19 was released, here it is

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1857586 13f79535-47bb-0310-9956-ffa450edef68
2019-04-15 14:36:51 +00:00
Jacques Le Roux ac3ff2a2ac Fixed: Error message is displayed while click on create new quotes.
(OFBIZ-10882)

This feature has been removed with OFBIZ-10882, 

This removes the "Create New Quote" link, the redundant "Save" link (there is a 
Save button) and the OrderCreateQuoteFromShoppingList label which was only used 
there

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1857173 13f79535-47bb-0310-9956-ffa450edef68
2019-04-09 11:49:10 +00:00
Deepak Dixit bd6ba0835d Improved: Amount field is editable at Product Detail Page
(OFBIZ-10663)
Added mising css and js code to show/hide the amount field based on Product.requireAmount field.
Thanks  Dikpal Kanungo for reporting the issue.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1857120 13f79535-47bb-0310-9956-ffa450edef68
2019-04-08 16:51:32 +00:00
Jacques Le Roux 7c76483d91 Fixed: Unable to create new quote from cart at eCommerce store
(OFBIZ-10886)

Actually we decided that an external user should not be able to create quotes
but only requests for quote.

This disables creating quotes from the ecommerce. An authorised user can still
do the same from the backedn (order manager)

Thanks: Sanjay Yadav for initial report, Sasikant Biswal for trying, Pierre for
mentioning that this should not be open to external users and Pawan Verma for 
the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1856917 13f79535-47bb-0310-9956-ffa450edef68
2019-04-04 12:17:35 +00:00
Jacques Le Roux 833db83f03 Fixed: Error message is displayed in shopping cart when click on recalculate
cart link
(OFBIZ-10852)

Login with valid username and password.
Navigate to ecommerce.
Add multiple product in shopping cart.
Select one product and click on remove selected.
Product should be removed.
Select another product and click on recalculate cart.

Expected result: Product should be recalculate.
Actual result: Error message is displayed as 404. Screen print attached

jleroux: I did not see the error message but the fix makes sense anyway

Thanks: Ashish Sharma for report Sasikant Biswal for the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1856802 13f79535-47bb-0310-9956-ffa450edef68
2019-04-02 07:52:53 +00:00
Rishi Solanki 73f7146d74 [Implemented] Short Messaging Service(SMS) Gateway Integration. Added msg91 component to plugins. Added README.md file with steps to run and setup. Added seed data for the same.
(OFBIZ-10457)
Thanks to Pritam Kute for your contribution and Michael Brohi for review and feedback.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1856624 13f79535-47bb-0310-9956-ffa450edef68
2019-03-30 13:00:29 +00:00
Rishi Solanki 9ce999b656 [Implemented] Short Messaging Service(SMS) Gateway Integration. Added msg91 component to plugins. It uses msg91 services to send sms. An example to demonstrate how to use SMS gateway integration with OFBiz.
(OFBIZ-10457)
Thanks to Pritam Kute for your contribution and Michael Brohi for review and feedback.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1856618 13f79535-47bb-0310-9956-ffa450edef68
2019-03-30 12:43:46 +00:00
Suraj Khurana 2310144baf Fixed: Upload new file button is not visible on My Profile page.
(OFBIZ-10851)
Thanks Shikha Jaiswal for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1856612 13f79535-47bb-0310-9956-ffa450edef68
2019-03-30 08:31:37 +00:00
Jacques Le Roux 70895a3646 Fixed: Update Tomcat to 9.0.16 due to CVE-2019-0199
(OFBIZ-10873)

The HTTP/2 implementation accepted streams with excessive numbers of
SETTINGS frames and also permitted clients to keep streams open without
reading/writing request/response data. By keeping streams open for
requests that utilised the Servlet API's blocking I/O, clients were able
to cause server-side threads to block eventually leading to thread
exhaustion and a DoS.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1856212 13f79535-47bb-0310-9956-ffa450edef68
2019-03-25 17:47:52 +00:00
Deepak Dixit a600780684 Improved: UI improvement at checkout page
(OFBIZ-10578)
Thanks  Nitish Mishra and Parakh Maheshwari for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1855090 13f79535-47bb-0310-9956-ffa450edef68
2019-03-09 06:41:12 +00:00
Deepak Dixit 513f18569b Improved: UI improvement at Configurable Product detail page
(OFBIZ-10578)
Thanks  Nitish Mishra and Parakh Maheshwari for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1855088 13f79535-47bb-0310-9956-ffa450edef68
2019-03-09 06:37:00 +00:00
Deepak Dixit 157f23f7d2 Improved: Markup improvement for the blogs screen
(OFBIZ-10578)
Thanks  Nitish Mishra and Parakh Maheshwari for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1855086 13f79535-47bb-0310-9956-ffa450edef68
2019-03-09 06:34:33 +00:00
Aditya Sharma 52c932ca5a Improved: Replace document.write() occurrences with some legitimate code
(OFBIZ-10759)
Removed document.write.lastFocusedName as code works without it

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1855084 13f79535-47bb-0310-9956-ffa450edef68
2019-03-09 06:29:37 +00:00
Suraj Khurana ac7435bd81 Fixed: Product image is not displayed on showcart page of ecommerce.
(OFBIZ-10738)
Thanks Arpit Mor for reporting the issue and Praveen Sharma for providing the patch.
It was occuring due to incorrect encoder type used and so URL was not creating properly to render the image.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1855082 13f79535-47bb-0310-9956-ffa450edef68
2019-03-09 06:25:00 +00:00
Deepak Dixit 65d1489261 Preparation for JDK11 update, Updated following code to fix warning with respect to JDK11
- Replaced Class::newInstance occurrences
(OFBIZ-10757)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1854684 13f79535-47bb-0310-9956-ffa450edef68
2019-03-03 10:29:37 +00:00
Deepak Dixit 5579e37bde Improved: Updated plugin code to fix console warning related to deprecated method. Removed Double constructor call as its depracated since jdk 9. Also replace the CellType::getCellTypeEnum method call with CellTyoe::getCellType
(OFBIZ-10757)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1853904 13f79535-47bb-0310-9956-ffa450edef68
2019-02-19 17:30:35 +00:00
Swapnil Mane c7f9cbdd0c Fixed: 404 error while creating/updating contact information from the checkout page
(OFBIZ-10827)

Thanks: Ravi Lodhi for reporting the issue and Pawan Verma for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1852988 13f79535-47bb-0310-9956-ffa450edef68
2019-02-05 11:42:54 +00:00
Jacques Le Roux c702407c32 Fixed: Implemented: Navigate from a domain to another with automated signed in
authentication
(OFBIZ-10307)

Non functional change

Removes now useless "webappName" var after I put in the SecuredUserLoginId 
cookies.

Thanks: Michael for spotting it in OFBIZ-10814

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851885 13f79535-47bb-0310-9956-ffa450edef68
2019-01-23 07:14:21 +00:00
Aditya Sharma 81e93b444f Improved: Replace Inline js with External js in renderDateFindField macro
(OFBIZ-9850)
Added an example in FormWidgetExamples for the field.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851316 13f79535-47bb-0310-9956-ffa450edef68
2019-01-15 04:57:08 +00:00
Deepak Dixit 5f6727ee53 Improved: Convert Promotion Screen of e-commerce as per Bootstrap Styling
(OFBIZ-10793)
Thanks  Nitish Mishra for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851185 13f79535-47bb-0310-9956-ffa450edef68
2019-01-12 19:15:09 +00:00
Deepak Dixit 8ba3822d60 Fixed:List Request page seems distorted of ecommerce component
(OFBIZ-10621)
Thanks  Garima jain for reporting the issue.
Set the col class based on right/left screen inclusion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851140 13f79535-47bb-0310-9956-ffa450edef68
2019-01-12 06:46:53 +00:00
Deepak Dixit 84b11df4c5 Only formatting , No function chages
(OFBIZ-10790)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851139 13f79535-47bb-0310-9956-ffa450edef68
2019-01-12 06:39:55 +00:00
Deepak Dixit 44a7af62ed Improved: Improve ecommerce main-decorator
(OFBIZ-10790)
Added two new section in ecommerce main-decorator, now we don't need to pass right/left bar screen name, instead we can include it directly in decoratot-section.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851135 13f79535-47bb-0310-9956-ffa450edef68
2019-01-12 06:15:17 +00:00
Akash Jain a6399b5c9f Improved: UI improvements on splitship page of ecommerce
(OFBIZ-10730)
Thanks, Aishwary Shrivastava and Arpit Mor for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851134 13f79535-47bb-0310-9956-ffa450edef68
2019-01-12 05:59:34 +00:00
Jacques Le Roux 844fc542d8 Fixed: Add session tracking mode and make cookie secure
(OFBIZ-6655)

Following "Session timeout for webapps" discussion on dev ML 
https://markmail.org/message/p6fbiojjrwb2ybxd

We decided to put back the session-timeout value in web.xml files and to remove
the line
    session.setMaxInactiveInterval(60*60); //in seconds
from ControlEventListener.java

Thanks: Deepak Nigam for report and Girish Vasmatkar for discussion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851068 13f79535-47bb-0310-9956-ffa450edef68
2019-01-11 16:12:01 +00:00
Deepak Dixit d4308cd24a Improved: Update multifex theme as per new markup
(OFBIZ-10118)
Thanks Ayushi Rathod, Parakh Maheshwari and Nitish Mishra for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851009 13f79535-47bb-0310-9956-ffa450edef68
2019-01-11 06:22:58 +00:00
Deepak Dixit caae84841f Fixed: Page dropdown list on categorydetail page broken
(OFBIZ-10787)
Thanks Sebastian Wachinger for reporting the issue.
Corrected the condition to display pagination options

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1851002 13f79535-47bb-0310-9956-ffa450edef68
2019-01-11 05:59:42 +00:00
Aditya Sharma baabf6b25d Improved: Replace jQuery.bind() with jQuery.on()
(OFBIZ-10758)
As of jQuery 3.0, .bind() has been deprecated. It was superseded by the .on() method for attaching event handlers to a document.
Additional change:
Improved boolean returns with single statement, replacing if blocks with explicit boolean return.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1850712 13f79535-47bb-0310-9956-ffa450edef68
2019-01-08 05:08:40 +00:00
Jacques Le Roux 6a9ede0945 Improved: Themes can't be changed in webpos
(OFBIZ-10767)

Following this discussion on dev ML I decided to test it on Ubuntu in my Windows 
7 VM and it works there. 
Just that you don't automatically get back to the webpos page when changing theme


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1850552 13f79535-47bb-0310-9956-ffa450edef68
2019-01-06 13:51:34 +00:00
2399 changed files with 42179 additions and 521131 deletions
+31
View File
@@ -0,0 +1,31 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
github:
description: "Apache OFBiz is an open source product for the automation of enterprise processes. It includes framework components and business applications for ERP, CRM, E-Business/E-Commerce, Supply Chain Management and Manufacturing Resource Planning. OFBiz provides a foundation and starting point for reliable, secure and scalable enterprise solutions."
homepage: https://ofbiz.apache.org/
labels:
- ofbiz
- plugins
- xml
- java
- groovy
- javascript
- web-framework
- database
- network-server
- https
- content
- geospatial
+11
View File
@@ -0,0 +1,11 @@
Improved:
Implemented:
Documented:
Completed:
Reverted:
Fixed:
(OFBIZ-)
Explanation
Thanks:
+2
View File
@@ -0,0 +1,2 @@
.DS_Store
bin/
+2
View File
@@ -0,0 +1,2 @@
@@ -1,29 +1,4 @@
LICENSE
Copyright (c) 2008 N. Quaine - NexWave Solutions All Rights Reserved.
CONDITIONS
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.
DISCLAIMER
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -225,40 +200,33 @@ DISCLAIMER
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================
This product bundles "jQuery" and "jQuery" plugins and extensions, which are available
under the "MIT" license. For details, see:
webpos/webapp/webpos/images/js/jquery.hotkeys-0.7.9.min.js
webpos/webapp/webpos/images/js/WebPosHotkeys.js
Some code in src/java/org/apache/lucene/util/UnicodeUtil.java was
derived from unicode conversion examples available at
http://www.unicode.org/Public/PROGRAMS/CVTUTF. Here is the copyright
from those sources:
=========================================================================
/*
* Copyright 2001-2004 Unicode, Inc.
*
* Disclaimer
*
* This source code is provided as is by Unicode, Inc. No claims are
* made as to fitness for any particular purpose. No warranties of any
* kind are expressed or implied. The recipient agrees to determine
* applicability of information provided. If this file has been
* purchased on magnetic or optical media from Unicode, Inc., the
* sole remedy for any claim will be exchange of defective media
* within 90 days of receipt.
*
* Limitations on Rights to Redistribute This Code
*
* Unicode, Inc. hereby grants the right to freely use the information
* supplied in this file in the creation of products supporting the
* Unicode Standard, and to make copies of this file in any form
* for internal or external distribution as long as this notice
* remains attached.
*/
This product bundles "Webhelp for DocBook", which is available
under the "MIT" License. For details, see cmssite/template/docbook/webhelp/
=========================================================================
Some code in src/java/org/apache/lucene/util/ArrayUtil.java was
derived from Python 2.4.2 sources available at
http://www.python.org. Full license is here:
This product bundles "DocBook XSL Stylesheets 1.77.1", which is available
under the "MIT" license.
For details, see cmssite/template/docbook/
=========================================================================
http://www.python.org/download/releases/2.4.2/license/
This product bundles "Bootstrap", which is available
under the "MIT" license.
For details, see:
ecommerce/webapp/ecommerce/js
ecommerce/webapp/ecommerce/css
=========================================================================
This product bundles "swagger-ui", which is available under the
"Apache License Version 2.0".
For details, see rest-api/webapp/docs
+5
View File
@@ -0,0 +1,5 @@
Apache OFBiz
Copyright 2001-2020 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
+9 -15
View File
@@ -1,20 +1,14 @@
<img src="http://ofbiz.apache.org/images/OFBiz-logo.png" alt="Apache OFBiz" />
<img src="https://camo.githubusercontent.com/b313d4ec52b77b5024e2988aaf76720258233e69/68747470733a2f2f6f6662697a2e6170616368652e6f72672f696d616765732f6f6662697a5f6c6f676f2e706e67" alt="Apache OFBiz" />
# Assetmaint component
The asset management and maintenance application enables organisations to
maintain a register of all kinds of assets. It enables them to plan maintenance
and keep track of allocations and use. Integrates with the accounting module
regarding depreciation bookings.
The asset management and maintenance application enables organisations to maintain a register of all kinds of assets. It enables them to plan maintenance and keep track of allocations and use. Integrates with the accounting module regarding depreciation bookings.
## more information
For more information about this component visit the product page in the OFBiz
WIKI, which can be found at
https://cwiki.apache.org/confluence/display/OFBIZ/Asset+Management
## issues
JIRA issues related to this component can be found at
https://issues.apache.org/jira/browse/OFBIZ/component/12311644
## Features
Asset registration
Maintenance planning
Depreciation calculation and registration
Meter registrations
Allocation registration
## commits
Committed revisions can be viewed at
http://svn.apache.org/viewvc/ofbiz/trunk/plugins/assetmaint/
+1 -21
View File
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="AssetMaintApplication">
<value xml:lang="de">Instandhaltungsanwendung</value>
<value xml:lang="en">Asset Maintenance Application</value>
@@ -155,16 +155,6 @@
<value xml:lang="zh">添加交付明细</value>
<value xml:lang="zh-TW">增加交付細項</value>
</property>
<property key="PageTitleChildWorkEfforts">
<value xml:lang="en">Task Breakdown</value>
<value xml:lang="fr">Décomposition de tâche</value>
<value xml:lang="it">Scoposizione compito</value>
<value xml:lang="ja">タスクブレークダウン</value>
<value xml:lang="th">งานหยุด</value>
<value xml:lang="vi">Phân nhỏ Tác vụ</value>
<value xml:lang="zh">任务分解</value>
<value xml:lang="zh-TW">任務分解</value>
</property>
<property key="PageTitleFindFixedAssetMaints">
<value xml:lang="de">Verwaltungen finden</value>
<value xml:lang="en">Find Maintenances</value>
@@ -176,16 +166,6 @@
<value xml:lang="zh">查找维修保养</value>
<value xml:lang="zh-TW">尋找維修保養</value>
</property>
<property key="PageTitleFindFixedAssets">
<value xml:lang="en">Find Equipments</value>
<value xml:lang="fr">Chercher des équipements</value>
<value xml:lang="it">Ricerca cespite</value>
<value xml:lang="ja">設備を検索</value>
<value xml:lang="th">ค้นหาเครื่องมือ</value>
<value xml:lang="vi">Tìm Thiết bị</value>
<value xml:lang="zh">查找设备</value>
<value xml:lang="zh-TW">尋找設備</value>
</property>
<property key="PageTitleListItemIssuance">
<value xml:lang="en">Parts List</value>
<value xml:lang="fr">Liste des pièces</value>
+1 -1
View File
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="IsMgrApplication">
<value xml:lang="en">Information Systems Management Application</value>
<value xml:lang="fr">Gestion du parc informatique</value>
@@ -28,4 +28,5 @@ under the License.
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="ASSETMAINTTECH" permissionId="ASSETMAINT_UPDATE"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FULLADMIN" permissionId="ASSETMAINT_ADMIN"/>
<SecurityGroupPermission fromDate="2001-01-01 00:00:00.0" groupId="VIEWADMIN" permissionId="ASSETMAINT_VIEW"/>
</entity-engine-xml>
+1 -1
View File
@@ -19,7 +19,7 @@
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
@@ -1,146 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint" short-description="Test case for service createFixedAssetMaintUpdateWorkEffort with a product Maintenance" login-required="false">
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
<set field="serviceCtx.statusId" value="FAM_CREATED"/>
<set field="serviceCtx.productMaintSeqId" value="seq03"/><!-- Product Maintenance -->
<set field="serviceCtx.intervalMeterTypeId" value="ODOMETER"/>
<set field="serviceCtx.estimatedStartDate" value="2009-12-18 00:00:00.000" type="Timestamp"/>
<set field="serviceCtx.estimatedCompletionDate" value="2009-12-18 01:00:00.000" type="Timestamp"/>
<set field="serviceCtx.actualStartDate" value="2009-12-20 00:00:00.000" type="Timestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createFixedAssetMaintUpdateWorkEffort" in-map-name="serviceCtx">
<result-to-field result-name="maintHistSeqId"/>
</call-service>
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint"/>
<get-related-one relation-name="ScheduleWorkEffort" value-field="fixedAssetMaint" to-value-field="workEffort"/>
<assert>
<not><if-empty field="fixedAssetMaint"/></not>
<not><if-empty field="fixedAssetMaint.scheduleWorkEffortId"/></not>
<not><if-empty field="workEffort"/></not>
<if-compare-field field="workEffort.estimatedStartDate" operator="equals" to-field="serviceCtx.estimatedStartDate"/>
<if-compare-field field="workEffort.estimatedCompletionDate" operator="equals" to-field="serviceCtx.estimatedCompletionDate"/>
<if-compare-field field="workEffort.actualStartDate" operator="equals" to-field="serviceCtx.actualStartDate"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateFixedAssetMaintUpdateWorkEffortWithoutProductMaint" short-description="Test case for service createFixedAssetMaintUpdateWorkEffort without a product maintenance" login-required="false">
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
<set field="serviceCtx.statusId" value="FAM_CREATED"/>
<set field="serviceCtx.productMaintTypeId" value="OIL_CHANGE"/>
<set field="serviceCtx.intervalMeterTypeId" value="ODOMETER"/>
<set field="serviceCtx.estimatedStartDate" value="2009-12-18 00:00:00.000" type="Timestamp"/>
<set field="serviceCtx.estimatedCompletionDate" value="2009-12-18 01:00:00.000" type="Timestamp"/>
<set field="serviceCtx.actualStartDate" value="2009-12-20 00:00:00.000" type="Timestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createFixedAssetMaintUpdateWorkEffort" in-map-name="serviceCtx">
<result-to-field result-name="maintHistSeqId"/>
</call-service>
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint">
<field-map field-name="fixedAssetId"/>
<field-map field-name="maintHistSeqId"/>
</entity-one>
<get-related-one relation-name="ScheduleWorkEffort" value-field="fixedAssetMaint" to-value-field="workEffort"/>
<assert>
<not><if-empty field="fixedAssetMaint"/></not>
<not><if-empty field="fixedAssetMaint.scheduleWorkEffortId"/></not>
<not><if-empty field="workEffort"/></not>
<if-compare-field field="workEffort.estimatedStartDate" operator="equals" to-field="serviceCtx.estimatedStartDate"/>
<if-compare-field field="workEffort.estimatedCompletionDate" operator="equals" to-field="serviceCtx.estimatedCompletionDate"/>
<if-compare-field field="workEffort.actualStartDate" operator="equals" to-field="serviceCtx.actualStartDate"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateFixedAssetMaintAndWorkEffort" short-description="Test case for service updateFixedAssetMaintAndWorkEffort" login-required="false">
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
<set field="maintHistSeqId" value="00001"/><!-- Sequence created by testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint -->
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
<set field="serviceCtx.maintHistSeqId" from-field="maintHistSeqId"/>
<set field="serviceCtx.estimatedCompletionDate" value="2009-12-22 01:00:00.000" type="Timestamp"/><!-- Changed estimatedCompletionDate to test update service -->
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint"/>
<set field="serviceCtx.workEffortId" from-field="fixedAssetMaint.scheduleWorkEffortId"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateFixedAssetMaintAndWorkEffort" in-map-name="serviceCtx"/>
<clear-field field="fixedAssetMaint"/>
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint"/>
<get-related-one relation-name="ScheduleWorkEffort" value-field="fixedAssetMaint" to-value-field="workEffort"/>
<assert>
<not><if-empty field="fixedAssetMaint"/></not>
<not><if-empty field="fixedAssetMaint.scheduleWorkEffortId"/></not>
<not><if-empty field="workEffort"/></not>
<if-compare-field field="workEffort.estimatedCompletionDate" operator="equals" to-field="serviceCtx.estimatedCompletionDate"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateFixedAssetMaintAndWorkEffortComplete" short-description="Test case for service updateFixedAssetMaintAndWorkEffort" login-required="false">
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint">
<field-map field-name="fixedAssetId" value="DEMO_VEHICLE_01"/>
<field-map field-name="maintHistSeqId" value="00001"/>
</entity-one>
<set field="serviceInMap.fixedAssetId" from-field="fixedAssetMaint.fixedAssetId"/>
<set field="serviceInMap.maintHistSeqId" from-field="fixedAssetMaint.maintHistSeqId"/>
<set field="serviceInMap.scheduleWorkEffortId" from-field="fixedAssetMaint.scheduleWorkEffortId"/>
<set field="serviceInMap.statusId" value="FAM_COMPLETED"/>
<now-timestamp field="nowTimestamp"/>
<set field="serviceInMap.actualCompletionDate" from-field="nowTimestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceInMap.userLogin" from-field="userLogin"/>
<call-service service-name="updateFixedAssetMaintAndWorkEffort" in-map-name="serviceInMap"/>
<entity-one entity-name="FixedAssetMaint" value-field="newFixedAssetMaint">
<field-map field-name="fixedAssetId" value="DEMO_VEHICLE_01"/>
<field-map field-name="maintHistSeqId" value="00001"/>
</entity-one>
<assert>
<if-compare field="newFixedAssetMaint.statusId" operator="equals" value="FAM_COMPLETED"/>
</assert>
<check-errors/>
<entity-one entity-name="WorkEffort" value-field="workEffort">
<field-map field-name="workEffortId" from-field="fixedAssetMaint.scheduleWorkEffortId"/>
</entity-one>
<assert>
<if-compare field="workEffort.currentStatusId" operator="equals" value="CAL_COMPLETED"/>
<if-compare-field field="workEffort.actualCompletionDate" operator="equals" to-field="nowTimestamp" type="Timestamp"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>
+7 -5
View File
@@ -20,7 +20,7 @@
<ofbiz-component name="assetmaint" enabled="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<!-- define resource loaders; most common is to use the component resource loader -->
<resource-loader name="main" type="component"/>
@@ -41,18 +41,20 @@
<webapp name="assetmaint"
title="AssetMaint"
position="19"
server="default-server"
location="webapp/assetmaint"
base-permission="ASSETMAINT"
base-permission="OFBTOOLS,ASSETMAINT"
mount-point="/assetmaint"
app-bar-display="true"/>
<webapp name="ismgr"
title="IS Mgr"
position="20"
server="default-server"
app-bar-display="false"
location="webapp/ismgr"
base-permission="ASSETMAINT"
mount-point="/ismgr"/>
base-permission="OFBTOOLS,ASSETMAINT"
mount-point="/ismgr"
app-bar-display="true"/>
</ofbiz-component>
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<!-- ECAs used to extend service permission checking -->
<eca service="fixedAssetPermissionCheck" event="return" run-on-failure="true">
+1 -1
View File
@@ -14,7 +14,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>Assetmaint Services: Fixed Asset </description>
<vendor>OFBiz</vendor>
<version>1.0</version>
+23
View File
@@ -0,0 +1,23 @@
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
= Asset Maintenance plugin
Assets are items of value that are owned by the business.
The Asset Maintenance application is used to schedule and trace all maintenance activities on assets.
@@ -0,0 +1,147 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ofbiz.assetmaint.test
import java.sql.Timestamp
import java.text.SimpleDateFormat
import org.apache.ofbiz.base.util.UtilDateTime
import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.service.testtools.OFBizTestCase
class FixedAssetMaintTests extends OFBizTestCase {
public FixedAssetMaintTests(String name) {
super(name)
}
void testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint() {
// Test case for service createFixedAssetMaintUpdateWorkEffort with a product Maintenance
String fixedAssetId = "DEMO_VEHICLE_01"
Map serviceCtx = [:]
serviceCtx.fixedAssetId = fixedAssetId
serviceCtx.statusId = "FAM_CREATED"
serviceCtx.productMaintSeqId = "seq03" // product maintenance
serviceCtx.intervalMeterTypeId = "ODOMETER"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
String estimatedStartDate = "2009-12-18 00:00:00.000"
serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime())
String estimatedCompletionDate = "2009-12-18 01:00:00.000"
serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime())
String actualStartDate = "2009-12-20 00:00:00.000"
serviceCtx.actualStartDate = new Timestamp(sdf.parse(actualStartDate).getTime())
serviceCtx.userLogin = userLogin
Map serviceResult = dispatcher.runSync('createFixedAssetMaintUpdateWorkEffort', serviceCtx)
String maintHistSeqId = serviceResult.maintHistSeqId
GenericValue fixedAssetMaint = from("FixedAssetMaint").where("fixedAssetId", fixedAssetId).queryFirst()
GenericValue workEffort = from("WorkEffort").where("workEffortId", fixedAssetMaint.scheduleWorkEffortId).queryOne()
assert fixedAssetMaint
assert fixedAssetMaint.scheduleWorkEffortId
assert workEffort
assert workEffort.estimatedStartDate == serviceCtx.estimatedStartDate
assert workEffort.estimatedCompletionDate == serviceCtx.estimatedCompletionDate
assert workEffort.actualStartDate == serviceCtx.actualStartDate
}
void testCreateFixedAssetMaintUpdateWorkEffortWithoutProductMaint() {
// Test case for service createFixedAssetMaintUpdateWorkEffort without a product maintenance
String fixedAssetId = "DEMO_VEHICLE_01"
Map serviceCtx = [:]
serviceCtx.fixedAssetId = fixedAssetId
serviceCtx.statusId = "FAM_CREATED"
serviceCtx.productMaintTypeId = "OIL_CHANGE"
serviceCtx.intervalMeterTypeId = "ODOMETER"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
String estimatedStartDate = "2009-12-18 00:00:00.000"
serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime())
String estimatedCompletionDate = "2009-12-18 01:00:00.000"
serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime())
String actualStartDate = "2009-12-20 00:00:00.000"
serviceCtx.actualStartDate = new Timestamp(sdf.parse(actualStartDate).getTime())
serviceCtx.userLogin = userLogin
Map serviceResult = dispatcher.runSync('createFixedAssetMaintUpdateWorkEffort', serviceCtx)
String maintHistSeqId = serviceResult.maintHistSeqId
GenericValue fixedAssetMaint = from("FixedAssetMaint").where("fixedAssetId", fixedAssetId, "maintHistSeqId", maintHistSeqId).queryOne()
GenericValue workEffort = from("WorkEffort").where("workEffortId", fixedAssetMaint.scheduleWorkEffortId).queryOne()
assert fixedAssetMaint
assert fixedAssetMaint.scheduleWorkEffortId
assert workEffort
assert workEffort.estimatedStartDate == serviceCtx.estimatedStartDate
assert workEffort.estimatedCompletionDate == serviceCtx.estimatedCompletionDate
assert workEffort.actualStartDate == serviceCtx.actualStartDate
}
void testUpdateFixedAssetMaintAndWorkEffort() {
// Test case for service updateFixedAssetMaintAndWorkEffort
String fixedAssetId = "DEMO_VEHICLE_01"
String maintHistSeqId = "00001" // Sequence created by testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint
Map serviceCtx = [:]
serviceCtx.fixedAssetId = fixedAssetId
serviceCtx.maintHistSeqId = maintHistSeqId
serviceCtx.statusId = "FAM_CREATED"
serviceCtx.productMaintTypeId = "OIL_CHANGE"
serviceCtx.intervalMeterTypeId = "ODOMETER"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
String estimatedCompletionDate = "2009-12-22 01:00:00.000" // Changed estimatedCompletionDate to test update service
serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime())
GenericValue fixedAssetMaint = from("FixedAssetMaint").where("fixedAssetId", fixedAssetId).queryFirst()
serviceCtx.workEffortId = fixedAssetMaint.scheduleWorkEffortId
serviceCtx.userLogin = userLogin
Map serviceResult = dispatcher.runSync('updateFixedAssetMaintAndWorkEffort', serviceCtx)
GenericValue workEffort = from("WorkEffort").where("workEffortId", fixedAssetMaint.scheduleWorkEffortId).queryOne()
assert fixedAssetMaint
assert fixedAssetMaint.scheduleWorkEffortId
assert workEffort
assert workEffort.estimatedCompletionDate == serviceCtx.estimatedCompletionDate
}
void testUpdateFixedAssetMaintAndWorkEffortComplete() {
// Test case for service updateFixedAssetMaintAndWorkEffort
GenericValue fixedAssetMaint = from("FixedAssetMaint").where("fixedAssetId", "DEMO_VEHICLE_01", "maintHistSeqId", "00001").queryOne()
Map serviceCtx = [:]
serviceCtx.fixedAssetId = fixedAssetMaint.fixedAssetId
serviceCtx.maintHistSeqId = fixedAssetMaint.maintHistSeqId
serviceCtx.scheduleWorkEffortId = fixedAssetMaint.scheduleWorkEffortId
serviceCtx.statusId = "FAM_COMPLETED"
serviceCtx.actualCompletionDate = UtilDateTime.nowTimestamp()
serviceCtx.userLogin = userLogin
Map serviceResult = dispatcher.runSync('updateFixedAssetMaintAndWorkEffort', serviceCtx)
GenericValue newFixedAssetMaint = from("FixedAssetMaint").where("fixedAssetId", "DEMO_VEHICLE_01", "maintHistSeqId", "00001").queryOne()
assert newFixedAssetMaint.statusId == "FAM_COMPLETED"
GenericValue workEffort = from("WorkEffort").where("workEffortId", fixedAssetMaint.scheduleWorkEffortId).queryOne()
assert workEffort.currentStatusId == "CAL_COMPLETED"
assert workEffort.actualCompletionDate == serviceCtx.actualCompletionDate
}
}
@@ -43,31 +43,33 @@ import org.apache.ofbiz.service.ServiceUtil;
public class FixedAssetMaintServices {
public static final String module = FixedAssetMaintServices.class.getName();
public static final String resource = "AssetMaintUiLabels";
private static final String MODULE = FixedAssetMaintServices.class.getName();
private static final String RESOURCE = "AssetMaintUiLabels";
public static Map<String, Object> addPartFixedAssetMaint(DispatchContext ctx, Map<String, Object> context) {
LocalDispatcher dispatcher = ctx.getDispatcher();
Delegator delegator = ctx.getDelegator();
Locale locale = (Locale) context.get("locale");
String fixedAssetId = (String)context.get("fixedAssetId");
String maintHistSeqId = (String)context.get("maintHistSeqId");
String productId = (String)context.get("productId");
String facilityId = (String)context.get("facilityId");
Double quantity = (Double)context.get("quantity");
String fixedAssetId = (String) context.get("fixedAssetId");
String maintHistSeqId = (String) context.get("maintHistSeqId");
String productId = (String) context.get("productId");
String facilityId = (String) context.get("facilityId");
Double quantity = (Double) context.get("quantity");
double requestedQty = quantity;
try {
GenericValue product = ProductWorker.findProduct(delegator, productId);
if (product == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AssetMaintInvalidPartProductIdError", UtilMisc.toMap("productId", productId), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "AssetMaintInvalidPartProductIdError", UtilMisc.toMap(
"productId", productId), locale));
}
Map<String, ? extends Object> findCurrInventoryParams = UtilMisc.toMap("productId", productId, "facilityId", facilityId);
Map<String, ? extends Object> findCurrInventoryParams = UtilMisc.toMap("productId", productId, "facilityId", facilityId);
GenericValue userLogin = (GenericValue) context.get("userLogin");
// Call issuance service
Map<String, Object> result = dispatcher.runSync("getInventoryAvailableByFacility", findCurrInventoryParams);
if (ServiceUtil.isError(result)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AssetMaintProblemGettingInventoryLevel", locale) + productId , null, null, result);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "AssetMaintProblemGettingInventoryLevel", locale) + productId,
null, null, result);
}
Object atpObj = result.get("availableToPromiseTotal");
double atp = 0.0;
@@ -75,14 +77,16 @@ public class FixedAssetMaintServices {
atp = Double.parseDouble(atpObj.toString());
}
if (requestedQty > atp) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AssetMaintLowPartInventoryError", UtilMisc.toMap("productId", productId , "quantity", Double.toString(atp)), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "AssetMaintLowPartInventoryError", UtilMisc.toMap("productId",
productId, "quantity", Double.toString(atp)), locale));
}
EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId),
EntityCondition.makeCondition("availableToPromiseTotal", EntityOperator.GREATER_THAN, "0")),
EntityOperator.AND);
List<GenericValue> inventoryItems = EntityQuery.use(delegator).from("InventoryItem").where(ecl).queryList(); //&& inventoryItems.size() > 0
List<GenericValue> inventoryItems = EntityQuery.use(delegator).from("InventoryItem").where(ecl).queryList(); //&& inventoryItems.size
// () > 0
Iterator<GenericValue> itr = inventoryItems.iterator();
while (requestedQty > 0 && itr.hasNext()) {
GenericValue inventoryItem = itr.next();
@@ -95,24 +99,25 @@ public class FixedAssetMaintServices {
} else {
issueQuantity = requestedQty;
}
Map<String, Object> itemIssuanceCtx = new HashMap<String, Object>();
Map<String, Object> itemIssuanceCtx = new HashMap<>();
itemIssuanceCtx.put("userLogin", userLogin);
itemIssuanceCtx.put("inventoryItemId", inventoryItemId);
itemIssuanceCtx.put("fixedAssetId", fixedAssetId);
itemIssuanceCtx.put("maintHistSeqId", maintHistSeqId);
itemIssuanceCtx.put("quantity", issueQuantity);
// Call issuance service
result = dispatcher.runSync("issueInventoryItemToFixedAssetMaint",itemIssuanceCtx);
result = dispatcher.runSync("issueInventoryItemToFixedAssetMaint", itemIssuanceCtx);
if (ServiceUtil.isError(result)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AssetMaintProblemCallingService", locale), null, null, result);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "AssetMaintProblemCallingService", locale), null, null,
result);
}
requestedQty = requestedQty - issueQuantity;
}
} catch (GenericEntityException e) {
Debug.logError("Problem in retriving data from database", module);
Debug.logError("Problem in retriving data from database", MODULE);
} catch (GenericServiceException e) {
Debug.logError("Problem in calling service issueInventoryItemToFixedAssetMaint", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AssetMaintProblemCallingService", locale));
Debug.logError("Problem in calling service issueInventoryItemToFixedAssetMaint", MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "AssetMaintProblemCallingService", locale));
}
return ServiceUtil.returnSuccess();
}
+2 -3
View File
@@ -20,10 +20,9 @@
<test-suite suite-name="assetmainttests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="assetmaint-tests">
<simple-method-test location="component://assetmaint/minilang/test/FixedAssetMaintTests.xml"/>
<junit-test-suite class-name="org.apache.ofbiz.assetmaint.test.FixedAssetMaintTests"/>
</test-case>
</test-suite>
+10 -1
View File
@@ -18,7 +18,7 @@
under the License.
-->
<web-app version="3.0">
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>Apache OFBiz - Asset Maintenance</display-name>
<description>Asset Management component of the Apache OFBiz Project</description>
@@ -77,6 +77,11 @@
<filter-name>ContextFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class>
</filter>
<filter>
<display-name>SameSiteFilter</display-name>
<filter-name>SameSiteFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.SameSiteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ControlFilter</filter-name>
<url-pattern>/*</url-pattern>
@@ -85,6 +90,10 @@
<filter-name>ContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SameSiteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener><listener-class>org.apache.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
<listener><listener-class>org.apache.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
@@ -1,53 +0,0 @@
<%--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--%>
<%@ page import="org.apache.ofbiz.base.util.*" %>
<html>
<head>
<title>OFBiz Message</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %>
<body bgcolor="#FFFFFF">
<div align="center">
<br/>
<table width="100%" border="1" height="200">
<tr>
<td>
<table width="100%" border="0" height="200">
<tr bgcolor="#CC6666">
<td height="45">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div>
</td>
</tr>
<tr>
<td>
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div align="center"></div>
</body>
</html>
+10 -1
View File
@@ -18,7 +18,7 @@
under the License.
-->
<web-app version="3.0">
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>Apache OFBiz - Information Systems</display-name>
<description>Information Systems Management application of the Apache OFBiz Project</description>
@@ -72,6 +72,11 @@
<filter-name>ContextFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class>
</filter>
<filter>
<display-name>SameSiteFilter</display-name>
<filter-name>SameSiteFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.SameSiteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ControlFilter</filter-name>
<url-pattern>/*</url-pattern>
@@ -80,6 +85,10 @@
<filter-name>ContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SameSiteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener><listener-class>org.apache.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
<listener><listener-class>org.apache.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
-53
View File
@@ -1,53 +0,0 @@
<%--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--%>
<%@ page import="org.apache.ofbiz.base.util.*" %>
<html>
<head>
<title>OFBiz Message</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %>
<body bgcolor="#FFFFFF">
<div align="center">
<br/>
<table width="100%" border="1" height="200">
<tr>
<td>
<table width="100%" border="0" height="200">
<tr bgcolor="#CC6666">
<td height="45">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div>
</td>
</tr>
<tr>
<td>
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div align="center"></div>
</body>
</html>
+2 -1
View File
@@ -39,6 +39,7 @@ under the License.
<set field="applicationMenuName" value="AssetMaintAppBar" global="true"/>
<set field="applicationMenuLocation" value="component://assetmaint/widget/AssetmaintMenus.xml" global="true"/>
<set field="applicationTitle" from-field="uiLabelMap.AssetMaintApplication"/>
<set field="helpAnchor" from-field="helpAnchor" default-value="_asset_maintenance_plugin"/>
</actions>
<widgets>
<include-screen name="ApplicationDecorator" location="component://commonext/widget/CommonScreens.xml"/>
@@ -138,6 +139,6 @@ under the License.
</widgets>
</section>
</screen>
</screens>
+2 -2
View File
@@ -60,8 +60,8 @@
<!--<link target="ViewFacilityInventoryByProductSimple" text="${uiLabelMap.CommonPrint}" style="buttontext">
<parameter param-name="facilityId" from-field="facilityId"/>
</link>-->
<link target="ViewFacilityInventoryByProductReport?${searchParameterString}" text="${uiLabelMap.CommonPrint}" style="buttontext"/>
<link target="ViewFacilityInventoryByProductExport?${searchParameterString}" text="${uiLabelMap.CommonExport}" style="buttontext"/>
<link target="ViewFacilityInventoryByProductReport?${searchParameterString}" text="${uiLabelMap.CommonPrint}2" style="buttontext" target-window="_blank"/>
<link target="ViewFacilityInventoryByProductExport?${searchParameterString}" text="${uiLabelMap.CommonExport}2" style="buttontext" target-window="_blank"/>
</container>
<include-form name="FindFacilityInventoryByProduct" location="component://product/widget/facility/FacilityForms.xml"/>
@@ -34,6 +34,7 @@ under the License.
<set field="activeApp" value="ismgr" global="true"/>
<set field="applicationMenuName" value="IsMgrAppBar" global="true"/>
<set field="applicationMenuLocation" value="component://assetmaint/widget/ismgr/Menus.xml" global="true"/>
<set field="helpAnchor" from-field="helpAnchor" default-value="_apache_ofbiz_plugins"/>
<set field="layoutSettings.companyName" from-field="uiLabelMap.IsMgrCompanyName" global="true"/>
<set field="layoutSettings.companySubtitle" from-field="uiLabelMap.IsMgrCompanySubtitle" global="true"/>
<!-- layoutSettings.headerImageUrl can be used to specify an application specific logo; if not set,
+1 -1
View File
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="BusinessIntelligenceApplication">
<value xml:lang="en">Business Intelligence Application</value>
<value xml:lang="fr">Application d'informatique décisionnelle</value>
+2 -1
View File
@@ -19,11 +19,12 @@ under the License.
-->
<entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitygroup.xsd">
<!-- ========================================================= -->
<!-- Dimensions -->
<!-- ========================================================= -->
<entity-group group="org.apache.ofbiz.olap" entity="CountryDimension"/>
<entity-group group="org.apache.ofbiz.olap" entity="CurrencyDimension"/>
<entity-group group="org.apache.ofbiz.olap" entity="DateDimension"/>
<entity-group group="org.apache.ofbiz.olap" entity="ProductDimension"/>
+26 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
@@ -29,6 +29,31 @@ under the License.
<!-- ========================================================= -->
<!-- Dimensions -->
<!-- ========================================================= -->
<entity entity-name="CountryDimension" package-name="org.apache.ofbiz.bi.dimension" title="Country Dimension">
<description>Country dimension. Based on ISO 3166-1. The natural key is [geoId]</description>
<field name="dimensionId" type="id">
<description>Unique identifier of the Date dimension record</description>
</field>
<field name="geoId" type="id">
<description>The natural key, based on ISO 3166-1 alpha-3</description>
</field>
<field name="geoName" type="name">
<description>The name of the country, based on ISO 3166</description>
</field>
<field name="geoCode" type="short-varchar">
<description>The ISO 3166-1 alpha-2 code of the country</description>
</field>
<field name="abbreviation" type="short-varchar">
<description>Based on the ISO 3166-1 alpha-3 code of the country</description>
</field>
<field name="telCountryCode" type="short-varchar">
<description>The telephone country code. Based on ITU.E123 and ITU.164</description>
</field>
<field name="ccTld" type="short-varchar">
<description>The country code top-level domain for the country. Base on IANA rfc1591</description>
</field>
<prim-key field="dimensionId"/>
</entity>
<entity entity-name="DateDimension" package-name="org.apache.ofbiz.bi.dimension" title="Date Dimension">
<description>Date (days) dimension. The natural key is [dateValue]</description>
<field name="dimensionId" type="id">
+136
View File
@@ -0,0 +1,136 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.ofbiz.entity.condition.EntityCondition
import org.apache.ofbiz.entity.condition.EntityOperator
import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.util.EntityListIterator
import org.apache.ofbiz.service.ModelService
import org.apache.ofbiz.service.ServiceUtil
def quickInitDataWarehouse() {
Map inMap = dispatcher.getDispatchContext().makeValidContext("loadDateDimension", ModelService.IN_PARAM, parameters)
serviceResult = run service: "loadDateDimension", with: inMap
if (!ServiceUtil.isSuccess(serviceResult)) return error(serviceResult.errorMessage)
inMap.clear()
serviceResult = run service: "loadCurrencyDimension", with: inMap
if (!ServiceUtil.isSuccess(serviceResult)) return error(serviceResult.errorMessage)
// loads all products in the ProductDimension
serviceResult = run service: "loadAllProductsInProductDimension", with: inMap
if (!ServiceUtil.isSuccess(serviceResult)) return error(serviceResult.errorMessage)
// loads the invoice items in the SalesInvoiceItemFact fact entity
entryExprs = EntityCondition.makeCondition([
EntityCondition.makeCondition("invoiceTypeId", EntityOperator.EQUALS, "SALES_INVOICE"),
EntityCondition.makeCondition("invoiceDate", EntityOperator.GREATER_THAN_EQUAL_TO, parameters.fromDate),
EntityCondition.makeCondition("invoiceDate", EntityOperator.LESS_THAN_EQUAL_TO, parameters.thruDate)
], EntityOperator.AND)
EntityListIterator listIterator = from("Invoice").where(entryExprs).queryIterator()
GenericValue iterator
while (iterator = listIterator.next()) {
inMap.invoiceId = iterator.invoiceId
serviceResult = run service: "loadSalesInvoiceFact", with: inMap
if (!ServiceUtil.isSuccess(serviceResult)) return error(serviceResult.errorMessage)
}
// loads the order items in the SalesOrderItemFact fact entity
entryExprs = EntityCondition.makeCondition([
EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"),
EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, parameters.fromDate),
EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, parameters.thruDate)
], EntityOperator.AND)
listIterator = from("OrderHeader").where(entryExprs).queryIterator()
inMap.clear()
while (iterator = listIterator.next()) {
inMap.orderId = iterator.orderId
serviceResult = run service: "loadSalesOrderFact", with: inMap
if (!ServiceUtil.isSuccess(serviceResult)) return error(serviceResult.errorMessage)
}
// loads the inventory items in the InventoryItemFact fact entity
listIterator = from("InventoryItem").where("inventoryItemTypeId", "NON_SERIAL_INV_ITEM").queryIterator()
inMap.clear()
while (iterator = listIterator.next()) {
inMap.inventoryItemId = iterator.inventoryItemId
serviceResult = run service: "loadInventoryFact", with: inMap
if (!ServiceUtil.isSuccess(serviceResult)) return error(serviceResult.errorMessage)
}
}
def loadCurrencyDimension() {
// Initialize the CurrencyDimension using the update strategy of 'type 1
EntityListIterator listIterator = from("Uom").where("uomTypeId", "CURRENCY_MEASURE").queryIterator()
GenericValue currency
while (currency = listIterator.next()) {
currencyDims = from("CurrencyDimension").where("currencyId", currency.uomId).queryList()
if (currencyDims) {
for (GenericValue currencyDim: currencyDims) {
currencyDim.description = currency.description
currencyDim.store()
}
} else {
currencyDim = makeValue("CurrencyDimension", [dimensionId: currency.uomId])
currencyDim.currencyId = currency.uomId
currencyDim.description = currency.description
currencyDim.create()
}
}
}
def prepareProductDimensionData() {
GenericValue product = from("Product").where("productId", parameters.productId).queryOne()
if (product == null) {
return error(UtilProperties.getMessage('ProductUiLabels', 'ProductProductNotFoundWithProduct', locale))
}
productDimension = makeValue("ProductDimension")
productDimension.setNonPKFields(product)
GenericValue productType = select("description").from("ProductType")
.where("productTypeId", product.productTypeId).cache().queryOne()
productDimension.productType = productType.description
Map result = success()
result.productDimension = productDimension
return result
}
def loadProductInProductDimension() {
Map inMap = dispatcher.getDispatchContext().makeValidContext("prepareProductDimensionData", ModelService.IN_PARAM, parameters)
serviceResult = run service: "prepareProductDimensionData", with: inMap
GenericValue productDimension
if (ServiceUtil.isSuccess(serviceResult)) {
productDimension = serviceResult.productDimension
}
inMap.clear()
inMap = dispatcher.getDispatchContext().makeValidContext("storeGenericDimension", ModelService.IN_PARAM, parameters)
inMap.naturalKeyFields = "productId"
inMap.dimensionValue = productDimension
run service: "storeGenericDimension", with: inMap
}
def loadAllProductsInProductDimension() {
EntityListIterator listIterator = from("Product").queryIterator()
GenericValue product
Map inMap
while (product = listIterator.next()) {
inMap = dispatcher.getDispatchContext().makeValidContext("loadProductInProductDimension", ModelService.IN_PARAM, parameters)
inMap.productId = product.productId
run service: "loadProductInProductDimension", with: inMap
}
}
+664
View File
@@ -0,0 +1,664 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.sql.Timestamp
import java.text.SimpleDateFormat
import java.sql.Date
import org.apache.ofbiz.base.util.UtilDateTime
import org.apache.ofbiz.base.util.UtilProperties
import org.apache.ofbiz.base.util.UtilValidate
import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.condition.EntityCondition
import org.apache.ofbiz.entity.condition.EntityOperator
import org.apache.ofbiz.order.order.OrderReadHelper
import org.apache.ofbiz.service.ServiceUtil
def loadSalesInvoiceFact() {
GenericValue invoice = from("Invoice").where(parameters).queryOne()
if (!invoice) {
String errorMessage = UtilProperties.getMessage("AccountingUiLabels", "AccountingInvoiceDoesNotExists", parameters.locale)
logError(errorMessage)
return error(errorMessage)
}
if ("SALES_INVOICE".equals(invoice.invoiceTypeId)) {
Map andConditions = ["invoiceItemTypeId": "INV_FPROD_ITEM"]
List invoiceItems = delegator.getRelated("InvoiceItem", null, null, invoice, false)
for (GenericValue invoiceItem : invoiceItems) {
Map inMap = [invoice: invoice, invoiceItem: invoiceItem]
run service: "loadSalesInvoiceItemFact", with: inMap
}
}
return success()
}
def loadSalesInvoiceItemFact() {
GenericValue invoice = parameters.invoice
GenericValue invoiceItem = parameters.invoiceItem
if (!invoice) {
invoice = from("Invoice").where(parameters).queryOne()
}
if (UtilValidate.isEmpty(invoiceItem)) {
invoiceItem = from("InvoiceItem").where(parameters).queryOne()
}
if (!invoice) {
String errorMessage = UtilProperties.getMessage("AccountingUiLabels", "AccountingInvoiceDoesNotExists", parameters.locale)
logError(errorMessage)
return error(errorMessage)
}
if (!invoiceItem) {
String errorMessage = UtilProperties.getMessage("AccountingUiLabels", "AccountingInvoiceItemDoesNotExists", parameters.locale)
logError(errorMessage)
return error(errorMessage)
}
if ("SALES_INVOICE".equals(invoice.invoiceTypeId)) {
GenericValue fact = from("SalesInvoiceItemFact").where(invoiceId: invoiceItem.invoiceId, invoiceItemSeqId: invoiceItem.invoiceItemSeqId).queryOne()
// key handling
if (!fact) {
Map inMap
Map naturalKeyFields
Map serviceResult
String dimensionId
fact = makeValue("SalesInvoiceItemFact")
fact.invoiceId = invoice.invoiceId
fact.invoiceItemSeqId = invoiceItem.invoiceItemSeqId
// conversion of the invoice date
if (invoice.invoiceDate) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "DateDimension"
Date invoiceDate = new Date(invoice.invoiceDate.getTime())
naturalKeyFields.dateValue = invoiceDate
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service: "getDimensionIdFromNaturalKey", with: inMap
fact.invoiceDateDimId = serviceResult.dimensionId
if (!fact.invoiceDateDimId) {
fact.invoiceDateDimId = "_NF_"
}
} else {
fact.invoiceDateDimId = "_NA_"
}
// conversion of the product id
if (invoiceItem.productId) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "ProductDimension"
naturalKeyFields.productId = invoiceItem.productId
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service: "getDimensionIdFromNaturalKey", with: inMap
fact.productDimId = serviceResult.dimensionId
if (!fact.productDimId) {
fact.productDimId = "_NF_"
}
} else {
fact.productDimId = "_NA_"
}
// conversion of the invoice currency
if (invoice.currencyUomId) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "CurrencyDimension"
naturalKeyFields.currencyId = invoice.currencyUomId
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service: "getDimensionIdFromNaturalKey", with: inMap
fact.origCurrencyDimId = serviceResult.dimensionId
if (!fact.origCurrencyDimId) {
fact.origCurrencyDimId = "_NF_"
}
} else {
fact.origCurrencyDimId = "_NA_"
}
// TODO
fact.orderId = "_NA_"
fact.billToCustomerDimId = "_NA_"
fact.create()
}
/*
* facts handling
*/
fact.quantity = invoiceItem.quantity as BigDecimal
fact.extGrossAmount = 0 as BigDecimal
fact.extDiscountAmount = 0 as BigDecimal
fact.extTaxAmount = 0 as BigDecimal
fact.extNetAmount = 0 as BigDecimal
if (invoiceItem.quantity && invoiceItem.amount) {
fact.extGrossAmount = invoiceItem.quantity * invoiceItem.amount
}
Map andConditions
// taxes
andConditions = [invoiceItemTypeId: "ITM_SALES_TAX"]
List taxes = delegator.getRelated("ChildrenInvoiceItem", null, null, invoiceItem, false)
for (GenericValue tax : taxes) {
if (tax.amount) {
fact.extTaxAmount = fact.extTaxAmount + tax.amount
}
}
// discounts
andConditions = [invoiceItemTypeId: "ITM_PROMOTION_ADJ"]
List discounts = delegator.getRelated("ChildrenInvoiceItem", null, null, invoiceItem, false)
for (GenericValue discount : discounts) {
if (discount.amount) {
fact.extDiscountAmount = fact.extDiscountAmount - discount.amount
}
}
fact.extNetAmount = fact.extGrossAmount - fact.extDiscountAmount
// TODO: prorate invoice header discounts and shipping charges
// TODO: costs
fact.extManFixedCost = 0 as BigDecimal
fact.extManVarCost = 0 as BigDecimal
fact.extStorageCost = 0 as BigDecimal
fact.extDistributionCost = 0 as BigDecimal
BigDecimal costs = fact.extManFixedCost + fact.extManVarCost + fact.extStorageCost + fact.extDistributionCost
fact.contributionAmount = fact.extNetAmount - costs
fact.store()
}
return success()
}
def loadSalesOrderFact() {
GenericValue orderHeader = from("OrderHeader").where(parameters).queryOne()
if (!orderHeader) {
String errorMessage = UtilProperties.getMessage("OrderErrorUiLabels", "OrderOrderIdDoesNotExists", parameters.locale)
logError(errorMessage)
return error(errorMessage)
}
if ("SALES_ORDER".equals(orderHeader.orderTypeId)) {
if ("ORDER_APPROVED".equals(orderHeader.statusId)) {
List orderItems = from("OrderItem")
.where("orderId", orderHeader.orderId, "orderItemTypeId", "PRODUCT_ORDER_ITEM")
.queryList()
for (GenericValue orderItem : orderItems) {
Map inMap = [:]
inMap.orderHeader = orderHeader
inMap.orderItem = orderItem
inMap.orderAdjustment = null
run service: "loadSalesOrderItemFact", with: inMap
}
}
}
return success()
}
def loadSalesOrderItemFact() {
Map inMap
Map naturalKeyFields
Map serviceResult
GenericValue orderHeader = parameters.orderHeader
GenericValue orderItem = parameters.orderItem
GenericValue orderAdjustment = parameters.orderAdjustment
List orderAdjustments
GenericValue orderStatus
if (!orderHeader) {
orderHeader = from("OrderHeader").where(parameters).queryOne()
}
if (!orderItem) {
orderItem = from("OrderItem").where(parameters).queryOne()
}
if (!orderAdjustment) {
orderAdjustments = from("OrderAdjustment").where("orderId": orderItem.orderId).queryList()
}
if (!orderHeader) {
String errorMessage = UtilProperties.getMessage("OrderErrorUiLabels", "OrderOrderIdDoesNotExists", parameters.locale)
logError(errorMessage)
return error(errorMessage)
}
if (!orderItem) {
String errorMessage = UtilProperties.getMessage("OrderErrorUiLabels", "OrderOrderItemIdDoesNotExists", parameters.locale)
logError(errorMessage)
return error(errorMessage)
}
if ("ORDER_APPROVED".equals(orderHeader.statusId)) {
GenericValue fact = from("SalesOrderItemFact").where(orderId: orderItem.orderId, orderItemSeqId: orderItem.orderItemSeqId).queryOne()
// key handling
if (!fact) {
fact = makeValue("SalesOrderItemFact")
fact.orderId = orderHeader.orderId
fact.orderItemSeqId = orderItem.orderItemSeqId
fact.productStoreId = orderHeader.productStoreId
fact.salesChannelEnumId = orderHeader.salesChannelEnumId
fact.statusId = orderItem.statusId
// account
if (orderHeader.productStoreId) {
GenericValue account = from("ProductStore").where(productStoreId: orderHeader.productStoreId).queryOne()
fact.account = account.storeName
}
// pod
if ("EUR".equals(orderHeader.currencyUom)) {
fact.pod = "Latin"
} else {
fact.pod = "Engish"
}
// brand
if (orderHeader.salesChannelEnumId) {
GenericValue brand = from("Enumeration").where(enumId: orderHeader.salesChannelEnumId).queryOne()
fact.brand = brand.description
}
// conversion of the order date
orderStatus = from("OrderStatus")
.where(orderId: orderHeader.orderId, statusId: "ORDER_APPROVED")
.orderBy("-statusDatetime")
.queryFirst()
if (orderStatus.statusDatetime) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "DateDimension"
Date statusDatetime = new Date(orderStatus.statusDatetime.getTime())
naturalKeyFields.dateValue = statusDatetime
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service: "getDimensionIdFromNaturalKey", with: inMap
fact.orderDateDimId = serviceResult.dimensionId
if (!fact.orderDateDimId) {
fact.orderDateDimId = "_NF_"
}
} else {
fact.orderDateDimId = "_NA_"
}
// conversion of the product id
if (UtilValidate.isNotEmpty(orderItem.productId)) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "ProductDimension"
naturalKeyFields.productId = orderItem.productId
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service: "getDimensionIdFromNaturalKey", with: inMap
fact.productDimId = serviceResult.dimensionId
if (!fact.productDimId) {
fact.productDimId = "_NF_"
}
} else {
fact.productDimId = "_NA_"
}
// conversion of the order currency
if (orderHeader.currencyUom) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "CurrencyDimension"
naturalKeyFields.currencyId = orderHeader.currencyUom
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service: "getDimensionIdFromNaturalKey", with: inMap
fact.origCurrencyDimId = serviceResult.dimensionId
if (!fact.origCurrencyDimId) {
fact.origCurrencyDimId = "_NF_"
}
} else {
fact.origCurrencyDimId = "_NA_"
}
// productCategoryId
GenericValue productCategoryMember = from("ProductCategoryMember").where(productId: orderItem.productId, thruDate: null).queryFirst()
if (productCategoryMember) {
fact.productCategoryId = productCategoryMember.productCategoryId
}
// TODO
fact.billToCustomerDimId = "_NA_"
fact.create()
}
/*
* facts handling
*/
Map partyAccountingPreferencesCallMap = [:]
OrderReadHelper orderReadHelper = new OrderReadHelper(orderHeader)
Map billFromParty = orderReadHelper.getBillFromParty()
partyAccountingPreferencesCallMap.organizationPartyId = billFromParty.partyId
Map accountResult = run service:"getPartyAccountingPreferences", with: partyAccountingPreferencesCallMap
GenericValue accPref = accountResult.partyAccountingPreference
fact.quantity = orderItem.quantity as BigDecimal
fact.extGrossAmount = 0 as BigDecimal
fact.extGrossCost = 0 as BigDecimal
fact.extDiscountAmount = 0 as BigDecimal
fact.extNetAmount = 0 as BigDecimal
fact.extShippingAmount = 0 as BigDecimal
fact.extTaxAmount = 0 as BigDecimal
fact.GS = 0 as BigDecimal
fact.GMS = 0 as BigDecimal
fact.GMP = 0 as BigDecimal
fact.GSS = 0 as BigDecimal
fact.GSC = 0 as BigDecimal
fact.GSP = 0 as BigDecimal
fact.GP = 0 as BigDecimal
fact.countOrder = 0 as BigDecimal
// extGrossAmount
Map convertUomCurrencyMap = [:]
convertUomCurrencyMap.uomId = orderHeader.currencyUom
convertUomCurrencyMap.uomIdTo = accPref.baseCurrencyUomId
if (UtilValidate.isNotEmpty(orderStatus)) {
convertUomCurrencyMap.nowDate = orderStatus.statusDatetime
}
Map convertResult = run service: "convertUomCurrency", with: convertUomCurrencyMap
BigDecimal exchangeRate = convertResult.conversionFactor
if (exchangeRate) {
BigDecimal unitPrice = orderItem.unitPrice * exchangeRate
fact.extGrossAmount = fact.quantity * unitPrice
}
// extGrossCost
GenericValue cost = from("SupplierProduct")
.where(productId: orderItem.productId, availableThruDate: null, minimumOrderQuantity: 0 as BigDecimal)
.queryFirst()
if (cost) {
convertUomCurrencyMap.uomId = cost.currencyUomId
convertUomCurrencyMap.uomIdTo = accPref.baseCurrencyUomId
if (orderStatus) {
convertUomCurrencyMap.nowDate = orderStatus.statusDatetime
}
Map grossCostResult = run service: "convertUomCurrency", with: convertUomCurrencyMap
exchangeRate = grossCostResult.conversionFactor
if (exchangeRate) {
BigDecimal costPrice = cost.lastPrice * exchangeRate
fact.extGrossCost = fact.quantity * costPrice
}
}
// extShippingAmount
for (GenericValue shipping : orderAdjustments) {
if ("SHIPPING_CHARGES".equals(shipping.orderAdjustmentTypeId)) {
fact.extShippingAmount = fact.extShippingAmount + shipping.amount
}
}
// extTaxAmount
for (GenericValue tax : orderAdjustments) {
if ("SALES_TAX".equals(tax.orderAdjustmentTypeId)) {
fact.extTaxAmount = fact.extTaxAmount + tax.amount
}
}
// extDiscountAmount
for (GenericValue discount : orderAdjustments) {
if ("PROMOTION_ADJUSTMENT".equals(discount.orderAdjustmentTypeId)) {
fact.extDiscountAmount = fact.extDiscountAmount + discount.amount
// product promo code
GenericValue productPromoCode = from("ProductPromoCode").where(productPromoId: discount.productPromoId).queryFirst()
if (productPromoCode) {
fact.productPromoCode = productPromoCode.productPromoCodeId
} else {
fact.productPromoCode = "Not require code"
}
}
}
// extNetAmount
fact.extNetAmount = fact.extGrossAmount - fact.extDiscountAmount
// GS
BigDecimal countGS = 0 as BigDecimal
List checkGSList = from("SalesOrderItemFact").where(orderId: orderHeader.orderId).queryList()
for (GenericValue checkGS : checkGSList) {
if (checkGS.GS) {
if (0 != checkGS.GS) {
countGS = 1
}
}
}
if (countGS == 0) {
convertUomCurrencyMap.uomId = orderHeader.currencyUom
convertUomCurrencyMap.uomIdTo = accPref.baseCurrencyUomId
if (orderStatus) {
convertUomCurrencyMap.nowDate = orderStatus.statusDatetime
}
Map GSResult = run service: "convertUomCurrency", with: convertUomCurrencyMap
exchangeRate = GSResult.conversionFactor
if (exchangeRate) {
fact.GS = orderHeader.grandTotal * exchangeRate
}
}
// GMS
fact.GMS = fact.GMS + fact.extGrossAmount
// GMP
fact.GMP = fact.GMS - fact.extGrossCost
// GSP
BigDecimal countGSP = 0 as BigDecimal
List checkGSPList = from("SalesOrderItemFact").where(orderId: orderHeader.orderId).queryList()
for (GenericValue checkGSP : checkGSPList) {
if (checkGSP.GSP) {
if (checkGSP.GSP != 0) {
countGSP = 1
}
}
}
if (countGSP == 0) {
List orderItemList = from("OrderItem").where(orderId: orderHeader.orderId).queryList()
BigDecimal warrantyPrice = 0 as BigDecimal
for (GenericValue warranty : orderAdjustments) {
if ("WARRANTY_ADJUSTMENT".equals(warranty.orderAdjustmentTypeId)) {
warrantyPrice = warrantyPrice + warranty.amount
}
}
BigDecimal GSS = fact.extShippingAmount + warrantyPrice
convertUomCurrencyMap.uomId = orderHeader.currencyUom
convertUomCurrencyMap.uomIdTo = accPref.baseCurrencyUomId
if (orderStatus) {
convertUomCurrencyMap.nowDate = orderStatus.statusDatetime
}
Map GSPResult = run service: "convertUomCurrency", with: convertUomCurrencyMap
exchangeRate = GSPResult.conversionFactor
if (exchangeRate) {
GSS = GSS * exchangeRate
}
fact.GSS = GSS
fact.GSP = GSS as BigDecimal
}
// GP
fact.GP = fact.GMP + fact.GSP
// countOrder
BigDecimal countOrder = 0 as BigDecimal
List checkCountOrderList = from("SalesOrderItemFact").where(orderId: orderHeader.orderId).queryList()
for (GenericValue checkCountOrder : checkCountOrderList) {
if (checkCountOrder.countOrder) {
if (checkCountOrder.countOrder != 0) {
countOrder = 1
}
}
}
if (countOrder == 0) {
fact.countOrder = 1 as BigDecimal
}
fact.store()
}
return success()
}
/**
* Load Sales Order Data Daily
*/
def loadSalesOrderDataDaily() {
Timestamp nowTimestamp = UtilDateTime.nowTimestamp()
Date nowDate = new Date(nowTimestamp.getTime())
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 07:00:00.000")
def today = sdf.format(nowDate)
Date yesterdayDate = new Date(nowTimestamp.getTime()-86400000)
def yesterday = sdf.format(yesterdayDate)
Map inMap = [:]
inMap.fromDate = yesterday
inMap.thruDate = today
run service: "importSalesOrderData", with: inMap
return success()
}
/**
* Import Sales Order Data
*/
def importSalesOrderData() {
Map inMap = [fromDate: parameters.fromDate, thruDate: parameters.thruDate]
Map res = run service:"loadDateDimension", with: inMap
if (!ServiceUtil.isSuccess(res)) {
return res
}
EntityCondition condition = EntityCondition.makeCondition(
EntityCondition.makeCondition("statusId", "ORDER_APPROVED"),
EntityCondition.makeCondition("statusDatetime", EntityOperator.GREATER_THAN_EQUAL_TO, parameters.fromDate),
EntityCondition.makeCondition("statusDatetime", EntityOperator.LESS_THAN, parameters.thruDate)
)
List orderStatusList = from("OrderStatus").where(condition).queryList()
for (GenericValue orderHeader : orderStatusList) {
inMap =[:]
inMap.orderId = orderHeader.orderId
res = run service:"loadSalesOrderFact", with: inMap
if (!ServiceUtil.isSuccess(res)) {
return res
}
}
return success()
}
/**
* Convert Uom Currency from UomConversionDated entity
*/
def convertUomCurrency() {
if (!parameters.nowDate) {
Timestamp now = UtilDateTime.nowTimestamp()
parameters.nowDate = now
}
Map result = success()
EntityCondition condition = EntityCondition.makeCondition(
EntityCondition.makeCondition("uomId", parameters.uomId),
EntityCondition.makeCondition("uomIdTo", parameters.uomIdTo),
EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, parameters.nowDate),
EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, parameters.nowDate)
)
GenericValue UomConversion = from("UomConversionDated").where(condition).orderBy("-fromDate").queryFirst()
if (UomConversion) {
result.conversionFactor = UomConversion.conversionFactor
} else {
GenericValue UomConversionLastest = from("UomConversionDated")
.where(uomId: parameters.uomId, uomIdTo: parameters.uomIdTo, thruDate: null)
.queryFirst()
if (UomConversionLastest) {
result.conversionFactor = UomConversionLastest.conversionFactor
}
}
return result
}
def loadInventoryFact() {
GenericValue inventory = from("InventoryItem").where(inventoryItemId: parameters.inventoryItemId).queryOne()
GenericValue fact = from("InventoryItemFact").where(inventoryItemId: parameters.inventoryItemId).queryOne()
Map inMap = [:]
Map naturalKeyFields = [:]
Map serviceResult
if (!fact) {
fact = makeValue("InventoryItemFact")
fact.inventoryItemId = inventory.inventoryItemId
// conversion of the inventory date
if (inventory?.createdStamp) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "DateDimension"
Date createdStampDatetime = new Date(inventory.createdStamp.getTime())
naturalKeyFields.dateValue = createdStampDatetime
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service:"getDimensionIdFromNaturalKey", with: inMap
fact.inventoryDateDimId = serviceResult.dimensionId
if (!fact.inventoryDateDimId) {
fact.inventoryDateDimId = "_NF_"
}
} else {
fact.inventoryDateDimId = "_NA_"
}
// conversion of the productId
if (inventory?.productId) {
inMap = [:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "ProductDimension"
naturalKeyFields.productId = inventory.productId
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service:"getDimensionIdFromNaturalKey", with: inMap
fact.productDimId = serviceResult.dimensionId
if (!fact.productDimId) {
fact.productDimId = "_NF_"
}
} else {
fact.productDimId = "_NA_"
}
// conversion of the order currency
if (inventory?.currencyUomId) {
inMap =[:]
naturalKeyFields = [:]
inMap.dimensionEntityName = "CurrencyDimension"
naturalKeyFields.currencyId = inventory.currencyUomId
inMap.naturalKeyFields = naturalKeyFields
serviceResult = run service:"getDimensionIdFromNaturalKey", with: inMap
fact.origCurrencyDimId = serviceResult.dimensionId
if (!fact.origCurrencyDimId) {
fact.origCurrencyDimId = "_NF_"
}
} else {
fact.origCurrencyDimId = "_NA_"
}
fact.create()
}
fact.facilityId = inventory.facilityId
fact.inventoryItemId = inventory.inventoryItemId
fact.quantityOnHandTotal = inventory.quantityOnHandTotal
fact.availableToPromiseTotal = inventory.availableToPromiseTotal
fact.unitCost = inventory.unitCost
// calculate sold out amount
fact.soldoutAmount = inventory.quantityOnHandTotal - inventory.availableToPromiseTotal
fact.store()
return success()
}
-142
View File
@@ -1,142 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="quickInitDataWarehouse" short-description="">
<set-service-fields service-name="loadDateDimension" map="parameters" to-map="inMap"/>
<call-service service-name="loadDateDimension" in-map-name="inMap"/>
<check-errors/>
<clear-field field="inMap"/>
<call-service service-name="loadCurrencyDimension" in-map-name="inMap"/>
<check-errors/>
<!-- loads all products in the ProductDimension -->
<clear-field field="inMap"/>
<call-service service-name="loadAllProductsInProductDimension" in-map-name="inMap"/>
<check-errors/>
<!-- loads the invoice items in the SalesInvoiceItemFact fact entity -->
<entity-condition entity-name="Invoice" list="invoices">
<condition-list>
<condition-expr field-name="invoiceTypeId" value="SALES_INVOICE"/>
<condition-expr field-name="invoiceDate" operator="greater-equals" from-field="parameters.fromDate"/>
<condition-expr field-name="invoiceDate" operator="less-equals" from-field="parameters.thruDate"/>
</condition-list>
</entity-condition>
<iterate list="invoices" entry="invoice">
<clear-field field="inMap"/>
<set field="inMap.invoiceId" from-field="invoice.invoiceId"/>
<call-service service-name="loadSalesInvoiceFact" in-map-name="inMap"/>
<check-errors/>
</iterate>
<!-- loads the order items in the SalesOrderItemFact fact entity -->
<entity-condition entity-name="OrderHeader" list="orderHeaders">
<condition-list>
<condition-expr field-name="orderTypeId" value="SALES_ORDER"/>
<condition-expr field-name="orderDate" operator="greater-equals" from-field="parameters.fromDate"/>
<condition-expr field-name="orderDate" operator="less-equals" from-field="parameters.thruDate"/>
</condition-list>
</entity-condition>
<iterate list="orderHeaders" entry="orderHeader">
<clear-field field="inMap"/>
<set field="inMap.orderId" from-field="orderHeader.orderId"/>
<call-service service-name="loadSalesOrderFact" in-map-name="inMap"></call-service>
<check-errors/>
</iterate>
<!-- loads the inventory items in the InventoryItemFact fact entity -->
<entity-condition entity-name="InventoryItem" list="inventoryItems">
<condition-expr field-name="inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
</entity-condition>
<iterate list="inventoryItems" entry="inventoryItem">
<clear-field field="inventMap"/>
<set field="inventMap.inventoryItemId" from-field="inventoryItem.inventoryItemId"/>
<call-service service-name="loadInventoryFact" in-map-name="inventMap"></call-service>
<check-errors/>
</iterate>
</simple-method>
<simple-method method-name="loadCurrencyDimension" short-description="Initialize the CurrencyDimension using the update strategy of 'type 1'">
<entity-and entity-name="Uom" list="currencies">
<field-map field-name="uomTypeId" value="CURRENCY_MEASURE"/>
</entity-and>
<iterate list="currencies" entry="currency">
<entity-and entity-name="CurrencyDimension" list="currencyDims">
<field-map field-name="currencyId" from-field="currency.uomId"/>
</entity-and>
<if-not-empty field="currencyDims">
<iterate list="currencyDims" entry="currencyDim">
<set field="currencyDim.description" from-field="currency.description"/>
<store-value value-field="currencyDim"/>
</iterate>
<else>
<make-value entity-name="CurrencyDimension" value-field="currencyDim"/>
<sequenced-id sequence-name="CurrencyDimension" field="currencyDim.dimensionId"/>
<set field="currencyDim.currencyId" from-field="currency.uomId"/>
<set field="currencyDim.description" from-field="currency.description"/>
<create-value value-field="currencyDim"/>
</else>
</if-not-empty>
</iterate>
</simple-method>
<simple-method method-name="prepareProductDimensionData" short-description="">
<entity-one entity-name="Product" value-field="product"/>
<if-empty field="product">
<add-error>
<fail-property resource="ProductUiLabels" property="ProductProductNotFoundWithProduct"/>
</add-error>
</if-empty>
<check-errors/>
<make-value entity-name="ProductDimension" value-field="productDimension"/>
<set-nonpk-fields map="product" value-field="productDimension"/>
<get-related-one value-field="product" relation-name="ProductType" to-value-field="productType"/>
<set field="productDimension.productType" from-field="productType.description"/>
<field-to-result field="productDimension"/>
</simple-method>
<simple-method method-name="loadProductInProductDimension" short-description="">
<set-service-fields service-name="prepareProductDimensionData" map="parameters" to-map="inMap"/>
<call-service service-name="prepareProductDimensionData" in-map-name="inMap">
<result-to-field result-name="productDimension"/>
</call-service>
<clear-field field="inMap"/>
<set-service-fields service-name="storeGenericDimension" map="parameters" to-map="inMap"/>
<set field="inMap.naturalKeyFields[]" value="productId"/>
<set field="inMap.dimensionValue" from-field="productDimension"/>
<call-service service-name="storeGenericDimension" in-map-name="inMap"/>
</simple-method>
<simple-method method-name="loadAllProductsInProductDimension" short-description="">
<entity-condition entity-name="Product" list="products"/>
<iterate list="products" entry="product">
<set-service-fields service-name="loadProductInProductDimension" map="parameters" to-map="inMap"/>
<set field="inMap.productId" from-field="product.productId"/>
<call-service service-name="loadProductInProductDimension" in-map-name="inMap"/>
<clear-field field="inMap"/>
</iterate>
</simple-method>
</simple-methods>
-751
View File
@@ -1,751 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="loadSalesInvoiceFact" short-description="">
<entity-one entity-name="Invoice" value-field="invoice"/>
<if-empty field="invoice">
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingInvoiceDoesNotExists"/>
</add-error>
</if-empty>
<check-errors/>
<if-compare field="invoice.invoiceTypeId" operator="equals" value="SALES_INVOICE">
<set field="andConditions.invoiceItemTypeId" value="INV_FPROD_ITEM"/>
<get-related relation-name="InvoiceItem" value-field="invoice" list="invoiceItems" map="andConditions"/>
<iterate list="invoiceItems" entry="invoiceItem">
<clear-field field="inMap"/>
<set field="inMap.invoice" from-field="invoice"/>
<set field="inMap.invoiceItem" from-field="invoiceItem"/>
<call-service service-name="loadSalesInvoiceItemFact" in-map-name="inMap"/>
</iterate>
</if-compare>
</simple-method>
<simple-method method-name="loadSalesInvoiceItemFact" short-description="">
<set field="invoice" from-field="parameters.invoice"/>
<set field="invoiceItem" from-field="parameters.invoiceItem"/>
<if-empty field="invoice">
<entity-one entity-name="Invoice" value-field="invoice"/>
</if-empty>
<if-empty field="invoiceItem">
<entity-one entity-name="InvoiceItem" value-field="invoiceItem"/>
</if-empty>
<if-empty field="invoice">
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingInvoiceDoesNotExists"/>
</add-error>
</if-empty>
<if-empty field="invoiceItem">
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingInvoiceItemDoesNotExists"/>
</add-error>
</if-empty>
<check-errors/>
<if-compare field="invoice.invoiceTypeId" operator="equals" value="SALES_INVOICE">
<entity-one entity-name="SalesInvoiceItemFact" value-field="fact" auto-field-map="false">
<field-map field-name="invoiceId" from-field="invoiceItem.invoiceId"/>
<field-map field-name="invoiceItemSeqId" from-field="invoiceItem.invoiceItemSeqId"/>
</entity-one>
<!-- key handling -->
<if-empty field="fact">
<make-value entity-name="SalesInvoiceItemFact" value-field="fact"/>
<set field="fact.invoiceId" from-field="invoice.invoiceId"/>
<set field="fact.invoiceItemSeqId" from-field="invoiceItem.invoiceItemSeqId"/>
<!-- conversion of the invoice date -->
<if-not-empty field="invoice.invoiceDate">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="DateDimension"/>
<set field="inMap.naturalKeyFields.dateValue" from-field="invoice.invoiceDate" type="Date"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.invoiceDateDimId"/>
</call-service>
<if-empty field="fact.invoiceDateDimId">
<set field="fact.invoiceDateDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.invoiceDateDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- conversion of the product id -->
<if-not-empty field="invoiceItem.productId">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="ProductDimension"/>
<set field="inMap.naturalKeyFields.productId" from-field="invoiceItem.productId"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.productDimId"/>
</call-service>
<if-empty field="fact.productDimId">
<set field="fact.productDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.productDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- conversion of the invoice currency -->
<if-not-empty field="invoice.currencyUomId">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="CurrencyDimension"/>
<set field="inMap.naturalKeyFields.currencyId" from-field="invoice.currencyUomId"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.origCurrencyDimId"/>
</call-service>
<if-empty field="fact.origCurrencyDimId">
<set field="fact.origCurrencyDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.origCurrencyDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- TODO -->
<set field="fact.orderId" value="_NA_"/>
<set field="fact.billToCustomerDimId" value="_NA_"/>
<create-value value-field="fact"/>
</if-empty>
<!-- =============== -->
<!-- facts handling -->
<!-- =============== -->
<set field="fact.quantity" from-field="invoiceItem.quantity" type="BigDecimal"/>
<set field="fact.extGrossAmount" value="0.0" type="BigDecimal"/>
<set field="fact.extDiscountAmount" value="0.0" type="BigDecimal"/>
<set field="fact.extTaxAmount" value="0.0" type="BigDecimal"/>
<set field="fact.extNetAmount" value="0.0" type="BigDecimal"/>
<calculate field="fact.extGrossAmount">
<calcop field="invoiceItem.quantity" operator="multiply">
<calcop field="invoiceItem.amount" operator="get"/>
</calcop>
</calculate>
<!-- taxes -->
<clear-field field="andConditions"/>
<set field="andConditions.invoiceItemTypeId" value="ITM_SALES_TAX"/>
<get-related relation-name="ChildrenInvoiceItem" value-field="invoiceItem" list="taxes" map="andConditions"/>
<iterate list="taxes" entry="tax">
<calculate field="fact.extTaxAmount">
<calcop field="fact.extTaxAmount" operator="add">
<calcop field="tax.amount" operator="get"/>
</calcop>
</calculate>
</iterate>
<!-- discounts -->
<clear-field field="andConditions"/>
<set field="andConditions.invoiceItemTypeId" value="ITM_PROMOTION_ADJ"/>
<get-related relation-name="ChildrenInvoiceItem" value-field="invoiceItem" list="discounts" map="andConditions"/>
<iterate list="discounts" entry="discount">
<calculate field="fact.extDiscountAmount" type="BigDecimal">
<calcop field="fact.extDiscountAmount" operator="add">
<calcop field="discount.amount" operator="negative"/>
</calcop>
</calculate>
</iterate>
<calculate field="fact.extNetAmount">
<calcop field="fact.extGrossAmount" operator="subtract">
<calcop field="fact.extDiscountAmount" operator="get"/>
</calcop>
</calculate>
<!-- TODO: prorate invoice header discounts and shipping charges -->
<!-- TODO: costs -->
<set field="fact.extManFixedCost" value="0.0" type="BigDecimal"/>
<set field="fact.extManVarCost" value="0.0" type="BigDecimal"/>
<set field="fact.extStorageCost" value="0.0" type="BigDecimal"/>
<set field="fact.extDistributionCost" value="0.0" type="BigDecimal"/>
<calculate field="fact.contributionAmount">
<calcop field="fact.extNetAmount" operator="subtract">
<calcop field="fact.extManFixedCost" operator="get"/>
<calcop field="fact.extManVarCost" operator="get"/>
<calcop field="fact.extStorageCost" operator="get"/>
<calcop field="fact.extDistributionCost" operator="get"/>
</calcop>
</calculate>
<store-value value-field="fact"/>
</if-compare>
</simple-method>
<simple-method method-name="loadSalesOrderFact" short-description="">
<entity-one entity-name="OrderHeader" value-field="orderHeader"/>
<if-empty field="orderHeader">
<add-error>
<fail-property resource="OrderErrorUiLabels" property="OrderOrderIdDoesNotExists"/>
</add-error>
</if-empty>
<check-errors/>
<if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER">
<if-compare field="orderHeader.statusId" operator="equals" value="ORDER_APPROVED">
<entity-condition entity-name="OrderItem" list="orderItems">
<condition-list combine="and">
<condition-expr field-name="orderId" operator="equals" from-field="orderHeader.orderId"/>
<!--<condition-expr field-name="productId" operator="not-like" value="M00%"/>-->
<condition-expr field-name="orderItemTypeId" operator="equals" value="PRODUCT_ORDER_ITEM"/>
<!--<condition-expr field-name="statusId" operator="equals" value="ITEM_APPROVED"/>-->
</condition-list>
</entity-condition>
<!--<set field="andConditions.orderItemTypeId" value="PRODUCT_ORDER_ITEM"/>
<get-related relation-name="OrderItem" value-field="orderHeader" list="orderItems" map="andConditions"/>-->
<iterate list="orderItems" entry="orderItem">
<clear-field field="inMap"/>
<set field="inMap.orderHeader" from-field="orderHeader"/>
<set field="inMap.orderItem" from-field="orderItem"/>
<set field="inMap.orderAdjustment" from-field="orderAdjustment"/>
<call-service service-name="loadSalesOrderItemFact" in-map-name="inMap"/>
</iterate>
</if-compare>
</if-compare>
</simple-method>
<simple-method method-name="loadSalesOrderItemFact" short-description="">
<set field="orderHeader" from-field="parameters.orderHeader"/>
<set field="orderItem" from-field="parameters.orderItem"/>
<set field="orderAdjustment" from-field="parameters.orderAdjustment"/>
<if-empty field="orderHeader">
<entity-one entity-name="OrderHeader" value-field="orderHeader"/>
</if-empty>
<if-empty field="orderItem">
<entity-one entity-name="OrderItem" value-field="orderItem"/>
</if-empty>
<if-empty field="orderAdjustment">
<entity-and entity-name="OrderAdjustment" list="orderAdjustments">
<field-map field-name="orderId" from-field="orderItem.orderId"/>
</entity-and>
</if-empty>
<if-empty field="orderHeader">
<add-error>
<fail-property resource="OrderErrorUiLabels" property="OrderOrderIdDoesNotExists"/>
</add-error>
</if-empty>
<if-empty field="orderItem">
<add-error>
<fail-property resource="OrderErrorUiLabels" property="OrderOrderItemIdDoesNotExists"/>
</add-error>
</if-empty>
<check-errors/>
<if-compare field="orderHeader.statusId" operator="equals" value="ORDER_APPROVED">
<entity-one entity-name="SalesOrderItemFact" value-field="fact" auto-field-map="false">
<field-map field-name="orderId" from-field="orderItem.orderId"/>
<field-map field-name="orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
</entity-one>
<!-- key handling -->
<if-empty field="fact">
<make-value entity-name="SalesOrderItemFact" value-field="fact"/>
<set field="fact.orderId" from-field="orderHeader.orderId"/>
<set field="fact.orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
<set field="fact.productStoreId" from-field="orderHeader.productStoreId"/>
<set field="fact.salesChannelEnumId" from-field="orderHeader.salesChannelEnumId"/>
<set field="fact.statusId" from-field="orderItem.statusId"/>
<!-- account -->
<if-not-empty field="orderHeader.productStoreId">
<entity-one entity-name="ProductStore" value-field="account">
<field-map field-name="productStoreId" from-field="orderHeader.productStoreId"/>
</entity-one>
<set field="fact.account" from-field="account.storeName"/>
</if-not-empty>
<!-- pod -->
<if-compare field="orderHeader.currencyUom" operator="equals" value="EUR">
<set field="fact.pod" value="Latin"/>
<else>
<set field="fact.pod" value="English"/>
</else>
</if-compare>
<!-- brand -->
<if-not-empty field="orderHeader.salesChannelEnumId">
<entity-one entity-name="Enumeration" value-field="brand">
<field-map field-name="enumId" from-field="orderHeader.salesChannelEnumId"/>
</entity-one>
<set field="fact.brand" from-field="brand.description"/>
</if-not-empty>
<!-- conversion of the order date -->
<entity-condition entity-name="OrderStatus" list="orderStatusList">
<condition-list combine="and">
<condition-expr field-name="orderId" from-field="orderHeader.orderId"/>
<condition-expr field-name="statusId" value="ORDER_APPROVED"/>
</condition-list>
<order-by field-name="-statusDatetime"/>
</entity-condition>
<first-from-list list="orderStatusList" entry="orderStatus"/>
<if-not-empty field="orderStatus.statusDatetime">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="DateDimension"/>
<set field="inMap.naturalKeyFields.dateValue" from-field="orderStatus.statusDatetime" type="Date"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.orderDateDimId"/>
</call-service>
<if-empty field="fact.orderDateDimId">
<set field="fact.orderDateDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.orderDateDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- conversion of the product id -->
<if-not-empty field="orderItem.productId">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="ProductDimension"/>
<set field="inMap.naturalKeyFields.productId" from-field="orderItem.productId"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.productDimId"/>
</call-service>
<if-empty field="fact.productDimId">
<set field="fact.productDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.productDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- conversion of the order currency -->
<if-not-empty field="orderHeader.currencyUom">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="CurrencyDimension"/>
<set field="inMap.naturalKeyFields.currencyId" from-field="orderHeader.currencyUom"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.origCurrencyDimId"/>
</call-service>
<if-empty field="fact.origCurrencyDimId">
<set field="fact.origCurrencyDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.origCurrencyDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- productCategoryId -->
<entity-and entity-name="ProductCategoryMember" list="productCategoryMembers">
<field-map field-name="productId" from-field="orderItem.productId"/>
<field-map field-name="thruDate" from-field="nullField"/>
</entity-and>
<if-not-empty field="productCategoryMembers">
<first-from-list list="productCategoryMembers" entry="productCategoryMember"/>
<set field="fact.productCategoryId" from-field="productCategoryMember.productCategoryId"/>
</if-not-empty>
<!-- TODO -->
<set field="fact.billToCustomerDimId" value="_NA_"/>
<create-value value-field="fact"/>
</if-empty>
<!-- =============== -->
<!-- facts handling -->
<!-- =============== -->
<set field="fact.quantity" from-field="orderItem.quantity" type="BigDecimal"/>
<set field="fact.extGrossAmount" value="0" type="BigDecimal"/>
<set field="fact.extGrossCost" value="0" type="BigDecimal"/>
<set field="fact.extDiscountAmount" value="0" type="BigDecimal"/>
<set field="fact.extNetAmount" value="0" type="BigDecimal"/>
<set field="fact.extShippingAmount" value="0" type="BigDecimal"/>
<set field="fact.extTaxAmount" value="0" type="BigDecimal"/>
<set field="fact.GS" value="0" type="BigDecimal"/>
<set field="fact.GMS" value="0" type="BigDecimal"/>
<set field="fact.GMP" value="0" type="BigDecimal"/>
<set field="fact.GSS" value="0" type="BigDecimal"/>
<set field="fact.GSC" value="0" type="BigDecimal"/>
<set field="fact.GSP" value="0" type="BigDecimal"/>
<set field="fact.GP" value="0" type="BigDecimal"/>
<set field="fact.countOrder" value="0" type="BigDecimal"/>
<!-- extGrossAmount -->
<set field="convertUomCurrencyMap.uomId" from-field="orderHeader.currencyUom"/>
<set field="convertUomCurrencyMap.uomIdTo" value="USD"/>
<set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/>
<call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap">
<result-to-field result-name="conversionFactor" field="exchangeRate"/>
</call-service>
<if-not-empty field="exchangeRate">
<calculate field="unitPrice">
<calcop field="orderItem.unitPrice" operator="multiply">
<calcop field="exchangeRate" operator="get"/>
</calcop>
</calculate>
<calculate field="fact.extGrossAmount">
<calcop field="fact.quantity" operator="multiply">
<calcop field="unitPrice" operator="get"/>
</calcop>
</calculate>
</if-not-empty>
<!-- extGrossCost -->
<entity-condition entity-name="SupplierProduct" list="costs">
<condition-list combine="and">
<condition-expr field-name="productId" operator="equals" from-field="orderItem.productId"/>
<condition-expr field-name="availableThruDate" operator="equals" from-field="nullField"/>
<condition-expr field-name="minimumOrderQuantity" operator="equals" value="0"/>
</condition-list>
</entity-condition>
<if-not-empty field="costs">
<first-from-list list="costs" entry="cost"/>
<set field="convertUomCurrencyMap.uomId" from-field="cost.currencyUomId"/>
<set field="convertUomCurrencyMap.uomIdTo" value="USD"/>
<set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/>
<call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap">
<result-to-field result-name="conversionFactor" field="exchangeRate"/>
</call-service>
<if-not-empty field="exchangeRate">
<calculate field="costPrice">
<calcop field="cost.lastPrice" operator="multiply">
<calcop field="exchangeRate" operator="get"/>
</calcop>
</calculate>
<calculate field="fact.extGrossCost">
<calcop field="fact.quantity" operator="multiply">
<calcop field="costPrice" operator="get"/>
</calcop>
</calculate>
</if-not-empty>
</if-not-empty>
<!-- extShippingAmount -->
<iterate list="orderAdjustments" entry="shipping">
<if-compare field="shipping.orderAdjustmentTypeId" operator="equals" value="SHIPPING_CHARGES">
<calculate field="fact.extShippingAmount">
<calcop field="fact.extShippingAmount" operator="add">
<calcop field="shipping.amount" operator="get"/>
</calcop>
</calculate>
</if-compare>
</iterate>
<!-- extTaxAmount -->
<iterate list="orderAdjustments" entry="tax">
<if-compare field="tax.orderAdjustmentTypeId" operator="equals" value="SALES_TAX">
<calculate field="fact.extTaxAmount">
<calcop field="fact.extTaxAmount" operator="add">
<calcop field="tax.amount" operator="get"/>
</calcop>
</calculate>
</if-compare>
</iterate>
<!-- extDiscountAmount -->
<iterate list="orderAdjustments" entry="discount">
<if-compare field="discount.orderAdjustmentTypeId" operator="equals" value="PROMOTION_ADJUSTMENT">
<calculate field="fact.extDiscountAmount">
<calcop field="fact.extDiscountAmount" operator="add">
<calcop field="discount.amount" operator="get"/>
</calcop>
</calculate>
<!-- product promo code -->
<entity-and entity-name="ProductPromoCode" list="productPromo">
<field-map field-name="productPromoId" from-field="discount.productPromoId"/>
</entity-and>
<first-from-list list="productPromo" entry="productPromoCode"/>
<if-not-empty field="productPromoCode">
<set field="fact.productPromoCode" from-field="productPromoCode.productPromoCodeId"/>
<else>
<set field="fact.productPromoCode" value="Not require code"/>
</else>
</if-not-empty>
</if-compare>
</iterate>
<!-- extNetAmount -->
<calculate field="fact.extNetAmount">
<calcop field="fact.extGrossAmount" operator="subtract">
<calcop field="fact.extDiscountAmount" operator="get"/>
</calcop>
</calculate>
<!-- GS -->
<set field="countGS" value="0"/>
<entity-and entity-name="SalesOrderItemFact" list="checkGSList">
<field-map field-name="orderId" from-field="orderHeader.orderId"/>
</entity-and>
<iterate list="checkGSList" entry="checkGS">
<if-not-empty field="checkGS.GS">
<if-compare field="checkGS.GS" operator="not-equals" value="0">
<set field="countGS" value="1"/>
</if-compare>
</if-not-empty>
</iterate>
<if-compare field="countGS" operator="equals" value="0">
<set field="convertUomCurrencyMap.uomId" from-field="orderHeader.currencyUom"/>
<set field="convertUomCurrencyMap.uomIdTo" value="USD"/>
<set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/>
<call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap">
<result-to-field result-name="conversionFactor" field="exchangeRate"/>
</call-service>
<if-not-empty field="exchangeRate">
<calculate field="fact.GS">
<calcop field="orderHeader.grandTotal" operator="multiply">
<calcop field="exchangeRate" operator="get"/>
</calcop>
</calculate>
</if-not-empty>
</if-compare>
<!-- GMS -->
<calculate field="fact.GMS">
<calcop field="fact.GMS" operator="add">
<calcop field="fact.extGrossAmount" operator="get"/>
</calcop>
</calculate>
<!-- GMP -->
<calculate field="fact.GMP">
<calcop field="fact.GMS" operator="subtract">
<calcop field="fact.extGrossCost" operator="get"/>
</calcop>
</calculate>
<!-- GSP -->
<set field="countGSP" value="0"/>
<entity-and entity-name="SalesOrderItemFact" list="checkGSPList">
<field-map field-name="orderId" from-field="orderHeader.orderId"/>
</entity-and>
<iterate list="checkGSPList" entry="checkGSP">
<if-not-empty field="checkGSP.GSP">
<if-compare field="checkGSP.GSP" operator="not-equals" value="0">
<set field="countGSP" value="1"/>
</if-compare>
</if-not-empty>
</iterate>
<if-compare field="countGSP" operator="equals" value="0">
<entity-and entity-name="OrderItem" list="orderItemList">
<field-map field-name="orderId" from-field="orderHeader.orderId"/>
</entity-and>
<set field="warrantyPrice" value="0" type="BigDecimal"/>
<iterate list="orderAdjustments" entry="warranty">
<if-compare field="warranty.orderAdjustmentTypeId" operator="equals" value="WARRANTY_ADJUSTMENT">
<calculate field="warrantyPrice">
<calcop field="warrantyPrice" operator="add">
<calcop field="warranty.amount" operator="get"/>
</calcop>
</calculate>
</if-compare>
</iterate>
<calculate field="GSS">
<calcop field="fact.extShippingAmount" operator="add">
<calcop field="warrantyPrice" operator="get"/>
</calcop>
</calculate>
<set field="convertUomCurrencyMap.uomId" from-field="orderHeader.currencyUom"/>
<set field="convertUomCurrencyMap.uomIdTo" value="USD"/>
<set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/>
<call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap">
<result-to-field result-name="conversionFactor" field="exchangeRate"/>
</call-service>
<if-not-empty field="exchangeRate">
<calculate field="GSS">
<calcop field="GSS" operator="multiply">
<calcop field="exchangeRate" operator="get"/>
</calcop>
</calculate>
</if-not-empty>
<set field="fact.GSS" from-field="GSS"/>
<set field="fact.GSP" from-field="GSS" type="BigDecimal"/>
</if-compare>
<!-- GP -->
<calculate field="fact.GP">
<calcop field="fact.GMP" operator="add">
<calcop field="fact.GSP" operator="get"/>
</calcop>
</calculate>
<!-- countOrder -->
<set field="countOrder" value="0"/>
<entity-and entity-name="SalesOrderItemFact" list="checkCountOrderList">
<field-map field-name="orderId" from-field="orderHeader.orderId"/>
</entity-and>
<iterate list="checkCountOrderList" entry="checkCountOrder">
<if-not-empty field="checkCountOrder.countOrder">
<if-compare field="checkCountOrder.countOrder" operator="not-equals" value="0">
<set field="countOrder" value="1"/>
</if-compare>
</if-not-empty>
</iterate>
<if-compare field="countOrder" operator="equals" value="0">
<set field="fact.countOrder" value="1" type="BigDecimal"/>
</if-compare>
<store-value value-field="fact"/>
</if-compare>
</simple-method>
<simple-method method-name="loadSalesOrderDataDaily" short-description="Load Sales Order Data Daily">
<now-date-to-env field="nowDate"/>
<set field="yesterday" value="${groovy:
import java.text.SimpleDateFormat;
def sdf = new SimpleDateFormat(&quot;yyyy-MM-dd 07:00:00.000&quot;);
def yesterday = sdf.format(nowDate-1);
return yesterday;
}" type="Timestamp"/>
<set field="today" value="${groovy:
import java.text.SimpleDateFormat;
def sdf = new SimpleDateFormat(&quot;yyyy-MM-dd 07:00:00.000&quot;);
def today = sdf.format(nowDate);
return today;
}" type="Timestamp"/>
<set field="inMap.fromDate" from-field="yesterday"/>
<set field="inMap.thruDate" from-field="today"/>
<call-service service-name="importSalesOrderData" in-map-name="inMap"></call-service>
</simple-method>
<simple-method method-name="importSalesOrderData" short-description="Import Sales Order Data">
<set-service-fields service-name="loadDateDimension" map="parameters" to-map="inMap"/>
<set field="inMap.fromDate" from-field="parameters.fromDate"/>
<set field="inMap.thruDate" from-field="parameters.thruDate"/>
<call-service service-name="loadDateDimension" in-map-name="inMap"/>
<check-errors/>
<entity-condition entity-name="OrderStatus" list="orderStatusList">
<condition-list combine="and">
<condition-expr field-name="statusId" value="ORDER_APPROVED"/>
<condition-expr field-name="statusDatetime" operator="greater-equals" from-field="parameters.fromDate"/>
<condition-expr field-name="statusDatetime" operator="less" from-field="parameters.thruDate"/>
</condition-list>
</entity-condition>
<iterate list="orderStatusList" entry="orderHeader">
<clear-field field="inMap"/>
<set field="inMap.orderId" from-field="orderHeader.orderId"/>
<call-service service-name="loadSalesOrderFact" in-map-name="inMap"></call-service>
<check-errors/>
</iterate>
</simple-method>
<simple-method method-name="convertUomCurrency" short-description="Convert Uom Currency from UomConversionDated entity">
<if-empty field="parameters.nowDate">
<now field="now"/>
<set field="parameters.nowDate" from-field="now"/>
</if-empty>
<entity-condition entity-name="UomConversionDated" list="UomConversionDatedList">
<condition-list combine="and">
<condition-expr field-name="uomId" operator="equals" from-field="parameters.uomId"/>
<condition-expr field-name="uomIdTo" operator="equals" from-field="parameters.uomIdTo"/>
<condition-expr field-name="fromDate" operator="less-equals" from-field="parameters.nowDate"/>
<condition-expr field-name="thruDate" operator="greater" from-field="parameters.nowDate"/>
</condition-list>
<order-by field-name="-fromDate"/>
</entity-condition>
<if-not-empty field="UomConversionDatedList">
<first-from-list list="UomConversionDatedList" entry="UomConversion"/>
<field-to-result field="UomConversion.conversionFactor" result-name="conversionFactor"/>
<else>
<entity-condition entity-name="UomConversionDated" list="UomConversionDatedLastestList">
<condition-list combine="and">
<condition-expr field-name="uomId" operator="equals" from-field="parameters.uomId"/>
<condition-expr field-name="uomIdTo" operator="equals" from-field="parameters.uomIdTo"/>
<condition-expr field-name="thruDate" operator="equals" from-field="nullField"/>
</condition-list>
</entity-condition>
<if-not-empty field="UomConversionDatedLastestList">
<first-from-list list="UomConversionDatedLastestList" entry="UomConversionLastest"/>
<field-to-result field="UomConversionLastest.conversionFactor" result-name="conversionFactor"/>
</if-not-empty>
</else>
</if-not-empty>
</simple-method>
<simple-method method-name="loadInventoryFact" short-description="">
<entity-one entity-name="InventoryItem" value-field="inventory">
<field-map field-name="inventoryItemId" from-field="parameters.inventoryItemId"/>
</entity-one>
<entity-one entity-name="InventoryItemFact" value-field="fact">
<field-map field-name="inventoryItemId" from-field="parameters.inventoryItemId"/>
</entity-one>
<if-empty field="fact">
<make-value entity-name="InventoryItemFact" value-field="fact"/>
<set field="fact.inventoryItemId" from-field="inventory.inventoryItemId"/>
<!-- conversion of the inventory date -->
<if-not-empty field="inventory.createdStamp">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="DateDimension"/>
<set field="inMap.naturalKeyFields.dateValue" from-field="inventory.createdStamp" type="Date"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.inventoryDateDimId"/>
</call-service>
<if-empty field="fact.inventoryDateDimId">
<set field="fact.inventoryDateDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.inventoryDateDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- conversion of the product id -->
<if-not-empty field="inventory.productId">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="ProductDimension"/>
<set field="inMap.naturalKeyFields.productId" from-field="inventory.productId"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.productDimId"/>
</call-service>
<if-empty field="fact.productDimId">
<set field="fact.productDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.productDimId" value="_NA_"/>
</else>
</if-not-empty>
<!-- conversion of the order currency -->
<if-not-empty field="inventory.currencyUomId">
<clear-field field="inMap"/>
<set field="inMap.dimensionEntityName" value="CurrencyDimension"/>
<set field="inMap.naturalKeyFields.currencyId" from-field="inventory.currencyUomId"/>
<call-service service-name="getDimensionIdFromNaturalKey" in-map-name="inMap">
<result-to-field result-name="dimensionId" field="fact.origCurrencyDimId"/>
</call-service>
<if-empty field="fact.origCurrencyDimId">
<set field="fact.origCurrencyDimId" value="_NF_"/>
</if-empty>
<else>
<set field="fact.origCurrencyDimId" value="_NA_"/>
</else>
</if-not-empty>
<create-value value-field="fact"/>
</if-empty>
<set field="fact.facilityId" from-field="inventory.facilityId"/>
<set field="fact.inventoryItemId" from-field="inventory.inventoryItemId"/>
<set field="fact.quantityOnHandTotal" from-field="inventory.quantityOnHandTotal"/>
<set field="fact.availableToPromiseTotal" from-field="inventory.availableToPromiseTotal"/>
<set field="fact.unitCost" from-field="inventory.unitCost"/>
<!-- calculate sold out amount -->
<calculate field="fact.soldoutAmount">
<calcop operator="get" field="inventory.quantityOnHandTotal">
<calcop operator="negative" field="inventory.availableToPromiseTotal"/>
</calcop>
</calculate>
<store-value value-field="fact"/>
</simple-method>
</simple-methods>
+2 -1
View File
@@ -20,7 +20,7 @@ under the License.
<ofbiz-component name="bi" enabled="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>
@@ -43,6 +43,7 @@ under the License.
<webapp name="bi"
title="Business Intelligence"
position="16"
menu-name="secondary"
server="default-server"
location="webapp/bi"
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/service-eca.xsd">
<!-- dimension entities -->
<eca service="createProduct" event="global-commit-post-run">
+31 -31
View File
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<service name="storeGenericDimension" engine="java"
location="org.apache.ofbiz.bi.util.DimensionServices" invoke="storeGenericDimension" auth="true">
@@ -35,8 +35,8 @@ under the License.
<attribute name="naturalKeyFields" type="Map" mode="IN" optional="false"/> <!-- the names/values pairs of the fields that compose the natural key of the dimension -->
<attribute name="dimensionId" type="String" mode="OUT" optional="true"/>
</service>
<service name="quickInitDataWarehouse" auth="true" engine="simple"
location="component://bi/minilang/DimensionServices.xml" invoke="quickInitDataWarehouse">
<service name="quickInitDataWarehouse" auth="true" engine="groovy"
location="component://bi/groovyScripts/DimensionServices.groovy" invoke="quickInitDataWarehouse">
<description>Quickly initialize the dimensions (Currency, Date, Product) and facts (SalesInvoiceItem): useful to quickly initialize the datawarehouse.</description>
<attribute name="fromDate" type="Timestamp" mode="IN" optional="false"/>
<attribute name="thruDate" type="Timestamp" mode="IN" optional="false"/>
@@ -49,44 +49,44 @@ under the License.
<attribute name="fromDate" type="Timestamp" mode="IN" optional="false"/>
<attribute name="thruDate" type="Timestamp" mode="IN" optional="false"/>
</service>
<service name="loadCurrencyDimension" auth="true" engine="simple"
location="component://bi/minilang/DimensionServices.xml" invoke="loadCurrencyDimension">
<service name="loadCurrencyDimension" auth="true" engine="groovy"
location="component://bi/groovyScripts/DimensionServices.groovy" invoke="loadCurrencyDimension">
<description>Loads data in the CurrencyDimension entity (olap entity) using the update strategy of 'type 1': overwrite the values of the attributes</description>
</service>
<!-- Product Dimension -->
<service name="prepareProductDimensionData" auth="true" engine="simple"
location="component://bi/minilang/DimensionServices.xml" invoke="prepareProductDimensionData">
<service name="prepareProductDimensionData" auth="true" engine="groovy"
location="component://bi/groovyScripts/DimensionServices.groovy" invoke="prepareProductDimensionData">
<description>Pulls information from the Product* entities (oltp entities) and prepares data for the ProductDimension entity (olap entity)</description>
<attribute name="productId" type="String" mode="IN" optional="false"/>
<attribute name="productDimension" type="GenericEntity" mode="OUT" optional="false"/>
</service>
<service name="loadProductInProductDimension" auth="true" engine="simple"
location="component://bi/minilang/DimensionServices.xml" invoke="loadProductInProductDimension">
<service name="loadProductInProductDimension" auth="true" engine="groovy"
location="component://bi/groovyScripts/DimensionServices.groovy" invoke="loadProductInProductDimension">
<description>Pulls information from the Product* entities and stores them in the ProductDimension entity (olap entity)</description>
<attribute name="productId" type="String" mode="IN" optional="false"/>
<attribute name="updateMode" type="String" mode="IN" optional="false"/> <!-- TYPE1, TYPE2, TYPE3 -->
</service>
<service name="loadType1ProductInProductDimension" auth="true" engine="simple"
location="component://bi/minilang/DimensionServices.xml" invoke="loadProductInProductDimension">
<service name="loadType1ProductInProductDimension" auth="true" engine="groovy"
location="component://bi/groovyScripts/DimensionServices.groovy" invoke="loadProductInProductDimension">
<description>Same as loadProductInProductDimension; the update strategy is 'type 1': overwrite the values of the attributes</description>
<attribute name="productId" type="String" mode="IN" optional="false"/>
<attribute name="updateMode" type="String" mode="IN" optional="true" default-value="TYPE1"/>
</service>
<service name="loadType2ProductInProductDimension" auth="true" engine="simple"
location="component://bi/minilang/DimensionServices.xml" invoke="loadProductInProductDimension">
<service name="loadType2ProductInProductDimension" auth="true" engine="groovy"
location="component://bi/groovyScripts/DimensionServices.groovy" invoke="loadProductInProductDimension">
<description>Same as loadProductInProductDimension; the update strategy is 'type 2': add a dimension row</description>
<attribute name="productId" type="String" mode="IN" optional="false"/>
<attribute name="updateMode" type="String" mode="IN" optional="true" default-value="TYPE2"/>
</service>
<service name="loadAllProductsInProductDimension" auth="true" engine="simple"
location="component://bi/minilang/DimensionServices.xml" invoke="loadAllProductsInProductDimension">
<service name="loadAllProductsInProductDimension" auth="true" engine="groovy"
location="component://bi/groovyScripts/DimensionServices.groovy" invoke="loadAllProductsInProductDimension">
<description>Calls the loadProductInProductDimension service for all the products.</description>
<attribute name="updateMode" type="String" mode="IN" optional="true" default-value="TYPE1"/>
</service>
<!-- Accounting Facts -->
<service name="loadSalesInvoiceItemFact" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="loadSalesInvoiceItemFact">
<service name="loadSalesInvoiceItemFact" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="loadSalesInvoiceItemFact">
<description>
Pulls information from the Invoice* entities and stores them in the SalesInvoiceItem entity (olap entity).
One of invoiceId/invoiceItemSeqId or invoice/invoiceItem must be passed or an error is returned.
@@ -96,15 +96,15 @@ under the License.
<attribute name="invoice" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
<attribute name="invoiceItem" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
</service>
<service name="loadSalesInvoiceFact" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="loadSalesInvoiceFact">
<service name="loadSalesInvoiceFact" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="loadSalesInvoiceFact">
<description>Calls the loadSalesInvoiceItemFact service for all the invoice items.</description>
<attribute name="invoiceId" type="String" mode="IN" optional="false"/>
</service>
<!-- Order Facts -->
<service name="loadSalesOrderItemFact" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="loadSalesOrderItemFact">
<service name="loadSalesOrderItemFact" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="loadSalesOrderItemFact">
<description>
Pulls information from the OrderItem* entities and stores them in the SalesOrderItem entity (olap entity).
One of orderId/orderItemSeqId or order/orderItem must be passed or an error is returned.
@@ -115,23 +115,23 @@ under the License.
<attribute name="orderItem" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
<attribute name="orderAdjustment " type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
</service>
<service name="loadSalesOrderFact" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="loadSalesOrderFact">
<service name="loadSalesOrderFact" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="loadSalesOrderFact">
<description>Calls the loadSalesOrderItemFact service for all the order items.</description>
<attribute name="orderId" type="String" mode="IN" optional="false"/>
</service>
<service name="loadSalesOrderDataDaily" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="loadSalesOrderDataDaily" transaction-timeout="10000000">
<service name="loadSalesOrderDataDaily" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="loadSalesOrderDataDaily" transaction-timeout="10000000">
<description>Load Sales Order Data Daily.</description>
</service>
<service name="importSalesOrderData" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="importSalesOrderData" transaction-timeout="10000000">
<service name="importSalesOrderData" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="importSalesOrderData" transaction-timeout="10000000">
<description>Import Sales Order Data.</description>
<attribute name="fromDate" type="Timestamp" mode="IN" optional="false"/>
<attribute name="thruDate" type="Timestamp" mode="IN" optional="false"/>
</service>
<service name="convertUomCurrency" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="convertUomCurrency">
<service name="convertUomCurrency" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="convertUomCurrency">
<description>Import Sales Order Data.</description>
<attribute name="uomId" type="String" mode="IN"/>
<attribute name="uomIdTo" type="String" mode="IN"/>
@@ -140,8 +140,8 @@ under the License.
</service>
<!-- Inventory Facts -->
<service name="loadInventoryFact" auth="true" engine="simple"
location="component://bi/minilang/FactServices.xml" invoke="loadInventoryFact">
<service name="loadInventoryFact" auth="true" engine="groovy"
location="component://bi/groovyScripts/FactServices.groovy" invoke="loadInventoryFact">
<attribute name="inventoryItemId" type="String" mode="IN" optional="true"/>
</service>
@@ -18,8 +18,6 @@ under the License.
*/
package org.apache.ofbiz.bi.util;
import java.lang.Object;
import java.lang.String;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@@ -41,8 +39,8 @@ import org.apache.ofbiz.service.ServiceUtil;
public class DimensionServices {
public static final String module = DimensionServices.class.getName();
public static final String resource = "BiUiLabels";
private static final String MODULE = DimensionServices.class.getName();
private static final String RESOURCE = "BiUiLabels";
public static Map<String, Object> getDimensionIdFromNaturalKey(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> resultMap = ServiceUtil.returnSuccess();
@@ -65,7 +63,7 @@ public class DimensionServices {
public static Map<String, Object> storeGenericDimension(DispatchContext ctx, Map<String, ? extends Object> context) {
Delegator delegator = ctx.getDelegator();
GenericValue dimensionValue = (GenericValue) context.get("dimensionValue");
List<String> naturalKeyFields = UtilGenerics.checkList(context.get("naturalKeyFields"), String.class);
List<String> naturalKeyFields = UtilGenerics.checkCollection(context.get("naturalKeyFields"), String.class);
String updateMode = (String) context.get("updateMode");
Locale locale = (Locale) context.get("locale");
@@ -75,7 +73,8 @@ public class DimensionServices {
andCondition.put(naturalKeyField, dimensionValue.get(naturalKeyField));
}
if (andCondition.isEmpty()) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "BusinessIntelligenceNaturalKeyWithourDimension", UtilMisc.toMap("naturalKeyFields", naturalKeyFields, "dimensionValue", dimensionValue), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "BusinessIntelligenceNaturalKeyWithourDimension",
UtilMisc.toMap("naturalKeyFields", naturalKeyFields, "dimensionValue", dimensionValue), locale));
}
List<GenericValue> existingDimensionValues = null;
try {
@@ -99,7 +98,8 @@ public class DimensionServices {
dimensionValue.set("dimensionId", delegator.getNextSeqId(dimensionValue.getEntityName()));
dimensionValue.create();
} else {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "BusinessIntelligenceUpdateModeStillNotSupported", UtilMisc.toMap("updateMode", updateMode), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "BusinessIntelligenceUpdateModeStillNotSupported",
UtilMisc.toMap("updateMode", updateMode), locale));
}
}
} catch (GenericEntityException gee) {
@@ -157,7 +157,7 @@ public class DimensionServices {
dateValue.set("yearName", Long.valueOf(calendar.get(Calendar.YEAR)));
dateValue.set("weekOfMonth", Long.valueOf(calendar.get(Calendar.WEEK_OF_MONTH)));
dateValue.set("weekOfYear", Long.valueOf(calendar.get(Calendar.WEEK_OF_YEAR)));
dateValue.set("weekdayType", (dayOfWeek == 1 || dayOfWeek == 7? "Weekend": "Weekday"));
dateValue.set("weekdayType", (dayOfWeek == 1 || dayOfWeek == 7 ? "Weekend" : "Weekday"));
dateValue.set("yearMonthDay", yearMonthDayFormat.format(currentDate));
dateValue.set("yearAndMonth", yearMonthFormat.format(currentDate));
+10 -1
View File
@@ -18,7 +18,7 @@
under the License.
-->
<web-app version="3.0">
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>Apache OFBiz - Business Intelligence</display-name>
<description>Business Intelligence component of the Apache OFBiz Project</description>
@@ -57,6 +57,11 @@
<filter-name>ContextFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class>
</filter>
<filter>
<display-name>SameSiteFilter</display-name>
<filter-name>SameSiteFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.SameSiteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ControlFilter</filter-name>
<url-pattern>/*</url-pattern>
@@ -65,6 +70,10 @@
<filter-name>ContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SameSiteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener><listener-class>org.apache.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
<listener><listener-class>org.apache.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
+4
View File
@@ -33,6 +33,7 @@ under the License.
<set field="applicationMenuName" value="BiAppBar" global="true"/>
<set field="applicationMenuLocation" value="component://bi/widget/BiMenus.xml" global="true"/>
<set field="applicationTitle" from-field="uiLabelMap.BusinessIntelligenceApplication" global="true"/>
<set field="helpAnchor" from-field="helpAnchor" default-value="_apache_ofbiz_plugins"/>
</actions>
<widgets>
<include-screen name="ApplicationDecorator" location="component://commonext/widget/CommonScreens.xml"/>
@@ -99,6 +100,9 @@ under the License.
<screen name="main">
<section>
<condition>
<if-has-permission permission="BI" action="_VIEW"/>
</condition>
<actions>
<set field="titleProperty" value="BusinessIntelligenceMainPage"/>
<set field="headerItem" value="main"/>
+1 -5
View File
@@ -1,12 +1,8 @@
![Apache OFBiz® logo](http://ofbiz.apache.org/images/OFBiz-logo.png) And
![Apache OFBiz® logo](https://camo.githubusercontent.com/b313d4ec52b77b5024e2988aaf76720258233e69/68747470733a2f2f6f6662697a2e6170616368652e6f72672f696d616765732f6f6662697a5f6c6f676f2e706e67)
![Birt Logo](http://www.eclipse.org/birt/img/logo/Birt-logo.png)
# Birt component
For more information about this component visit the [https://cwiki.apache.org/confluence/display/OFBIZ/Using+BIRT+with+OFBiz](https://cwiki.apache.org/confluence/display/OFBIZ/Using+BIRT+with+OFBiz) page in the OFBiz wiki
Information about the birt product can be found at: [http://www.eclipse.org/birt/](http://www.eclipse.org/birt/)
JIRA issues related to this component can be found at [https://issues.apache.org/jira/browse/OFBIZ/component/12321022](https://issues.apache.org/jira/browse/OFBIZ/component/12321022 "Jira")
Committed revisions can be viewed at [http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/birt/](http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/birt/ "Svn")
Information on the OFBiz Flexible Birt Reports are at [https://cwiki.apache.org/confluence/display/OFBIZ/Birt+Flexible+Reports](https://cwiki.apache.org/confluence/display/OFBIZ/Birt+Flexible+Reports)
+1 -1
View File
@@ -20,7 +20,7 @@
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="BirtErrorCannotDetermineDataSource">
<value xml:lang="en">Failed to determine data source for report</value>
<value xml:lang="fr">La détermination de la source de données à échoué</value>
+1 -1
View File
@@ -18,7 +18,7 @@
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
<property key="BirtApplication">
<value xml:lang="en">Eclipse BIRT Application</value>
<value xml:lang="fr">Application Eclipse Birt</value>
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entity-engine-xml>
<DataResource dataResourceId="HELP_BIRT" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="plugins/birt/data/helpdata/HELP_BIRT.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS"
dataResourceName="BIRT" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="HELP_BIRT" contentTypeId="DOCUMENT" contentName="BIRT Overview" templateDataResourceId="HELP_TEMPL"
dataResourceId="HELP_BIRT" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
<ContentAssoc contentId="HELP_ROOT" contentIdTo="HELP_BIRT" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" mapKey="BIRT_main"/>
</entity-engine-xml>
-6
View File
@@ -18,12 +18,6 @@
under the License.
-->
<entity-engine-xml>
<SecurityPermission permissionId="BIRT_ADMIN" description="ALL Birt component operations"/>
<SecurityPermission permissionId="BIRT_CREATE" description="Create report from master"/>
<SecurityPermission permissionId="BIRT_UPDATE" description="Update operations for reports"/>
<SecurityPermission permissionId="BIRT_DELETE" description="Delete reports"/>
<SecurityPermission permissionId="BIRT_VIEW" description="View and use all birt reports"/>
<SecurityGroup groupId="BIRTADMIN" description="Birt - admin"/>
<SecurityGroup groupId="BIRTUSER" description="Birt - user"/>
@@ -7,9 +7,9 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,14 +17,10 @@
specific language governing permissions and limitations
under the License.
-->
<section xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="5.0" xmlns:xl="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="http://docbook.org/ns/docbook ../../../content/dtd/docbook.xsd"
xmlns="http://docbook.org/ns/docbook">
<title>Project help</title>
<section>
<para>
This screen displays Informations of the project. There are sprint, member and other.
</para>
</section>
</section>
<entity-engine-xml>
<SecurityPermission permissionId="BIRT_ADMIN" description="ALL Birt component operations"/>
<SecurityPermission permissionId="BIRT_CREATE" description="Create report from master"/>
<SecurityPermission permissionId="BIRT_UPDATE" description="Update operations for reports"/>
<SecurityPermission permissionId="BIRT_DELETE" description="Delete reports"/>
<SecurityPermission permissionId="BIRT_VIEW" description="View and use all birt reports"/>
</entity-engine-xml>
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entity-engine-xml>
<DataResource dataResourceId="HELP_EXAMPLE" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="plugins/example/data/helpdata/HELP_EXAMPLE.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS"
dataResourceName="Framework Example" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="HELP_EXAMPLE" contentTypeId="DOCUMENT" contentName="Framework Example" templateDataResourceId="HELP_TEMPL"
dataResourceId="HELP_EXAMPLE" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
<ContentAssoc contentId="HELP_ROOT" contentIdTo="HELP_EXAMPLE" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000"/>
<DataResource dataResourceId="HELP_EXAMPLE_FR" localeString="fr" dataResourceTypeId="OFBIZ_FILE"
objectInfo="plugins/example/data/helpdata/HELP_EXAMPLE_FR.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS"
dataResourceName="Exemple pour le développement" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="HELP_EXAMPLE_FR" contentTypeId="DOCUMENT" contentName="Exemple pour le développement" templateDataResourceId="HELP_TEMPL"
dataResourceId="HELP_EXAMPLE_FR" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html" localeString="fr" />
<ContentAssoc contentId="HELP_EXAMPLE" contentIdTo="HELP_EXAMPLE_FR" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2006-01-12 01:01:01"/>
<DataResource dataResourceId="EXAMPLE_main" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="plugins/example/data/helpdata/HELP_EXAMPLE_main.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Example help main page" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EXAMPLE_main" contentTypeId="DOCUMENT" contentName="Example main menu." templateDataResourceId="HELP_TEMPL" dataResourceId="EXAMPLE_main" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
<ContentAssoc contentId="HELP_EXAMPLE" contentIdTo="EXAMPLE_main" mapKey="EXAMPLE_main" fromDate="2006-01-12 01:01:01" contentAssocTypeId="TREE_CHILD" sequenceNum="000"/>
<ContentAssoc contentId="HELP_EXAMPLE" contentIdTo="EXAMPLE_main" mapKey="EXAMPLE_FindExample" fromDate="2006-01-12 01:01:02" sequenceNum="000" contentAssocTypeId="INSTANCE"/>
<DataResource dataResourceId="EXAMPLE_docbook" localeString="en" dataResourceTypeId="OFBIZ_FILE"
objectInfo="plugins/example/data/helpdata/HELP_EXAMPLE_docbook.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Example docBook usage" mimeTypeId="text/xml" isPublic="Y" />
<Content contentId="EXAMPLE_docbook" contentTypeId="DOCUMENT" contentName="Example Docbook usage" templateDataResourceId="HELP_TEMPL" dataResourceId="EXAMPLE_docbook" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
<ContentAssoc contentId="HELP_EXAMPLE" contentIdTo="EXAMPLE_docbook" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="EXAMPLE_docbook"/>
</entity-engine-xml>
-87
View File
@@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<section xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5.0"
xmlns:xl="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="http://docbook.org/ns/docbook ../../../content/dtd/docbook.xsd"
xmlns="http://docbook.org/ns/docbook">
<title>OFBiz BIRT Overview</title>
<para>
Welcome to OFBiz BIRT. The part installed within OFBiz allows you to run the reports which are prepared using Eclipse with the BIRT plugin installed.
</para>
<para>
This is a short document to help you get started using BIRT to make a report.
</para>
<para>
As a demo we have prepared a an example report.
Look at the <link xl:href="http://eclipse.org/birt/phoenix/">Eclipse BIRT web site</link> for more information.
</para>
<para>
-
</para>
<para>
There is also a new feature (2017) which allows you to dynamically create Birt reports, and allow your users to customise them: the OFBiz Flexible Reports.
</para>
<para>
Look at the <link xl:href="https://cwiki.apache.org/confluence/display/OFBIZ/Birt+Flexible+Reports">the official documentation</link> for more information.
</para>
<section>
<title>1. PDF tab</title>
<para>When you click on this tab. It will render the example report in a PDF format</para>
</section>
<section>
<title>2. Send any format through Mail tab</title>
<para>When you click on this tab. It will show a form that can send the report per email.</para>
</section>
<section>
<title>3. Chart tab</title>
<para>When you click on this tab. An example chart will render in a PDF format</para>
</section>
<section>
<title>Examine the Example Report</title>
<para>
The example report that run in OFBiz is in the file component://birt/webapp/birt/report/example.rptdesign. When you have started Eclipse BIRT, open this document.
This report show how a report receives data from OFBiz through Scripted Data Source using the OFBiz delegator.
This report has the scripted data source name "OFBiz" and the data set that use the script data source name is called "Product".
Open the script editor for Product data set, it uses the delegator object query data from the Product entity.
A report that runs on the OFBiz platform can use the delegator object, dispatcher object, security object and classpath of OFBiz environment in the script.</para>
</section>
<section>
<title>How do I send parameter to report?</title>
<para>If a report is to be rendered through a view map, you can send a parameter through attribute of the request object, the attribute's name is "birtParameters" which is a map.</para>
<para>If a report is to be rendered through an e-mail, you can send the parameter through the service's parameter name called birtParameters.</para>
</section>
<section>
<title>Which are the supported content types?</title>
<para>Excel (.xls)</para>
<para>Excel (.xlsx)</para>
<para>LibreOffice Calc (.ods)</para>
<para>LibreOffice Impress (.odp)</para>
<para>LibreOffice Writer (.odt)</para>
<para>Pdf (.pdf)</para>
<para>Postscript (.ps)</para>
<para>Powerpoint (.ppt)</para>
<para>Powerpoint (.pptx)</para>
<para>Text (.html)</para>
<para>Word (.doc)</para>
<para>Word (.docx)</para>
</section>
</section>
-29
View File
@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<chapter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5.0"
xmlns:xl="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="http://docbook.org/ns/docbook ../../applications/content/dtd/docbook.xsd"
xmlns="http://docbook.org/ns/docbook">
<title>BIRT report generator.</title>
<para> An example report sales can be found in the example component. </para>
<para>
<xi:include href="../../../plugins/birt/data/helpdata/HELP_BIRT.xml"/>
</para>
</chapter>
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
<title>View definitions for master report services</title>
<description>None</description>
<version>1.0</version>
@@ -17,8 +17,6 @@
* under the License.
*/
def module = "AcctgTransEntriesSearchResultsParameters.groovy"
try {
def birtParameters = [:]
birtParameters.organizationPartyId = parameters.organizationPartyId
@@ -43,6 +41,6 @@ try {
birtParameters.userLoginId = userLogin.userLoginId
request.setAttribute("birtParameters", birtParameters)
} catch (e) {
Debug.logError(e, module)
logError(e)
}
return "success";
@@ -18,9 +18,6 @@
*/
import java.sql.Timestamp
import org.apache.ofbiz.base.util.Debug
def module = "BalanceSheetParameters.groovy"
try {
def birtParameters = [:]
@@ -36,6 +33,6 @@ try {
birtParameters.locale = locale
request.setAttribute("birtParameters", birtParameters)
} catch (e) {
Debug.logError(e, module)
logError(e)
}
return "success";
@@ -18,9 +18,6 @@
*/
import java.sql.Timestamp
import org.apache.ofbiz.base.util.Debug
def module = "IncomeStatementParameters.groovy"
try {
def birtParameters = [:]
@@ -35,6 +32,6 @@ try {
birtParameters.userLoginId = userLogin.userLoginId
request.setAttribute("birtParameters", birtParameters)
} catch (e) {
Debug.logError(e, module)
logError(e)
}
return "success";
@@ -17,14 +17,12 @@
* under the License.
*/
def module = "InvoiceAcctgTransEntryParameters.groovy"
try {
birtParameters = [:]
birtParameters.invoiceId = parameters.invoiceId
birtParameters.userLoginId = userLogin.userLoginId
request.setAttribute("birtParameters", birtParameters)
} catch (e) {
Debug.logError(e, module)
logError(e)
}
return "success";
@@ -17,14 +17,12 @@
* under the License.
*/
def module = "PaymentAcctgTransEntryParameters.groovy"
try {
birtParameters = [:]
birtParameters.paymentId = parameters.paymentId
birtParameters.userLoginId = userLogin.userLoginId
request.setAttribute("birtParameters", birtParameters)
} catch (e) {
Debug.logError(e, module)
logError(e)
}
return "success";
@@ -17,8 +17,6 @@
* under the License.
*/
def module = "TrialBalanceParameters.groovy"
try {
def birtParameters = [:]
birtParameters.organizationPartyId = parameters.organizationPartyId
@@ -26,6 +24,6 @@ try {
birtParameters.userLoginId = userLogin.userLoginId
request.setAttribute("birtParameters", birtParameters)
} catch (e) {
Debug.logError(e, module)
logError(e)
}
return "success";
+13 -13
View File
@@ -22,17 +22,17 @@ import org.apache.ofbiz.base.util.UtilValidate
reportBy = parameters.reportBy
exportType = parameters.exportType
if (UtilValidate.isEmpty(parameters.fromDate)) {
if (!parameters.fromDate) {
request.setAttribute("_ERROR_MESSAGE_", "Please select From Date.")
return "error"
}
if (exportType == "pdf") {
if (reportBy == "day") {
if ("pdf" == exportType) {
if ("day" == reportBy) {
return "dayPDF"
} else if (reportBy == "week") {
} else if ("week" == reportBy) {
return "weekPDF"
} else if (reportBy == "month") {
} else if ("month" == reportBy) {
return "monthPDF"
} else {
request.setAttribute("_ERROR_MESSAGE_", "Please select Report By.")
@@ -40,12 +40,12 @@ if (exportType == "pdf") {
}
}
if (exportType == "excel") {
if (reportBy == "day") {
if ("excel" == exportType) {
if ("day" == reportBy) {
return "dayExcel"
} else if (reportBy == "week") {
} else if ("week" == reportBy) {
return "weekExcel"
} else if (reportBy == "month") {
} else if ("month" == reportBy) {
return "monthExcel"
} else {
request.setAttribute("_ERROR_MESSAGE_", "Please select Report By.")
@@ -53,12 +53,12 @@ if (exportType == "excel") {
}
}
if (exportType == "html") {
if (reportBy == "day") {
if ("html" == exportType) {
if ("day" == reportBy) {
return "dayHTML"
} else if (reportBy == "week") {
} else if ("week" == reportBy) {
return "weekHTML"
} else if (reportBy == "month") {
} else if ("month"== reportBy) {
return "monthHTML"
} else {
request.setAttribute("_ERROR_MESSAGE_", "Please select Report By.")
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.ofbiz.base.util.Debug
import org.apache.ofbiz.base.util.UtilDatetime
import java.sql.*
@@ -27,11 +26,11 @@ DateDay = DateStr.substring(0,10)
DateMonth = DateStr.substring(5,7)
DateYear = DateStr.substring(0,4)
if (DateMonth == "01"||DateMonth == "03"||DateMonth == "05"||DateMonth == "07"||DateMonth == "08"||DateMonth == "10"||DateMonth == "12")
if ("01" == DateMonth||"03" == DateMonth||"05" == DateMonth||"07" == DateMonth||"08" == DateMonth||"10" == DateMonth||"12" == DateMonth)
{
NunberDate = 31
}
else if (DateMonth == "02")
else if ("02" == DateMonth)
{
NunberDate = 29
}
@@ -48,7 +47,7 @@ try {
birtParameters.DateYear = DateYear
birtParameters.NunberDate = NunberDate
} catch (e) {
Debug.logError(e, "")
logError(e)
}
request.setAttribute("birtParameters", birtParameters)
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.ofbiz.base.util.Debug
import org.apache.ofbiz.base.util.UtilDateTime
import java.sql.*
import com.ibm.icu.util.Calendar
@@ -33,7 +32,7 @@ try
birtParameters.Week = Week
birtParameters.Year = Year
} catch (e) {
Debug.logError(e, "")
logError(e)
}
request.setAttribute("birtParameters", birtParameters)
+1 -2
View File
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.ofbiz.base.util.Debug
import java.sql.*
fromDateStr = parameters.fromDate
@@ -36,7 +35,7 @@ try {
birtParameters.thruMonth = month
birtParameters.thisYear = year
} catch (e) {
Debug.logError(e, "")
logError(e)
}
request.setAttribute("birtParameters", birtParameters)
+5 -3
View File
@@ -20,12 +20,11 @@ under the License.
<ofbiz-component name="birt" enabled="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/BirtHelpData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/BirtTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/OrderPortletData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/BirtSecurityGroupDemoData.xml"/>
@@ -36,7 +35,6 @@ under the License.
<entity-resource type="data" reader-name="demo" loader="main" location="data/example/ExampleSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/example/ExamplePortletData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/example/ExamplePortalSeedData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/example/ExampleHelpData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/example/ExampleDemoData.xml"/>
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/ServiceReportsView.xml"/>
@@ -47,11 +45,13 @@ under the License.
<webapp name="accounting"
title="Accounting"
server="default-server"
position="5"
location="webapp/accounting"
base-permission="OFBTOOLS,ACCOUNTING"
mount-point="/accounting"/>
<webapp name="facility"
title="Facility"
position="3"
description="FacilityComponentDescription"
server="default-server"
location="webapp/facility"
@@ -59,6 +59,7 @@ under the License.
mount-point="/facility"/>
<webapp name="order"
title="Order"
position="4"
description="OrderComponentDescription"
server="default-server"
location="webapp/ordermgr"
@@ -67,6 +68,7 @@ under the License.
<webapp name="birt"
title="BIRT"
position="17"
server="default-server"
location="webapp/birt"
base-permission="OFBTOOLS,WEBTOOLS"
+1 -1
View File
@@ -19,7 +19,7 @@ under the License.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
<description>OFBiz BIRT Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
@@ -1,23 +1,37 @@
=== Report creation
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
==== Introduction
http://www.apache.org/licenses/LICENSE-2.0
NOTE: This feature will begin to be officially available with the R17.12 branch first release
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
=== Report creation
A flexible report is an OFBiz content of FLEXIBLE_REPORT type that allows a final user to make use of the reporting
module to obtain flexible reports, ie reports which are created from an entity or view definition and even from a
service. A flexible report is created from a Report Master (content REPORT_MASTER), and an optional XML override of the
parent form.
==== Introduction
==== Pre-requisite
A flexible report is an OFBiz content of FLEXIBLE_REPORT type that allows a final user to make use of the reporting
module to obtain flexible reports, ie reports which are created from an entity or view definition and even from a
service. A flexible report is created from a Report Master (content REPORT_MASTER), and an optional XML override of the
parent form.
* OFBiz framework
* The Birt plugin
* The BIRT Report Designer: <<#_using_the_birt_report_designer,Using the Birt Report Designer>>
==== Pre-requisite
* OFBiz framework
* The Birt plugin
* The BIRT Report Designer: <<#_using_the_birt_report_designer,Using the Birt Report Designer>>
'''
. Get to Birt component in OFBiz image:Birt-Menus.png[Birt menus]
==== How to do
. Get to Birt component in OFBiz image:Birt-Menus.png[Birt menus]
. Click on the "Flexible Report" menu (varies depending on themes)
. Click on the "Generate report" button, you get to this screen:
. Fill the form: image:Example-Report.png[Example Report]
@@ -26,54 +40,54 @@ parent form.
** The description is a short description which will allow you to recognise the report and its topic.
** The box "Generate filters in design" will add in the design the visualisation of the filters filled in the filtering form.
Once the form is validated, OFBiz will show you the "Edit Report" screen.
Once the form is validated, OFBiz will show you the "Edit Report" screen.
image::Edit-Report-screen.png[Edit Report screen]
image::Edit-Report-screen.png[Edit Report screen]
==== Report information
==== Report information
This first panel allows you to change the report description and status. Actually it does not make sense changing the
status to published before having downloaded the .rptdesign file (Birt Report Designer file) from the server (in
database), edited and uploaded it back to the server. This is explained in the section below. Changing the status allows
users to use your reports. But if you publish without any change the report will render as empty.
This first panel allows you to change the report description and status. Actually it does not make sense changing the
status to published before having downloaded the .rptdesign file (Birt Report Designer file) from the server (in
database), edited and uploaded it back to the server. This is explained in the section below. Changing the status allows
users to use your reports. But if you publish without any change the report will render as empty.
==== The .rptdesign report file: download, edit, upload and publish it
==== The .rptdesign report file: download, edit, upload and publish it
To really use the report you need to download the .rptdesign file from the server in a location from where you can edit
it with the BIRT Report Designer. So you need to install first the BIRT Report Designer. Then you can edit the
.rptdesign file in the BIRT Report Designer. For that refer to <<#_using_the_birt_report_designer,Using the Birt Report
Designer>>.
To really use the report you need to download the .rptdesign file from the server in a location from where you can edit
it with the BIRT Report Designer. So you need to install first the BIRT Report Designer. Then you can edit the
.rptdesign file in the BIRT Report Designer. For that refer to <<#_using_the_birt_report_designer,Using the Birt Report
Designer>>.
===== Editing the downloaded file
===== Editing the downloaded file
Once you installed the BIRT Report Designer and have downloaded the .rptdesign file, you can edit it with the Birt
Report Designer. When you have edited it suiting your needs you must upload it to the server for your changes to be
taken into account by OFBiz.
Once you installed the BIRT Report Designer and have downloaded the .rptdesign file, you can edit it with the Birt
Report Designer. When you have edited it suiting your needs you must upload it to the server for your changes to be
taken into account by OFBiz.
*This is when things begin to be really interesting*. You can then test your report using the "Preview" panel. There you
can temporarily filter the result, and use the export format you prefer, once done click "Send". You can then decide to
change the report content in the Birt Report Designer again or keep your changes. Once done in the Birt Report Designer,
simply select the changed file to upload, and upload it again. You can re-test your changes and continue until you
really get what you want! You can then publish the report to allow users to select and use it. There are 2 ways to
publish a report from the "Manage reports" screen or directly in the "Report information" panel. We will see the "Manage
reports" screen below.
*This is when things begin to be really interesting*. You can then test your report using the "Preview" panel. There you
can temporarily filter the result, and use the export format you prefer, once done click "Send". You can then decide to
change the report content in the Birt Report Designer again or keep your changes. Once done in the Birt Report Designer,
simply select the changed file to upload, and upload it again. You can re-test your changes and continue until you
really get what you want! You can then publish the report to allow users to select and use it. There are 2 ways to
publish a report from the "Manage reports" screen or directly in the "Report information" panel. We will see the "Manage
reports" screen below.
==== Filters Overriding
==== Filters Overriding
You may want to overide the default filters. You can then use the Xml "Override filters" panel to override and
personnalize the form, once done click "Save". If you ignore that step, it will *NOT* prevent the report creation, *it
is already done*, it will just be with the generic filtering form inherited from the master from.
You may want to overide the default filters. You can then use the Xml "Override filters" panel to override and
personnalize the form, once done click "Save". If you ignore that step, it will *NOT* prevent the report creation, *it
is already done*, it will just be with the generic filtering form inherited from the master from.
NOTE: if no preview is available, it is usually due to a mistake in the master form code. You can edit it in the
database.
NOTE: if no preview is available, it is usually due to a mistake in the master form code. You can edit it in the
database.
==== Manage reports
==== Manage reports
The "Manage reports" button get you to a screen which allows to edit (get back to current page), publish or delete a
report.
The "Manage reports" button get you to a screen which allows to edit (get back to current page), publish or delete a
report.
==== Use a report
==== Use a report
Users can select and use any published report from that screen. When they select a report they then get the same
"Preview" Panel and can do the same things than in the "Edit Report" screen. Refer users to
Users can select and use any published report from that screen. When they select a report they then get the same
"Preview" Panel and can do the same things than in the "Edit Report" screen. Refer users to
@@ -0,0 +1,75 @@
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
= BIRT in OFbiz User Interface
Welcome to OFBiz BIRT component. +
The part installed within OFBiz allows you to run the reports which are prepared using Eclipse with the BIRT plugin installed.
This is a short document to help you get started using BIRT to make a report.
As a demo we have prepared a an example report. +
Look at the http://eclipse.org/birt/phoenix/[Eclipse BIRT web site] for more information.
There is also a new feature (2017) which allows you to dynamically create Birt reports, and allow your users to customise them:
the <<_ofbiz_flexible_reports>>.
== PDF tab
When you click on this tab.
It will render the example report in a PDF format
== Send any format through Mail tab
When you click on this tab.
It will show a form that can send the report per email.
== Chart tab
When you click on this tab.
An example chart will render in a PDF format
== Examine the Example Report
The example report design that run in OFBiz is in the file component://birt/webapp/birt/report/example.rptdesign.
When you have started Eclipse BIRT, open this document.
This report show how a report receives data from OFBiz through Scripted Data Source using the OFBiz delegator. +
This report has the scripted data source name "OFBiz" and the data set that use the script data source name is called "Product".
Open the script editor for Product data set, it uses the delegator object query data from the Product entity.
A report that runs on the OFBiz platform can use the delegator object, dispatcher object, security object and classpath of
OFBiz environment in the script.
== How do I send parameter to report?
If a report is to be rendered through a view map, you can send a parameter through attribute of the request object,
the attribute's name is "birtParameters" which is a map.
If a report is to be rendered through an e-mail, you can send the parameter through the service's parameter name called
birtParameters.
== Which are the supported content types?
* Excel (.xls)
* Excel (.xlsx)
* LibreOffice Calc (.ods)
* LibreOffice Impress (.odp)
* LibreOffice Writer (.odt)
* Pdf (.pdf)
* Postscript (.ps)
* Powerpoint (.ppt)
* Powerpoint (.pptx)
* Text (.html)
* Word (.doc)
* Word (.docx)
@@ -1,21 +1,37 @@
=== Using a flexible report
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
==== Introduction
http://www.apache.org/licenses/LICENSE-2.0
NOTE: this feature will be officially available with the R17.12 branch first release
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
=== Using a flexible report
A flexible report is an OFBiz content of FLEXIBLE_REPORT type which allows the final user to obtain reports using the
Birt reporting module. It will be produced at a specific time of your choosing, with your chosen output format,
filtering the data with a few parameters defined during report design creation.
==== Introduction
==== Pre-requisite
NOTE: this feature will be officially available with the R17.12 branch first release
A flexible report is an OFBiz content of FLEXIBLE_REPORT type which allows the final user to obtain reports using the
Birt reporting module. It will be produced at a specific time of your choosing, with your chosen output format,
filtering the data with a few parameters defined during report design creation.
==== Pre-requisite
* OFBiz
* The Birt plugin
* Pre-published reports created from report masters
==== Using the report
==== Using the report
. go to the Birt component or to another page harboring reports.
. In the Birt component, click "Use a report".
. Select your report and hit "Send".
@@ -1,12 +1,30 @@
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
=== Report master creation
==== Introduction
NOTE: this feature will be officially available with the R17.12 branch first release
A report master is an OFBiz content which allows a user to generate data reports.
It defines data connexion, and a general filtering form for data.
It can be based on an entity, a dedicated service, or in a wider sense on any shape
A report master is an OFBiz content which allows a user to generate data reports.
It defines data connexion, and a general filtering form for data.
It can be based on an entity, a dedicated service, or in a wider sense on any shape
a data connexion can take and return back a map.
==== Pre-requisite
@@ -15,19 +33,19 @@ a data connexion can take and return back a map.
* Birt plugin
==== Report Master based on an entity/view
. Create or choice a database entity or view
. Create the general filtering form within the file plugins/birt/widget/birt/BirtMasterForms.xml. The only informations to be changed are entity-name and form name.
+
[source,xml]
----
<form name="CTNT_MASTER_EXAMPLE" type="single" extends="AbstractFlexibleReportSearchForm">
<auto-fields-entity entity-name="Example" default-field-type="find"/>
</form>
----
[start=3]
. Add the informations about this Master in the database using the file
plugins/birt/data/BirtMasterData.xml
. Add the informations about this Master in the database using the file
plugins/birt/data/BirtMasterData.xml
+
[source,xml]
----
<DataResource dataResourceId="DR_MASTER_EXAMPLE" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="FORM_COMBINED" />
@@ -42,13 +60,13 @@ plugins/birt/data/BirtMasterData.xml
<ContentAttribute contentId="CTNT_MASTER_EXAMPLE" attrName="Entity" attrValue="Example"/>
----
The form in the database is the form that will allow users to change form parameters.
You can add any field you desire. Some field names are though reserved: reportContentId, overrideFilters,
+
The form in the database is the form that will allow users to change form parameters.
You can add any field you desire. Some field names are though reserved: reportContentId, overrideFilters,
entityViewName, birtContentType.
[start=4]
. Add in the file content/config/contentEntityLabels.xml the Property that will allow translation
. Add in the file content/config/contentEntityLabels.xml the Property that will allow translation
for your report master description.
+
[source,xml]
----
<property key="Content.description.CTNT_MASTER_EXAMPLE">
@@ -60,41 +78,48 @@ for your report master description.
Your Report Master is created ! You can now create reports using it.
==== Report Master based on a service
In plugins/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java there is 2 sets of dedicated services (see examples there)
. In each set the first service, will return 4 items:
** an object of type Map<String, String> called dataMap.
*Keys*: data field names. *Values*: data types (OFBiz types).
** an object of type Map<String, String> called fieldDisplayLabels.
*Keys*: data field names. *Values*: the names displayed to the user.
This output is optional, should it be missing, the keys will be displayed.
** an object of type Map<String, String> called filterMap.
*Keys*: data filtering field names (exact names used for the form fields).
*Values*: data type (OFBiz type).
This output is optional, if missing, filters can not be displayed on the report.
** an object of type Map<String, String> called filterDisplayLabels.
*Keys*: data filtering field names (exact names used for the form fields).
*Values*: names to be displayed to the user.
This output is optional, should it be missing, the keys will be displayed.
. The second service will actually get the data. It receives an object (Object type) called reportContext.
From this object, you can obtain the map parameters using the following code:
** an object of type Map<String, String> called *dataMap*.
*** *Keys*: data field names.
*** *Values*: data types (OFBiz types).
** an object of type Map<String, String> called *fieldDisplayLabels*.
*** *Keys*: data field names.
*** *Values*: the names displayed to the user.
+
This output is optional, should it be missing, the keys will be displayed.
** an object of type Map<String, String> called *filterMap*.
*** *Keys*: data filtering field names (exact names used for the form fields).
*** *Values*: data type (OFBiz type).
+
This output is optional, if missing, filters can not be displayed on the report.
** an object of type Map<String, String> called *filterDisplayLabels*.
*** *Keys*: data filtering field names (exact names used for the form fields).
*** *Values*: names to be displayed to the user.
+
This output is optional, should it be missing, the keys will be displayed.
. The second service will actually get the data. It receives an object (Object type) called reportContext. +
From this object, you can obtain the map parameters using the following code:
+
[source,java]
----
Map<String, Object> parameters = UtilGenerics.checkMap(reportContext.getParameterValue("parameters"));
----
This Map will give access fields of the filtering form.
This service will return a list of type List<GenericValue>, containing the data.
+
This Map will give access fields of the filtering form. +
This service will return a list of type List<GenericValue>, containing the data. +
A Map<String, Object> would also do.
Then,
. create the parent form in the file plugins/birt/widget/birt/BirtMasterForms.xml.
Field names created here must be the names used on the Map parameters of the previous service,
Field names created here must be the names used on the Map parameters of the previous service,
and also corresponding to the map filterMap.
+
[source,xml]
----
<form name="CTNT_MASTER_TURNOVER" type="single" extends="AbstractFlexibleReportSearchForm">
@@ -104,9 +129,9 @@ and also corresponding to the map filterMap.
<field name="productStoreId"><lookup target-form-name="LookupProductStore"/></field>
</form>
----
[start=2]
. Create the master in database following.
. Create the master in database following.
+
[source,xml]
----
<CustomMethod customMethodId="CM_FB_TURNOVER" customMethodTypeId="FLEXIBLE_BIRT" customMethodName="flexibleReportTurnOver" description="service to resolve invoice for turnover report domain"/>
@@ -125,10 +150,10 @@ and also corresponding to the map filterMap.
<ContentAttribute contentId="CTNT_MASTER_TURNOVER" attrName="Service" attrValue="default"/>
----
The form in the database is the form that will allow users to change form parameters.
You can add any field you desire. Some field names are reserved: reportContentId, overrideFilters,
+
The form in the database is the form that will allow users to change form parameters.
You can add any field you desire. Some field names are reserved: reportContentId, overrideFilters,
entityViewName, birtContentType.
[start=3]
. Import these data in the base using Webtools XML import (or the longer "gradlew 'ofbiz -l readers=seed,ext' command).
. Add in the file content/config/contentEntityLabels.xml the Property which will translate your report Master description.
@@ -1,71 +1,89 @@
=== Using the Birt Report Designer
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
==== Introduction
http://www.apache.org/licenses/LICENSE-2.0
NOTE: this feature will be officially available with the R17.12 branch first release
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
=== Using the Birt Report Designer
The creation of a flexible report goes through a design step of the initial flexible report output under the Birt Report
Designer.
==== Introduction
This document describes the simplest designs to connect to the data. It is not exhaustive, and simply attempts to cover
basic needs. You will find much more documentation online. In our approach, the connection to the data is generated
automatically by OFBiz, only the design part of the report will be discussed.
NOTE: this feature will be officially available with the R17.12 branch first release
==== Installing the BIRT Report Designer
The creation of a flexible report goes through a design step of the initial flexible report output under the Birt Report
Designer.
Installing the BIRT Report Designer is easy. If you use Eclipse, you can include it as a plugin. You can also install
the whole BIRT Report Designer. I use Eclipse but I prefer the second way, to not mix things. So simply download and
install the whole all-in-one thing. Or install the plugin if you prefer and use its "Report Design" view which allows to
edit .rptdesign files.
This document describes the simplest designs to connect to the data. It is not exhaustive, and simply attempts to cover
basic needs. You will find much more documentation online. In our approach, the connection to the data is generated
automatically by OFBiz, only the design part of the report will be discussed.
NOTE: if you installed the BIRT Report Designer under say, a Birt directory, then by default the reports will be
accessed from the Birt\workspace\Report Builder directly and this is where you should put the .rptdesign files when
downloading them. Your mileage may wary...
==== Installing the BIRT Report Designer
==== Different areas of the screen and their role
Installing the BIRT Report Designer is easy. If you use Eclipse, you can include it as a plugin. You can also install
the whole BIRT Report Designer. I use Eclipse but I prefer the second way, to not mix things. So simply download and
install the whole all-in-one thing. Or install the plugin if you prefer and use its "Report Design" view which allows to
edit .rptdesign files.
===== Navigator - Report Builder
NOTE: if you installed the BIRT Report Designer under say, a Birt directory, then by default the reports will be
accessed from the Birt\workspace\Report Builder directly and this is where you should put the .rptdesign files when
downloading them. Your mileage may wary...
This is where you should find the .rptdesign files you downloaded.
==== Different areas of the screen and their role
image::Report-Builder.png[Report Builder]
===== Navigator - Report Builder
===== Data Explorer
This is where you should find the .rptdesign files you downloaded.
The Data Explorer defaults to the right of your screen. It gives you access to two things. The data fields available for
the report, and the filter fields that can be used for this report.
image::Report-Builder.png[Report Builder]
image::Data-Explorer.png[Data Explorer]
===== Data Explorer
===== Palette
The Data Explorer defaults to the right of your screen. It gives you access to two things. The data fields available for
the report, and the filter fields that can be used for this report.
The palette provides the various tools you can insert in the report. Simple text, image, table of data, layout table,
graph, aggregation, etc. All objects are added to the report by drag & drop.
image::Data-Explorer.png[Data Explorer]
image::Palette.png[Palette]
===== Palette
===== Tabs
The palette provides the various tools you can insert in the report. Simple text, image, table of data, layout table,
graph, aggregation, etc. All objects are added to the report by drag & drop.
At the right bottom of the window is a series of five tabs.
image::Palette.png[Palette]
We will use two:
===== Tabs
At the right bottom of the window is a series of five tabs.
We will use two:
* Layout, which will allow most of the design.
* Master Page, which will give access by its owners to standard parameters such as the orientation or size of the report.
The preview is not accessible because it can not be executed outside of OFBiz. Any changes to the scripts will be erased
during the upload in OFBiz.
The preview is not accessible because it can not be executed outside of OFBiz. Any changes to the scripts will be erased
during the upload in OFBiz.
===== Simple design without break
===== Simple design without break
The simplest possible design is to insert in a table (table in the palette), a part or all of the data set data fields.
To do this, right-click on Data Set in the Data Explorer \-> Insert in Layout, and then select the fields you want to
see appear.
The simplest possible design is to insert in a table (table in the palette), a part or all of the data set data fields.
To do this, right-click on Data Set in the Data Explorer \-> Insert in Layout, and then select the fields you want to
see appear.
===== Simple design with break
===== Simple design with break
A break is a collection of data made by Birt from the data. It permits to classify according to a field, and to give
details for each category, then to aggregate certain fields, etc.
A break is a collection of data made by Birt from the data. It permits to classify according to a field, and to give
details for each category, then to aggregate certain fields, etc.
. Insert a table (Table) in the report \-> OK
. Right-click on the table \-> Edit Data Binding, select all fields
@@ -77,40 +95,40 @@ details for each category, then to aggregate certain fields, etc.
** A group detail line
** A footer of the group
** A global footer line
. Then insert some elements in the design: in the global header, everything that does not depend on the group, for example the title of the report. In the header of the group, everything that is common to the whole group and that you want to see in its title. In the details, the fields that may appear for each group line. As in the image below, the fields might be inserted by Copy/Paste from the Data Set, and titles via a text element of the palette. You can add lines and columns by right clicking on the end of the line (gray rectangle when the table is selected), etc.
. Then insert some elements in the design: in the global header, everything that does not depend on the group, for example the title of the report. In the header of the group, everything that is common to the whole group and that you want to see in its title. In the details, the fields that may appear for each group line. As in the image below, the fields might be inserted by Copy/Paste from the Data Set, and titles via a text element of the palette. You can add lines and columns by right clicking on the end of the line (gray rectangle when the table is selected), etc.
image::Design-with-break.png[Design with break]
====== Construction of aggregation
image::Design-with-break.png[Design with break]
====== Construction of aggregation
The aggregations may be on the whole table, or only on a group. They are characterized by an expression to aggregate
(made up of different data fields), a possible filter on the data lines, and an aggregation function, eg:
The aggregations may be on the whole table, or only on a group. They are characterized by an expression to aggregate
(made up of different data fields), a possible filter on the data lines, and an aggregation function, eg:
image::Aggregation-builder.png[Aggregation builder]
image::Aggregation-builder.png[Aggregation builder]
====== Expression builder
====== Expression builder
The _fx_ (for expression and filter) buttons are used to open a complex expression construction window. It is possible
to use predefined functions, Javascript, data fields, already built aggregations, and so on. This window can also be
used by including a data element, which allows to construct non-aggregated data expressions.
The _fx_ (for expression and filter) buttons are used to open a complex expression construction window. It is possible
to use predefined functions, Javascript, data fields, already built aggregations, and so on. This window can also be
used by including a data element, which allows to construct non-aggregated data expressions.
image::Expression-builder.png[Expression builder]
image::Expression-builder.png[Expression builder]
Footer lines often allow you to place aggregations, such as sums on the group or table rows, eg
Footer lines often allow you to place aggregations, such as sums on the group or table rows, eg
image::Design-with-break-complete.png[Design with break complete]
image::Design-with-break-complete.png[Design with break complete]
WARNING: any unused line must be deleted, otherwise it generates white spaces on the report.
WARNING: any unused line must be deleted, otherwise it generates white spaces on the report.
==== Layout Management
==== Layout Management
===== General settings
===== General settings
Right button leads to Properties Editor tab at bottom. Then click on the Master Page tab, just above. In the Property
Editor you will see a series of general properties that will allow you to modify the general form of the report.
Right button leads to Properties Editor tab at bottom. Then click on the Master Page tab, just above. In the Property
Editor you will see a series of general properties that will allow you to modify the general form of the report.
===== Styles
===== Styles
By right-clicking on any item in the table, you have access to the menu of styles. From there they can be edited,
applied, created. A style can be applied to the whole picture, to a row or column, to a cell, or to an element in that
cell (text, data, ...).
By right-clicking on any item in the table, you have access to the menu of styles. From there they can be edited,
applied, created. A style can be applied to the whole picture, to a row or column, to a cell, or to an element in that
cell (text, data, ...).
+20 -13
View File
@@ -16,29 +16,36 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
= Birt Apache OFBiz® plugin
= Birt OFBiz® plugin
The Apache OFBiz Project
Release 17.12
:imagesdir: ./images
ifdef::backend-pdf[]
:title-logo-image: image::OFBiz-Logo.svg[Apache OFBiz Logo, pdfwidth=4.25in, align=center]
:title-logo-image: image::images/OFBiz-Logo.svg[Apache OFBiz Logo, pdfwidth=4.25in, align=center]
:source-highlighter: rouge
endif::[]
:imagesdir: ./images/birt
image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[link="http://www.apache.org/licenses/LICENSE-2.0"]
The birt plugin is one of the OFBiz plugins.
== OFBiz Flexible Reports
One of the functionalities of the birt plugin are the "OFBiz Flexible Reports"
NOTE: This feature will begin to be officially available with the R17.12 branch first release
There is an announce with some history in the OFBiz blog:
https://blogs.apache.org/ofbiz/entry/the-birt-flexible-reports-a[Reporting in Apache OFBiz® and the OFBiz Flexible Reports]
There is an anounce with some history in the OFBiz blog:
https://blogs.apache.org/ofbiz/entry/the-birt-flexible-reports-a[Reporting in Apache OFBiz® and the OFBiz Flexible Reports]
== Technical Documentation
include::_include/bt-creating reports.adoc[leveloffset=+0]
include::_include/bt-using the birt report designer.adoc[leveloffset=+0]
include::_include/bt-report master creation.adoc[leveloffset=+0]
== User documentation
include::_include/bt-how to use flexible reports.adoc[leveloffset=+0]
include::_include/bt-help.adoc[leveloffset=+1]
=== Technical Documentation
include::_include/bt-creating reports.adoc[leveloffset=+1]
include::_include/bt-using the birt report designer.adoc[leveloffset=+1]
include::_include/bt-report master creation.adoc[leveloffset=+1]
=== User documentation
include::_include/bt-how to use flexible reports.adoc[leveloffset=+1]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

@@ -37,7 +37,7 @@ import org.xml.sax.SAXException;
*/
public class BirtFactory {
public final static String module = BirtFactory.class.getName();
private static final String MODULE = BirtFactory.class.getName();
private static IReportEngine engine;
@@ -66,7 +66,7 @@ public class BirtFactory {
* @throws ParserConfigurationException
*/
public static InputStream getReportInputStreamFromLocation(String resourceName)
throws IOException, SAXException, ParserConfigurationException{
throws IOException, SAXException, ParserConfigurationException {
InputStream reportInputStream = null;
synchronized (BirtFactory.class) {
@@ -81,8 +81,8 @@ public class BirtFactory {
throw new IllegalArgumentException("Could not resolve location to URL: " + resourceName);
}
reportInputStream = reportFileUrl.openStream();
double totalSeconds = (System.currentTimeMillis() - startTime)/1000.0;
Debug.logInfo("Got report in " + totalSeconds + "s from: " + reportFileUrl.toExternalForm(), module);
double totalSeconds = (System.currentTimeMillis() - startTime) / 1000.0;
Debug.logInfo("Got report in " + totalSeconds + "s from: " + reportFileUrl.toExternalForm(), MODULE);
}
if (reportInputStream == null) {
@@ -61,29 +61,29 @@ import org.eclipse.birt.report.engine.api.RenderOption;
public final class BirtWorker {
public final static String module = BirtWorker.class.getName();
private static final String MODULE = BirtWorker.class.getName();
private final static String BIRT_PARAMETERS = "birtParameters";
private final static String BIRT_LOCALE = "birtLocale";
private final static String BIRT_IMAGE_DIRECTORY = "birtImageDirectory";
private final static String BIRT_CONTENT_TYPE = "birtContentType";
private final static String BIRT_OUTPUT_FILE_NAME = "birtOutputFileName";
private static final String resourceError = "BirtErrorUiLabels";
private static final String BIRT_PARAMETERS = "birtParameters";
private static final String BIRT_LOCALE = "birtLocale";
private static final String BIRT_IMAGE_DIRECTORY = "birtImageDirectory";
private static final String BIRT_CONTENT_TYPE = "birtContentType";
private static final String BIRT_OUTPUT_FILE_NAME = "birtOutputFileName";
private static final String RES_ERROR = "BirtErrorUiLabels";
private final static HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
private static final HTMLServerImageHandler IMAGE_HANDLER = new HTMLServerImageHandler();
private BirtWorker() {}
private BirtWorker() { }
private static final Map<Integer, Level> levelIntMap = new HashMap<>();
private static final Map<Integer, Level> LEVEL_INT_MAP = new HashMap<>();
static {
levelIntMap.put(Debug.ERROR, Level.SEVERE);
levelIntMap.put(Debug.TIMING, Level.FINE);
levelIntMap.put(Debug.INFO, Level.INFO);
levelIntMap.put(Debug.IMPORTANT, Level.INFO);
levelIntMap.put(Debug.WARNING, Level.WARNING);
levelIntMap.put(Debug.ERROR, Level.SEVERE);
levelIntMap.put(Debug.FATAL, Level.ALL);
levelIntMap.put(Debug.ALWAYS, Level.ALL);
LEVEL_INT_MAP.put(Debug.ERROR, Level.SEVERE);
LEVEL_INT_MAP.put(Debug.TIMING, Level.FINE);
LEVEL_INT_MAP.put(Debug.INFO, Level.INFO);
LEVEL_INT_MAP.put(Debug.IMPORTANT, Level.INFO);
LEVEL_INT_MAP.put(Debug.WARNING, Level.WARNING);
LEVEL_INT_MAP.put(Debug.ERROR, Level.SEVERE);
LEVEL_INT_MAP.put(Debug.FATAL, Level.ALL);
LEVEL_INT_MAP.put(Debug.ALWAYS, Level.ALL);
}
/**
@@ -110,19 +110,19 @@ public final class BirtWorker {
if (birtImageDirectory == null) {
birtImageDirectory = "/";
}
Debug.logInfo("Get report engine", module);
Debug.logInfo("Get report engine", MODULE);
IReportEngine engine = BirtFactory.getReportEngine();
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
if (birtLocale != null) {
Debug.logInfo("Set BIRT locale:" + birtLocale, module);
Debug.logInfo("Set BIRT locale:" + birtLocale, MODULE);
task.setLocale(birtLocale);
}
// set parameters if exists
Map<String, Object> parameters = UtilGenerics.cast(context.get(BirtWorker.getBirtParameters()));
if (parameters != null) {
//Debug.logInfo("Set BIRT parameters:" + parameters, module);
//Debug.logInfo("Set BIRT parameters:" + parameters, MODULE);
task.setParameterValues(parameters);
}
@@ -138,7 +138,7 @@ public final class BirtWorker {
HTMLRenderOption htmlOptions = new HTMLRenderOption(options);
htmlOptions.setImageDirectory(birtImageDirectory);
htmlOptions.setBaseImageURL(birtImageDirectory);
options.setImageHandler(imageHandler);
options.setImageHandler(IMAGE_HANDLER);
} else if ("application/pdf".equals(contentType)) { // PDF
PDFRenderOption pdfOptions = new PDFRenderOption(options);
pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, Boolean.TRUE);
@@ -151,8 +151,8 @@ public final class BirtWorker {
// run report
if (Debug.infoOn()) {
Debug.logInfo("BIRT's locale is: " + task.getLocale(), module);
Debug.logInfo("Run report's task", module);
Debug.logInfo("BIRT's locale is: " + task.getLocale(), MODULE);
Debug.logInfo("Run report's task", MODULE);
}
task.run();
task.close();
@@ -165,7 +165,7 @@ public final class BirtWorker {
* @param response
*/
public static void setWebContextObjects(Map<String, Object> appContext, HttpServletRequest request, HttpServletResponse response)
throws GeneralException {
throws GeneralException {
HttpSession session = request.getSession();
ServletContext servletContext = session.getServletContext();
@@ -181,23 +181,23 @@ public final class BirtWorker {
appContext.put("dispatcher", WebAppUtil.getDispatcher(servletContext));
}
public static String getBirtParameters () {
public static String getBirtParameters() {
return BIRT_PARAMETERS;
}
public static String getBirtLocale () {
public static String getBirtLocale() {
return BIRT_LOCALE;
}
public static String getBirtImageDirectory () {
public static String getBirtImageDirectory() {
return BIRT_IMAGE_DIRECTORY;
}
public static String getBirtContentType () {
public static String getBirtContentType() {
return BIRT_CONTENT_TYPE;
}
public static String getBirtOutputFileName () {
public static String getBirtOutputFileName() {
return BIRT_OUTPUT_FILE_NAME;
}
@@ -231,12 +231,12 @@ public final class BirtWorker {
EntityCondition entityConditionRpt = EntityCondition.makeCondition("contentTypeId", "RPTDESIGN");
String templatePathLocation = BirtUtil.resolveTemplatePathLocation();
File templatePathLocationDir = new File(templatePathLocation);
if (!templatePathLocationDir.exists()) {
boolean created = templatePathLocationDir.mkdirs();
if (!created) {
throw new GeneralException(UtilProperties.getMessage(resourceError, "BirtErrorCannotLocateReportFolder", locale));
}
if (!templatePathLocationDir.exists()) {
boolean created = templatePathLocationDir.mkdirs();
if (!created) {
throw new GeneralException(UtilProperties.getMessage(RES_ERROR, "BirtErrorCannotLocateReportFolder", locale));
}
}
int i = 0;
String templateFileLocation = null;
EntityCondition ecl = null;
@@ -252,14 +252,18 @@ public final class BirtWorker {
} while (EntityQuery.use(delegator).from("ContentDataResourceView").where(ecl).queryCount() > 0);
//resolve the initial form structure from master content
Map<String, Object> resultElectronicText = dispatcher.runSync("getElectronicText", UtilMisc.toMap("contentId", masterContentId, "locale", locale, "userLogin", userLogin));
Map<String, Object> resultElectronicText = dispatcher.runSync("getElectronicText", UtilMisc.toMap("contentId", masterContentId, "locale",
locale, "userLogin", userLogin));
if (ServiceUtil.isError(resultElectronicText)) {
throw new GeneralException(ServiceUtil.getErrorMessage(resultElectronicText));
}
String reportForm = (String) resultElectronicText.get("textData");
if (!reportForm.startsWith("<?xml")) {
StringBuffer xmlHeaderForm = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
xmlHeaderForm.append("<forms xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://ofbiz.apache.org/dtds/widget-form.xsd\">");
xmlHeaderForm.append("<forms xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ "xmlns=\"http://ofbiz.apache.org/Widget-Form\" "
+ "xsi:schemaLocation=\"http://ofbiz.apache.org/Widget-Form "
+ "http://ofbiz.apache.org/dtds/widget-form.xsd\">");
xmlHeaderForm.append(reportForm);
xmlHeaderForm.append("</forms>");
reportForm = xmlHeaderForm.toString();
@@ -269,15 +273,18 @@ public final class BirtWorker {
//create content and dataressource strucutre
Map<String, Object> result = null;
result = dispatcher.runSync("createDataResource", UtilMisc.toMap("dataResourceId", dataResourceId, "dataResourceTypeId", "ELECTRONIC_TEXT", "dataTemplateTypeId", "FORM_COMBINED", "userLogin", userLogin));
result = dispatcher.runSync("createDataResource", UtilMisc.toMap("dataResourceId", dataResourceId, "dataResourceTypeId", "ELECTRONIC_TEXT",
"dataTemplateTypeId", "FORM_COMBINED", "userLogin", userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
result = dispatcher.runSync("createElectronicTextForm", UtilMisc.toMap("dataResourceId", dataResourceId, "textData", reportForm, "userLogin", userLogin));
result = dispatcher.runSync("createElectronicTextForm", UtilMisc.toMap("dataResourceId", dataResourceId, "textData", reportForm, "userLogin",
userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
result = dispatcher.runSync("createContent", UtilMisc.toMap("contentId", contentId, "contentTypeId", "FLEXIBLE_REPORT", "dataResourceId", dataResourceId, "statusId", "CTNT_IN_PROGRESS", "contentName", reportName, "description", description, "userLogin", userLogin));
result = dispatcher.runSync("createContent", UtilMisc.toMap("contentId", contentId, "contentTypeId", "FLEXIBLE_REPORT", "dataResourceId",
dataResourceId, "statusId", "CTNT_IN_PROGRESS", "contentName", reportName, "description", description, "userLogin", userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
@@ -287,23 +294,29 @@ public final class BirtWorker {
if (!rptDesignName.endsWith(".rptdesign")) {
rptDesignName = rptDesignName.concat(".rptdesign");
}
result = dispatcher.runSync("createDataResource", UtilMisc.toMap("dataResourceId", dataResourceIdRpt, "dataResourceTypeId", "LOCAL_FILE", "mimeTypeId", "text/rptdesign", "dataResourceName", rptDesignName, "objectInfo", templateFileLocation, "userLogin", userLogin));
result = dispatcher.runSync("createDataResource", UtilMisc.toMap("dataResourceId", dataResourceIdRpt, "dataResourceTypeId", "LOCAL_FILE",
"mimeTypeId", "text/rptdesign", "dataResourceName", rptDesignName, "objectInfo", templateFileLocation, "userLogin", userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
result = dispatcher.runSync("createContent", UtilMisc.toMap("contentId", contentIdRpt, "contentTypeId", "RPTDESIGN", "dataResourceId", dataResourceIdRpt, "statusId", "CTNT_PUBLISHED", "contentName", reportName, "description", description + " (.rptDesign file)", "userLogin", userLogin));
result = dispatcher.runSync("createContent", UtilMisc.toMap("contentId", contentIdRpt, "contentTypeId", "RPTDESIGN", "dataResourceId",
dataResourceIdRpt, "statusId", "CTNT_PUBLISHED", "contentName", reportName, "description", description + " (.rptDesign file)",
"userLogin", userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
result = dispatcher.runSync("createContentAssoc", UtilMisc.toMap("contentId", masterContentId, "contentIdTo", contentId, "contentAssocTypeId", "SUB_CONTENT", "userLogin", userLogin));
result = dispatcher.runSync("createContentAssoc", UtilMisc.toMap("contentId", masterContentId, "contentIdTo", contentId,
"contentAssocTypeId", "SUB_CONTENT", "userLogin", userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
result = dispatcher.runSync("createContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", contentIdRpt, "contentAssocTypeId", "SUB_CONTENT", "userLogin", userLogin));
result = dispatcher.runSync("createContentAssoc", UtilMisc.toMap("contentId", contentId, "contentIdTo", contentIdRpt, "contentAssocTypeId",
"SUB_CONTENT", "userLogin", userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
result = dispatcher.runSync("createContentAttribute", UtilMisc.toMap("contentId", contentId, "attrName", workflowType, "attrValue", modelElementName, "userLogin", userLogin));
result = dispatcher.runSync("createContentAttribute", UtilMisc.toMap("contentId", contentId, "attrName", workflowType, "attrValue",
modelElementName, "userLogin", userLogin));
if (ServiceUtil.isError(result)) {
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
@@ -324,6 +337,7 @@ public final class BirtWorker {
break;
}
}
config.setLogConfig(UtilProperties.getPropertyValue("debug", "log4j.appender.css.dir", ofbizHome + "/runtime/logs/"), levelIntMap.get(lowerLevel));
config.setLogConfig(UtilProperties.getPropertyValue("debug", "log4j.appender.css.dir", ofbizHome + "/runtime/logs/"),
LEVEL_INT_MAP.get(lowerLevel));
}
}
@@ -36,10 +36,9 @@ import org.apache.ofbiz.birt.BirtWorker;
public class BirtContainer implements Container {
public static final String module = BirtContainer.class.getName();
protected String configFile;
private static final String MODULE = BirtContainer.class.getName();
private String configFile;
private String name;
@Override
@@ -53,7 +52,7 @@ public class BirtContainer implements Container {
*/
@Override
public boolean start() throws ContainerException {
Debug.logInfo("Start BIRT container", module);
Debug.logInfo("Start BIRT container", MODULE);
// make sure the subclass sets the config name
if (getName() == null) {
@@ -73,20 +72,20 @@ public class BirtContainer implements Container {
// startup platform
try {
Debug.logInfo("Startup BIRT platform", module);
Debug.logInfo("Startup BIRT platform", MODULE);
Platform.startup(config);
} catch (BirtException e) {
throw new ContainerException(e);
}
// create report engine
Debug.logInfo("Create factory object", module);
Debug.logInfo("Create factory object", MODULE);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
if (factory == null) {
throw new ContainerException("can not create birt engine factory");
}
Debug.logInfo("Create report engine", module);
Debug.logInfo("Create report engine", MODULE);
IReportEngine engine = factory.createReportEngine(config);
BirtFactory.setReportEngine(engine);
@@ -100,7 +99,7 @@ public class BirtContainer implements Container {
formatList = supportedFormat;
}
}
Debug.logInfo("BIRT supported formats: " + formatList, module);
Debug.logInfo("BIRT supported formats: " + formatList, MODULE);
return false;
}
@@ -46,8 +46,8 @@ import org.apache.ofbiz.common.email.NotificationServices;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.security.Security;
import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.LocalDispatcher;
import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
import org.apache.ofbiz.service.ServiceUtil;
import org.apache.ofbiz.widget.model.ThemeFactory;
import org.apache.ofbiz.widget.renderer.ScreenRenderer;
@@ -63,11 +63,10 @@ import freemarker.template.TemplateException;
public class BirtEmailServices {
public static final String module = BirtEmailServices.class.getName();
public static final String resource = "BirtUiLabels";
private static final String MODULE = BirtEmailServices.class.getName();
private static final String RESOURCE = "BirtUiLabels";
/**
* send birt mail
*
* @param ctx the dispatch context
* @param context the context
* @return returns the result of the service execution
@@ -77,7 +76,6 @@ public class BirtEmailServices {
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Security security = ctx.getSecurity();
String webSiteId = (String) serviceContext.remove("webSiteId");
String bodyText = (String) serviceContext.remove("bodyText");
String bodyScreenUri = (String) serviceContext.remove("bodyScreenUri");
@@ -90,6 +88,9 @@ public class BirtEmailServices {
String birtImageDirectory = (String) serviceContext.remove(BirtWorker.getBirtImageDirectory());
String birtContentType = (String) serviceContext.remove(BirtWorker.getBirtContentType());
VisualTheme visualTheme = (VisualTheme) context.get("visualTheme");
if (visualTheme == null) {
visualTheme = ThemeFactory.resolveVisualTheme(null);
}
if (visualTheme == null) visualTheme = ThemeFactory.resolveVisualTheme(null);
if (bodyParameters == null) {
bodyParameters = MapStack.create();
@@ -116,12 +117,14 @@ public class BirtEmailServices {
try {
screenStringRenderer = new MacroScreenRenderer("screen", visualTheme.getModelTheme().getScreenRendererLocation("screen"));
} catch (TemplateException e) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()),
locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (IOException e) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()),
locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
}
ScreenRenderer screens = new ScreenRenderer(bodyWriter, screenContext, screenStringRenderer);
@@ -132,20 +135,24 @@ public class BirtEmailServices {
try {
screens.render(bodyScreenUri);
} catch (GeneralException e) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString",
e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (IOException e) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorIORenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorIORenderingScreenForEmail", UtilMisc.toMap("errorString",
e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (SAXException e) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorSAXRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorSAXRenderingScreenForEmail", UtilMisc.toMap("errorString",
e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (ParserConfigurationException e) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorParserConfigRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorParserConfigRenderingScreenForEmail", UtilMisc.toMap("errorString",
e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
}
}
@@ -160,7 +167,7 @@ public class BirtEmailServices {
// create the output stream for the generation
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Map<String, Object> birtContext = new HashMap<String, Object>();
Map<String, Object> birtContext = new HashMap<>();
if (birtLocale == null) {
birtLocale = locale;
}
@@ -179,18 +186,17 @@ public class BirtEmailServices {
appContext.put("delegator", delegator);
appContext.put("dispatcher", dispatcher);
appContext.put("security", security);
InputStream reportInputStream = BirtFactory.getReportInputStreamFromLocation(birtReportLocation);
IReportRunnable design = engine.openReportDesign(reportInputStream);
Debug.logInfo("Export report as content type:" + birtContentType, module);
Debug.logInfo("Export report as content type:" + birtContentType, MODULE);
BirtWorker.exportReport(design, context, birtContentType, baos);
baos.flush();
baos.close();
// store in the list of maps for sendmail....
List<Map<String, ? extends Object>> bodyParts = new LinkedList<Map<String,? extends Object>>();
List<Map<String, ? extends Object>> bodyParts = new LinkedList<>();
if (bodyText != null) {
bodyText = FlexibleStringExpander.expandString(bodyText, screenContext, locale);
bodyText = FlexibleStringExpander.expandString(bodyText, screenContext, locale);
bodyParts.add(UtilMisc.toMap("content", bodyText, "type", "text/html"));
} else {
bodyParts.add(UtilMisc.toMap("content", bodyWriter.toString(), "type", "text/html"));
@@ -198,39 +204,46 @@ public class BirtEmailServices {
bodyParts.add(UtilMisc.toMap("content", baos.toByteArray(), "type", "application/pdf", "filename", attachmentName));
serviceContext.put("bodyParts", bodyParts);
} catch (GeneralException ge) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", ge.toString()), locale);
Debug.logError(ge, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType",
birtContentType, "errorString", ge.toString()), locale);
Debug.logError(ge, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (IOException ie) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorIORenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", ie.toString()), locale);
Debug.logError(ie, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorIORenderingAttachmentForEmail", UtilMisc.toMap("birtContentType",
birtContentType, "errorString", ie.toString()), locale);
Debug.logError(ie, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (FOPException fe) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorFOPRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", fe.toString()), locale);
Debug.logError(fe, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorFOPRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType",
birtContentType, "errorString", fe.toString()), locale);
Debug.logError(fe, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (SAXException se) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorSAXRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", se.toString()), locale);
Debug.logError(se, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorSAXRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType",
birtContentType, "errorString", se.toString()), locale);
Debug.logError(se, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (ParserConfigurationException pe) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorParserRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", pe.toString()), locale);
Debug.logError(pe, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorParserRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType",
birtContentType, "errorString", pe.toString()), locale);
Debug.logError(pe, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (EngineException ee) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", ee.toString()), locale);
Debug.logError(ee, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType",
birtContentType, "errorString", ee.toString()), locale);
Debug.logError(ee, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (SQLException se) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorSQLRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", se.toString()), locale);
Debug.logError(se, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorSQLRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType",
birtContentType, "errorString", se.toString()), locale);
Debug.logError(se, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
}
} else {
isMultiPart = false;
// store body and type for single part message in the context.
if (bodyText != null) {
bodyText = FlexibleStringExpander.expandString(bodyText, screenContext, locale);
bodyText = FlexibleStringExpander.expandString(bodyText, screenContext, locale);
serviceContext.put("body", bodyText);
} else {
serviceContext.put("body", bodyWriter.toString());
@@ -251,7 +264,9 @@ public class BirtEmailServices {
serviceContext.put("subject", subject);
serviceContext.put("partyId", partyId);
if (Debug.verboseOn()) Debug.logVerbose("sendMailFromScreen sendMail context: " + serviceContext, module);
if (Debug.verboseOn()) {
Debug.logVerbose("sendMailFromScreen sendMail context: " + serviceContext, MODULE);
}
Map<String, Object> result = ServiceUtil.returnSuccess();
try {
@@ -267,8 +282,8 @@ public class BirtEmailServices {
}
}
} catch (GenericServiceException e) {
String errMsg = UtilProperties.getMessage(resource, "BirtErrorInSendingEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
String errMsg = UtilProperties.getMessage(RESOURCE, "BirtErrorInSendingEmail", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
}
result.put("body", bodyWriter.toString());
@@ -50,30 +50,29 @@ import org.eclipse.birt.report.engine.api.script.IReportContext;
public class BirtMasterReportServices {
public static final String module = BirtServices.class.getName();
public static final String resource = "BirtUiLabels";
public static final String resource_error = "BirtErrorUiLabels";
private static final String MODULE = BirtServices.class.getName();
private static final String RESOURCE = "BirtUiLabels";
// The following methods are flexible report services as examples for reporting
public static Map<String, Object> workEffortPerPersonPrepareDate(DispatchContext dctx, Map<String, Object> context) {
Map<String, String> dataMap = UtilMisc.toMap(
"lastName", "name",
"firstName", "name",
"hours", "floating-point",
"fromDate", "date-time",
"lastName", "name",
"firstName", "name",
"hours", "floating-point",
"fromDate", "date-time",
"thruDate", "date-time");
LinkedHashMap<String, String> filterMap = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> filterMap = new LinkedHashMap<>();
filterMap.put("firstName", "name");
filterMap.put("lastName", "name");
filterMap.put("fromDate", "date-time");
filterMap.put("thruDate", "date-time");
Map<String, String> fieldDisplayLabels = UtilMisc.toMap(
"lastName", "Last name",
"firstName", "First name",
"hours", "Hours",
"fromDate", "From date",
"lastName", "Last name",
"firstName", "First name",
"hours", "Hours",
"fromDate", "From date",
"thruDate", "Thru date");
LinkedHashMap<String, String> filterDisplayLabels = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> filterDisplayLabels = new LinkedHashMap<>();
filterDisplayLabels.put("firstName", "First name");
filterDisplayLabels.put("lastName", "Last name");
filterDisplayLabels.put("fromDate", "From date");
@@ -89,7 +88,7 @@ public class BirtMasterReportServices {
public static Map<String, Object> workEffortPerPerson(DispatchContext dctx, Map<String, Object> context) {
Delegator delegator = dctx.getDelegator();
IReportContext reportContext = (IReportContext) context.get("reportContext");
Map<String, Object> parameters = UtilGenerics.checkMap(reportContext.getParameterValue("parameters"));
Map<String, Object> parameters = UtilGenerics.cast(reportContext.getParameterValue("parameters"));
List<GenericValue> listWorkEffortTime = null;
if (UtilValidate.isEmpty(parameters.get("firstName")) && UtilValidate.isEmpty(parameters.get("lastName"))) {
@@ -98,7 +97,7 @@ public class BirtMasterReportServices {
List<GenericValue> listPersons = null;
try {
// TODO: translate labels
List<EntityExpr> listConditions = new ArrayList<EntityExpr>();
List<EntityExpr> listConditions = new ArrayList<>();
if (UtilValidate.isNotEmpty(parameters.get("firstName"))) {
EntityExpr conditionFirstName = EntityCondition.makeCondition("firstName", parameters.get("firstName"));
listConditions.add(conditionFirstName);
@@ -119,7 +118,7 @@ public class BirtMasterReportServices {
}
String partyId = person.getString("partyId");
List<EntityExpr> listConditionsWorkEffort = new ArrayList<EntityExpr>();
List<EntityExpr> listConditionsWorkEffort = new ArrayList<>();
Timestamp thruDate = null;
Timestamp fromDate = null;
if (UtilValidate.isEmpty(parameters.get("fromDate"))) {
@@ -144,10 +143,10 @@ public class BirtMasterReportServices {
.where(ecl).select("hours", "fromDate", "thruDate")
.queryList();
} catch (GenericEntityException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
ServiceUtil.returnError("Error getting party from person name.");
}
List<GenericValue> listCompiled = new ArrayList<GenericValue>();
List<GenericValue> listCompiled = new ArrayList<>();
if (UtilValidate.isNotEmpty(listWorkEffortTime)) listCompiled.addAll(listWorkEffortTime);
if (UtilValidate.isNotEmpty(listPersons)) listCompiled.addAll(listPersons);
Map<String, Object> result = ServiceUtil.returnSuccess();
@@ -157,43 +156,43 @@ public class BirtMasterReportServices {
public static Map<String, Object> turnOverPrepareFields(DispatchContext dctx, Map<String, Object> context) {
Map<String, String> dataMap = UtilMisc.toMap(
"invoiceTypeId", "short-varchar",
"invoicePartyId", "short-varchar",
"statusId", "short-varchar",
"invoiceDate", "date",
"dueDate", "date",
"currencyUomId", "short-varchar",
"invoiceItemTypeId", "short-varchar",
"invoiceItemSeqId", "short-varchar",
"productId", "short-varchar",
"partyId", "short-varchar",
"primaryProductCategoryId", "short-varchar",
"quantity", "numeric",
"amount", "currency-amount",
"productStoreId", "short-varchar",
"invoiceTypeId", "short-varchar",
"invoicePartyId", "short-varchar",
"statusId", "short-varchar",
"invoiceDate", "date",
"dueDate", "date",
"currencyUomId", "short-varchar",
"invoiceItemTypeId", "short-varchar",
"invoiceItemSeqId", "short-varchar",
"productId", "short-varchar",
"partyId", "short-varchar",
"primaryProductCategoryId", "short-varchar",
"quantity", "numeric",
"amount", "currency-amount",
"productStoreId", "short-varchar",
"storeName", "short-varchar");
Map<String, String> fieldDisplayLabels = UtilMisc.toMap(
"invoiceTypeId", "invoice Type",
"invoicePartyId", "Invoice",
"statusId", "Status",
"invoiceDate", "Date",
"dueDate", "Due date ",
"currencyUomId", "Currency",
"invoiceItemTypeId", "Invoice type line",
"invoiceItemSeqId", "Invoice line",
"productId", "Product",
"partyId", "Customer",
"primaryProductCategoryId", "Product category",
"quantity", "Qty",
"amount", "Amount",
"productStoreId", "Product Store",
"invoiceTypeId", "invoice Type",
"invoicePartyId", "Invoice",
"statusId", "Status",
"invoiceDate", "Date",
"dueDate", "Due date",
"currencyUomId", "Currency",
"invoiceItemTypeId", "Invoice type line",
"invoiceItemSeqId", "Invoice line",
"productId", "Product",
"partyId", "Customer",
"primaryProductCategoryId", "Product category",
"quantity", "Qty",
"amount", "Amount",
"productStoreId", "Product Store",
"storeName", "Product store name");
LinkedHashMap<String, String> filterMap = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> filterMap = new LinkedHashMap<>();
filterMap.put("productCategoryId", "short-varchar");
filterMap.put("productStoreId", "short-varchar");
filterMap.put("fromDate", "date");
filterMap.put("thruDate", "date");
LinkedHashMap<String, String> filterDisplayLabels = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> filterDisplayLabels = new LinkedHashMap<>();
//it's better to use Label Map, maybe an improvement point !
filterDisplayLabels.put("productCategoryId", "product Category");
filterDisplayLabels.put("productStoreId", "product Store");
@@ -211,11 +210,11 @@ public class BirtMasterReportServices {
Delegator delegator = dctx.getDelegator();
Locale locale = (Locale) context.get("locale");
IReportContext reportContext = (IReportContext) context.get("reportContext");
Map<String, Object> parameters = UtilGenerics.checkMap(reportContext.getParameterValue("parameters"));
Map<String, Object> parameters = UtilGenerics.cast(reportContext.getParameterValue("parameters"));
List<GenericValue> listTurnOver = null;
List<Map<String, Object>> listInvoiceEditable = new ArrayList<Map<String, Object>>();
List<EntityCondition> listAllConditions = new ArrayList<EntityCondition>();
List<Map<String, Object>> listInvoiceEditable = new ArrayList<>();
List<EntityCondition> listAllConditions = new ArrayList<>();
try {
// treating fromDate field condition
if (UtilValidate.isNotEmpty(parameters.get("fromDate"))) {
@@ -237,19 +236,23 @@ public class BirtMasterReportServices {
// product category field condition
if (UtilValidate.isNotEmpty(parameters.get("productCategoryId"))) {
List<String> productCategoryList = new ArrayList<String>();
List<String> productCategoryList = new ArrayList<>();
if (parameters.get("productCategoryId") instanceof String) {
String productCategoryId = (String) parameters.get("productCategoryId");
productCategoryList.add(productCategoryId);
} else if (parameters.get("productStoreId") instanceof String) {
productCategoryList = UtilGenerics.checkList(parameters.get("productCategoryId"));
productCategoryList = UtilGenerics.cast(parameters.get("productCategoryId"));
}
// getting productIds in these categories
EntityExpr conditionProductCategory = EntityCondition.makeCondition("primaryProductCategoryId", EntityOperator.IN, productCategoryList);
EntityExpr conditionFromDate = EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.nowTimestamp());
EntityExpr conditionBeforeDate = EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN_EQUAL_TO, UtilDateTime.nowTimestamp());
EntityExpr conditionProductCategory = EntityCondition.makeCondition("primaryProductCategoryId", EntityOperator.IN,
productCategoryList);
EntityExpr conditionFromDate = EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO,
UtilDateTime.nowTimestamp());
EntityExpr conditionBeforeDate = EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN_EQUAL_TO,
UtilDateTime.nowTimestamp());
EntityExpr conditionNull = EntityCondition.makeCondition("thruDate", null);
EntityCondition conditionThroughDate = EntityCondition.makeCondition(EntityOperator.OR, UtilMisc.toList(conditionBeforeDate, conditionNull));
EntityCondition conditionThroughDate = EntityCondition.makeCondition(EntityOperator.OR, UtilMisc.toList(conditionBeforeDate,
conditionNull));
List<GenericValue> listProductIds = EntityQuery.use(delegator)
.from("ProductCategoryMember")
.where(EntityCondition.makeCondition(UtilMisc.toList(conditionProductCategory, conditionFromDate, conditionThroughDate)))
@@ -260,20 +263,22 @@ public class BirtMasterReportServices {
}
// productStoreId condition
List<String> productStoreList = new ArrayList<String>();
List<String> productStoreList = new ArrayList<>();
if (UtilValidate.isNotEmpty(parameters.get("productStoreId"))) {
if (parameters.get("productStoreId") instanceof String) {
String productStoreId = (String) parameters.get("productStoreId");
productStoreList.add(productStoreId);
} else if (parameters.get("productStoreId") instanceof List) {
productStoreList = UtilGenerics.checkList(parameters.get("productStoreId"));
productStoreList = UtilGenerics.cast(parameters.get("productStoreId"));
}
// getting list of invoice Ids linked to these productStore
EntityExpr conditionProductStoreId = EntityCondition.makeCondition("productStoreId", EntityOperator.IN, productStoreList);
List<GenericValue> listOrderAndProductStores = EntityQuery.use(delegator).from("OrderAndProductStore").where(conditionProductStoreId).select("orderId").queryList();
List<GenericValue> listOrderAndProductStores =
EntityQuery.use(delegator).from("OrderAndProductStore").where(conditionProductStoreId).select("orderId").queryList();
List<String> listOrderIds = EntityUtil.getFieldListFromEntityList(listOrderAndProductStores, "orderId", true);
EntityExpr conditionOrderId = EntityCondition.makeCondition("orderId", EntityOperator.IN, listOrderIds);
List<GenericValue> listInvoices = EntityQuery.use(delegator).from("OrderItemBilling").where(conditionOrderId).select("invoiceId").queryList();
List<GenericValue> listInvoices =
EntityQuery.use(delegator).from("OrderItemBilling").where(conditionOrderId).select("invoiceId").queryList();
List<String> listInvoiceString = EntityUtil.getFieldListFromEntityList(listInvoices, "invoiceId", true);
EntityExpr conditionInvoiceIdProductStore = EntityCondition.makeCondition("invoiceId", EntityOperator.IN, listInvoiceString);
@@ -282,7 +287,8 @@ public class BirtMasterReportServices {
// adding mandatory conditions
// condition on invoice item type
List<String> listInvoiceItemType = UtilMisc.toList("ITM_PROMOTION_ADJ", "INV_PROD_ITEM", "INV_FPROD_ITEM", "INV_DPROD_ITEM", "INV_FDPROD_ITEM", "INV_PROD_FEATR_ITEM");
List<String> listInvoiceItemType = UtilMisc.toList("ITM_PROMOTION_ADJ", "INV_PROD_ITEM", "INV_FPROD_ITEM", "INV_DPROD_ITEM",
"INV_FDPROD_ITEM", "INV_PROD_FEATR_ITEM");
listInvoiceItemType.add("ITM_DISCOUNT_ADJ");
listInvoiceItemType.add("CRT_FPROD_ITEM");
listInvoiceItemType.add("CRT_DPROD_ITEM");
@@ -298,11 +304,13 @@ public class BirtMasterReportServices {
// condition on invoice ((not cancelled) or null)
EntityExpr conditionStatusNotCancelled = EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "INVOICE_CANCELLED");
EntityExpr conditionStatusNull = EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, null);
EntityCondition conditionStatus = EntityCondition.makeCondition(UtilMisc.toList(conditionStatusNotCancelled, conditionStatusNull), EntityOperator.OR);
EntityCondition conditionStatus = EntityCondition.makeCondition(UtilMisc.toList(conditionStatusNotCancelled, conditionStatusNull),
EntityOperator.OR);
listAllConditions.add(conditionStatus);
// condition sales invoice or customer return invoice
EntityExpr conditionSalesInvoice = EntityCondition.makeCondition("invoiceTypeId", EntityOperator.IN, UtilMisc.toList("SALES_INVOICE", "CUST_RTN_INVOICE"));
EntityExpr conditionSalesInvoice = EntityCondition.makeCondition("invoiceTypeId", EntityOperator.IN, UtilMisc.toList("SALES_INVOICE",
"CUST_RTN_INVOICE"));
listAllConditions.add(conditionSalesInvoice);
// retrieving all invoices
@@ -328,16 +336,18 @@ public class BirtMasterReportServices {
// adding missing fields
for (GenericValue invoice : listTurnOver) {
Map<String, Object> invoiceEditableTemp = UtilGenerics.checkMap(invoice.clone());
Map<String, Object> invoiceEditableTemp = UtilGenerics.cast(invoice.clone());
invoiceEditableTemp.remove("GenericEntity");
Map<String, Object> invoiceEditable = new HashMap<String, Object>();
Map<String, Object> invoiceEditable = new HashMap<>();
invoiceEditable.putAll(invoiceEditableTemp);
invoiceEditable.put("partyName", PartyHelper.getPartyName(delegator, invoice.getString("partyId"), false));
// adding productStoreId and productStoreName
EntityExpr conditionInvoiceId = EntityCondition.makeCondition("invoiceId", invoice.getString("invoiceId"));
// EntityExpr conditionInvoiceItemSeqId = EntityCondition.makeCondition("invoiceItemSeqId", invoice.getString("invoiceItemSeqId"));
// List<GenericValue> listOrderBilling = delegator.findList("OrderItemBilling", EntityCondition.makeCondition(UtilMisc.toList(conditionInvoiceId, conditionInvoiceItemSeqId)), UtilMisc.toSet("orderId"), null, null, false);
// EntityExpr conditionInvoiceItemSeqId = EntityCondition.makeCondition("invoiceItemSeqId", invoice.getString
// ("invoiceItemSeqId"));
// List<GenericValue> listOrderBilling = delegator.findList("OrderItemBilling", EntityCondition.makeCondition
// (UtilMisc.toList(conditionInvoiceId, conditionInvoiceItemSeqId)), UtilMisc.toSet("orderId"), null, null, false);
GenericValue orderBilling = EntityQuery.use(delegator)
.from("OrderItemBilling")
.where(conditionInvoiceId)
@@ -350,8 +360,9 @@ public class BirtMasterReportServices {
.where(conditionOrderId)
.cache()
.queryFirst();
if (UtilValidate.isNotEmpty(productStoreList) && ! productStoreList.contains(productStore.getString("productStoreId"))) {
continue; // FIXME pretty ugly... but had problems with the rare case where an invoice matches with several orders with more than one productStore
if (UtilValidate.isNotEmpty(productStoreList) && !productStoreList.contains(productStore.getString("productStoreId"))) {
continue; // FIXME pretty ugly... but had problems with the rare case where an invoice matches with several orders with
// more than one productStore
}
invoiceEditable.put("productStoreId", productStore.getString("productStoreId"));
invoiceEditable.put("storeName", productStore.getString("storeName"));
@@ -362,8 +373,8 @@ public class BirtMasterReportServices {
listInvoiceEditable.add(invoiceEditable);
}
} catch (Exception e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "BirtErrorRetrievingTurnOver", locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "BirtErrorRetrievingTurnOver", locale));
}
Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("records", listInvoiceEditable);
@@ -88,10 +88,9 @@ import com.ibm.icu.util.ULocale;
public class BirtServices {
public static final String module = BirtServices.class.getName();
public static final String resource = "BirtUiLabels";
public static final String resource_error = "BirtErrorUiLabels";
public static final String resourceProduct = "BirtUiLabels";
private static final String MODULE = BirtServices.class.getName();
private static final String RESOURCE = "BirtUiLabels";
private static final String RES_ERROR = "BirtErrorUiLabels";
/**
* Instantiate a new Flexible report, using the data given in parameters and <code>ReportDesignGenerator</code> class.
@@ -101,13 +100,13 @@ public class BirtServices {
try {
rptGenerator = new ReportDesignGenerator(context, dctx);
} catch (Exception e1) {
Debug.logError(e1, module);
Debug.logError(e1, MODULE);
return ServiceUtil.returnError(e1.getMessage());
}
try {
rptGenerator.buildReport();
} catch (Exception e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError(e.getMessage());
}
return ServiceUtil.returnSuccess();
@@ -115,14 +114,15 @@ public class BirtServices {
@Deprecated
// TODO lack documentation about the reason of deprecation
// Seems to need to be simply removed since not used at all. But not sure it's not still useful in certain situations, else why not already removed?
// Seems to need to be simply removed since not used at all.
// But not sure it's not still useful in certain situations, else why not already removed?
public static Map<String, Object> prepareFlexibleReportOptionFieldsFromEntity(DispatchContext dctx, Map<String, Object> context) {
String entityViewName = (String) context.get("entityViewName");
GenericValue userLogin = (GenericValue) context.get("userLogin");
List<String> listMultiFields = new ArrayList<String>();
List<String> listMultiFields = new ArrayList<>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> result = new HashMap<>();
Locale locale = (Locale) context.get("locale");
ModelEntity modelEntity = delegator.getModelEntity(entityViewName);
@@ -134,18 +134,19 @@ public class BirtServices {
String fieldType = mField.getType();
String birtType = null;
try {
Map<String, Object> convertRes = dispatcher.runSync("convertFieldTypeToBirtType", UtilMisc.toMap("fieldType", fieldType, "userLogin", userLogin));
Map<String, Object> convertRes = dispatcher.runSync("convertFieldTypeToBirtType", UtilMisc.toMap("fieldType", fieldType,
"userLogin", userLogin));
if (ServiceUtil.isError(convertRes)) {
String errMsg = UtilProperties.getMessage(resource_error, "BirtErrorConversionFieldToBirtFailed", locale);
String errMsg = UtilProperties.getMessage(RES_ERROR, "BirtErrorConversionFieldToBirtFailed", locale);
return ServiceUtil.returnError(errMsg + ServiceUtil.getErrorMessage(convertRes));
}
birtType = (String) convertRes.get("birtType");
if (UtilValidate.isEmpty(birtType)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorConversionFieldToBirtFailed", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorConversionFieldToBirtFailed", locale));
}
} catch (GenericServiceException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorConversionFieldToBirtFailed", locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorConversionFieldToBirtFailed", locale));
}
// make more general when report forms have been made so too.
if ("date-time".equalsIgnoreCase(birtType) || "date".equalsIgnoreCase(birtType) || "time".equalsIgnoreCase(birtType)) {
@@ -162,7 +163,6 @@ public class BirtServices {
/**
* Perform find data on given view/entity and return these into Birt compatible format.
* This service is meant to be used as default for View/entity report design
*
*/
public static Map<String, Object> callPerformFindFromBirt(DispatchContext dctx, Map<String, Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -170,38 +170,38 @@ public class BirtServices {
Locale locale = (Locale) context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
String entityViewName = (String) reportContext.getParameterValue("modelElementName");
Map<String, Object> inputFields = UtilGenerics.checkMap(reportContext.getParameterValue("parameters"));
Map<String, Object> resultPerformFind = new HashMap<String, Object>();
Map<String, Object> inputFields = UtilGenerics.cast(reportContext.getParameterValue("parameters"));
Map<String, Object> resultPerformFind = new HashMap<>();
Map<String, Object> resultToBirt = null;
List<GenericValue> list = null;
if (UtilValidate.isEmpty(entityViewName)) {
entityViewName = (String) inputFields.get("modelElementName");
if (UtilValidate.isEmpty(entityViewName)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorEntityViewNotFound", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorEntityViewNotFound", locale));
}
}
try {
resultPerformFind = dispatcher.runSync("performFind", UtilMisc.<String, Object>toMap("entityName", entityViewName,
resultPerformFind = dispatcher.runSync("performFind", UtilMisc.<String, Object>toMap("entityName", entityViewName,
"inputFields", inputFields, "userLogin", userLogin, "noConditionFind", "Y", "locale", locale));
if (ServiceUtil.isError(resultPerformFind)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorRunningPerformFind", locale));
}
} catch (GenericServiceException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorRunningPerformFind", locale));
}
try (EntityListIterator listIt = (EntityListIterator) resultPerformFind.get("listIt")) {
if (UtilValidate.isNotEmpty(listIt)) {
list = listIt.getCompleteList();
} else {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorRunningPerformFind", locale));
}
} catch (GenericEntityException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorRunningPerformFind", locale));
}
resultToBirt = ServiceUtil.returnSuccess();
resultToBirt.put("records", list);
@@ -212,8 +212,8 @@ public class BirtServices {
* Analyse given master and create report design from its data
* Two cases are implemented :
* <ul>
* <li>Entity : data retieval is based on a simple view/entity</li>
* <li>Service : data retrieval is based on service</li>
* <li>Entity : data retieval is based on a simple view/entity</li>
* <li>Service : data retrieval is based on service</li>
* </ul>
*/
public static Map<String, Object> createFlexibleReportFromMaster(DispatchContext dctx, Map<String, Object> context) {
@@ -232,12 +232,12 @@ public class BirtServices {
EntityCondition entityCondition = EntityCondition.makeCondition("contentId", masterContentId);
masterContentAttribute = EntityQuery.use(delegator).from("ContentAttribute").where(entityCondition).queryFirst();
} catch (GenericEntityException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorNoAttributeFound", locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorNoAttributeFound", locale));
}
if (masterContentAttribute == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorNoAttributeFound", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorNoAttributeFound", locale));
}
String attrName = masterContentAttribute.getString("attrName");
String reportContentId;
@@ -245,58 +245,66 @@ public class BirtServices {
String entityViewName = masterContentAttribute.getString("attrValue");
ModelEntity modelEntity = delegator.getModelEntity(entityViewName);
if (modelEntity == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorEntityViewNotExist", locale) + " " + entityViewName);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorEntityViewNotExist", locale) + " " + entityViewName);
}
try {
Map<String, Object> resultContent = dispatcher.runSync("createFlexibleReportFromMasterEntityWorkflow", UtilMisc.toMap("entityViewName", entityViewName,
"reportName", reportName, "description", description, "writeFilters", writeFilters, "masterContentId", masterContentId, "userLogin", userLogin, "locale", locale));
if(ServiceUtil.isError(resultContent)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(resultContent));
}
reportContentId = (String) resultContent.get("contentId");
} catch (GenericServiceException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotDetermineDataSource", locale));
}
} else if ("Service".equalsIgnoreCase(attrName)) {
String serviceName = masterContentAttribute.getString("attrValue");
try {
Map<String, Object> resultContent = dispatcher.runSync("createFlexibleReportFromMasterServiceWorkflow", UtilMisc.toMap("serviceName", serviceName,
"reportName", reportName, "description", description, "writeFilters", writeFilters, "masterContentId", masterContentId, "userLogin", userLogin, "locale", locale));
Map<String, Object> resultContent = dispatcher.runSync("createFlexibleReportFromMasterEntityWorkflow", UtilMisc.toMap(
"entityViewName", entityViewName,
"reportName", reportName, "description", description, "writeFilters", writeFilters, "masterContentId", masterContentId,
"userLogin", userLogin, "locale", locale));
if (ServiceUtil.isError(resultContent)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(resultContent));
}
reportContentId = (String) resultContent.get("contentId");
} catch (GenericServiceException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotDetermineDataSource", locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorCannotDetermineDataSource", locale));
}
} else if ("Service".equalsIgnoreCase(attrName)) {
String serviceName = masterContentAttribute.getString("attrValue");
try {
Map<String, Object> resultContent = dispatcher.runSync("createFlexibleReportFromMasterServiceWorkflow", UtilMisc.toMap(
"serviceName", serviceName, "reportName", reportName, "description", description, "writeFilters", writeFilters,
"masterContentId", masterContentId, "userLogin", userLogin, "locale", locale));
if (ServiceUtil.isError(resultContent)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(resultContent));
}
reportContentId = (String) resultContent.get("contentId");
} catch (GenericServiceException e) {
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorCannotDetermineDataSource", locale));
}
} else {
// TODO check: could create other workflows. WebService? Does it need to be independent from Service workflow?
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotDetermineDataSource", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorCannotDetermineDataSource", locale));
}
// prepare report form to display to allow override
String textForm;
Map<String, Object> resultFormDisplay;
try {
resultFormDisplay = dispatcher.runSync("prepareFlexibleReportSearchFormToEdit", UtilMisc.toMap("reportContentId", reportContentId, "userLogin", userLogin, "locale", locale));
resultFormDisplay = dispatcher.runSync("prepareFlexibleReportSearchFormToEdit", UtilMisc.toMap("reportContentId", reportContentId,
"userLogin", userLogin, "locale", locale));
if (ServiceUtil.isError(resultFormDisplay)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(resultFormDisplay));
}
textForm = (String) resultFormDisplay.get("textForm");
} catch (GenericServiceException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCreatingDefaultSearchForm", locale).concat(": ").concat(e.getMessage()));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR,
"BirtErrorCreatingDefaultSearchForm", locale).concat(": ").concat(e.getMessage()));
}
Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "BirtFlexibleReportSuccessfullyGenerated", locale).concat(" ").concat(reportName));
Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage(RESOURCE, "BirtFlexibleReportSuccessfullyGenerated",
locale).concat(" ").concat(reportName));
result.put("textForm", textForm);
result.put("reportContentId", reportContentId);
return result;
}
// TODO check: I'm not a big fan of how I did the createFormForDisplay / overrideReportForm. Could probably be improved using a proper formForReport object or something similar.
// TODO check: I'm not a big fan of how I did the createFormForDisplay / overrideReportForm. Could probably be improved using a proper
// formForReport object or something similar.
/**
* Update search form of a report design
*/
@@ -310,27 +318,33 @@ public class BirtServices {
// safety check : do not accept "${groovy", "${bsh" and "javascript"
String overideFiltersNoWhiteSpace = overrideFilters.replaceAll("\\s", "");
if (overideFiltersNoWhiteSpace.contains("${groovy:") || overideFiltersNoWhiteSpace.contains("${bsh:") || overideFiltersNoWhiteSpace.contains("javascript:")) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorUnauthorisedCharacter", locale));
if (overideFiltersNoWhiteSpace.contains("${groovy:") || overideFiltersNoWhiteSpace.contains("${bsh:")
|| overideFiltersNoWhiteSpace.contains("javascript:")) {
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorUnauthorisedCharacter", locale));
}
try {
GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", reportContentId).queryOne();
String dataResourceId = content.getString("dataResourceId");
StringBuffer newForm = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?> <forms xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://ofbiz.apache.org/dtds/widget-form.xsd\">");
StringBuffer newForm = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?> <forms xmlns:xsi=\"http://www.w3"
+ ".org/2001/XMLSchema-instance\" "
+ "xmlns=\"http://ofbiz.apache.org/Widget-Form\" "
+ "xsi:schemaLocation=\"http://ofbiz.apache.org/Widget-Form "
+ "http://ofbiz.apache.org/dtds/widget-form.xsd\">");
newForm.append(overrideFilters);
newForm.append("</forms>");
Document xmlForm = UtilXml.readXmlDocument(newForm.toString());
Map<String, Object> result = dispatcher.runSync("updateElectronicTextForm", UtilMisc.toMap("dataResourceId", dataResourceId, "textData", UtilXml.writeXmlDocument(xmlForm),
Map<String, Object> result = dispatcher.runSync("updateElectronicTextForm", UtilMisc.toMap("dataResourceId", dataResourceId,
"textData", UtilXml.writeXmlDocument(xmlForm),
"userLogin", userLogin, "locale", locale));
if (ServiceUtil.isError(result)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
}
} catch (GeneralException | SAXException | ParserConfigurationException | IOException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in overrideReportForm service."); //TODO labelise
}
return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "BirtSearchFormSuccessfullyOverridde", locale));
return ServiceUtil.returnSuccess(UtilProperties.getMessage(RESOURCE, "BirtSearchFormSuccessfullyOverridde", locale));
}
/**
@@ -348,23 +362,24 @@ public class BirtServices {
String contentId = null;
Map<String, Object> result = ServiceUtil.returnSuccess();
try {
Map<String, Object> resultMapsForGeneration = dispatcher.runSync("prepareFlexibleReportFieldsFromEntity", UtilMisc.toMap("modelEntity", modelEntity,
Map<String, Object> resultMapsForGeneration = dispatcher.runSync("prepareFlexibleReportFieldsFromEntity", UtilMisc.toMap("modelEntity",
modelEntity,
"userLogin", userLogin, "locale", locale));
if (ServiceUtil.isError(resultMapsForGeneration)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(resultMapsForGeneration));
}
Map<String, String> dataMap = UtilGenerics.checkMap(resultMapsForGeneration.get("dataMap"));
Map<String, String> dataMap = UtilGenerics.cast(resultMapsForGeneration.get("dataMap"));
Map<String, String> fieldDisplayLabels = null;
if (UtilValidate.isNotEmpty(resultMapsForGeneration.get("fieldDisplayLabels"))) {
fieldDisplayLabels = UtilGenerics.checkMap(resultMapsForGeneration.get("fieldDisplayLabels"));
fieldDisplayLabels = UtilGenerics.cast(resultMapsForGeneration.get("fieldDisplayLabels"));
}
Map<String, String> filterMap = null;
if (UtilValidate.isNotEmpty(resultMapsForGeneration.get("filterMap"))) {
filterMap = UtilGenerics.checkMap(resultMapsForGeneration.get("filterMap"));
filterMap = UtilGenerics.cast(resultMapsForGeneration.get("filterMap"));
}
Map<String, String> filterDisplayLabels = null;
if (UtilValidate.isNotEmpty(resultMapsForGeneration.get("filterDisplayLabels"))) {
filterDisplayLabels = UtilGenerics.checkMap(resultMapsForGeneration.get("filterDisplayLabels"));
filterDisplayLabels = UtilGenerics.cast(resultMapsForGeneration.get("filterDisplayLabels"));
}
contentId = BirtWorker.recordReportContent(delegator, dispatcher, context);
// callPerformFindFromBirt is the customMethod for Entity workflow
@@ -390,7 +405,7 @@ public class BirtServices {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
}
} catch (GeneralException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in createFlexibleReportFromMasterEntityWorkflow service"); //TODO labelise
}
result.put("contentId", contentId);
@@ -427,9 +442,9 @@ public class BirtServices {
}
try {
@SuppressWarnings("unused") // Used only to passively check
ModelService modelService = dctx.getModelService(serviceName);
ModelService modelService = dctx.getModelService(serviceName);
} catch (GenericServiceException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("No service define with name " + serviceName); //TODO labelise
}
contentId = BirtWorker.recordReportContent(delegator, dispatcher, context);
@@ -438,10 +453,10 @@ public class BirtServices {
if (ServiceUtil.isError(serviceResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
}
Map<String, String> dataMap = UtilGenerics.checkMap(serviceResult.get("dataMap"));
Map<String, String> filterMap = UtilGenerics.checkMap(serviceResult.get("filterMap"));
Map<String, String> fieldDisplayLabels = UtilGenerics.checkMap(serviceResult.get("fieldDisplayLabels"));
Map<String, String> filterDisplayLabels = UtilGenerics.checkMap(serviceResult.get("filterDisplayLabels"));
Map<String, String> dataMap = UtilGenerics.cast(serviceResult.get("dataMap"));
Map<String, String> filterMap = UtilGenerics.cast(serviceResult.get("filterMap"));
Map<String, String> fieldDisplayLabels = UtilGenerics.cast(serviceResult.get("fieldDisplayLabels"));
Map<String, String> filterDisplayLabels = UtilGenerics.cast(serviceResult.get("filterDisplayLabels"));
Map<String, Object> resultGeneration = dispatcher.runSync("createFlexibleReport", UtilMisc.toMap(
"locale", locale,
"dataMap", dataMap,
@@ -453,11 +468,11 @@ public class BirtServices {
"fieldDisplayLabels", fieldDisplayLabels,
"filterDisplayLabels", filterDisplayLabels));
if (ServiceUtil.isError(resultGeneration)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCreatingFlexibleReport", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorCreatingFlexibleReport", locale));
}
} catch (GeneralException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCreatingFlexibleReport", locale));
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorCreatingFlexibleReport", locale));
}
result.put("contentId", contentId);
return result;
@@ -470,14 +485,15 @@ public class BirtServices {
Locale locale = (Locale) context.get("locale");
ModelEntity modelEntity = (ModelEntity) context.get("modelEntity");
Map<String, String> dataMap = new HashMap<String, String>();
Map<String, String> fieldDisplayLabels = new HashMap<String, String>();
LinkedHashMap<String, String> filterMap = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> filterDisplayLabels = new LinkedHashMap<String, String>();
Map<String, String> dataMap = new HashMap<>();
Map<String, String> fieldDisplayLabels = new HashMap<>();
LinkedHashMap<String, String> filterMap = new LinkedHashMap<>();
LinkedHashMap<String, String> filterDisplayLabels = new LinkedHashMap<>();
List<String> listEntityFields = modelEntity.getAllFieldNames();
Map<Object, Object> uiLabelMap = new HashMap<Object, Object>();
final String[] resourceGlob = {"OrderUiLabels", "ProductUiLabels", "PartyUiLabels", "ContentUiLabels", "AccountingUiLabels", "CommonUiLabels", "BirtUiLabels"};
Map<Object, Object> uiLabelMap = new HashMap<>();
final String[] resourceGlob = {"OrderUiLabels", "ProductUiLabels", "PartyUiLabels", "ContentUiLabels", "AccountingUiLabels",
"CommonUiLabels", "BirtUiLabels"};
for (String res : resourceGlob) {
uiLabelMap.putAll(UtilProperties.getProperties(res, locale));
}
@@ -507,15 +523,20 @@ public class BirtServices {
filterMap.put(field.concat("_fld0_op"), "short-varchar");
filterMap.put(field.concat("_fld1_value"), mField.getType());
filterMap.put(field.concat("_fld1_op"), "short-varchar");
filterDisplayLabels.put(field.concat("_fld0_value"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(resource, "BirtFindFieldOptionValue0", locale)));
filterDisplayLabels.put(field.concat("_fld0_op"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(resource, "BirtFindFieldOptionValue0", locale).concat(UtilProperties.getMessage(resource, "BirtFindCompareOperator", locale))));
filterDisplayLabels.put(field.concat("_fld1_value"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(resource, "BirtFindFieldOptionValue1", locale)));
filterDisplayLabels.put(field.concat("_fld1_op"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(resource, "BirtFindFieldOptionValue1", locale).concat(UtilProperties.getMessage(resource, "BirtFindCompareOperator", locale))));
filterDisplayLabels.put(field.concat("_fld0_value"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(RESOURCE,
"BirtFindFieldOptionValue0", locale)));
filterDisplayLabels.put(field.concat("_fld0_op"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(RESOURCE,
"BirtFindFieldOptionValue0", locale).concat(UtilProperties.getMessage(RESOURCE, "BirtFindCompareOperator", locale))));
filterDisplayLabels.put(field.concat("_fld1_value"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(RESOURCE,
"BirtFindFieldOptionValue1", locale)));
filterDisplayLabels.put(field.concat("_fld1_op"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(RESOURCE,
"BirtFindFieldOptionValue1", locale).concat(UtilProperties.getMessage(RESOURCE, "BirtFindCompareOperator", locale))));
} else { // remaining types need 4 fields (fld0-1_op-value)
filterMap.put(field, mField.getType());
filterMap.put(field.concat("_op"), "short-varchar");
filterDisplayLabels.put(field, fieldDisplayLabels.get(field));
filterDisplayLabels.put(field.concat("_op"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(resource, "BirtFindCompareOperator", locale)));
filterDisplayLabels.put(field.concat("_op"), fieldDisplayLabels.get(field).concat(UtilProperties.getMessage(RESOURCE,
"BirtFindCompareOperator", locale)));
}
}
Map<String, Object> result = ServiceUtil.returnSuccess();
@@ -544,14 +565,17 @@ public class BirtServices {
try {
GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", reportContentId).cache().queryOne();
String dataResourceId = content.getString("dataResourceId");
GenericValue electronicText = EntityQuery.use(delegator).from("ElectronicText").where("dataResourceId", dataResourceId).cache().queryOne();
GenericValue electronicText =
EntityQuery.use(delegator).from("ElectronicText").where("dataResourceId", dataResourceId).cache().queryOne();
textData = electronicText.getString("textData");
} catch (GenericEntityException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in createFormForDisplay service."); //TODO labelise
}
if (Debug.infoOn()) Debug.logInfo(textData, module);
if (Debug.infoOn()) {
Debug.logInfo(textData, MODULE);
}
textData = textData.substring(textData.indexOf("<form "), textData.length());
if (textData.contains("</form>")) {
textData = textData.substring(0, textData.indexOf("</form>") + 7);
@@ -578,26 +602,27 @@ public class BirtServices {
try {
listContent = EntityQuery.use(delegator).from("Content").where(entityConditionContent).select("contentId").queryList();
} catch (GenericEntityException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in deleteAllReports service."); //TODO labelise
}
if (UtilValidate.isEmpty(listContent)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorNoFlexibleReportToDelete", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorNoFlexibleReportToDelete", locale));
}
listContentId = EntityUtil.getFieldListFromEntityList(listContent, "contentId", true);
try {
for (String contentId : listContentId) {
Map<String, Object> returnMap = dispatcher.runSync("deleteFlexibleReport", UtilMisc.toMap("contentId", contentId, "userLogin", userLogin, "locale", locale));
Map<String, Object> returnMap = dispatcher.runSync("deleteFlexibleReport", UtilMisc.toMap("contentId", contentId, "userLogin",
userLogin, "locale", locale));
if (ServiceUtil.isError(returnMap)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(returnMap));
}
}
} catch (GenericServiceException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in deleteAllReports service."); //TODO labelise
}
return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "BirtFlexibleReportsSuccessfullyDeleted", locale));
return ServiceUtil.returnSuccess(UtilProperties.getMessage(RESOURCE, "BirtFlexibleReportsSuccessfullyDeleted", locale));
}
/**
@@ -625,38 +650,40 @@ public class BirtServices {
.select("drObjectInfo")
.queryList();
} catch (GenericEntityException e1) {
Debug.logError(e1, module);
Debug.logError(e1, MODULE);
return ServiceUtil.returnError("Error in deleteFlexibleReport service."); //TODO labelise
}
if (listRptDesignFileGV.size() > 1) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorUnexpectedNumberReportToDelete", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorUnexpectedNumberReportToDelete", locale));
}
List<String> listRptDesignFile = EntityUtil.getFieldListFromEntityList(listRptDesignFileGV, "drObjectInfo", false);
String rptfileName = listRptDesignFile.get(0);
Path path = Paths.get(rptfileName);
try {
if (!Files.deleteIfExists(path)) {
ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotLocateReportFile", locale));
ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorCannotLocateReportFile", locale));
}
} catch (IOException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in deleteFlexibleReport service."); //TODO labelise
}
try {
delegator.removeByAnd("ContentAttribute", UtilMisc.toMap("contentId", contentId));
Map<String, Object> result = dispatcher.runSync("removeContentAndRelated", UtilMisc.toMap("contentId", contentId, "userLogin", userLogin, "locale", locale));
Map<String, Object> result = dispatcher.runSync("removeContentAndRelated", UtilMisc.toMap("contentId", contentId, "userLogin",
userLogin, "locale", locale));
if (ServiceUtil.isError(result)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
}
result = dispatcher.runSync("removeContentAndRelated", UtilMisc.toMap("contentId", contentIdRpt, "userLogin", userLogin, "locale", locale));
result = dispatcher.runSync("removeContentAndRelated", UtilMisc.toMap("contentId", contentIdRpt, "userLogin", userLogin, "locale",
locale));
if (ServiceUtil.isError(result)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
}
} catch (GenericServiceException | GenericEntityException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in deleteFlexibleReport service."); //TODO labelise
}
return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "BirtFlexibleReportSuccessfullyDeleted", locale));
return ServiceUtil.returnSuccess(UtilProperties.getMessage(RESOURCE, "BirtFlexibleReportSuccessfullyDeleted", locale));
}
/**
@@ -668,7 +695,7 @@ public class BirtServices {
Locale locale = (Locale) context.get("locale");
Delegator delegator = dctx.getDelegator();
Map<String, Object> result = null;
List<String> listSuccessMessage = new ArrayList<String>();
List<String> listSuccessMessage = new ArrayList<>();
// the idea is to allow only design to be uploaded. We use the stored file and add the new design from the uploaded file within.
DesignConfig config = new DesignConfig();
@@ -678,7 +705,7 @@ public class BirtServices {
IDesignEngineFactory factory = (IDesignEngineFactory) Platform.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY);
engine = factory.createDesignEngine(config);
} catch (Exception e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
SessionHandle session = engine.newSessionHandle(ULocale.forLocale(locale));
@@ -686,14 +713,14 @@ public class BirtServices {
// get old file to restore dataset and datasource
ByteBuffer newRptDesignBytes = (ByteBuffer) context.get("uploadRptDesign");
if (newRptDesignBytes == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotFindUploadedFile", locale));
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorCannotFindUploadedFile", locale));
}
GenericValue dataResource = null;
try {
dataResource = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", dataResourceId).queryOne();
} catch (GenericEntityException e1) {
Debug.logError(e1, module);
Debug.logError(e1, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
String rptDesignName = dataResource.getString("objectInfo");
@@ -701,7 +728,7 @@ public class BirtServices {
try {
Platform.startup();
} catch (BirtException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Cannot start Birt platform");
}
@@ -710,7 +737,7 @@ public class BirtServices {
try {
designStored = session.openDesign(rptDesignName);
} catch (DesignFileException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
@@ -724,7 +751,7 @@ public class BirtServices {
try {
iter.remove();
} catch (Exception e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
}
@@ -745,9 +772,9 @@ public class BirtServices {
// user file is deleted straight away to prevent the use of the report as script entry (security)
Path path = Paths.get(nameTempRpt);
Files.deleteIfExists(path);
} catch (Exception e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorInuploadRptDesignNoFile", locale));
} catch (DesignFileException | IOException e) {
Debug.logError(e, MODULE);
return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR, "BirtErrorInuploadRptDesignNoFile", locale));
}
//copy cube
@@ -761,7 +788,7 @@ public class BirtServices {
try {
designStored.getCubes().add(copy);
} catch (Exception e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
}
@@ -777,7 +804,7 @@ public class BirtServices {
try {
designStored.getBody().add(copy);
} catch (Exception e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
}
@@ -792,7 +819,8 @@ public class BirtServices {
}
}
// FXIME ? adding simple master page => All these casts and other occurrences ... It's ugly, but it's so hard that when I find a solution that works ...
// FXIME ? adding simple master page => All these casts and other occurrences ... It's ugly, but it's so hard that when I find a
// solution that works ...
@SuppressWarnings("unchecked")
List<DesignElementHandle> listMasterPages = designFromUser.getMasterPages().getContents();
for (DesignElementHandle masterPage : listMasterPages) {
@@ -802,7 +830,7 @@ public class BirtServices {
}
}
} catch (Exception e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
@@ -812,7 +840,7 @@ public class BirtServices {
try {
designStored.setPageVariable(pageVariable.getName(), pageVariable.getPropertyBindingExpression(pageVariable.getName()));
} catch (SemanticException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
}
@@ -822,7 +850,7 @@ public class BirtServices {
SlotHandle stylesStored = designStored.getStyles();
// getting style names from stored report
List<String> listStyleNames = new ArrayList<String>();
List<String> listStyleNames = new ArrayList<>();
@SuppressWarnings("unchecked")
Iterator<DesignElementHandle> iterStored = stylesStored.iterator();
while (iterStored.hasNext()) {
@@ -841,7 +869,7 @@ public class BirtServices {
try {
designStored.getStyles().add(copy);
} catch (Exception e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
}
@@ -850,17 +878,18 @@ public class BirtServices {
try {
designStored.saveAs(rptDesignName);
} catch (IOException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise
}
designFromUser.close();
designStored.close();
if (Debug.infoOn()) Debug.logInfo("####### Design uploaded: ".concat(rptDesignName), module);
if (Debug.infoOn()) {
Debug.logInfo("####### Design uploaded: ".concat(rptDesignName), MODULE);
}
// TODO check: should we, as a secondary safety precaution, delete any file finishing with _TEMP_.rptdesign?
listSuccessMessage.add(UtilProperties.getMessage(resource, "BirtFlexibleRptDesignSuccessfullyUploaded", locale));
listSuccessMessage.add(UtilProperties.getMessage(RESOURCE, "BirtFlexibleRptDesignSuccessfullyUploaded", locale));
result = ServiceUtil.returnSuccess(listSuccessMessage);
return result;
}
}
}
@@ -39,16 +39,16 @@ import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
public final class BirtUtil {
public final static String module = BirtUtil.class.getName();
private static final String MODULE = BirtUtil.class.getName();
private final static Map<String, String> entityFieldTypeBirtTypeMap = MapUtils.unmodifiableMap(UtilMisc.toMap(
private static final Map<String, String> ENTITY_FIELD_TYPE_BIRT_TYPE_MAP = MapUtils.unmodifiableMap(UtilMisc.toMap(
"id", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"url", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"name", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"value", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"email", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"comment", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"id-long",DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"id-long", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"id-vlong", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"very-long", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
"indicator", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING,
@@ -70,14 +70,14 @@ public final class BirtUtil {
"object", DesignChoiceConstants.COLUMN_DATA_TYPE_JAVA_OBJECT,
"blob", DesignChoiceConstants.COLUMN_DATA_TYPE_BLOB));
private final static Map<String, String> entityFieldTypeBirtParameterTypeMap = MapUtils.unmodifiableMap(UtilMisc.toMap(
private static final Map<String, String> ENTITY_FIELD_TYPE_BIRT_PARAM_TYPE_MAP = MapUtils.unmodifiableMap(UtilMisc.toMap(
"id", DesignChoiceConstants.PARAM_TYPE_STRING,
"url", DesignChoiceConstants.PARAM_TYPE_STRING,
"name", DesignChoiceConstants.PARAM_TYPE_STRING,
"value", DesignChoiceConstants.PARAM_TYPE_STRING,
"email", DesignChoiceConstants.PARAM_TYPE_STRING,
"comment", DesignChoiceConstants.PARAM_TYPE_STRING,
"id-long",DesignChoiceConstants.PARAM_TYPE_STRING,
"id-long", DesignChoiceConstants.PARAM_TYPE_STRING,
"id-vlong", DesignChoiceConstants.PARAM_TYPE_STRING,
"very-long", DesignChoiceConstants.PARAM_TYPE_STRING,
"indicator", DesignChoiceConstants.PARAM_TYPE_STRING,
@@ -99,7 +99,7 @@ public final class BirtUtil {
"object", DesignChoiceConstants.PARAM_TYPE_JAVA_OBJECT,
"blob", DesignChoiceConstants.PARAM_TYPE_JAVA_OBJECT));
private final static Map<String, String> mimeTypeOutputFormatMap = UtilMisc.toMap(
private static final Map<String, String> MIME_TYPE_OUTPUT_FORMAT_MAP = UtilMisc.toMap(
"text/html", RenderOption.OUTPUT_FORMAT_HTML,
"application/pdf", RenderOption.OUTPUT_FORMAT_PDF,
"application/postscript", "postscript",
@@ -113,7 +113,7 @@ public final class BirtUtil {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", "docx",
"application/vnd.openxmlformats-officedocument.presentationml.presentation", "pptx");
private BirtUtil() {}
private BirtUtil() { }
/**
* Return birt field type corresponding to given entity field type
@@ -124,11 +124,11 @@ public final class BirtUtil {
if (UtilValidate.isEmpty(entityFieldType)) {
return null;
}
return entityFieldTypeBirtTypeMap.get(entityFieldType.toLowerCase());
return ENTITY_FIELD_TYPE_BIRT_TYPE_MAP.get(entityFieldType.toLowerCase());
}
/**
* Return birt parameter type corresponding to given entity field type
* Return birt parameter type corresponding to given entity field type
* @param entityFieldType
* @return birt parameter type corresponding to given entity field type
*/
@@ -136,7 +136,7 @@ public final class BirtUtil {
if (UtilValidate.isEmpty(entityFieldType)) {
return null;
}
return entityFieldTypeBirtParameterTypeMap.get(entityFieldType.toLowerCase());
return ENTITY_FIELD_TYPE_BIRT_PARAM_TYPE_MAP.get(entityFieldType.toLowerCase());
}
/**
@@ -145,7 +145,7 @@ public final class BirtUtil {
* @return true if mime type related to a contentType is supported by Birt
*/
public static boolean isSupportedMimeType(String contentType) {
return mimeTypeOutputFormatMap.containsKey(contentType);
return MIME_TYPE_OUTPUT_FORMAT_MAP.containsKey(contentType);
}
/**
@@ -156,7 +156,7 @@ public final class BirtUtil {
*/
public static String getMimeTypeOutputFormat(String contentType) throws GeneralException {
if (isSupportedMimeType(contentType)) {
return mimeTypeOutputFormatMap.get(contentType);
return MIME_TYPE_OUTPUT_FORMAT_MAP.get(contentType);
}
throw new GeneralException("Unknown content type : " + contentType);
}
@@ -237,4 +237,4 @@ public final class BirtUtil {
if (UtilValidate.isEmpty(reportName)) return "";
return StringUtil.replaceString(StringUtil.removeRegex(reportName.trim(), "[^\\p{L}\\s]"), " ", "_");
}
}
}
@@ -66,29 +66,34 @@ import com.ibm.icu.util.ULocale;
public class ReportDesignGenerator {
private static final String module = ReportDesignGenerator.class.getName();
private static final String MODULE = ReportDesignGenerator.class.getName();
private static final String RES_ERROR = "BirtErrorUiLabels";
private Locale locale;
private ElementFactory factory;
/** The generated design */
/**
* The generated design
*/
private ReportDesignHandle design;
private Map<String, String> dataMap;
/** Map of all filter supported by the report design */
/**
* Map of all filter supported by the report design
*/
private Map<String, String> filterMap;
/** Service name to populate dataset of the report design*/
/**
* Service name to populate dataset of the report design
*/
private String serviceName;
private Map<String, String> fieldDisplayLabels;
private Map<String, String> filterDisplayLabels;
private String rptDesignName;
private boolean generateFilters = false;
public static final String resource_error = "BirtErrorUiLabels";
public ReportDesignGenerator(Map<String, Object> context, DispatchContext dctx) throws GeneralException, SemanticException {
locale = (Locale) context.get("locale");
dataMap = UtilGenerics.checkMap(context.get("dataMap"));
dataMap = UtilGenerics.cast(context.get("dataMap"));
filterMap = UtilGenerics.cast(context.get("filterMap"));
serviceName = (String) context.get("serviceName");
fieldDisplayLabels = UtilGenerics.checkMap(context.get("fieldDisplayLabels"));
fieldDisplayLabels = UtilGenerics.cast(context.get("fieldDisplayLabels"));
filterDisplayLabels = UtilGenerics.cast(context.get("filterDisplayLabels"));
rptDesignName = (String) context.get("rptDesignName");
String writeFilters = (String) context.get("writeFilters");
@@ -104,13 +109,14 @@ public class ReportDesignGenerator {
* Generate report design (rtdesign file).
* @throws IOException
* @throws GeneralException
* @throws BirtException
* @throws BirtException
*/
public void buildReport() throws IOException, GeneralException, BirtException {
DesignConfig config = new DesignConfig();
Platform.startup();
IDesignEngine engine = ((IDesignEngineFactory) Platform.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY)).createDesignEngine(config);
IDesignEngine engine = ((IDesignEngineFactory) Platform.createFactoryObject(
IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY)).createDesignEngine(config);
// creating main design elements
SessionHandle session = engine.newSessionHandle(ULocale.forLocale(locale));
design = session.createDesign();
@@ -146,7 +152,7 @@ public class ReportDesignGenerator {
for (String filter : filterMap.keySet()) {
String birtType = BirtUtil.convertFieldTypeToBirtParameterType(filterMap.get(filter));
if (birtType == null) {
throw new GeneralException(UtilProperties.getMessage(resource_error, "BirtErrorConversionFieldToBirtFailed", locale));
throw new GeneralException(UtilProperties.getMessage(RES_ERROR, "BirtErrorConversionFieldToBirtFailed", locale));
}
// get label
String displayFilterName;
@@ -156,10 +162,13 @@ public class ReportDesignGenerator {
displayFilterName = filter;
}
ScalarParameterHandle scalParam = factory.newScalarParameter(filter);
// scalParam.setDisplayName(displayFilterName); // TODO has no incidence at all right now, is only displayed when using birt's report parameter system. Not our case. I leave it here if any idea arise of how to translate these.
// scalParam.setDisplayName(displayFilterName); // TODO has no incidence at all right now, is only displayed when using birt's
// report parameter system. Not our case. I leave it here if any idea arise of how to translate these.
scalParam.setPromptText(displayFilterName);
if ("javaObject".equals(birtType)) { //Fields of type='blob' are rejected by Birt: org.eclipse.birt.report.model.api.metadata.PropertyValueException: The choice value "javaObject" is not allowed.
throw new GeneralException("Fields of type='blob' are rejected by Birt. Create a view entity, based on the requested entity, where you exclude the field of type='blob'");
if ("javaObject".equals(birtType)) { //Fields of type='blob' are rejected by Birt: org.eclipse.birt.report.model.api.metadata
// .PropertyValueException: The choice value "javaObject" is not allowed.
throw new GeneralException("Fields of type='blob' are rejected by Birt. Create a view entity, based on the requested entity, "
+ "where you exclude the field of type='blob'");
} else {
scalParam.setDataType(birtType);
}
@@ -213,16 +222,18 @@ public class ReportDesignGenerator {
ImageHandle image = factory.newImage(null);
CellHandle cell = (CellHandle) row.getCells().get(0);
cell.getContent().add(image);
image.setURL("http://ofbiz.apache.org/images/ofbiz_logo.png");
image.setURL("https://ofbiz.apache.org/images/ofbiz_logo.png");
LabelHandle label = factory.newLabel(null);
cell = (CellHandle) row.getCells().get(1);
cell.getContent().add(label);
label.setText("Dat is dat test !");
// ################ CODE HERE IF YOU WANT TO ADD GENERATED DESIGN / MAY BE WORTH USING RPTTEMPLATE AND-OR RPTLIBRARY ################### */
design.saveAs(rptDesignName);
design.close();
if (Debug.infoOn())Debug.logInfo("####### Design generated: " + rptDesignName, module);
if (Debug.infoOn()) {
Debug.logInfo("####### Design generated: " + rptDesignName, MODULE);
}
session.closeAll(false);
Platform.shutdown();
}
@@ -232,7 +243,7 @@ public class ReportDesignGenerator {
* <p>This script is used to populate Birt design parameters from input</p>
*/
private void createScriptedBeforeFactory() {
StringBuffer beforeFactoryScript = new StringBuffer("Debug.logInfo(\"###### In beforeFactory\", module);\n");
StringBuffer beforeFactoryScript = new StringBuffer("Debug.logInfo(\"###### In beforeFactory\", MODULE);\n");
beforeFactoryScript.append("var inputFields = reportContext.getParameterValue(\"parameters\");\n");
beforeFactoryScript.append("//get a list of all report parameters\n");
beforeFactoryScript.append("var parameters = reportContext.getDesignHandle().getAllParameters();\n");
@@ -262,20 +273,22 @@ public class ReportDesignGenerator {
dataSetInitializeScript.append("importPackage(Packages.org.apache.ofbiz.service);\n");
dataSetInitializeScript.append("importPackage(Packages.org.apache.ofbiz.base.util);\n");
dataSetInitializeScript.append("importPackage(java.util);\n");
dataSetInitializeScript.append("module = \"" + rptDesignName + "\";");
dataSetInitializeScript.append("Debug.logInfo(\"###### In initialize \", module);");
dataSetInitializeScript.append("MODULE = \"" + rptDesignName + "\";");
dataSetInitializeScript.append("Debug.logInfo(\"###### In initialize \", MODULE);");
design.setInitialize(dataSetInitializeScript.toString());
// set open Birt script
StringBuffer dataSetOpenScript = new StringBuffer("importPackage(Packages.org.apache.ofbiz.birt);\n");
dataSetOpenScript.append("Debug.logInfo(\"#### In open\", module)\n");
dataSetOpenScript.append("Debug.logInfo(\"#### In open\", MODULE)\n");
dataSetOpenScript.append("try {\n");
dataSetOpenScript.append(" listRes = dispatcher.runSync(\"" + serviceName + "\", UtilMisc.toMap(\"userLogin\", reportContext.getParameterValue(\"userLogin\"), \"locale\", reportContext.getParameterValue(\"locale\"), \"reportContext\", reportContext));\n");
dataSetOpenScript.append(" listRes = dispatcher.runSync(\"" + serviceName + "\", UtilMisc.toMap(\"userLogin\", reportContext"
+ ".getParameterValue(\"userLogin\"), \"locale\", reportContext.getParameterValue(\"locale\"), "
+ "\"reportContext\", reportContext));\n");
dataSetOpenScript.append(" if (ServiceUtil.isError(listRes)) {\n");
dataSetOpenScript.append(" Debug.logError(ServiceUtil.getErrorMessage(listRes));\n");
dataSetOpenScript.append(" }\n");
dataSetOpenScript.append("}\n");
dataSetOpenScript.append("catch (e) { Debug.logError(e, module); }\n");
dataSetOpenScript.append("catch (e) { Debug.logError(e, MODULE); }\n");
dataSetOpenScript.append("records = listRes.get(\"records\");\n");
dataSetOpenScript.append("countOfRow = 0;\n");
dataSetOpenScript.append("totalRow = records.size();\n");
@@ -310,7 +323,7 @@ public class ReportDesignGenerator {
resultSetCol.setColumnName(field);
String birtType = BirtUtil.convertFieldTypeToBirtType(dataMap.get(field));
if (birtType == null) {
throw new GeneralException(UtilProperties.getMessage(resource_error, "BirtErrorConversionFieldToBirtFailed", locale));
throw new GeneralException(UtilProperties.getMessage(RES_ERROR, "BirtErrorConversionFieldToBirtFailed", locale));
}
resultSetCol.setPosition(i);
resultSetCol.setDataType(birtType);
@@ -334,7 +347,9 @@ public class ReportDesignGenerator {
design.getDataSets().add(dataSetHandle);
}
/** Create new dataSource named OFBiz */
/**
* Create new dataSource named OFBiz
*/
private void createScriptedDataSource() throws SemanticException {
ScriptDataSourceHandle dataSource = factory.newScriptDataSource("OFBiz");
design.getDataSources().add(dataSource);
@@ -37,12 +37,12 @@ import org.apache.ofbiz.birt.BirtWorker;
@SuppressWarnings("serial")
public class BirtViewerServlet extends ViewerServlet {
public final static String module = BirtViewerServlet.class.getName();
private static final String MODULE = BirtViewerServlet.class.getName();
@Override
protected IContext __getContext(HttpServletRequest request, HttpServletResponse response) throws BirtException {
BirtReportServiceFactory.getReportService().setContext(getServletContext(), null);
// set app context
Map<String, Object> appContext = UtilGenerics.cast(ReportEngineService.getInstance().getEngineConfig().getAppContext());
try {
@@ -50,8 +50,6 @@ public class BirtViewerServlet extends ViewerServlet {
} catch (GeneralException e) {
throw new BirtException(e.getMessage());
}
return new BirtContext(new ViewerServletRequest(ParameterAccessor.getParameter(request, ParameterAccessor.PARAM_REPORT)
, request), response);
return new BirtContext(new ViewerServletRequest(ParameterAccessor.getParameter(request, ParameterAccessor.PARAM_REPORT), request), response);
}
}
@@ -24,24 +24,22 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.ofbiz.base.util.GeneralException;
import org.apache.ofbiz.base.util.UtilGenerics;
import org.apache.ofbiz.birt.BirtWorker;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.report.context.BirtContext;
import org.eclipse.birt.report.context.IContext;
import org.eclipse.birt.report.service.BirtReportServiceFactory;
import org.eclipse.birt.report.service.ReportEngineService;
import org.eclipse.birt.report.utility.ParameterAccessor;
import org.apache.ofbiz.base.util.UtilGenerics;
import org.apache.ofbiz.birt.BirtWorker;
@SuppressWarnings("serial")
public class BirtEngineServlet extends org.eclipse.birt.report.servlet.BirtEngineServlet {
public final static String module = BirtEngineServlet.class.getName();
public class OfbizBirtEngineServlet extends org.eclipse.birt.report.servlet.BirtEngineServlet {
@Override
protected IContext __getContext(HttpServletRequest request, HttpServletResponse response) throws BirtException {
BirtReportServiceFactory.getReportService().setContext(getServletContext(), null);
// set app context
Map<String, Object> appContext = UtilGenerics.cast(ReportEngineService.getInstance().getEngineConfig().getAppContext());
try {
@@ -49,7 +47,6 @@ public class BirtEngineServlet extends org.eclipse.birt.report.servlet.BirtEngin
} catch (GeneralException e) {
throw new BirtException(e.getMessage());
}
return new BirtContext(new ViewerServletRequest(ParameterAccessor.getParameter(request, ParameterAccessor.PARAM_REPORT)
, request), response);
return new BirtContext(new ViewerServletRequest(ParameterAccessor.getParameter(request, ParameterAccessor.PARAM_REPORT), request), response);
}
}
@@ -30,16 +30,13 @@ import org.apache.ofbiz.base.location.FlexibleLocation;
import org.apache.ofbiz.base.util.Debug;
public class ViewerServletRequest extends HttpServletRequestWrapper {
public final static String module = ViewerServletRequest.class.getName();
protected String originalReportParam = null;
private static final String MODULE = ViewerServletRequest.class.getName();
private String originalReportParam = null;
public ViewerServletRequest(String originalReportParam, HttpServletRequest request) {
super(request);
this.originalReportParam = originalReportParam;
}
@Override
public String getParameter(String name) {
if (ParameterAccessor.PARAM_REPORT.equals(name)) {
@@ -53,7 +50,7 @@ public class ViewerServletRequest extends HttpServletRequestWrapper {
try {
reportFileUrl = FlexibleLocation.resolveLocation(reportParam, loader);
} catch (MalformedURLException e) {
Debug.logError(e, module);
Debug.logError(e, MODULE);
}
if (reportFileUrl == null) {
throw new IllegalArgumentException("Could not resolve location to URL: " + reportParam);
@@ -51,29 +51,32 @@ import org.xml.sax.SAXException;
public class BirtViewHandler implements ViewHandler {
public static final String module = BirtViewHandler.class.getName();
public static final String resource_error = "BirtErrorUiLabels";
protected ServletContext servletContext = null;
private static final String MODULE = BirtViewHandler.class.getName();
private static final String RES_ERROR = "BirtErrorUiLabels";
private ServletContext servletContext = null;
private String name = "birt";
@Override
public void init(ServletContext context) throws ViewHandlerException {
this.servletContext = context;
}
@Override
public String getName() {
return name;
}
@Override
public void setName(String name) {
this.name = name;
}
@Override
public void render(String name, String page, String info,
String contentType, String encoding, HttpServletRequest request,
HttpServletResponse response) throws ViewHandlerException {
try {
IReportEngine engine = org.apache.ofbiz.birt.BirtFactory.getReportEngine();
// open report design
@@ -85,7 +88,7 @@ public class BirtViewHandler implements ViewHandler {
}
if (UtilValidate.isEmpty(page)) {
Locale locale = request.getLocale();
throw new ViewHandlerException(UtilProperties.getMessage(resource_error, "BirtErrorNotPublishedReport", locale));
throw new ViewHandlerException(UtilProperties.getMessage(RES_ERROR, "BirtErrorNotPublishedReport", locale));
}
if (page.startsWith("component://")) {
InputStream reportInputStream = BirtFactory.getReportInputStreamFromLocation(page);
@@ -93,13 +96,13 @@ public class BirtViewHandler implements ViewHandler {
} else {
design = engine.openReportDesign(page);
}
Map<String, Object> appContext = UtilGenerics.cast(engine.getConfig().getAppContext());
BirtWorker.setWebContextObjects(appContext, request, response);
Map<String, Object> context = new HashMap<String, Object>();
Map<String, Object> context = new HashMap<>();
// set parameters from request
Map<String, Object> parameters = UtilGenerics.cast(request.getAttribute(BirtWorker.getBirtParameters()));
Map<String, Object> parameters = UtilGenerics.cast(request.getAttribute(BirtWorker.getBirtParameters()));
if (parameters != null) {
context.put(BirtWorker.getBirtParameters(), parameters);
} else {
@@ -110,13 +113,13 @@ public class BirtViewHandler implements ViewHandler {
if (locale == null) {
locale = UtilHttp.getLocale(request);
}
// set override content type
String overrideContentType = request.getParameter(BirtWorker.getBirtContentType());
if (UtilValidate.isNotEmpty(overrideContentType)) {
contentType = overrideContentType;
}
// set output file name to get also file extension
String outputFileName = request.getParameter(BirtWorker.getBirtOutputFileName());
if (UtilValidate.isNotEmpty(outputFileName)) {
@@ -151,11 +154,11 @@ public class BirtViewHandler implements ViewHandler {
throw new ViewHandlerException("general error: " + e.toString(), e);
} catch (SAXException se) {
String errMsg = "Error SAX rendering " + page + " view handler: " + se.toString();
Debug.logError(se, errMsg, module);
Debug.logError(se, errMsg, MODULE);
throw new ViewHandlerException(errMsg, se);
} catch (ParserConfigurationException pe) {
String errMsg = "Error parser rendering " + page + " view handler: " + pe.toString();
Debug.logError(pe, errMsg, module);
Debug.logError(pe, errMsg, MODULE);
throw new ViewHandlerException(errMsg, pe);
}
}
+10 -1
View File
@@ -19,7 +19,7 @@ specific language governing permissions and limitations
under the License.
-->
<web-app version="3.0">
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>Apache OFBiz - Accounting Manager</display-name>
<description>Accounting Manager Module of the Apache OFBiz Project</description>
@@ -63,6 +63,11 @@ under the License.
<filter-name>ContextFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class>
</filter>
<filter>
<display-name>SameSiteFilter</display-name>
<filter-name>SameSiteFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.SameSiteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ControlFilter</filter-name>
<url-pattern>/*</url-pattern>
@@ -71,6 +76,10 @@ under the License.
<filter-name>ContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SameSiteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener><listener-class>org.apache.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
<listener><listener-class>org.apache.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
+10 -12
View File
@@ -18,7 +18,7 @@ specific language governing permissions and limitations
under the License.
-->
<web-app version="3.0">
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>Apache OFBiz - BIRT Component</display-name>
<description>BIRT Component of the Apache OFBiz Project</description>
@@ -35,16 +35,6 @@ under the License.
<param-name>mainDecoratorLocation</param-name>
<param-value>component://birt/widget/birt/BirtScreens.xml</param-value>
</context-param>
<context-param>
<description>Enable widget boundary comments. See org.apache.ofbiz.widget.model.ModelWidget.widgetBoundaryCommentsEnabled().</description>
<param-name>widgetVerbose</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<description>Remove unnecessary whitespace from HTML output.</description>
<param-name>compressHTML</param-name>
<param-value>false</param-value>
</context-param>
<filter>
<display-name>ControlFilter</display-name>
@@ -64,6 +54,11 @@ under the License.
<filter-name>ContextFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class>
</filter>
<filter>
<display-name>SameSiteFilter</display-name>
<filter-name>SameSiteFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.SameSiteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ControlFilter</filter-name>
<url-pattern>/*</url-pattern>
@@ -72,6 +67,10 @@ under the License.
<filter-name>ContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SameSiteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener><listener-class>org.apache.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
<listener><listener-class>org.apache.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
@@ -142,7 +141,6 @@ under the License.
<url-pattern>/extract</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
-52
View File
@@ -1,52 +0,0 @@
<%--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--%>
<%@ page import="org.apache.ofbiz.base.util.*" %>
<html>
<head>
<title>OFBiz Message</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %>
<body bgcolor="#FFFFFF">
<div align="center">
<br/>
<table width="100%" border="1" height="200">
<tr>
<td>
<table width="100%" border="0" height="200">
<tr bgcolor="#CC6666">
<td height="45">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div>
</td>
</tr>
<tr>
<td>
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div align="center"></div>
</body>
</html>
+10 -1
View File
@@ -19,7 +19,7 @@ specific language governing permissions and limitations
under the License.
-->
<web-app version="3.0">
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>Apache OFBiz - Facility Manager</display-name>
<description>Facility Manager Module of the Apache OFBiz Project</description>
@@ -63,6 +63,11 @@ under the License.
<filter-name>ContextFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class>
</filter>
<filter>
<display-name>SameSiteFilter</display-name>
<filter-name>SameSiteFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.SameSiteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ControlFilter</filter-name>
<url-pattern>/*</url-pattern>
@@ -71,6 +76,10 @@ under the License.
<filter-name>ContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SameSiteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener><listener-class>org.apache.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
<listener><listener-class>org.apache.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
+10 -1
View File
@@ -19,7 +19,7 @@ specific language governing permissions and limitations
under the License.
-->
<web-app version="3.0">
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>Apache OFBiz - Order Manager</display-name>
<description>Order Manager Module of the Apache OFBiz Project</description>
@@ -58,6 +58,11 @@ under the License.
<filter-name>ContextFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class>
</filter>
<filter>
<display-name>SameSiteFilter</display-name>
<filter-name>SameSiteFilter</filter-name>
<filter-class>org.apache.ofbiz.webapp.control.SameSiteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ControlFilter</filter-name>
<url-pattern>/*</url-pattern>
@@ -66,6 +71,10 @@ under the License.
<filter-name>ContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SameSiteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener><listener-class>org.apache.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
<listener><listener-class>org.apache.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
+3 -2
View File
@@ -43,6 +43,7 @@ under the License.
<set field="applicationMenuName" value="BirtAppBar" global="true"/>
<set field="applicationMenuLocation" value="component://birt/widget/birt/BirtMenus.xml" global="true"/>
<set field="applicationTitle" from-field="uiLabelMap.BirtExampleApplication" global="true"/>
<set field="helpAnchor" from-field="helpAnchor" default-value="_birt_ofbiz_plugin"/>
</actions>
<widgets>
<include-screen name="ApplicationDecorator" location="component://commonext/widget/CommonScreens.xml"/>
@@ -225,12 +226,12 @@ under the License.
<field-map field-name="mainAction" value="CREATE"/>
</service>
<set field="hasCreatePermission" from-field="permCreateResult.hasPermission"/>
<service service-name="genericBirtPermission" result-map="permDeleteResult">
<field-map field-name="mainAction" value="DELETE"/>
</service>
<set field="hasDeletePermission" from-field="permDeleteResult.hasPermission"/>
<service service-name="genericBirtPermission" result-map="permUpdateResult">
<field-map field-name="mainAction" value="UPDATE"/>
</service>
+4 -4
View File
@@ -55,8 +55,8 @@ under the License.
<label style="h1" text="${uiLabelMap.ProductInventoryByProduct} ${uiLabelMap.CommonFor} ${facility.facilityName}"/>
</container>
<container>
<link target="ViewFacilityInventoryByProductReport?${searchParameterString}" text="${uiLabelMap.CommonPrint}" style="buttontext"/>
<link target="ViewFacilityInventoryByProductExport?${searchParameterString}" text="${uiLabelMap.CommonExport}" style="buttontext"/>
<link target="ViewFacilityInventoryByProductReport?${searchParameterString}" text="${uiLabelMap.CommonPrint}" style="buttontext" target-window="_blank"/>
<link target="ViewFacilityInventoryByProductExport?${searchParameterString}" text="${uiLabelMap.CommonExport}" style="buttontext" target-window="_blank"/>
<link target="ViewFacilityInventoryHistoryReport?${searchParameterString}" text="${uiLabelMap.BirtFacilityReportInventoryHistoryReport}" style="buttontext"/>
</container>
<screenlet title="${uiLabelMap.PageTitleFindFacilityInventoryItemsByProduct}">
@@ -86,8 +86,8 @@ under the License.
<label style="h1" text="${uiLabelMap.ProductInventoryByProduct} ${uiLabelMap.CommonFor} ${facility.facilityName}"/>
</container>
<container>
<link target="ViewFacilityInventoryByProductReport?facilityId=${parameters.facilityId}" text="${uiLabelMap.CommonPrint}" style="buttontext"/>
<link target="ViewFacilityInventoryByProductExport?facilityId=${parameters.facilityId}" text="${uiLabelMap.CommonExport}" style="buttontext"/>
<link target="ViewFacilityInventoryByProductReport?facilityId=${parameters.facilityId}" text="${uiLabelMap.CommonPrint}" style="buttontext" target-window="_blank"/>
<link target="ViewFacilityInventoryByProductExport?facilityId=${parameters.facilityId}" text="${uiLabelMap.CommonExport}" style="buttontext" target-window="_blank"/>
<link target="ViewFacilityInventoryHistoryReport?facilityId=${parameters.facilityId}" text="${uiLabelMap.BirtFacilityReportInventoryHistoryReport}" style="buttontext"/>
</container>
<screenlet title="${uiLabelMap.BirtFacilityReportInventoryHistoryReport}">
+2 -1
View File
@@ -57,7 +57,8 @@ under the License.
<form name="SaleOrdersByChannel" type="single" target="OrdersByChannel.pdf" target-window="_BLANK">
<field name="SalesChannel" title="${uiLabelMap.OrderSalesChannel}">
<drop-down allow-empty="true">
<drop-down allow-empty="false">
<option key="" description="${uiLabelMap.CommonAll}"/>
<entity-options entity-name="Enumeration" key-field-name="enumId" description="${description}">
<entity-constraint name="enumTypeId" operator="equals" value="ORDER_SALES_CHANNEL"/>
</entity-options>

Some files were not shown because too many files have changed in this diff Show More