(OFBIZ-8337)
Continuing the refactoring work on the startup sequence, this commit
specifically focuses on the ComponentContainer and how it loads
components into the system. The following changes are made:
- simplify and cleanup the ofbiz-containers.xml to have only one entry
- substantially simplify the ComponentLoaderConfig class and remove unnecessary defined state
- delete the JustLoadComponentsContainer (used to exist for the server command --testlist which no longer exists)
- fully refactor the ComponentContainer class and breakup the messy logic into chunks of private methods. The methods are also properly documented.
- remove an old reference to the testlist container which no longer exists
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1772256 13f79535-47bb-0310-9956-ffa450edef68
code using it, that wraps most of the OFBiz integration with FreeMarker.
This is the list of the main modifications:
* simplified and cleaned up the public methods of FreeMarkerWorker, used to
retrieve and render Freemarker templates and changed client code accordingly to
use them
* removed unused methods in FreeMarkerWorker and made some others private
* improved the integration code in FreeMarkerWorker to better use the Freemarker
API and specifically to leverage the various TemplateLoaders and the Freemarker
caching mechanism; it is now possible to switch the OFBiz legacy template
caching mechanism to use the Freemarker one instead
* improved the implementation of Freemarker template rendering from strings
(used by DataResourceWorker): it now leverages the Freemarker's
StringTemplateLoader that provides the ability to cache the strings, retrieved
from DataResources records, based on the timestamp of the last modification
* moved freemarkerImports.properties from "widget" to "base" component, and
changed its content (and the content of the associated templates
AutoImportTemplate.ftl and HtmlTemplate.ftl) to remove the dependency from base
to widget&common; some resources of "widget" and "common" are still referenced
from AutoImportTemplate.ftl (that is in "base") but even if they are soft
dependencies: if they are missing the system will load properly without any
error or warning; before this change it was impossible to use, or unit test,
FreeMarkerWorker before the "widget" and "common" components were loaded by the
system, now it is possible
* created a new class for unit tests for FreeMarkerWorker, named
FreeMarkerWorkerTests: at the moment it contains just one simple unit test but
more should be implemented
* refactored WebToolsServices.entityImport(...) to leverage the
FreeMarkerWorker.renderTemplate(...) method to run the Freemarker template,
rather than dealing with the Freemarker API directly; this is now possible
thanks to the cleanups and improvements done in the FreeMarkerWorker class; this
same approach should be implemented for a few other similar integration points
(mostly in the "content" component); this is a TODO item
* moved the encodeDoubleQuotes(...) method from FreeMarkerWorker to
MacroFormRenderer and made it private since this is the only calss using it and
its logic is not related to FreeMarker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762227 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-8224)
This commit removes the support for the Bean Scripting Framework (BSF) from the OFBiz framework:
no application code was using this since several years and there are better and more modern tools at the present time.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760384 13f79535-47bb-0310-9956-ffa450edef68
* https://localhost:8443/webtools/control/LogView
* https://localhost:8443/webtools/control/FetchLogs
Each method use the same line rendering and the difference is : LogView display only runtime/logs/ofbiz.log (or you can surcharge it vith debug.properties) and FecthLogs list all file name ofbiz* present on runtime/logs/ofbiz.log and offert the possibility to search only line that macth a string.
I review the code to use only one script (remove LogView.groovy) and improve following points :
* Optimise the FetchLog.groovy to display with same velocity a file with or without string chain filtering
* Add a property to change the root log directory. Under linux we use /var/log/ofbiz/
* Add a regExp to match the file name of file present in the directory. Helpful when you want to see error.log
* Complete debug.properties with comment for describe example for new properties
And last point, add refresh button on the end page to reload the log without lost your state on the page.
Related issue OFBIZ-7944
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1755302 13f79535-47bb-0310-9956-ffa450edef68
Most is done already. Test pass but testFopMacroLibrary but I don't see how it could be related to these changes, could be a quirk on Windows, BuilBot will tell us. Anyway, I will later double-check to be sure, also to see if I did not miss anything else.
I have voluntarily left 2 or 3 moot points
I was unable to remove possible POS references in <property key="FieldDescription.ProductStore.isImmediatelyFulfilled"> for certain language I'm unable to read.
I have to check if we should keep or not this code snippet
<!-- if inventory info is not available for all of the products, then don't do the issuance, ie there has to be at least SOME inventory info in the database to facilitate inventory-less POS terminals -->
<entity-count entity-name="InventoryItem" count-field="iiCount">
<condition-expr field-name="facilityId" operator="equals" from-field="orderHeader.originFacilityId"/>
</entity-count>
I simply commented out twice this snippet in InvoiceServices.java, because I wonder if it would not be useful when the webPos will be able to issue money change
// if (null == adj.get("amount")) { // JLR 17/4/7 : fix a bug coming from POS in case of use of a discount (on item(s) or sale, sale here) and a cash amount higher than total (hence issuing change)
// continue;
// }
While at it, since I modified OPTIONAL_LIBRARIES, I also changed these svn:properties: svn:eol-style = native & svn:mime-type = text/plain
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1754402 13f79535-47bb-0310-9956-ffa450edef68
We had already the org.apache logger. IIRW, it's because we use Apache libs (eg Tomcat) and we want to be warned when issues appear at this level.
By adding the org.apache.ofbiz info logger we should keep warnings a the org.apache level and get info at the org.apache.ofbiz level
I'm though unsure why we needed
<logger name="org.apache.ofbiz.base.converter.Converters" level="warn"/>
which seems contradictory. I Googled for an explanation but I'm still short of it. I'll check with http://logging.apache.org/log4j/2.x/manual/configuration.html.
For now it works, so I apply the patch because it's already a relief and will help to resolve the harder problem of instable tests results.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1753029 13f79535-47bb-0310-9956-ffa450edef68
Remove all bsh libraries and bsh remaining fonctionnalities.
Bsh interpreter is replaced by GroovyShell evaluation.
To avoid groovyShell undefined var exception, the evaluated expression is analysed, detecting variables used and setting its to null if undefined in context.
Today only alphabetic variable with '_' are detected (i.e. my_variable==null).
Add in example a test replacement of " syntax to simple quote.
Remove all found bsh references
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752231 13f79535-47bb-0310-9956-ffa450edef68
This feature has been contributed a long time ago as an experimental feature but never really matured into a production ready artifact: since it was contributed, no users asked about how to use it, or tested it, or reported bugs or enhancement requests.
More importantly, the feature has always been disabled in the OFBiz framework (i.e. the widget code and the entity engine code were not using it).
This removal should not impact our user base; however, after the removal, an entry to the Attic will be created to keep track of it and to make it easier, to interested users, to get this code, improve it (e.g. by making it dependent on a live external jar, for example MapDB instead of JDBM) and possibly contribute it back to the project.
The most compelling reason for its removal is that the feature was based on a snapshot, unreleased version of JDBM, which is now a mostly dead project: for licensing reasons we are no more allowed to bundle jars in our releases. Additionally, having code that relies an old jar from a no more active project represents a maintenance issue for the community.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751817 13f79535-47bb-0310-9956-ffa450edef68
Fixes "Comment out RMI related code because of the Java deserialization issue" - https://issues.apache.org/jira/browse/OFBIZ-6942
We decided to comment out as less as possible because once, in the start and both properties; the rmi part is off and the related test services are off there is no RMI related danger left (test services are not a danger but would fail during tests run).
It's then easier for users who need RMI in their projects to have only to uncomment those and not digg everywhere.
[CVE-2016-2170] The infamous Java serialization vulnerability
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1736083 13f79535-47bb-0310-9956-ffa450edef68
I decided to comment out as less as possible because once the RMI loaders, the RMI dispatcher and the related test services are off there is no RMI related danger left (test services are not a danger but would fail during tests run). It's then easier for users who need RMI in their projects to have only to uncomment those and not digg everywhere. Because the naming (JNDI) server relies on the rmi loader it will also be commented out.
[CVE-2016-2170] The infamous Java serialization vulnerability
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1735569 13f79535-47bb-0310-9956-ffa450edef68
As explained in OFBIZ-6669 last comments, contrary to what I did in ContentWorker class, when I before did the work on *ContentWrapper classes I did not use the sanitizer but only an encoder (either HTML or URL).
Because I wrongly supposed that only plain text was used there and certainly my lazy mind thought it was easier because of the URL encoderType to also handle.
When the encoderType is HTML, we now use the sanitizer in *ContentWrapper classes, and ContentWorker.java has also been adapted.
For that I enhanced the UtilCodec class. The sanitizer is only used when HTML is requested, else the sanitize() method simply calls the encode() method.
I removed the content.sanitize property in content.properties and added a sanitizer.permissive.policy property in the new owasp.properties (in base config) with some explanations. This allows for more configuration.
I changed the line 85 in productsummary.ftl to use an HTML content wrapper, same in minilastviewedcategories.ftl.
To be totally complete, we should change *lines like* in productsummary.ftl line 85 to use an HTML content wrapper.
Not easy to spot but anyway those not done will simply not totally show well, without any security impacts.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713634 13f79535-47bb-0310-9956-ffa450edef68
Currently only a list of geoPoints is shown. The user experience will improve when we not only show that, but a map as well.
jleroux:
I refactored the js scripts in party editGeoLocation.ftl and added webtools GeoLocation.ftl into a new common GoogleGeoLocation.ftl template now included in both party editGeoLocation.ftl and webtools GeoLocation.ftl
I also removed trailing blanks in common GeoLocation.ftl template.
I also added a French label
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713627 13f79535-47bb-0310-9956-ffa450edef68
I had to comment out two lines in the unit tests because they were failing after the upgrade; still investigating on this.
This commit resolves OFBIZ-5343.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648747 13f79535-47bb-0310-9956-ffa450edef68
Adds
<auto-detect/>
in the fonts section of our fop.xconf
Adds the Google NotoSans font which is Apache licensed
* http://www.google.com/fonts/specimen/Noto+Sans
* https://www.google.com/get/noto/#/
Uses NotoSans as the default FOP font. For that puts the NotoSans font 4 files in framework/resources/fonts and add <directory>framework/resources/fonts/NotoSansFonts</directory> in fop.xconf
Renders ₹ in content/control/fonts.pdf as we do for €. Other symbols could be added later when needed, backed by Google NotoSans font...
Renders the NotoSans content/control/fonts.pdf as we do for other main fonts
Adds the rupee symbol (₹) to antisamy-esapi.xml file like we have the euro symbol (€)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1647782 13f79535-47bb-0310-9956-ffa450edef68
The help gives you:
c:\projectsASF\ofbiz>java -jar ofbiz.jar -help
Usage: java -jar ofbiz.jar [command] [arguments]
-both -----> Run simultaneously the POS (Point of Sales) application and OFBiz standard
-help, -? ----> This screen
-install -----> Run install (create tables/load data)
-pos -----> Run the POS (Point of Sales) application
-setup -------> Run external application server setup
-start -------> Start the server
-status ------> Status of the server
-shutdown ----> Shutdown the server
-test --------> Run the JUnit test script
[no config] --> Use default config
[no command] -> Start the server w/ default config
But actually only the -help, -status and -shutdown command need a dash.
For now we decided to change the documentation generated by the help command to remove dashes when they are not needed.
To change
-install -----> Run install (create tables/load data)
by
-load-data -----> Create tables/load data
To comment out the
-setup -------> Run external application server setup
line
When done, we will try to have things consistent and re-add the missing dashes to the commands and in the help. Then the "Technical production setup guide" should be updated, pfew...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1640588 13f79535-47bb-0310-9956-ffa450edef68
* Groovy services and Groovy events now use the same util methods from GroovyUtil to parse/execute the scripts
* the script base class is now specified in the base/config/groovy.parameter file rather than in the serviceengine.xml
* the same util methods (DSL) are now available to all Groovy scripts (executed as services, events or widget actions)
* removed a series of unused methods in the GroovyUtil class
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1636346 13f79535-47bb-0310-9956-ffa450edef68
1) added a comment to summarize the default configuration, with a reference to the online log4j2 documentation for further customizations
2) added a new appender for errors (or greater); implemented using a filter to keep the logger definition as clean as possible
3) removed the external appender because the amount of log statements (warnings or greater) from external jars is not large and should not cause much confusion if we keep them with OFBiz log statements
4) increased the number of rolling files for ofbiz.log to 10
5) changed date format to "yyyy-mm-dd hh:mm:ss.sss"
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1633550 13f79535-47bb-0310-9956-ffa450edef68
added/revised zh-TW translations in the framework, applications and specialpurpose folders to have consistent, commonly-used meaningful terms in Traditional Chinese.
jleroux: from Nick Ho's patch I have extracted only the Chinese changes, w/o the proposed dash to underscore changes
This contains notably this 14 "zh" (not "sh-TW") changes:
<value xml:lang="zh">人将由电子邮件接受一个临时密码。</value><!-- was 客户将通过电子邮件收到一个临时密码。 -->
<value xml:lang="zh">合计属于公司: </value>
<value xml:lang="zh"> 完整文本:${fullText}</value>
<value xml:lang="zh">供货商佣金百分比</value>
<value xml:lang="zh">文本大小</value>
<value xml:lang="zh">值</value>
<value xml:lang="zh">算子</value>
<value xml:lang="zh">不能转移已序列化的库存。</value>
<value xml:lang="zh">货运收据</value>
<value xml:lang="zh">获取标识为 ${productStoreShipMethId} 的产品店铺送货方法(ProductStoreShipmentMeth)时出错:${errorString}</value>
<value xml:lang="zh">中国人民币元</value>
<value xml:lang="zh">如果选择"specify other",下拉框旁边会出现文本框。参考form的drop-down元素的other-field-size属性说明</value>
<value xml:lang="zh">文本消息</value>
<value xml:lang="zh">能够收到和解析XML消息,但是BSR->NOUN(买卖关系->名词) ${bsrNoun} 和/或 BSR->VERB(买卖关系->动词) ${bsrVerb} 是空的</value>
I have no competency to judge these changes, but from previous Shi Jinghai's feedback I believe there are OK
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1625816 13f79535-47bb-0310-9956-ffa450edef68
This certificate is valid for 10 years (until May 27 08:43:19 2024 GMT)
Characteristics: C=US, ST=DE, L=Wilmington, O=Apache Software Fundation, OU=Apache OFBiz, CN=ofbiz-vm.apache.org/emailAddress=dev@ofbiz.apache.org
The password is still the same: changeit, I checked: HTTPS works locally
I don't really understand the content and the need of framework/base/cert/ so I only added framework/base/cert/demoCA/newcerts/03.pem and framework/base/cert/README which explains this change
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1598544 13f79535-47bb-0310-9956-ffa450edef68