[
https://issues.apache.org/jira/browse/OFBIZ-4375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092516#comment-13092516
]
Atul Vani commented on OFBIZ-4375:
----------------------------------
1. // prodCatalogMap should be prodCatalogMap2, it's a TYPO. Moreover we don't
even need it, whatever isn't calatlog (isCatalog == false) is a category.
I wrote this, because it will require code changes in
org.ofbiz.product.category.CategoryServices.getChildCategoryTree() method. This
method is called using an ajax request when we browse the child categories.
What I think about all this is that the getChildCategoryTree seem to be placed
in the wrong file, IMO CategoryServices.java should contain only service
implementation and methods used by them. Moreover, CatagoryTree.groovy can be
modified in such a way that we won't even need getChildCategoryTree method in
the first place.
Using the JSON in such a way as it is done seem wrong too. If we wanna use JSON
then we should use net.sf.json.JSONArray and net.sf.json.JSONObject. Then put
the JSON data into a hidden input field or a JS variable (like it's previous
done in OFBiz, -1 from me), and use the JS to extract it and process it. This
is a much cleaner way and reduces dependencies between things.
And at last, IMO we should use html_data instead of json_data with jsTree.
After all, a cleaner, maintainable, easy to understand and modify code is all
we want in the end :)
I had plans to do these in second pass. Please let me know your opinion.
2. Yes, we should use the groovy style. Please modify the file accordingly
before committing, thanks in advance :) I've started to learn groovy, so that I
write more of a groovy code then java in a groovy file ;)
3. Thanks Jacques :)
> TYPO in CategoryTree.groovy, lot's of un-used/un-wanted variables and
> un-clean & really hard to understand code
> ---------------------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-4375
> URL: https://issues.apache.org/jira/browse/OFBIZ-4375
> Project: OFBiz
> Issue Type: Bug
> Components: product
> Reporter: Atul Vani
> Assignee: Jacques Le Roux
> Fix For: Release Branch 11.04, SVN trunk
>
> Attachments: OFBIZ-4375.patch, OFBIZ-4375.patch
>
>
> TYPO in CategoryTree.groovy:
> <<prodCatalogMap.put("isCategoryType", true);>> should be
> <<prodCatalogMap2.put("isCategoryType", true);>>
> lot's of un-used/un-wanted variables:
> i, prodCatalogTree2, prodCatalogCategories, prodCatalog, prodCatalogId
> un-clean and really hard to understand code.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira