Author: jleroux
Date: Mon Apr 18 12:02:47 2011 New Revision: 1094505 URL: http://svn.apache.org/viewvc?rev=1094505&view=rev Log: A patch from Leon "Add "MUNICIPALITY" to getStateList's search condition to make "municipality" of china visible in state list" https://issues.apache.org/jira/browse/OFBIZ-4258 In china, city like "Shanghai","Beijing", "Chongqin" and "Tianjin" is municipality which is equivalent to province, but there's no such municipality in the state list displayed in client end. In Geo entity, these municipalities is stored with geoTypeId="MUNICIPALITY", So I add it as a new search condition to CommonWorkers.getStateList to fix this issue. Fixes some problem in current GeoData_CN.xml Also changes the geoTypeId from "REGIONS" to "MUNICIPALITY" for some "Autonomous regions" and "Special administrative Regions" and add some missing country-state associations. It's better to add new geo types for "Autonomous regions" or "Special Administrative Regions", but I don't want to make the thing complex if there's no such strong demand. Modified: ofbiz/trunk/framework/common/data/GeoData_CN.xml ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java Modified: ofbiz/trunk/framework/common/data/GeoData_CN.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/data/GeoData_CN.xml?rev=1094505&r1=1094504&r2=1094505&view=diff ============================================================================== --- ofbiz/trunk/framework/common/data/GeoData_CN.xml (original) +++ ofbiz/trunk/framework/common/data/GeoData_CN.xml Mon Apr 18 12:02:47 2011 @@ -51,13 +51,13 @@ under the License. <Geo abbreviation="粤" geoCode="44" geoId="CN-44" geoName="广ä¸" geoTypeId="PROVINCE" wellKnownText="Guangdong"/> <Geo abbreviation="é½" geoCode="35" geoId="CN-35" geoName="ç¦å»º" geoTypeId="PROVINCE" wellKnownText="Fujian"/> <Geo abbreviation="å°" geoCode="71" geoId="CN-71" geoName="å°æ¹¾" geoTypeId="PROVINCE" wellKnownText="Taiwan"/> - <Geo abbreviation="æ¡" geoCode="45" geoId="CN-45" geoName="广西" geoTypeId="REGION" wellKnownText="Guangxi"/> - <Geo abbreviation="å èå¤" geoCode="15" geoId="CN-15" geoName="å èå¤" geoTypeId="REGION" wellKnownText="Inner Mongolia"/> - <Geo abbreviation="å®" geoCode="64" geoId="CN-64" geoName="å®å¤" geoTypeId="REGION" wellKnownText="Ningxia"/> - <Geo abbreviation="æ°" geoCode="65" geoId="CN-65" geoName="æ°ç" geoTypeId="REGION" wellKnownText="Xinjiang"/> - <Geo abbreviation="è" geoCode="54" geoId="CN-54" geoName="西è" geoTypeId="REGION" wellKnownText="Tibet"/> - <Geo abbreviation="é¦æ¸¯" geoCode="91" geoId="CN-91" geoName="é¦æ¸¯" geoTypeId="REGION" wellKnownText="Hong Kong"/> - <Geo abbreviation="æ¾³é¨" geoCode="92" geoId="CN-92" geoName="æ¾³é¨" geoTypeId="REGION" wellKnownText="Macau"/> + <Geo abbreviation="æ¡" geoCode="45" geoId="CN-45" geoName="广西" geoTypeId="MUNICIPALITY" wellKnownText="Guangxi"/> + <Geo abbreviation="å èå¤" geoCode="15" geoId="CN-15" geoName="å èå¤" geoTypeId="MUNICIPALITY" wellKnownText="Inner Mongolia"/> + <Geo abbreviation="å®" geoCode="64" geoId="CN-64" geoName="å®å¤" geoTypeId="MUNICIPALITY" wellKnownText="Ningxia"/> + <Geo abbreviation="æ°" geoCode="65" geoId="CN-65" geoName="æ°ç" geoTypeId="MUNICIPALITY" wellKnownText="Xinjiang"/> + <Geo abbreviation="è" geoCode="54" geoId="CN-54" geoName="西è" geoTypeId="MUNICIPALITY" wellKnownText="Tibet"/> + <Geo abbreviation="é¦æ¸¯" geoCode="91" geoId="CN-91" geoName="é¦æ¸¯" geoTypeId="MUNICIPALITY" wellKnownText="Hong Kong"/> + <Geo abbreviation="æ¾³é¨" geoCode="92" geoId="CN-92" geoName="æ¾³é¨" geoTypeId="MUNICIPALITY" wellKnownText="Macau"/> <GeoAssoc geoId="CHN" geoIdTo="CN-11" geoAssocTypeId="REGIONS"/> <GeoAssoc geoId="CHN" geoIdTo="CN-50" geoAssocTypeId="REGIONS"/> @@ -86,6 +86,8 @@ under the License. <GeoAssoc geoId="CHN" geoIdTo="CN-44" geoAssocTypeId="REGIONS"/> <GeoAssoc geoId="CHN" geoIdTo="CN-35" geoAssocTypeId="REGIONS"/> <GeoAssoc geoId="CHN" geoIdTo="CN-71" geoAssocTypeId="REGIONS"/> + <GeoAssoc geoId="CHN" geoIdTo="CN-45" geoAssocTypeId="REGIONS"/> + <GeoAssoc geoId="CHN" geoIdTo="CN-15" geoAssocTypeId="REGIONS"/> <GeoAssoc geoId="CHN" geoIdTo="CN-64" geoAssocTypeId="REGIONS"/> <GeoAssoc geoId="CHN" geoIdTo="CN-65" geoAssocTypeId="REGIONS"/> <GeoAssoc geoId="CHN" geoIdTo="CN-54" geoAssocTypeId="REGIONS"/> Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java?rev=1094505&r1=1094504&r2=1094505&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java Mon Apr 18 12:02:47 2011 @@ -91,7 +91,7 @@ public class CommonWorkers { List<GenericValue> geoList = FastList.newInstance(); EntityCondition condition = EntityCondition.makeCondition(EntityOperator.OR, EntityCondition.makeCondition("geoTypeId", "STATE"), EntityCondition.makeCondition("geoTypeId", "PROVINCE"), - EntityCondition.makeCondition("geoTypeId", "TERRITORY")); + EntityCondition.makeCondition("geoTypeId", "TERRITORY"), EntityCondition.makeCondition("geoTypeId", "MUNICIPALITY")); List<String> sortList = UtilMisc.toList("geoName"); try { geoList = delegator.findList("Geo", condition, null, sortList, null, true); @@ -119,6 +119,7 @@ public class CommonWorkers { EntityCondition.makeCondition(EntityOperator.OR, EntityCondition.makeCondition("geoTypeId", "STATE"), EntityCondition.makeCondition("geoTypeId", "PROVINCE"), + EntityCondition.makeCondition("geoTypeId", "MUNICIPALITY"), EntityCondition.makeCondition("geoTypeId", "COUNTY"))); if (UtilValidate.isEmpty(listOrderBy)) { |
Free forum by Nabble | Edit this page |