on 08-31-2018 8:20 AM
Can we have 2 extension extended from ycommercewebservices template? If yes, how to proceed with it ?
We have a requirement in Hybris 6.7 where we need to keep the webservices from two third party integrations separate in two different extensions.
For example webservices integration for third party A in one extension,say A and webservices integration for third party B in another extension say B. Now I have extended ycommercewebservices for third party A, it is not giving any build issues.
Now when I extended the webservices for third party B, it is giving build issues.
The issue is, when I extend from ycommercewebservices for third party B, it gives rise to conflicts in items and beans autocreated by extending. I have tried removing the items and beans which are conflicting but still it is giving build issue.
Did anyone face such a issue?
Is it even feasible to create separate extensions extending from same ycommercewebservices template.
I wouldn't create two extensions using ycommercewebservices
, as it's not sensible to have more than one
If you need to separate the data, use different BaseSites
with different catalog versions or similar mechanisms
if you just need to implement a custom REST API, use ywebservices
as template.
Documentation for ywebservices
(available since 6.0):
https://help.hybris.com/1808/hcd/eb5f0e9c20464a488466790333e0e6e2.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. We were having similar scenario. I will explain this briefly below and how we could solve it.
Scenario:
Challenges:
We tried lot of refactoring but of no use. The only option is to have separate commercewebservices extension for b2c commerce functionality.
Solution:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is definitely possible, just use Hybris' extendable extension approach.
Create an extension 'A' from ycommercewebservices template. Now create another extension called webservicescommons and copy A-items.xml and all spring configuration xml files into webservicescommons extension. In short your extension A should only have controllers. Move all the facades/services to webservicescommons extension.
Now Create another extension 'B' similarly and delete all items.xml and spring configuration files and facades and services java files.
In extensioninfo.xml file for extension 'A'. Add requires-extension attribute webservicescommons In extensioninfo.xml file for extension 'B'. Add requires-extension attribute webservicescommons
Put all extension in localextension.xml file.
In short, you have made 2 extensions A & B and have moved all beans and all facades/services logic into a common extension. So your common extension is now reusable and your extension 'A' & 'B' will have endpoints for third parties to call.
Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.