(OFBIZ-11130)
This Factorizes their implementation which was copy-pasted. The remaining
issue concerning the undesirable re-implementation of ‘resolveURI’ has been
explained in a comment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862315 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-11014)
‘StringUtil#toMap’ was only used in the ‘CollectionConverters.StringToMap’
converter so in order to clean ‘StringUtil’ it seems better to inline it. The
corresponding tests has been adapted to check
‘CollectionConverters.StringToMap#convert’ behavior instead.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862228 13f79535-47bb-0310-9956-ffa450edef68
select entities
(OFBIZ-11125)
No Proper error message is displayed if user misses to select entities from the
list, and throw error message
Thanks: Jayansh Shinde
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862207 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10966)
Currently, we support import/export entity data in XML format.
Nowadays JSON is widely used in industry, we can have support for JSON format
which looks quite similar to XML support.
Here is example of XML data and it's JSON version
<Party partyId="123456" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
{“Party”: {"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}
Design Proposal
We can write entityImportJson and entityImportDirJson services for importing
JSON from screen and directory respectively.
And the entityExportAllJson service for exporting entity data in JSON.
Import Design
The import service will perform following operations:
1.) Validate the input JSON data
2.) On successful validation, convert JSON to OFBiz's entity model
(GenericValue)
3.) The GenericValue will be inserted in database by some handler class for e.g
we can write JsonDataHandler, it will convert given JSON to
List<GenericValue>, and finally write it to database
(Similar pattern is used in XML import).
Export Design
Based on existing XML pattern the writeXmlText method of GenericEntity class
write the exported data in XML format.
In the similar way, we can implement writeJsonText to export data in JSON format.
jleroux: I fixed 2 trivials things and at my request in last patch Jayansh added
"JSON Data Export All" and "JSON Data Import Dir
Thanks: Jayansh Shinde
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862206 13f79535-47bb-0310-9956-ffa450edef68
provided by user
(OFBIZ-11124)
In framework/webtools XML Data Export I reported an issue, Jayansh fixed it:
If user provided file name and output directory in that case the entity xml
files are generated at both locations, i.e. at root we have test.xml and in user
provided output directory we have multiple files with [entityname].xml.
The expected change would be if user provided both output directory and filename
then file should be created in given directory with given filename.
Thanks: Jayansh Shinde for the fix
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862045 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7257)
Here is an implementation plan for the proposed solution.
Order Attachment Flow:
1) Show 'Attachments' instead of 'Image' on the order view screen.
2) If there are any attachments associated with the order, then their information will be displayed in the form of a button(Content link) else 'No Attachment' label should be shown.
3) If no attachments are there, then along with the label, a button(Add Attachment) will be displayed.
On clicking the Add Attachment button, a user will be redirected to a page where he/she can add different types of content(image, document, URL, etc.) to the order.
Order Attachment Modeling:
Used OrderContent as the entity to store the content and order association.
Created OrderContentType data for an image and document for starters.
Thanks Avnindra Sharma for reporting the original issue, Devanshu Vyas for providing the patch and Jacques for review and suggestions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1861853 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11078)
When you tried to decrypt a field present on embedded entity-view, key use is the view name and not the final entity who contains this field.
You currently have the problem on PartyContactMechDetail where if you want to displaying the ftpPassword for a FtpAddress, the view failed and tried to use ContactMechDetail to decrypt instead of FtpAddress
To solve it, we iterate on the entity contains the field in the view while is an entity-view :
PartyContactMechDetail.ftpPassword
-> ContactMechDetail.ftpPassword
-> FtpAddress.ftpPassword
-> key found FtpAddress
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860365 13f79535-47bb-0310-9956-ffa450edef68
(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-framework/trunk@1860051 13f79535-47bb-0310-9956-ffa450edef68