This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release17.12
in repository
https://gitbox.apache.org/repos/asf/ofbiz-framework.gitThe following commit(s) were added to refs/heads/release17.12 by this push:
new 2ce14c8 Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
2ce14c8 is described below
commit 2ce14c8fe1e0f1182d6deb5c44336badcfba7c60
Author: Jacques Le Roux <
[hidden email]>
AuthorDate: Thu Apr 8 13:47:47 2021 +0200
Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)
Accidentally removed PartyServices::createRoleType
---
.../apache/ofbiz/party/party/PartyServices.java | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
index 8e44a20c..570021f 100644
--- a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
+++ b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
@@ -998,6 +998,29 @@ public class PartyServices {
return result;
}
+ public static Map<String, Object> createRoleType(DispatchContext dctx, Map<String, ? extends Object> context) {
+ Map<String, Object> result = new HashMap<>();
+ Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale) context.get("locale");
+ GenericValue roleType = null;
+
+ try {
+ roleType = delegator.makeValue("RoleType");
+ roleType.setPKFields(context);
+ roleType.setNonPKFields(context);
+ roleType = delegator.create(roleType);
+ } catch (GenericEntityException e) {
+ Debug.logError(e, MODULE);
+ return ServiceUtil.returnError(UtilProperties.getMessage(RES_ERROR,
+ "PartyCannotCreateRoleTypeEntity",
+ UtilMisc.toMap("errMessage", e.getMessage()), locale));
+ }
+ if (roleType != null) {
+ result.put("roleType", roleType);
+ }
+ return result;
+ }
+
@Deprecated // migration from ftl to widget in process.
public static Map<String, Object> findParty(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = ServiceUtil.returnSuccess();