You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by er...@apache.org on 2012/06/19 23:36:33 UTC
svn commit: r1351866 [37/48] - in /ofbiz/branches/20120329_portletWidget: ./
applications/accounting/ applications/accounting/config/
applications/accounting/data/ applications/accounting/entitydef/
applications/accounting/script/org/ofbiz/accounting/i...
Modified: ofbiz/branches/20120329_portletWidget/framework/common/config/PrefErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/config/PrefErrorUiLabels.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/config/PrefErrorUiLabels.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/config/PrefErrorUiLabels.xml Tue Jun 19 21:36:11 2012
@@ -27,6 +27,7 @@
<value xml:lang="it">Non è possibile copiare le preferenze utente: argomento(i) invalidi</value>
<value xml:lang="pt_BR">Não foi possÃvel copiar as preferências do usuário: Argumento(s) inválido(s)</value>
<value xml:lang="th">à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸±à¸à¸¥à¸à¸à¸ªà¸´à¸à¸à¸´à¸à¸´à¹à¸¨à¸©à¸à¸à¸à¸à¸¹à¹à¹à¸à¹:à¸à¹à¸à¸à¸´à¸ªà¸¹à¸à¸à¹à¹à¸à¹à¹à¸¡à¹à¹à¸à¹</value>
+ <value xml:lang="vi">Không thá» sao chép Thiết láºp ngÆ°á»i dùng: Tham sá» không hợp lá»</value>
<value xml:lang="zh">æ æ³å¤å¶ç¨æ·è®¾ç½®ï¼æ æçåæ°</value>
</property>
<property key="copyPreference.writeFailure">
@@ -37,6 +38,7 @@
<value xml:lang="it">Non è possibile copiare le preferenze utente (lettura/scrittura fallita): {0}</value>
<value xml:lang="pt_BR">Não foi possÃvel copiar as preferências do usuário (de leitura / gravação falha): {0}</value>
<value xml:lang="th">à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸±à¸à¸¥à¸à¸à¸ªà¸´à¸à¸à¸´à¸à¸´à¹à¸¨à¸©à¸à¸à¸à¸à¸¹à¹à¹à¸à¹ (à¸à¹à¸²à¸/à¹à¸à¸µà¸¢à¸à¸¥à¹à¸¡à¹à¸«à¸¥à¸§): {0}</value>
+ <value xml:lang="vi">Không thá» sao chép Thiết láºp ngÆ°á»i dùng (Äá»c/ghi không thà nh công)</value>
<value xml:lang="zh">æ æ³å¤å¶ç¨æ·è®¾ç½®(读/å失败)ï¼{0}</value>
</property>
<property key="getPreference.invalidArgument">
@@ -47,6 +49,7 @@
<value xml:lang="it">Non è possibile ottenerele preferenze utente: argomento(i) invalidi)</value>
<value xml:lang="pt_BR">Não foi possÃvel obter as preferências do usuário: Argumento(s) inválido(s)</value>
<value xml:lang="th">à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸£à¸µà¸¢à¸à¸à¹à¸²à¸ªà¸´à¸à¸à¸´à¸à¸´à¹à¸¨à¸©à¸à¸à¸à¸à¸¹à¹à¹à¸à¹:à¸à¹à¸à¸à¸´à¸ªà¸¹à¸à¸à¹à¹à¸à¹à¹à¸¡à¹à¹à¸à¹</value>
+ <value xml:lang="vi">Không thá» lấy thông tin Thiết láºp ngÆ°á»i dùng: Tham sá» không hợp lá»</value>
<value xml:lang="zh">æ æ³å¾å°ç¨æ·è®¾ç½®ï¼æ æçåæ°</value>
</property>
<property key="getPreference.permissionError">
@@ -55,6 +58,7 @@
<value xml:lang="fr">Erreur de permissions tout en obtenant des préférences d'utilisateur</value>
<value xml:lang="it">Errore di permesso durante la lettura delle preferenza utente</value>
<value xml:lang="pt_BR">Erro de Permissões ao obter as preferências do usuário</value>
+ <value xml:lang="vi">Lá»i phân quyá»n khi lấy thông tin Thiết láºp ngÆ°á»i dùng</value>
<value xml:lang="zh">è·å¾ç¨æ·è®¾ç½®æ¶åçæéé误</value>
</property>
<property key="getPreference.readFailure">
@@ -65,6 +69,7 @@
<value xml:lang="it">Non è possibile ottenere le preferenze utente (lettura fallita): {0}</value>
<value xml:lang="pt_BR">Não foi possÃvel obter as preferências do usuário (falha na leitura): {0}</value>
<value xml:lang="th">à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸£à¸µà¸¢à¸à¸à¹à¸²à¸ªà¸´à¸à¸à¸´à¸à¸´à¹à¸¨à¸©à¸à¸à¸à¸à¸¹à¹à¹à¸à¹ (à¸à¹à¸²à¸à¸¥à¹à¸¡à¹à¸«à¸¥à¸§): {0}</value>
+ <value xml:lang="vi">Không thá» sao chép Thiết láºp ngÆ°á»i dùng (Äá»c không thà nh công)</value>
<value xml:lang="zh">æ æ³è·å¾ç¨æ·è®¾ç½®(读失败)ï¼{0}</value>
</property>
<property key="setPreference.invalidArgument">
@@ -75,6 +80,7 @@
<value xml:lang="it">Non è possibile ottenere le preferenze utente: argomento(i) invalidi</value>
<value xml:lang="pt_BR">Não foi possÃvel definir as preferências do usuário: Argumento(s) inválido(s)</value>
<value xml:lang="th">à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸±à¹à¸à¸à¹à¸²à¸ªà¸´à¸à¸à¸´à¸à¸´à¹à¸¨à¸©à¸à¸à¸à¸à¸¹à¹à¹à¸à¹:à¸à¹à¸à¸à¸´à¸ªà¸¹à¸à¸à¹à¹à¸à¹à¹à¸¡à¹à¹à¸à¹</value>
+ <value xml:lang="vi">Không thá» Äặt Thiết láºp ngÆ°á»i dùng: Tham sá» không hợp lá»</value>
<value xml:lang="zh">æ æ³è®¾ç½®ç¨æ·è®¾ç½®ï¼æ æçåæ°</value>
</property>
<property key="setPreference.writeFailure">
@@ -85,6 +91,7 @@
<value xml:lang="it">Non è possibile ottenere le preferenze utente (scrittura fallita): {0}</value>
<value xml:lang="pt_BR">Não foi possÃvel definir as preferências do usuário (falha de escrita): {0}</value>
<value xml:lang="th">à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸±à¹à¸à¸à¹à¸²à¸ªà¸´à¸à¸à¸´à¸à¸´à¹à¸¨à¸©à¸à¸à¸à¸à¸¹à¹à¹à¸à¹ (à¹à¸à¸µà¸¢à¸à¸¥à¹à¸¡à¹à¸«à¸¥à¸§): {0}</value>
+ <value xml:lang="vi">Không thá» Äặt Thiết láºp ngÆ°á»i dùng (ghi không thà nh công)</value>
<value xml:lang="zh">æ æ³è®¾ç½®ç¨æ·è®¾ç½®(å失败)ï¼{0}</value>
</property>
</resource>
Modified: ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData.xml Tue Jun 19 21:36:11 2012
@@ -328,5 +328,6 @@ under the License.
<CountryAddressFormat geoId="POL" geoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/>
<CountryAddressFormat geoId="IND" geoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/>
<CountryAddressFormat geoId="ITA" geoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/>
+ <CountryAddressFormat geoId="CHE" geoAssocTypeId="REGIONS" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/>
<CountryAddressFormat geoId="FRA" geoAssocTypeId="" requireStateProvinceId="" requirePostalCode="" postalCodeRegex="" hasPostalCodeExt="" requirePostalCodeExt="" addressFormat=""/>
</entity-engine-xml>
Modified: ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData_UK.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData_UK.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData_UK.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/data/GeoData_UK.xml Tue Jun 19 21:36:11 2012
@@ -191,4 +191,20 @@ under the License.
<GeoAssoc geoId="WALS" geoIdTo="GB-PMBRK" geoAssocTypeId="REGIONS"/>
<GeoAssoc geoId="WALS" geoIdTo="GB-RNRS" geoAssocTypeId="REGIONS"/>
<GeoAssoc geoId="SCOT" geoIdTo="GB-WLOTH" geoAssocTypeId="REGIONS"/>
+
+ <!-- Counties of N.Ireland -->
+ <Geo abbreviation="ATRM" geoCode="ATRM" geoId="NIRL-ATRM" geoName="Antrim" geoTypeId="COUNTY"/>
+ <Geo abbreviation="ARMG" geoCode="ARMG" geoId="NIRL-ARMG" geoName="Armagh" geoTypeId="COUNTY"/>
+ <Geo abbreviation="DOWN" geoCode="DOWN" geoId="NIRL-DOWN" geoName="Down" geoTypeId="COUNTY"/>
+ <Geo abbreviation="FMNH" geoCode="FMNH" geoId="NIRL-FMNH" geoName="Fermanagh" geoTypeId="COUNTY"/>
+ <Geo abbreviation="LDRY" geoCode="LDRY" geoId="NIRL-LDRY" geoName="Londonderry" geoTypeId="COUNTY"/>
+ <Geo abbreviation="TYR" geoCode="TYR" geoId="NIRL-TYR" geoName="Tyrone" geoTypeId="COUNTY"/>
+ <GeoAssoc geoId="NIRL" geoIdTo="NIRL-ATRM" geoAssocTypeId="REGIONS"/>
+ <GeoAssoc geoId="NIRL" geoIdTo="NIRL-ARMG" geoAssocTypeId="REGIONS"/>
+ <GeoAssoc geoId="NIRL" geoIdTo="NIRL-DOWN" geoAssocTypeId="REGIONS"/>
+ <GeoAssoc geoId="NIRL" geoIdTo="NIRL-FMNH" geoAssocTypeId="REGIONS"/>
+ <GeoAssoc geoId="NIRL" geoIdTo="NIRL-LDRY" geoAssocTypeId="REGIONS"/>
+ <GeoAssoc geoId="NIRL" geoIdTo="NIRL-TYR" geoAssocTypeId="REGIONS"/>
+ <!-- End of N.Ireland -->
+
</entity-engine-xml>
Modified: ofbiz/branches/20120329_portletWidget/framework/common/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/ofbiz-component.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/ofbiz-component.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/ofbiz-component.xml Tue Jun 19 21:36:11 2012
@@ -27,7 +27,7 @@ under the License.
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_olap.xml"/>
<entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup_olap.xml"/>
- <entity-resource type="data" reader-name="seed" loader="main" location="data/CommonSecurityData.xml"/>
+ <entity-resource type="data" reader-name="security" loader="main" location="data/CommonSecurityData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/CommonSystemPropertyData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/CommonTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/CountryCodeData.xml"/>
@@ -38,19 +38,20 @@ under the License.
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_BG.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_BR.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_CA.xml"/>
+ <entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_CH.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_CN.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_CO.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_DE.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_ES.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_FR.xml"/>
- <entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_IT.xml"/>
+ <entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_IE.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_IN.xml"/>
- <entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_IRL.xml"/>
+ <entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_IT.xml"/>
+ <entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_MX.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_NL.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_PL.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_UK.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_US.xml"/>
- <entity-resource type="data" reader-name="seed" loader="main" location="data/GeoData_MX.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/LanguageData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/UnitData.xml"/>
Modified: ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/CommonEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/CommonEvents.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/CommonEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/CommonEvents.java Tue Jun 19 21:36:11 2012
@@ -68,7 +68,7 @@ public class CommonEvents {
public static final String module = CommonEvents.class.getName();
- public static UtilCache<String, Map<String, String>> appletSessions = UtilCache.createUtilCache("AppletSessions", 0, 600000, true);
+ private static final UtilCache<String, Map<String, String>> appletSessions = UtilCache.createUtilCache("AppletSessions", 0, 600000, true);
public static String checkAppletRequest(HttpServletRequest request, HttpServletResponse response) {
Delegator delegator = (Delegator) request.getAttribute("delegator");
@@ -122,8 +122,8 @@ public class CommonEvents {
if (visit.getString("sessionId").equals(sessionId)) {
String currentPage = request.getParameter("currentPage");
- if (appletSessions.containsKey(sessionId)) {
- Map<String, String> sessionMap = appletSessions.get(sessionId);
+ Map<String, String> sessionMap = appletSessions.get(sessionId);
+ if (sessionMap != null) {
String followers = sessionMap.get("followers");
List<String> folList = StringUtil.split(followers, ",");
for (String follower: folList) {
Modified: ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java Tue Jun 19 21:36:11 2012
@@ -1,3 +1,22 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+
package org.ofbiz.common;
import java.io.File;
Modified: ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/geo/GeoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/geo/GeoWorker.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/geo/GeoWorker.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/geo/GeoWorker.java Tue Jun 19 21:36:11 2012
@@ -62,7 +62,7 @@ public class GeoWorker {
List<GenericValue> geoList = FastList.newInstance();
List<GenericValue> thisGeoAssoc = null;
try {
- thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null);
+ thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null, false);
} catch (GenericEntityException e) {
Debug.logError(e, "Unable to get associated Geo GROUP_MEMBER relationship(s)", module);
}
@@ -70,7 +70,7 @@ public class GeoWorker {
for (GenericValue nextGeoAssoc: thisGeoAssoc) {
GenericValue nextGeo = null;
try {
- nextGeo = nextGeoAssoc.getRelatedOne("MainGeo");
+ nextGeo = nextGeoAssoc.getRelatedOne("MainGeo", false);
} catch (GenericEntityException e) {
Debug.logError(e, "Unable to get related Geo", module);
}
Modified: ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml Tue Jun 19 21:36:11 2012
@@ -46,7 +46,6 @@ under the License.
<handler name="screentext" type="view" class="org.ofbiz.widget.screen.ScreenTextViewHandler"/-->
<handler name="screenfop" type="view" class="org.ofbiz.widget.screen.ScreenFopViewHandler"/>
<handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/>
- <handler name="ftl" type="view" class="org.ofbiz.webapp.ftl.FreeMarkerViewHandler"/>
<handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/>
<handler name="birt" type="view" class="org.ofbiz.birt.webapp.view.BirtViewHandler"/>
Modified: ofbiz/branches/20120329_portletWidget/framework/common/webcommon/includes/states.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/webcommon/includes/states.ftl?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/webcommon/includes/states.ftl (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/webcommon/includes/states.ftl Tue Jun 19 21:36:11 2012
@@ -29,7 +29,7 @@ under the License.
</#if>
<#list stateAssocs as stateAssoc>
- <#assign state = delegator.getRelatedOne("AssocGeo", stateAssoc )>
+ <#assign state = stateAssoc.getRelatedOne("AssocGeo", false)>
<option value='${state.geoId}'>${state.geoName?default(state.geoId)}</option>
</#list>
-->
Propchange: ofbiz/branches/20120329_portletWidget/framework/common/widget/HelpScreens.xml
------------------------------------------------------------------------------
Merged /ofbiz/trunk/framework/common/widget/HelpScreens.xml:r1340642-1346323
Modified: ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageForms.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageForms.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageForms.xml Tue Jun 19 21:36:11 2012
@@ -29,32 +29,32 @@ under the License.
<parameter param-name="parentPortalPageId" from-field="parameters.parentPortalPageId"/>
</hyperlink>
</field>
- <field name="top" title="${uiLabelMap.CommonEmptyHeader}" use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == 0)"><hyperlink target="" description=""/></field>
- <field name="bot" title="${uiLabelMap.CommonEmptyHeader}" use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == listSize-1)"><hyperlink target="" description=""/></field>
- <field name="up" title="${uiLabelMap.CommonEmptyHeader}" use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == 0)"><hyperlink target="" description=""/></field>
- <field name="dwn" title="${uiLabelMap.CommonEmptyHeader}" use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == listSize-1)"><hyperlink target="" description=""/></field>
- <field name="top" title="${uiLabelMap.CommonEmptyHeader}" use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex > 0)">
+ <field name="top" title=" " use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == 0)"><hyperlink target="" description=""/></field>
+ <field name="bot" title=" " use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == listSize-1)"><hyperlink target="" description=""/></field>
+ <field name="up" title=" " use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == 0)"><hyperlink target="" description=""/></field>
+ <field name="dwn" title=" " use-when="(ownerUserLoginId.equals("_NA_"))||(itemIndex == listSize-1)"><hyperlink target="" description=""/></field>
+ <field name="top" title=" " use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex > 0)">
<hyperlink target="updatePortalPageSeq" image-location="/images/arrow-end-up-green.png">
<parameter param-name="mode" value="TOP"/>
<parameter param-name="portalPageId"/>
<parameter param-name="parentPortalPageId" from-field="parameters.parentPortalPageId"/>
</hyperlink>
</field>
- <field name="bot" title="${uiLabelMap.CommonEmptyHeader}" use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex < listSize-1)">
+ <field name="bot" title=" " use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex < listSize-1)">
<hyperlink target="updatePortalPageSeq" image-location="/images/arrow-end-down-green.png">
<parameter param-name="mode" value="BOT"/>
<parameter param-name="portalPageId"/>
<parameter param-name="parentPortalPageId" from-field="parameters.parentPortalPageId"/>
</hyperlink>
</field>
- <field name="up" title="${uiLabelMap.CommonEmptyHeader}" use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex > 0)">
+ <field name="up" title=" " use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex > 0)">
<hyperlink target="updatePortalPageSeq" image-location="/images/arrow-single-up-green.png">
<parameter param-name="mode" value="UP"/>
<parameter param-name="portalPageId"/>
<parameter param-name="parentPortalPageId" from-field="parameters.parentPortalPageId"/>
</hyperlink>
</field>
- <field name="dwn" title="${uiLabelMap.CommonEmptyHeader}" use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex < listSize-1)">
+ <field name="dwn" title=" " use-when="(!ownerUserLoginId.equals("_NA_"))&&(itemIndex < listSize-1)">
<hyperlink target="updatePortalPageSeq" image-location="/images/arrow-single-down-green.png">
<parameter param-name="mode" value="DWN"/>
<parameter param-name="portalPageId"/>
Modified: ofbiz/branches/20120329_portletWidget/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/datafile/src/org/ofbiz/datafile/ModelDataFileReader.java Tue Jun 19 21:36:11 2012
@@ -41,7 +41,7 @@ import org.w3c.dom.NodeList;
public final class ModelDataFileReader {
public static final String module = ModelDataFileReader.class.getName();
- private static UtilCache<URL, ModelDataFileReader> readers = UtilCache.createUtilCache("ModelDataFile", true);
+ private static final UtilCache<URL, ModelDataFileReader> readers = UtilCache.createUtilCache("ModelDataFile", true);
public static ModelDataFileReader getModelDataFileReader(URL readerURL) throws DataFileException {
ModelDataFileReader reader = readers.get(readerURL);
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/config/entityengine.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/config/entityengine.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/config/entityengine.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/config/entityengine.xml Tue Jun 19 21:36:11 2012
@@ -74,7 +74,7 @@ access. For a detailed description see t
<group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> -->
</delegator>
- <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant run-install" before running "ant run-tests" -->
+ <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant load-demo" before running "ant run-tests" -->
<delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
<group-map group-name="org.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
@@ -101,6 +101,7 @@ access. For a detailed description see t
security = OFBiz security group and security permissions. are required to show a component.
tenant = OFBiz and External Tenant Data
seed = OFBiz and External Seed Data - to be maintained along with source and updated whenever a system deployment is updated
+ security = OFBiz security group and security permissions. are required to show a component.
seed-initial = OFBiz and External Seed Data - to be maintained along with source like other seed data, but only loaded initially and not updated when a system is updated except manually reviewing each line
demo = OFBiz Only Demo Data
ext = External General Data (custom)
@@ -110,6 +111,7 @@ access. For a detailed description see t
<entity-data-reader name="security"/>
<entity-data-reader name="tenant"/>
<entity-data-reader name="seed"/>
+ <entity-data-reader name="security"/>
<entity-data-reader name="seed-initial"/>
<entity-data-reader name="demo"/>
<entity-data-reader name="ext"/>
@@ -158,6 +160,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -188,6 +191,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -239,6 +243,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -266,6 +271,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -290,6 +296,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -316,6 +323,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -346,6 +354,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -378,6 +387,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -410,6 +420,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -442,6 +453,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<inline-jdbc
jdbc-driver="com.mysql.jdbc.Driver"
jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz_odbc?autoReconnect=true"
@@ -471,6 +483,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -510,6 +523,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -545,6 +559,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -580,6 +595,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -613,6 +629,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -655,6 +672,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -680,6 +698,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -709,6 +728,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -753,6 +773,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -778,6 +799,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
@@ -807,6 +829,7 @@ access. For a detailed description see t
<read-data reader-name="security"/>
<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
+ <read-data reader-name="security"/>
<read-data reader-name="seed-initial"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/dtd/entity-config.xsd
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/dtd/entity-config.xsd?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/dtd/entity-config.xsd (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/dtd/entity-config.xsd Tue Jun 19 21:36:11 2012
@@ -457,7 +457,7 @@ under the License.
<xs:attribute type="xs:nonNegativeInteger" name="pool-deadlock-maxwait" default="300000"/>
<xs:attribute type="xs:nonNegativeInteger" name="pool-deadlock-retrywait" default="10000"/>
<xs:attribute type="xs:string" name="pool-jdbc-test-stmt"/>
- <xs:attribute type="xs:string" name="pool-xa-wrapper-class" default="org.enhydra.jdbc.standard.StandardXADataSource"/>
+ <xs:attribute type="xs:string" name="pool-xa-wrapper-class"/>
</xs:attributeGroup>
<xs:element name="jndi-jdbc">
<xs:complexType>
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/Delegator.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/Delegator.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/Delegator.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/Delegator.java Tue Jun 19 21:36:11 2012
@@ -775,7 +775,9 @@ public interface Delegator {
* GenericValue instance containing the entity
* @return List of GenericValue instances as specified in the relation
* definition
+ * @deprecated use {@link #getRelated(String, Map, List, GenericValue, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy, GenericValue value) throws GenericEntityException;
/**
@@ -791,10 +793,35 @@ public interface Delegator {
* GenericValue instance containing the entity
* @return List of GenericValue instances as specified in the relation
* definition
+ * @deprecated use {@link #getRelated(String, Map, List, GenericValue, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedCache(String relationName, GenericValue value) throws GenericEntityException;
/**
+ * Get the named Related Entity for the GenericValue from the persistent
+ * store
+ *
+ * @param relationName
+ * String containing the relation name which is the combination
+ * of relation.title and relation.rel-entity-name as specified in
+ * the entity XML definition file
+ * @param byAndFields
+ * the fields that must equal in order to keep; may be null
+ * @param orderBy
+ * The fields of the named entity to order the query by; may be
+ * null; optionally add a " ASC" for ascending or " DESC" for
+ * descending
+ * @param value
+ * GenericValue instance containing the entity
+ * @param useCache
+ * Whether to cache the results
+ * @return List of GenericValue instances as specified in the relation
+ * definition
+ */
+ public List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy, GenericValue value, boolean useCache) throws GenericEntityException;
+
+ /**
* Get a dummy primary key for the named Related Entity for the GenericValue
* NOTE 20080502: 2 references
*
@@ -812,24 +839,45 @@ public interface Delegator {
public GenericPK getRelatedDummyPK(String relationName, Map<String, ? extends Object> byAndFields, GenericValue value) throws GenericEntityException;
/**
- * Get related entity where relation is of type one, uses findByPrimaryKey
+ * Get related entity where relation is of type one, uses findOne
* NOTE 20080502: 7 references
*
* @throws IllegalArgumentException
* if the list found has more than one item
+ * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean)
*/
+ @Deprecated
public GenericValue getRelatedOne(String relationName, GenericValue value) throws GenericEntityException;
/**
- * Get related entity where relation is of type one, uses findByPrimaryKey,
+ * Get related entity where relation is of type one, uses findOne
* checking first in the cache to see if the desired value is there NOTE
* 20080502: 1 references
*
* @throws IllegalArgumentException
* if the list found has more than one item
+ * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean)
*/
+ @Deprecated
public GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException;
+ /**
+ * Get related entity where relation is of type one, uses findByPrimaryKey
+ *
+ * @param relationName
+ * String containing the relation name which is the combination
+ * of relation.title and relation.rel-entity-name as specified in
+ * the entity XML definition file
+ * @param value
+ * GenericValue instance containing the entity
+ * @param useCache
+ * Whether to cache the results
+ * @return GenericValue that is the related entity
+ * @throws IllegalArgumentException
+ * if the list found has more than one item
+ */
+ public GenericValue getRelatedOne(String relationName, GenericValue value, boolean useCache) throws GenericEntityException;
+
public void initEntityEcaHandler();
public void initDistributedCacheClear();
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Tue Jun 19 21:36:11 2012
@@ -1942,8 +1942,17 @@ public class GenericDelegator implements
/* (non-Javadoc)
* @see org.ofbiz.entity.Delegator#getRelated(java.lang.String, java.util.Map, java.util.List, org.ofbiz.entity.GenericValue)
+ * @deprecated use {@link #getRelated(String, Map, List, GenericValue, boolean)
*/
+ @Deprecated
public List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy, GenericValue value) throws GenericEntityException {
+ return getRelated(relationName, byAndFields, orderBy, value, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ofbiz.entity.Delegator#getRelated(java.lang.String, java.util.Map, java.util.List, org.ofbiz.entity.GenericValue, boolean)
+ */
+ public List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy, GenericValue value, boolean useCache) throws GenericEntityException {
ModelEntity modelEntity = value.getModelEntity();
ModelRelation relation = modelEntity.getRelation(relationName);
@@ -1962,7 +1971,7 @@ public class GenericDelegator implements
fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
}
- return this.findByAnd(relation.getRelEntityName(), fields, orderBy, false);
+ return this.findByAnd(relation.getRelEntityName(), fields, orderBy, useCache);
}
/* (non-Javadoc)
@@ -1993,52 +2002,36 @@ public class GenericDelegator implements
/* (non-Javadoc)
* @see org.ofbiz.entity.Delegator#getRelatedCache(java.lang.String, org.ofbiz.entity.GenericValue)
+ * @deprecated use {@link #getRelated(String, Map, List, GenericValue, boolean)
*/
+ @Deprecated
public List<GenericValue> getRelatedCache(String relationName, GenericValue value) throws GenericEntityException {
- ModelEntity modelEntity = value.getModelEntity();
- ModelRelation relation = modelEntity.getRelation(relationName);
-
- if (relation == null) {
- throw new GenericModelException("Could not find relation for relationName: " + relationName + " for value " + value);
- }
-
- Map<String, Object> fields = FastMap.newInstance();
- for (int i = 0; i < relation.getKeyMapsSize(); i++) {
- ModelKeyMap keyMap = relation.getKeyMap(i);
- fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
- }
-
- return this.findByAnd(relation.getRelEntityName(), fields, null, true);
+ return getRelated(relationName, null, null, value, true);
}
/* (non-Javadoc)
- * @see org.ofbiz.entity.Delegator#getRelatedOne(java.lang.String, org.ofbiz.entity.GenericValue)
+ * @see org.ofbiz.entity.Delegator#getRelatedOne(java.lang.String, org.ofbiz.entity.GenericValue, boolean)
+ * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean)
*/
+ @Deprecated
public GenericValue getRelatedOne(String relationName, GenericValue value) throws GenericEntityException {
- ModelRelation relation = value.getModelEntity().getRelation(relationName);
-
- if (relation == null) {
- throw new GenericModelException("Could not find relation for relationName: " + relationName + " for value " + value);
- }
- if (!"one".equals(relation.getType()) && !"one-nofk".equals(relation.getType())) {
- throw new GenericModelException("Relation is not a 'one' or a 'one-nofk' relation: " + relationName + " of entity " + value.getEntityName());
- }
-
- Map<String, Object> fields = FastMap.newInstance();
- for (int i = 0; i < relation.getKeyMapsSize(); i++) {
- ModelKeyMap keyMap = relation.getKeyMap(i);
- fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
- }
-
- return this.findByPrimaryKey(relation.getRelEntityName(), fields);
+ return this.getRelatedOne(relationName, value, false);
}
/* (non-Javadoc)
- * @see org.ofbiz.entity.Delegator#getRelatedOneCache(java.lang.String, org.ofbiz.entity.GenericValue)
+ * @see org.ofbiz.entity.Delegator#getRelatedOneCache(java.lang.String, org.ofbiz.entity.GenericValue, boolean)
+ * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean)
*/
+ @Deprecated
public GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException {
- ModelEntity modelEntity = value.getModelEntity();
- ModelRelation relation = modelEntity.getRelation(relationName);
+ return this.getRelatedOne(relationName, value, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ofbiz.entity.Delegator#getRelatedOne(java.lang.String, org.ofbiz.entity.GenericValue, boolean)
+ */
+ public GenericValue getRelatedOne(String relationName, GenericValue value, boolean useCache) throws GenericEntityException {
+ ModelRelation relation = value.getModelEntity().getRelation(relationName);
if (relation == null) {
throw new GenericModelException("Could not find relation for relationName: " + relationName + " for value " + value);
@@ -2053,7 +2046,7 @@ public class GenericDelegator implements
fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
}
- return this.findByPrimaryKeyCache(relation.getRelEntityName(), fields);
+ return this.findOne(relation.getRelEntityName(), fields, useCache);
}
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericValue.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericValue.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericValue.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/GenericValue.java Tue Jun 19 21:36:11 2012
@@ -165,9 +165,11 @@ public class GenericValue extends Generi
/** Get the named Related Entity for the GenericValue from the persistent store
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelated(String relationName) throws GenericEntityException {
- return this.getDelegator().getRelated(relationName, null, null, this);
+ return this.getDelegator().getRelated(relationName, null, null, this, false);
}
/** Get the named Related Entity for the GenericValue from the persistent store
@@ -175,9 +177,11 @@ public class GenericValue extends Generi
* @param orderBy The fields of the named entity to order the query by; may be null;
* optionally add a " ASC" for ascending or " DESC" for descending
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelated(String relationName, List<String> orderBy) throws GenericEntityException {
- return this.getDelegator().getRelated(relationName, FastMap.<String, Object>newInstance(), orderBy, this);
+ return this.getDelegator().getRelated(relationName, FastMap.<String, Object>newInstance(), orderBy, this, false);
}
/** Get the named Related Entity for the GenericValue from the persistent store
@@ -186,18 +190,34 @@ public class GenericValue extends Generi
* @param orderBy The fields of the named entity to order the query by; may be null;
* optionally add a " ASC" for ascending or " DESC" for descending
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy) throws GenericEntityException {
- return this.getDelegator().getRelated(relationName, byAndFields, orderBy, this);
+ return this.getDelegator().getRelated(relationName, byAndFields, orderBy, this, false);
}
/** Get the named Related Entity for the GenericValue from the persistent
* store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant)
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedCache(String relationName) throws GenericEntityException {
- return this.getDelegator().getRelatedCache(relationName, this);
+ return this.getDelegator().getRelated(relationName, null, null, this, true);
+ }
+
+ /** Get the named Related Entity for the GenericValue from the persistent store
+ *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
+ * @param byAndFields the fields that must equal in order to keep; may be null
+ * @param orderBy The fields of the named entity to order the query by; may be null;
+ * optionally add a " ASC" for ascending or " DESC" for descending
+ * @param useCache Whether to cache the results
+ *@return List of GenericValue instances as specified in the relation definition
+ */
+ public List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy, boolean useCache) throws GenericEntityException {
+ return this.getDelegator().getRelated(relationName, byAndFields, orderBy, this, useCache);
}
/**
@@ -235,13 +255,11 @@ public class GenericValue extends Generi
* @param orderBy The fields of the named entity to order the query by; may be null;
* optionally add a " ASC" for ascending or " DESC" for descending
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedCache(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy) throws GenericEntityException {
- List<GenericValue> col = getRelatedCache(relationName);
-
- if (byAndFields != null) col = EntityUtil.filterByAnd(col, byAndFields);
- if (UtilValidate.isNotEmpty(orderBy)) col = EntityUtil.orderBy(col, orderBy);
- return col;
+ return this.getDelegator().getRelated(relationName, byAndFields, orderBy, this, true);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -250,9 +268,11 @@ public class GenericValue extends Generi
* @param orderBy The fields of the named entity to order the query by; may be null;
* optionally add a " ASC" for ascending or " DESC" for descending
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedCache(String relationName, List<String> orderBy) throws GenericEntityException {
- return this.getRelatedCache(relationName, null, orderBy);
+ return this.getDelegator().getRelated(relationName, null, orderBy, this, true);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -266,7 +286,7 @@ public class GenericValue extends Generi
List<GenericValue> col = relatedCache.get(relationName);
if (col == null) {
- col = getRelated(relationName);
+ col = getRelated(relationName, null, null, false);
relatedCache.put(relationName, col);
}
return col;
@@ -311,18 +331,31 @@ public class GenericValue extends Generi
/** Get the named Related Entity for the GenericValue from the persistent store
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelatedOne(String, boolean)}
*/
+ @Deprecated
public GenericValue getRelatedOne(String relationName) throws GenericEntityException {
- return this.getDelegator().getRelatedOne(relationName, this);
+ return this.getDelegator().getRelatedOne(relationName, this, false);
}
/** Get the named Related Entity for the GenericValue from the persistent
* store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant)
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelatedOne(String, boolean)}
*/
+ @Deprecated
public GenericValue getRelatedOneCache(String relationName) throws GenericEntityException {
- return this.getDelegator().getRelatedOneCache(relationName, this);
+ return this.getDelegator().getRelatedOne(relationName, this, true);
+ }
+
+ /** Get the named Related Entity for the GenericValue from the persistent store
+ *@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
+ *@param useCache Whether to cache the results
+ *@return The single related GenericValue instance
+ */
+ public GenericValue getRelatedOne(String relationName, boolean useCache) throws GenericEntityException {
+ return this.getDelegator().getRelatedOne(relationName, this, useCache);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -336,7 +369,7 @@ public class GenericValue extends Generi
GenericValue value = relatedOneCache.get(relationName);
if (value == null) {
- value = getRelatedOne(relationName);
+ value = getRelatedOne(relationName, false);
if (value != null) relatedOneCache.put(relationName, value);
}
return value;
@@ -346,9 +379,11 @@ public class GenericValue extends Generi
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@param fields the fields that must equal in order to keep
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedByAnd(String relationName, Map<String, ? extends Object> fields) throws GenericEntityException {
- return this.getDelegator().getRelated(relationName, fields, null, this);
+ return this.getDelegator().getRelated(relationName, fields, null, this, false);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -356,9 +391,11 @@ public class GenericValue extends Generi
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@param fields the fields that must equal in order to keep
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedByAndCache(String relationName, Map<String, ? extends Object> fields) throws GenericEntityException {
- return EntityUtil.filterByAnd(this.getDelegator().getRelatedCache(relationName, this), fields);
+ return this.getDelegator().getRelated(relationName, fields, null, this, true);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -376,9 +413,11 @@ public class GenericValue extends Generi
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@param orderBy the order that they should be returned
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedOrderBy(String relationName, List<String> orderBy) throws GenericEntityException {
- return this.getDelegator().getRelated(relationName, null, orderBy, this);
+ return this.getDelegator().getRelated(relationName, null, orderBy, this, false);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -386,9 +425,11 @@ public class GenericValue extends Generi
*@param relationName String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
*@param orderBy the order that they should be returned
*@return List of GenericValue instances as specified in the relation definition
+ *@deprecated use {@link #getRelated(String, Map, List, boolean)}
*/
+ @Deprecated
public List<GenericValue> getRelatedOrderByCache(String relationName, List<String> orderBy) throws GenericEntityException {
- return EntityUtil.orderBy(this.getDelegator().getRelatedCache(relationName, this), orderBy);
+ return this.getDelegator().getRelated(relationName, null, orderBy, this, true);
}
/** Get the named Related Entity for the GenericValue from the persistent
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java Tue Jun 19 21:36:11 2012
@@ -147,7 +147,7 @@ public class DBCPConnectionFactory imple
// create the pool object factory
PoolableConnectionFactory factory = new PoolableConnectionFactory(xacf, pool, null, null, true, true);
- factory.setValidationQuery("select example_type_id from example_type limit 1");
+ factory.setValidationQuery("select 1 from entity_key_store where key_name = ''");
factory.setDefaultReadOnly(false);
String transIso = jdbcElement.getAttribute("isolation-level");
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java Tue Jun 19 21:36:11 2012
@@ -91,7 +91,7 @@ public class ConnectionFactory {
public static ConnectionFactoryInterface getManagedConnectionFactory() {
if (_factory == null) { // don't want to block here
- synchronized (TransactionFactory.class) {
+ synchronized (ConnectionFactory.class) {
// must check if null again as one of the blocked threads can still enter
if (_factory == null) {
try {
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java Tue Jun 19 21:36:11 2012
@@ -89,10 +89,8 @@ public class ModelFieldTypeReader implem
throw new IllegalStateException("Error loading field type file " + fieldTypeResourceHandler.getLocation());
}
Map<String, ModelFieldType> fieldTypeMap = createFieldTypeCache(document.getDocumentElement(), fieldTypeResourceHandler.getLocation());
- reader = new ModelFieldTypeReader(fieldTypeMap);
- readers.putIfAbsent(tempModelName, reader);
+ reader = readers.putIfAbsentAndGet(tempModelName, new ModelFieldTypeReader(fieldTypeMap));
utilTimer.timerString("[ModelFieldTypeReader.getModelFieldTypeReader] Read " + fieldTypeMap.size() + " field types");
- reader = readers.get(tempModelName);
}
return reader;
}
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java Tue Jun 19 21:36:11 2012
@@ -53,7 +53,7 @@ import org.w3c.dom.Node;
public class ModelGroupReader implements Serializable {
public static final String module = ModelGroupReader.class.getName();
- public static UtilCache<String, ModelGroupReader> readers = UtilCache.createUtilCache("entity.ModelGroupReader", 0, 0);
+ private static final UtilCache<String, ModelGroupReader> readers = UtilCache.createUtilCache("entity.ModelGroupReader", 0, 0);
private Map<String, String> groupCache = null;
private Set<String> groupNames = null;
@@ -71,15 +71,8 @@ public class ModelGroupReader implements
String tempModelName = delegatorInfo.entityGroupReader;
ModelGroupReader reader = readers.get(tempModelName);
- if (reader == null) { // don't want to block here
- synchronized (ModelGroupReader.class) {
- // must check if null again as one of the blocked threads can still enter
- reader = readers.get(tempModelName);
- if (reader == null) {
- reader = new ModelGroupReader(tempModelName);
- readers.put(tempModelName, reader);
- }
- }
+ if (reader == null) {
+ reader = readers.putIfAbsentAndGet(tempModelName, new ModelGroupReader(tempModelName));
}
return reader;
}
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelReader.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelReader.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/model/ModelReader.java Tue Jun 19 21:36:11 2012
@@ -58,7 +58,7 @@ import org.w3c.dom.Node;
public class ModelReader implements Serializable {
public static final String module = ModelReader.class.getName();
- public static UtilCache<String, ModelReader> readers = UtilCache.createUtilCache("entity.ModelReader", 0, 0);
+ private static final UtilCache<String, ModelReader> readers = UtilCache.createUtilCache("entity.ModelReader", 0, 0);
protected Map<String, ModelEntity> entityCache = null;
@@ -89,17 +89,11 @@ public class ModelReader implements Seri
String tempModelName = delegatorInfo.entityModelReader;
ModelReader reader = readers.get(tempModelName);
- if (reader == null) { // don't want to block here
- synchronized (ModelReader.class) {
- // must check if null again as one of the blocked threads can still enter
- reader = readers.get(tempModelName);
- if (reader == null) {
- reader = new ModelReader(tempModelName);
- // preload caches...
- reader.getEntityCache();
- readers.put(tempModelName, reader);
- }
- }
+ if (reader == null) {
+ reader = new ModelReader(tempModelName);
+ // preload caches...
+ reader.getEntityCache();
+ reader = readers.putIfAbsentAndGet(tempModelName, reader);
}
return reader;
}
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Tue Jun 19 21:36:11 2012
@@ -310,7 +310,7 @@ public class EntityTestSuite extends Ent
ArrayList<GenericValue> testings = new ArrayList<GenericValue>();
for (GenericValue nodeMember: values) {
- testings.add(nodeMember.getRelatedOne("Testing"));
+ testings.add(nodeMember.getRelatedOne("Testing", false));
}
// and remove the nodeMember afterwards
delegator.removeAll(values);
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java Tue Jun 19 21:36:11 2012
@@ -78,16 +78,16 @@ public class TransactionUtil implements
@Deprecated
public static <V> V doNewTransaction(String ifErrorMessage, Callable<V> callable) throws GenericEntityException {
- return inTransaction(noTransaction(callable), ifErrorMessage, 0, true).call();
+ return noTransaction(inTransaction(callable, ifErrorMessage, 0, true)).call();
}
@Deprecated
public static <V> V doNewTransaction(String ifErrorMessage, boolean printException, Callable<V> callable) throws GenericEntityException {
- return inTransaction(noTransaction(callable), ifErrorMessage, 0, printException).call();
+ return noTransaction(inTransaction(callable, ifErrorMessage, 0, printException)).call();
}
public static <V> V doNewTransaction(Callable<V> callable, String ifErrorMessage, int timeout, boolean printException) throws GenericEntityException {
- return inTransaction(noTransaction(callable), ifErrorMessage, timeout, printException).call();
+ return noTransaction(inTransaction(callable, ifErrorMessage, timeout, printException)).call();
}
@Deprecated
@@ -104,7 +104,7 @@ public class TransactionUtil implements
return inTransaction(callable, ifErrorMessage, timeout, printException).call();
}
- public static <V> Callable<V> noTransaction(Callable<V> callable) {
+ public static <V> NoTransaction<V> noTransaction(Callable<V> callable) {
return new NoTransaction<V>(callable);
}
@@ -973,10 +973,18 @@ public class TransactionUtil implements
this.callable = callable;
}
- public V call() throws Exception {
+ public V call() throws GenericEntityException {
Transaction suspended = TransactionUtil.suspend();
try {
return callable.call();
+ } catch (Error e) {
+ throw e;
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (GenericEntityException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new GenericEntityException(e);
} finally {
TransactionUtil.resume(suspended);
}
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java Tue Jun 19 21:36:11 2012
@@ -39,7 +39,7 @@ public class EntityTypeUtil {
public static boolean isType(Collection<GenericValue> thisCollection, String typeRelation, GenericValue targetType) {
for (GenericValue value: thisCollection) {
try {
- GenericValue related = value.getRelatedOne(typeRelation);
+ GenericValue related = value.getRelatedOne(typeRelation, false);
if (isType(related, targetType)) {
return true;
} // else keep looking
@@ -72,7 +72,7 @@ public class EntityTypeUtil {
private static GenericValue getParentType(GenericValue typeValue) {
// assumes Parent relation is "Parent<entityName>"
try {
- return typeValue.getRelatedOneCache("Parent" + typeValue.getEntityName());
+ return typeValue.getRelatedOne("Parent" + typeValue.getEntityName(), true);
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
return null;
@@ -86,7 +86,7 @@ public class EntityTypeUtil {
// first get all childrenTypes ...
List<GenericValue> childrenTypes = null;
try {
- childrenTypes = typeValue.getRelatedCache("Child" + typeValue.getEntityName());
+ childrenTypes = typeValue.getRelated("Child" + typeValue.getEntityName(), null, null, true);
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
return null;
Modified: ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java Tue Jun 19 21:36:11 2012
@@ -339,42 +339,44 @@ public class EntityUtil {
return result;
}
+ /**
+ * @deprecated use {@link #getRelated(String, Map, List, boolean)}
+ */
+ @Deprecated
public static List<GenericValue> getRelated(String relationName, List<GenericValue> values) throws GenericEntityException {
- if (values == null) return null;
-
- List<GenericValue> result = FastList.newInstance();
- for (GenericValue value: values) {
- result.addAll(value.getRelated(relationName));
- }
- return result;
+ return getRelated(relationName, null, values, false);
}
+ /**
+ * @deprecated use {@link #getRelated(String, Map, List, boolean)}
+ */
+ @Deprecated
public static List<GenericValue> getRelatedCache(String relationName, List<GenericValue> values) throws GenericEntityException {
- if (values == null) return null;
-
- List<GenericValue> result = FastList.newInstance();
- for (GenericValue value: values) {
- result.addAll(value.getRelatedCache(relationName));
- }
- return result;
+ return getRelated(relationName, null, values, true);
}
+ /**
+ * @deprecated use {@link #getRelated(String, Map, List, boolean)}
+ */
+ @Deprecated
public static List<GenericValue> getRelatedByAnd(String relationName, Map<String, ? extends Object> fields, List<GenericValue> values) throws GenericEntityException {
- if (values == null) return null;
-
- List<GenericValue> result = FastList.newInstance();
- for (GenericValue value: values) {
- result.addAll(value.getRelatedByAnd(relationName, fields));
- }
- return result;
+ return getRelated(relationName, fields, values, false);
}
+ /**
+ * @deprecated use {@link #getRelated(String, Map, List, boolean)}
+ */
+ @Deprecated
public static List<GenericValue> getRelatedByAndCache(String relationName, Map<String, ? extends Object> fields, List<GenericValue> values) throws GenericEntityException {
+ return getRelated(relationName, fields, values, true);
+ }
+
+ public static List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> fields, List<GenericValue> values, boolean useCache) throws GenericEntityException {
if (values == null) return null;
List<GenericValue> result = FastList.newInstance();
for (GenericValue value: values) {
- result.addAll(value.getRelatedByAndCache(relationName, fields));
+ result.addAll(value.getRelated(relationName, fields, null, useCache));
}
return result;
}
Modified: ofbiz/branches/20120329_portletWidget/framework/entityext/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entityext/ofbiz-component.xml?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entityext/ofbiz-component.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entityext/ofbiz-component.xml Tue Jun 19 21:36:11 2012
@@ -29,7 +29,7 @@ under the License.
<entity-resource type="data" reader-name="seed" loader="main" location="data/EntityExtTypeData.xml"/>
<entity-resource type="data" reader-name="seed-initial" loader="main" location="data/EntityScheduledServices.xml"/>
- <entity-resource type="data" reader-name="seed" loader="main" location="data/EntityExtSecurityData.xml"/>
+ <entity-resource type="data" reader-name="security" loader="main" location="data/EntityExtSecurityData.xml"/>
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
Modified: ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java Tue Jun 19 21:36:11 2012
@@ -49,19 +49,14 @@ public class EntityEcaUtil {
public static final String module = EntityEcaUtil.class.getName();
- public static UtilCache<String, Map<String, Map<String, List<EntityEcaRule>>>> entityEcaReaders = UtilCache.createUtilCache("entity.EcaReaders", 0, 0, false);
+ private static final UtilCache<String, Map<String, Map<String, List<EntityEcaRule>>>> entityEcaReaders = UtilCache.createUtilCache("entity.EcaReaders", 0, 0, false);
public static Map<String, Map<String, List<EntityEcaRule>>> getEntityEcaCache(String entityEcaReaderName) {
Map<String, Map<String, List<EntityEcaRule>>> ecaCache = entityEcaReaders.get(entityEcaReaderName);
if (ecaCache == null) {
- synchronized (EntityEcaUtil.class) {
- ecaCache = entityEcaReaders.get(entityEcaReaderName);
- if (ecaCache == null) {
- ecaCache = FastMap.newInstance();
- readConfig(entityEcaReaderName, ecaCache);
- entityEcaReaders.put(entityEcaReaderName, ecaCache);
- }
- }
+ ecaCache = FastMap.newInstance();
+ readConfig(entityEcaReaderName, ecaCache);
+ ecaCache = entityEcaReaders.putIfAbsentAndGet(entityEcaReaderName, ecaCache);
}
return ecaCache;
}
Modified: ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java Tue Jun 19 21:36:11 2012
@@ -778,7 +778,7 @@ public class EntityPermissionChecker {
List<GenericValue> purposes = null;
try {
- purposes = entity.getRelatedCache(entityName + "Purpose");
+ purposes = entity.getRelated(entityName + "Purpose", null, null, true);
} catch (GenericEntityException e) {
Debug.logError(e, "No associated purposes found. ", module);
return purposeIds;
@@ -820,7 +820,7 @@ public class EntityPermissionChecker {
String partyId = (String)userLogin.get("partyId");
List<GenericValue> relatedRoles = null;
- List<GenericValue> tmpRelatedRoles = entity.getRelatedCache(entityName + "Role");
+ List<GenericValue> tmpRelatedRoles = entity.getRelated(entityName + "Role", null, null, true);
relatedRoles = EntityUtil.filterByDate(tmpRelatedRoles);
if (relatedRoles != null) {
for (GenericValue contentRole: relatedRoles) {
@@ -835,7 +835,7 @@ public class EntityPermissionChecker {
GenericValue party = null;
String partyTypeId = null;
try {
- party = contentRole.getRelatedOne("Party");
+ party = contentRole.getRelatedOne("Party", false);
partyTypeId = (String)party.get("partyTypeId");
if (partyTypeId != null && partyTypeId.equals("PARTY_GROUP")) {
Map<String, Object> map = FastMap.newInstance();
Modified: ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java Tue Jun 19 21:36:11 2012
@@ -847,9 +847,9 @@ public class EntitySyncContext {
/** prepare a list of all entities we want to synchronize: remove all view-entities and all entities that don't match the patterns attached to this EntitySync */
protected List<ModelEntity> makeEntityModelToUseList() throws GenericEntityException {
- List<GenericValue> entitySyncIncludes = entitySync.getRelated("EntitySyncInclude");
+ List<GenericValue> entitySyncIncludes = entitySync.getRelated("EntitySyncInclude", null, null, false);
// get these ones as well, and just add them to the main list, it will have an extra field but that shouldn't hurt anything in the code below
- List<GenericValue> entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView");
+ List<GenericValue> entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView", null, null, false);
entitySyncIncludes.addAll(entitySyncGroupIncludes);
List<ModelEntity> entityModelToUseList = EntityGroupUtil.getModelEntitiesFromRecords(entitySyncIncludes, delegator, true);
Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/config/minilang.properties
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/config/minilang.properties?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/minilang/config/minilang.properties (original)
+++ ofbiz/branches/20120329_portletWidget/framework/minilang/config/minilang.properties Tue Jun 19 21:36:11 2012
@@ -20,7 +20,7 @@
# Mini-language parsing validation level: strict/lenient/none. Strict will throw
# exceptions during runtime when XML errors or syntax errors are encountered,
# while lenient will only log a warning. A setting of none disables validation.
-validation.level=lenient
+validation.level=none
# Enable mini-language auto-correction. If set to true, mini-language will attempt
# to correct common syntax errors. The corrections are saved in the original