Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051172Retail ModulesRetail APIpublic2022-11-29 10:152022-12-16 07:27
nicola_uva 
ranjith_qualiantech_com 
immediatemajoralways
closedfixed 
5
pi 
RR22Q4.1 
https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/88903ac5c94205168d78a8ab7bb9c4d5cbba4b02 [^]
No
0051172: Export User API - Mapping Broken
User export entity mapping is using an entity mapping of the import flow (UserRoles) to map the "roles" property
the error can be reproduced after this change: https://issues.openbravo.com/view.php?id=50689 [^]
which adds an import java property mapping handler for the UserRoles
1)Using Postman perform the following request
https://livebuilds.openbravo.com/retail_modules_pgsql_pi/ws/org.openbravo.retail.api.ExportService/User/byUsername?username=Openbravo [^]

2)in the openbravo log you can see an error


2022-11-28 13:25:24,162 [http-nio-8081-exec-3] ERROR org.openbravo.service.web.BaseWebServiceServlet - java.lang.UnsupportedOperationException: Operation not supported for ImportJavaPropertyMappingHandlers
org.openbravo.base.exception.OBException: java.lang.UnsupportedOperationException: Operation not supported for ImportJavaPropertyMappingHandlers
    at org.openbravo.service.external.integration.mapping.PropertyMapper.createSynchronizableBusinessObject(PropertyMapper.java:163) ~[classes/:?]
    at org.openbravo.service.external.integration.export.SynchronizableBusinessObjectExporter.exportToSynchronizableBusinessObject(SynchronizableBusinessObjectExporter.java:129) ~[classes/:?]
    at org.openbravo.service.external.integration.export.SynchronizableBusinessObjectExporter.exportToSynchronizableBusinessObject(SynchronizableBusinessObjectExporter.java:108) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.OneToManyEntityPropertyMapping.getTargetList(OneToManyEntityPropertyMapping.java:104) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.OneToManyEntityPropertyMapping.getMappingValueForExport(OneToManyEntityPropertyMapping.java:92) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.DirectPropertyMapping.getMappingValueForExport(DirectPropertyMapping.java:1) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.PropertyMapping.addMappingValue(PropertyMapping.java:77) ~[classes/:?]
    at org.openbravo.service.external.integration.mapping.PropertyMapper.createSynchronizableBusinessObject(PropertyMapper.java:155) ~[classes/:?]
    at org.openbravo.service.external.integration.export.SynchronizableBusinessObjectExporter.exportToSynchronizableBusinessObject(SynchronizableBusinessObjectExporter.java:129) ~[classes/:?]
    at org.openbravo.api.ApiExporter.lambda$10(ApiExporter.java:344) ~[classes/:?]
define a separate entity mapping for the UserRoles entity but for the EXPORT flow" + add a test case that seems it is missing
No tags attached.
blocks defect 0051028pi closed ranjith_qualiantech_com Export User API - Mapping Broken 
Issue History
2022-12-16 00:41guilleaerTypedefect => backport
2022-12-16 00:41guilleaerTarget Versionpi => RR22Q4.1
2022-12-16 05:43hgbotNote Added: 0144752
2022-12-16 07:27hgbotResolutionopen => fixed
2022-12-16 07:27hgbotStatusscheduled => closed
2022-12-16 07:27hgbotNote Added: 0144753
2022-12-16 07:27hgbotNote Added: 0144754

Notes
(0144752)
hgbot   
2022-12-16 05:43   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/113 [^]
(0144753)
hgbot   
2022-12-16 07:27   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/113 [^]
(0144754)
hgbot   
2022-12-16 07:27   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.api [^]
Changeset: 18ea94c8a46180e89e2839770f0957d0b6a899cc
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 16-12-2022 10:10:37
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/18ea94c8a46180e89e2839770f0957d0b6a899cc [^]

Fixed ISSUE-51172: Added OBToExternal entity mapping for UserRole

---
M src-db/database/sourcedata/OBEI_ENTITY_MAPPING.xml
M src-db/database/sourcedata/OBEI_PROP_MAP_INSTANCE.xml
M src-test/org/openbravo/api/export/ApiExporterTest.java
---