Author: mrisaliti
Date: Fri May 30 22:35:19 2008 New Revision: 661951 URL: http://svn.apache.org/viewvc?rev=661951&view=rev Log: Converted EditKeywordThesaurus.bsh/EditProductStoreSurveys.bsh to groovy (Part of issue OFBIZ-1801) Added: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy - copied, changed from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.bsh Removed: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.bsh Modified: ofbiz/trunk/applications/product/widget/catalog/ThesaurusScreens.xml Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy (from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.bsh) URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.bsh&r1=661942&r2=661951&rev=661951&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.bsh (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy Fri May 30 22:35:19 2008 @@ -17,12 +17,12 @@ * under the License. */ -import org.ofbiz.entity.*; -import org.ofbiz.base.util.*; +import org.ofbiz.entity.* +import org.ofbiz.base.util.* -relationshipEnums = delegator.findByAndCache("Enumeration", UtilMisc.toMap("enumTypeId", "KW_THES_REL"), UtilMisc.toList("sequenceId")); +relationshipEnums = delegator.findByAndCache("Enumeration", ['enumTypeId' : 'KW_THES_REL'], ['sequenceId']); -keywordThesauruses = delegator.findList("KeywordThesaurus", null, null, UtilMisc.toList("enteredKeyword"), null, false); +keywordThesauruses = delegator.findList("KeywordThesaurus", null, null, ['enteredKeyword'], null, false); //if no param sent in make firstLetter 'a' else use firstLetter passed in firstLetterString = request.getParameter("firstLetter"); @@ -36,20 +36,20 @@ //add elememts to new list as long as it is smaller then 20, // but always get all of the first letter keywordThesaurusIter = keywordThesauruses.iterator(); -newKeywordThesaurus=new LinkedList(); -specialCharKeywordThesaurus=new LinkedList(); -currentLetter=firstLetter; +newKeywordThesaurus = new LinkedList(); +specialCharKeywordThesaurus = new LinkedList(); +currentLetter = firstLetter; if (keywordThesaurusIter.hasNext()) { while (keywordThesaurusIter.hasNext()) { - keywordThesaurus = keywordThesaurusIter.next(); + keywordThesaurus = keywordThesaurusIter.next(); if (keywordThesaurus.get("enteredKeyword").charAt(0)<'a' || keywordThesaurus.get("enteredKeyword").charAt(0)>'z') { specialCharKeywordThesaurus.add(keywordThesaurus); - } else if (keywordThesaurus.get("enteredKeyword").charAt(0)>=firstLetter) { - if (keywordThesaurus.get("enteredKeyword").charAt(0)==currentLetter || + } else if (keywordThesaurus.get("enteredKeyword").charAt(0) >= firstLetter) { + if (keywordThesaurus.get("enteredKeyword").charAt(0) == currentLetter || newKeywordThesaurus.size()<20){ newKeywordThesaurus.add(keywordThesaurus); - currentLetter=keywordThesaurus.get("enteredKeyword").charAt(0); + currentLetter = keywordThesaurus.get("enteredKeyword").charAt(0); } } } @@ -68,7 +68,7 @@ letterList.add(i); } -context.put("relationshipEnums", relationshipEnums); -context.put("keywordThesauruses", newKeywordThesaurus); -context.put("firstLetter", firstLetter); -context.put("letterList", letterList); +context.relationshipEnums = relationshipEnums; +context.keywordThesauruses = newKeywordThesaurus; +context.firstLetter = firstLetter; +context.letterList = letterList; \ No newline at end of file Modified: ofbiz/trunk/applications/product/widget/catalog/ThesaurusScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ThesaurusScreens.xml?rev=661951&r1=661950&r2=661951&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/ThesaurusScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/ThesaurusScreens.xml Fri May 30 22:35:19 2008 @@ -54,7 +54,7 @@ <set field="tabButtonItem" value="EditKeywordThesaurus"/> <set field="headerItem" value="thesaurus"/> - <script location="component://product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.bsh"/> + <script location="component://product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy"/> </actions> <widgets> <decorator-screen name="CommonThesaurusDecorator"> |
Free forum by Nabble | Edit this page |