(OFBIZ-9144)
This is the first commit to the above mentioned issue which fixes many javadoc
errors dispersed through the different components. The fixes are not
necessarily improvements to the javadocs but rather making them valid javadocs
to prevent reporting errors from gradle
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774154 13f79535-47bb-0310-9956-ffa450edef68
.getAttribute() never returns null, it defaults to empty
Removes commented out import net.sf.json imports we use Jackson only (no license
issues)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1770543 13f79535-47bb-0310-9956-ffa450edef68
trying to unbox
(OFBIZ-8342)
site-conf.xsd doesn't define transaction-timeout as being mandatory but
ConfigXMLReader treats it as one and in the absence of the attribute an
exception is being thrown causing the application to break.
jleroux: I have slightly modified the patch, eventElement.getAttribute never
returns null, default to empty
Thanks: Valery Chenzo
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1770540 13f79535-47bb-0310-9956-ffa450edef68
conditional.xml to conditionalLabels.xml
DefaultMessages.xml to DefaultMessagesLabels.xml
EmailPassword.xml to EmailPasswordLabels.xml
Found while working on OFBIZ-8321
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1764261 13f79535-47bb-0310-9956-ffa450edef68
multitenant mode on, caused by the recent refactoring to ContextFilter.
(OFBIZ-8338)
Thanks: Ingo Wolfmayr for the bug report.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763251 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
the initialization of the ControlFilter.
These unit tests are experimental but interesting because they provide test
coverage in isolation for some aspect of the framework that were not covered
before or only covered by integration tests.
The tests for the ControlFilter are particularly interesting because they
leverage Mockito to run the test in isolation by mocking the FilterConfig
object.
Please review and run these tests in your local environment, provide your
feedback and report any issues you may find: this will help to define a pattern
for the definition of unit tests that could be applied more extensively.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761440 13f79535-47bb-0310-9956-ffa450edef68
default encoding for the requests and some fine tuning of ControlFilter
settings; removed no more used code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761424 13f79535-47bb-0310-9956-ffa450edef68
new ControlFilter, from the ContextFilter; modified existing applications to use
the two filters in a chain; removed from the other specialized filters all the
logic that was duplicated or extended from ContextFilter.
A web application, in order to leverage the OFBiz framework, requires that a
series of objects are in its contexts (servlet context, session and request)
such as "delegator", "delegatorName", "dispatcher", "security" etc. etc...
This setup is performed by the logic contained in the servlet filter implemented
by the ContextFilter class.
The execution of this logic is required for the application to run properly.
However, before this commit, in the ContextFilter there was other logic, related
to access control and redirection rules (some of them performed in coordination
with the ControlServlet), making it difficult to deploy this filter in all the
web applications, especially the ones that implement special handling of paths.
In fact, this filter was deployed in most but not all the web application in the
OFBiz codebase: specifically it was not deployed in web applications that
require the execution of other filters (e.g. CatalogUrlFilter, etc...) like the
ones in the "ecommerce" and "solr" components.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761304 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7120)
This is the first patch from the ticket and is for the implementation done to support the multisite feature in specialpurpose/cmssite component.
Thanks Mohammed Rehan Khan for the contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761150 13f79535-47bb-0310-9956-ffa450edef68
defined in the new ControlFilter class.
The old constant defined in ContextFilter will soon be removed together with the
debug field, that is not currently used.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760949 13f79535-47bb-0310-9956-ffa450edef68
Modified the rdering of import statements, minor changes to remove some
unnecessary dependencies on util classes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760947 13f79535-47bb-0310-9956-ffa450edef68
currently available in the ContextFilter.
At the moment the filter is not used but, once the "controller" logic will be
removed by the ContextFilter, the applications' web.xml files will be updated
to deploy the two filters in a chain:
* ControlFilter will filter and redirect requests
* ContextFilter will set the required objects in the contexts (session and
request) like the delegator, dispatcher etc...
This separation of concerns will make the deplyment more flexible when
additional filters are required.
While the logic in this new filter is functionally mostly the same of that
currently in ContextFilter, this new implementation is more efficient and the
behavior and configuration parameters are clearly discribed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760725 13f79535-47bb-0310-9956-ffa450edef68
if it is not set already by the client.
Before this change the filter used to override the character encoding, even if
it was specified in the http request.
Also removed some unused imports and comments.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760528 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
* introduced a constant for the "control" mount point
* moved public fields and methods from the ContentUrlFilter to the OfbizContentAltUrlTransforms and made them private (since they are only used by this class)
* no more need for the UrlServletHelper to extend the ContextFilter
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759368 13f79535-47bb-0310-9956-ffa450edef68
* removed an unused filter (UrlRegexpContextFilter)
* moved a series of methods from ContextFilter to WebAppUtil, where they make more sense; changed one of them to be a static method
* made private some methods of ContextFilter and WebAppUtil because they were not used outside of their classes
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759332 13f79535-47bb-0310-9956-ffa450edef68
Notes:
* Also removes empty framework/base/lib/scripting and useless applications\content\lib\uno\README (miss doc in wiki)
* When jpim-0.1.jar will be (hopefully) replaced we can drop lib ref in framework/base/ofbiz-component.xml
* I wonder if we should let the geronimo component alone with only 2 classes, could we not put that in entity or entityext?
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1755306 13f79535-47bb-0310-9956-ffa450edef68
This is the first of two steps in the above mentioned JIRA. This
first step changes the java source directory for every component
from /src to /src/main/java. The next step will be adding unit
tests to every component in /src/test/java
Thank you to Deepak Dixit for tips on how to use the SVN commands
to make the appropriate file moving.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752838 13f79535-47bb-0310-9956-ffa450edef68
This is the first patch that takes OFBiz to the point of no return
in terms of switching from Ant to Gradle build system. Specifically
this patch applies the following items:
- Delete all old Ant and Maven build scripts
- Delete 169 Jar libraries and replace them with remote ones in the
gradle build script
- update the gradle build scripts for the dependencies and other minor
changes needed for the script work correctly
All tests pass with the command ./gradlew cleanAll loadDefault testIntegration
Again, thank you for everyone who contributed valueble time and effort in this
process.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752033 13f79535-47bb-0310-9956-ffa450edef68
* removed the code that implemented the deprecated "call-bsh" operation in Minilang
* removed the BeanShellContainer (it has been disabled a long time ago)
* removed the BeanShell service engine, no more used
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751947 13f79535-47bb-0310-9956-ffa450edef68
This is the 2nd step: puts back the original names, so it will be transparent for remaining references in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749489 13f79535-47bb-0310-9956-ffa450edef68
This is a 1st step, in a 2nd I will put back the original names, so it will be transparent for remaining reference in xml catalogs, Java code, etc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749488 13f79535-47bb-0310-9956-ffa450edef68
(resource == null || resource.length() <= 0)
From Java spec. a String, Collection, Map or CharSequence can't have a negative length, so the pattern above can be reduced to
(resource == null || resource.length() == 0)
which can be replaced using
UtilValidate.isEmpty()
I checked, there are several other occurrences of this pattern (some very old, I guess most were routinely copied from an initial occurrence). I decided to replace all of them, here they are.
I did that already long ago for the
(resource == null || resource.length() == 0)
pattern. It remains 4 of them. Three are justified (because of the dependency on base component or because using isEmpty() on Object is disputable for performance reasons). I took care of the remaining one right aways (in SplashScreen.java)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747976 13f79535-47bb-0310-9956-ffa450edef68
1. The following xsd are duplicated to use namespaces
site-conf.xsd -> site-conf-ns.xsd
widget-form.xsd -> widget-form-ns.xsd
widget-screen.xsd -> widget-screen-ns.xsd
widget-menu.xsd -> widget-menu-ns.xsd
simple-methods.xsd-> simple-methods-ns.xsd
For example, in site-conf-ns.xsd, we have the following document level attribute
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://ofbiz.apache.org/Site-Conf" targetNamespace="http://ofbiz.apache.org/Site-Conf">
instead of
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
2. The above schema are used into compound-widgets.xsd so that compound widgets use only one consolidated schema.
3. Update ExampleCompoundWidgets.xml to use the new compound-widgets.xsd. For example
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sc="http://ofbiz.apache.org/Site-Conf"
xmlns:sm="http://ofbiz.apache.org/Simple-Method"
xmlns:wf="http://ofbiz.apache.org/Widget-Form"
xmlns:wt="http://ofbiz.apache.org/Widget-Tree"
xmlns:wm="http://ofbiz.apache.org/Widget-Menu"
xmlns:ws="http://ofbiz.apache.org/Widget-Screen"
xsi:noNamespaceSchemaLocation="../../../../framework/widget/dtd/compound-widgets.xsd">
<sc:site-conf>
<sc:request-map uri="CompoundWidgets1">
<sc:security https="true" auth="true"/>
<sc:event type="simple" invoke="CompoundWidgetsFunc" path="component://example/widget/example/ExampleCompoundWidgets.xml"/>
<sc:response name="success" type="view" value="CompoundWidgets1"/>
</sc:request-map>
<sc:request-map uri="CompoundWidgets2"><sc:security https="true" auth="true"/><sc:response name="success" type="view" value="CompoundWidgets2"/></sc:request-map>
<sc:view-map name="CompoundWidgets1" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets1"/>
<sc:view-map name="CompoundWidgets2" type="screen" page="component://example/widget/example/ExampleCompoundWidgets.xml#CompoundWidgets2"/>
</sc:site-conf>
...... the rest
4. Change java code to support reading xml with namespace (i.e. xml for compound widgets)
jleroux: I simply replaced tabs by spaces in Java files and removed this commented out line
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/compound-widgets.xsd">
in ExampleCompoundWidgets.xml
We decided to duplicate the simple-methods.xsd rather than updating all concerned files. Else we would have to update the attributes at document level for rest of the controllers, menus, forms, simple methods and screens. For example, in controller.xml, we would have to change
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd”
to
xmlns="http://ofbiz.apache.org/sc” xsi:schemaLocation="http://ofbiz.apache.org/dtds/site-conf-ns.xsd”>
But especially we would have to use the same syntax with namespaces prefixes than in ExampleCompoundWidgets.xml (see example above). This can be discussed because with auto-completion it's not a big deal, but could be overwhelming for existing custom projects...
James mentionned that "the schema location at compound-widgets.xsd is relative to the project...". I don't see any problems with that. We can keep as is as long as we maintain the relation (ie if the main XSDs are moved). Moreover with the previous addition of compound-widgets.xsd in widget-catalog.xml it seems all things work correctly (eg w/o the new *-ns.xsd yet committed, the auto-completion works well in ExampleCompoundWidgets.xml
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746302 13f79535-47bb-0310-9956-ffa450edef68
The tests did not pass because of xmlrpc. Simply adding it in http.request-map.list in url.properties and like for SOAPService request setting <security https="false"/> does it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746254 13f79535-47bb-0310-9956-ffa450edef68
I just realised that the main change (the one in ConfigXMLReader.java, exposed in a comment in OFBIZ-6849) was not committed in r1745525. I guess it was because of tests I did for OFBIZ-4090, I certainly removed these changes then and forgot to put them back.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746159 13f79535-47bb-0310-9956-ffa450edef68
Quoting Deepak on dev ML
Hi Jacques,
I think in fop.xconf file we have to keep http url, as FOP does not support
https baseUrl for external graphics due to certificate issue (not remember
exact reason).
{code}
<!-- Base URL for resolving relative URLs -->
- <base>http://localhost:8080</base>
+ <base>https://localhost:8443</base>
{code}
If we set the https as <base> than images will not be rendered. Please
refer
http://demo-trunk-ofbiz.apache.org/ordermgr/control/order.pdf?orderId=DEMO10091
and we get following error on console:
{code}
[java] 2016-05-27 13:51:48,308 |http-nio-8443-exec-3 |FOUserAgent
|E| Image not found. URI: /images/ofbiz_logo.gif. (No context
info available)
{code}
If we set the http url than its working fine.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1745732 13f79535-47bb-0310-9956-ffa450edef68
Completes in screens the changes done in forms at r1741873. I then replaced few form lists by grids, where it was possible to do it with regexp.
Also complete StatsForms.xml to use only grids and "searchList" form in ecommerce ContentForms to NOT use grid (not called in screen)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1742196 13f79535-47bb-0310-9956-ffa450edef68
Because using SecureRandom comes with a cost, I have identified the places where it's reasonable to keep the non secured Random (like tests, internal sequences, etc.).
Ant to use UUID.randomUUID to generate the external link id
Also, though there are no real proven vulnerabilities, I decided to backport as much as possible since it's now public.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1741684 13f79535-47bb-0310-9956-ffa450edef68
We are using Groovy as event in the controller request, everything works fine for us but as we used delegator.find()
it generates the following error
ERROR: Cannot do a find that returns an EntityListIterator with no transaction in place. Wrap this call in a transaction.
[java] java.lang.Exception: Stack Trace
[java] at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1757) [ofbiz-entity.jar:?]
[java] at org.ofbiz.entity.Delegator$find.call(Unknown Source) [ofbiz-entity.jar:?]
[java] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) [groovy-all-2.2.1.jar:2.2.1]
[java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) [groovy-all-2.2.1.jar:2.2.1]
[java] at ProductInventory$_run_closure1.doCall(ProductInventory.groovy:18) [script:?]
Reason:
Since we are using find method of GenericDelegator.java
As per the code implementation it required the transaction should exist
if (!TransactionUtil.isTransactionInPlace()) {
if not, it generate error
ERROR: Cannot do a find that returns an EntityListIterator with no transaction in place. Wrap this call in a transaction.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Solution: initialize the transaction when the groovy is called as event and commit the transaction after the completion.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1740629 13f79535-47bb-0310-9956-ffa450edef68