(OFBIZ-11212)
When you use a date-find element on form, the defaut option are in code like to greater_than and less _than
public DateFindField(int fieldSource, String type) {
super(fieldSource, type);
this.defaultOptionFrom = greaterThanEqualTo;
this.defaultOptionThru = lessThanEqualTo;
}
but on macro
<#macro renderDateFindField ...
<option value=greaterThan<#if defaultOptionFrom==greaterThan> selected=selected</#if>></option><#rt/>
...
<option value=opLessThan<#if defaultOptionThru==opLessThan> selected=selected</#if>></option><#rt/>
...
</#macro>
So the value java isn't correct with ftl values and default value never used.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867582 13f79535-47bb-0310-9956-ffa450edef68
(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-framework/trunk@1865796 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7532)
To display a number we had different possibilities :
* on ftl use the template <@ofbizAmount and <@ofbizCurrency
* by java call a function UtilFormatOut.formatAmount, UtilFormatOut.formatPrice, UtilFormatOut.formatQuantity, etc..
* by form widget, use <display type=accounting-number for accounting but nothing for other
To simplify and homogenize all, I implemented a number type purpose :
* default: display a number by default, use when no purpose is present
* quantity: display a number as a quantity
* amount: display a number as an amount (like price without currency)
* spelled: litteral displaying for a number (use on <@ofbizAmount ftl only before)
* percentage: display a number as a percentage
* accounting: diplay a number for accounting specific
Each purpose can be associate to a number for displaying it :
* on ftl <@ofbizNumber number=value format=purpose/>
* on java UtilFormatOut.formatNumber(value, purpose, delegator, locale)
* on form widget <display type=number format=purpose/>
The format use by a purpose is define on framework/common/config/number.properties with the template
.displaying.format = ##0.00
With this, you can surchage a configuration, create your own purpose or surchage only one through entity SystemProperty.
Concerning the backware compatibility:
* For the ftl the template <@ofbizAmount is now a link to '<@ofbizNumber format=amount'
* For java all previous function call UtilFormatOut.formatNumber with the matching purpose
* For form xml accounting-number is managed as an exection
Last point, display a currency is different that a number, so I didn't refactoring some code for this case (only move properties from general to number for centralize de configuration on the same file)
Thanks Charles Steltzlen to start the refactoring
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1864832 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11135)
We want to be able to reuse the selection of used fields for any form
renderers. As a consequence it seems more appropriate to move the
behavior of ‘FormRenderer#getUsedFields’ to the ‘ModelFormField’
class.
Additionally we have decoupled the filtering logic from the iteration
process by constructing a stateful predicate.
The corresponding unit tests have been adapted to both changes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862636 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11129)
Avoid some boiler-plate when retrieving the request handler inside a
servlet context.
--this line, and those below, will be ignored--
M applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
M applications/order/src/main/java/org/apache/ofbiz/order/task/TaskEvents.java
M applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/SeoTransform.java
M applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/UrlRegexpTransform.java
M applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java
M framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
M framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java
M framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlTreeRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
M framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862295 13f79535-47bb-0310-9956-ffa450edef68
(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-framework/trunk@1862294 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10959)
While working on a Production environment, it is found that for some reason entity timestamp fields are disabled at Search Results screen in Trunk and the previous release branch.
Thanks Pawan Verma for reporting the issue and providing the patch, Jacques, Gil, Mathieu for reviewing it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859915 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10660)
Steps to Regenerate
1. Open /catalog/control/createProductPriceCond
2. Add the name for a new Price Rule
3. Add Condition and go to Add Action panel
4. Check the dropdown values under Action Type
*Actual: *
Same value reflecting twice in the dropdown ( Flat Amount Modify)
The Image is attached in Jira for reference
Thanks: Archana Asthana for report Prakhar Kumar for the fix
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858355 13f79535-47bb-0310-9956-ffa450edef68
(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.
Thanks Jacques Le Roux and Swapnil M Mane for acknowledging the commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858295 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10937)
Since Java 1.7, when defining generic types it is unnecessary to
redefine those types in the constructor when it is done in the
declared type.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857906 13f79535-47bb-0310-9956-ffa450edef68
This commit causing 'ResultSet not open' while rendering list forms.
Scott's comments from ML:
You'll need to be careful with this one, based on the limited usage of the
iterator here it seems likely that it will be used again later in the
process.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857095 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10817)
When freemarker failed to execute a template, you have on end screen rendered all java stack trace generated.
I improve this to display the stack trace only when widget is on verbose, no regression during development and when you switch to production site, in general your widget verbose is off so end user haven't stack trace and replace it by ∎ (that totally unused for them but help to detect a problem).
I also introduce two new properties on widget.properties:
widget.freemarker.template.verbose : if your widget verbose is off and you want display the freemarker stacktrace when your template generate an exception set it to true
widget.freemarker.template.exception.message : when you don't displaying freemarker stacktrace, you can replace it by an other message by default it use ∎ but you can set what you want, like 'ERROR', '##' or ' '
Thanks to Deepak Dixit, Jacques Le Roux, Michael Brohl and Mathieu Lirzin for their suggest
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856524 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10753)
When OFBiz raise an error, the framework use a jsp page to display it.
I improved the error page generation to support also ftl template rendering and by this way extend the theme engine to support to overide it
On controler.xml we can now use :
<errorpage>/error/error.jsp</errorpage>
or
<errorpage>component://common/webcommon/error/Error.ftl</errorpage> (default configuration)
On your theme you can add your own error page :
<template>
...
<template-file widget=menu location=component://common-theme/template/macro/HtmlMenuMacroLibrary.ftl/>
+ <template-file widget=error location=component://common-theme/template/ErrorPage.ftl/>
</template>
The component://common/webcommon/error/Error.ftl contains the logic theming connection and to simplify source code, all framework old error page (error.jsp) have been removed to centralize all on this new page.
Thanks to Marine Desmarchelier for the error page design
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856175 13f79535-47bb-0310-9956-ffa450edef68
When OFBiz render a platform specific with a ftl template file, the widget verbosity throw function ModelWidget.widgetBoundary() was called with parameters as context. However this function control if a parameters is already present, so if you set a context.widgetVerbose = false, is was ignored and widget verbosity was present for ftl rendering.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1852532 13f79535-47bb-0310-9956-ffa450edef68
The ModelForm.java is using an incorrect parameter name for sorting if a form
extends from another form. This fixes it by using the correct parameter name.
Thanks: Gil Portenseigne for reviewing and providing a better implementation
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851426 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10689)
Actually this is a firts step that simply renames
ObjectType::simpleTypeConvert to
ObjectType::simpleTypeOrObjectConvert
and improves the simpleTypeOrObjectConvert Javadoc
Thanks: Pierre Smits for report, Deepak Dixit for discussion
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850027 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10722)
When we have more than one form, in a screen, that use a date-find field,
the second date-find picker is not working.
To reproduce, you can add a new form with a date-find and call it below
FindInvoices in FindInvoices screen
Then load page [https://localhost:8443/accounting/control/findInvoices] .
You should see that there is no picker on the second date-find
The patch adds an id that allow renderDateFindField macro script to work for
both fields
Thanks: Leila Mekika
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849165 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10711)
Due to r1848673 for "Fix or Silence various warnings" (OFBIZ-10701)
a try-with-resources was used but the Object passed in context (an
EntityListIterator) should not be close there. It's reused in
FindGeneric.groovy:107 by a performFind service defined in the
dynamicAutoEntityFieldListForm String.
Thanks: Deepak Dixit for report.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848954 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10701)
In order to detect potential issues early, the linting compiler option should be
used by default and disabled with {{./gradlew -PXlint:none build}}.
Additionally it is important to reduce the number of warnings otherwise new
warnings will remain unnoticed.
The warning related to the com.googlecode.concurrentlinkedhashmap dependency
should resolves itself once we handle upgrade to Caffeine like proposed in
OFBIZ-6747.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848673 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10411)
To define boolean values, some ad-hoc enumeration of "true" and "false" are
repeatedly used. Since XML Schema defines a standard boolean datatype it's
better to use it.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846727 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10600)
Fixed the lack of menu theme definition in the xsd file
Thanks: To Jacques Le Roux for being more attentive to the log file than I have been ;)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1844697 13f79535-47bb-0310-9956-ffa450edef68