-1

So, I can see many files under customize folder under platform. Is there any other way to oveerride platform in general other than putting it in customize folder?

If we have to override some OOTB file there are two ways: 1) If its in some extension, we can create customized extension and do our changes. 2) Add stuff into customize folder and do ant customize.

What if OOTB file is in platform? Is there any other way?

I expect to customize platform without adding it to customize folder.

sakshinarang
  • 99
  • 3
  • 14

3 Answers3

1

Using buildcallbacks you can replace the files even the files in platform jar .

  • any document where tutorial shows how to write on these xmls? Its hard to understand it for the first time. I need to understand the tags and their meanings in it. – sakshinarang Nov 08 '19 at 12:57
1

Is the function/bean you want to override is injected through Spring?

If no, and you need to override say some jar, class or xml. You have choice of ant customize or buildcallbacks.xml

If yes, it's no different than overriding any other beans from parent extension. The only thing is that you will not need to create an extension dependency as platform is available globally.

For example : If you wish to override some function in DefaultCatalogDao to give your own implementation. You can do it like...

  1. Create your own implementation extending the platform related service
  2. Inject your custom bean with alias of the defaultCatalogDao
<alias alias="catalogDao" name="customCatalogDao"/>
<bean id="customCatalogDao" class="......CustomCatalogDao" parent="defaultCatalogDao"/>

For Commerce Cloud

You can change platform files using customize folder in Commerce Cloud V2 too. You would need to create a folder in your custom repository with name _CUSTOMIZE_ and then as you do in non cloud version, add your files (with exact folder structure as in platform).

Once you creare above folder, CCV2 build strategy automatically picks and deploys it, without any additional configuration. Hope it helps!

www.hybriscx.com
  • 1,129
  • 4
  • 22
  • I have a file ${hybris_platform}/bootstrap/resources/containerization/platformimage/dockerbasics/startup.sh.tmpl which i wish to update. I cannot do that using ant customize as that won't work in hybris cloud. Where shall I put the updated file and in which extension shall I update it on!? – sakshinarang Nov 08 '19 at 12:54
  • currently, I'm on 6.7 but soon will move to hybris cloud, not sure which one. Can you guide on the above comment? – sakshinarang Nov 08 '19 at 13:43
  • 1
    There is a way to achive `ant customize` function on Commerce Cloud v2. See updated answer. – www.hybriscx.com Nov 08 '19 at 13:44
  • what if I don't have to ant customize? any other way even if it works in CCV2. – sakshinarang Nov 08 '19 at 13:49
  • Unfortunately not. There is no other Hybris recommended way to replace such files in platform. – www.hybriscx.com Nov 08 '19 at 13:53
  • 1
    Thanks for informing about __CUSTOMIZE__ thing though. Will work on that if no other solution is seen. – sakshinarang Nov 09 '19 at 01:04
  • Can you share hybris link for its documentation please of where did you find this solution from for CCV2? – sakshinarang Nov 11 '19 at 09:19
1

You can simply copy paste your file or write your own shell script to execute it and copy file to platform but how would it be different from ant customize. And why would you want to go away from standard hybris practices? Would that give you any extra benefit? I am sure that would only lead to issues during upgrade etc. Its not spring bean injection where you could tell your platform to use your implementation instead on other. There is no sense in wasting time in finding something which doesnt go along with product best practices.

  • 1. I don't wish to manually change platform as that won't be committed and received by other developers. 2. Secondly, if ant customize doesnt work in Cloud, we have to find another good way rather than updating OOTB platform manually. 3. Its a valid query when you have to move to Cloud. – sakshinarang Nov 09 '19 at 00:57