Posts

SAP Commerce Cloud and Read-Only Replica

Image
 Introduction SAP Commerce Cloud introduced Read-Only Replicas as a standard feature for all production environments. Aim for Read-only data source is to offload batch queries or expensive ones from master data.  That data-source gives copy of same sized like master. When production runs on Premium P11 master, RO replica will be same, Premium P11 instance running side-by-side with master. Read-Only replica is available for all Premium DBs in CCv2. That is a standard functionality provided by Azure. Product Availability Feature is available from SAP Commerce Cloud version 1905 +.  With patches onward: 1905.37 , 2005.21 , 2011.16 , and 2105.6 . (You need to run update (aka 'Migrate Data') operation during deployment). CronJob and Job models have been extended and usage of replica has been simplified to a flag. This patch introduces the support for a read-only replica. The feature includes additional configuration options for the Backoffice search, task engine, Job/CronJob...

Eclipse plugin development and Apple Silicon M1

So... I have upgraded recently laptop to Macbook Pro M1. I am happy with hardware as it is blazing fast, cold, just perfect. But... I have issues with development. I am not going to mention, that my VMWare Fusion is not available on Apple Silicon and I am not able to test my eclipse plugin anymore on Windows 10, which is like... 80% of all users. Just maddness. When I decided to go with Apple Silicon I assumed, that VMWare will deliver Fusion pretty fast. I know there is beta released, but still I am not able to use it. Recently I have encountered an issue with architecture, when I tried to run my plugin in debug mode from Eclipse IDE. Let's check what problem I have: Eclipse RCP configuration looked like this: VM linked is embedded JRE: /Users/User/Develop/bin/EclipseRCP.app/Contents/Eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.aarch64_17.0.2.v20220201-1208/jre/lib/libjli.dylib Solution for mixing architecture on Eclipse Debug Mode The reason of...

FlexibleSearch Pagination

SAP Commerce platform provides functionality for pagination DB results. You are able to find paginated DAO: There is also Flexible Service which also allows pagination: That implementation depends on other DTOs i.e: PaginatedFlexibleSearchParameter and SearchPageData : Usage of that code is not popular in platform. Can be found in few places (I will update that part later on) but what is most important here, it is not easiest solution at all! Solution for pagination So how to make it better, with no hassle with extra helper objects? Just use what FlexibleSearchQuery class gives to you. FlexibleSearchQuery gives you 2 methods setStart and setCount thanks to that you are able to set up pagination functionality in code. SAP API Documentation FlexibleSearchQuery

SAP Commerce Cloud Backoffice Development

Image
Backoffice development is based on ZK framework has their own advantages, i.e. quite easy customisation if we introduce new or extending types, tree navigation and search. That is mostly based on XML configuration. SAP Help have scattered information how to add backoffice feature to your extension, but still it is possible base on that chaotic articles find most of the answers: how to make extension backoffice-one ( Backoffice FAQ ) backoffice xml configuration overview ( UI Configuration Overview ) extending existing Item configuration by merging with new one ( UI Configuration Merging Mechanism ) Recently I have added functionality to keep task logs in external storage, as these logs can consume for some customers like tens of GBs of DB storage, which are mostly "store & forget" items. So.. I have extended Item type for that: Then I have created my <ext>-backoffice-config.xml where I have added where I would like to add my attribute to be placed...

Exporting Data from SAP Commerce by ImpEx

 From time to time I need to export data from SAP Commerce Cloud system. For me the best approach is to have them in Excel where I can filter them out nicely. I usually use for that ImpEx Export with flexibleSearch query. Here is an example of that kind of script: in export line there is FlexibleSearch query with WHERE clause which I use to filter out data for my needs. Usually I run ImpEx Export from hac cockpit, where I have zip file listed right away after execution. Package contains CSV file, which I open in Excel/Calc/Numbers and do the filtering. Recently I had to remove large volume of business processes after load tests. For that I have created similar impex, but with more user-friendly method for querying data to be filtered. Here I have used exportItemsFlexibleSearch method. impex.exportItemsFlexibleSearch(""/* flexible search query */""); Here as you can see, there is only query used, with no additional parameters required. Generated zip f...

Eclipse File URL encoding is broken

I have been struggling with one issue raised to SAP Commerce eclipse plugin for a while and could not create test scenario to reproduce the bug  #48 Fortunately one of users came up to situation that if file path to eclipse contains whitespace then it is not possible to convert Eclipse URL to File URL, then to URI to finally get a File instance pointing to local file.  Long story short, whitespace should be encoded to format %20 to be compatible with standard. Currently (2020/2021 A.D.) it is not. I it is left as " " Bit long, but unfortunately that scenario is quite often seen in plugin development. I was able to find on Eclipse Bugzilla  #145096  and there was a struggle what to do with that... Until script has closed that bug. Bummer. Last reply was: Wrong. Non-encoded URLs are lossy. See explanations in bug 3109 comment 28 . The only right solution is to stop using non-encoded URLs, even if that breaks buggy API clients that tried to "encode" wrong URLs (that ...

Eclipse damn SDK and all that stuff

 Well. I always had an issue with eclipse plugin development. I have to confess. Once at the beginning of my career as a Java developer I had a chance to just scratch a surface of eclipse SDK and plugin development in version Eclipse 3.2 M2. I quickly switched to server side and stayed there till now. No documentation, no books in place. Constant browsing through SDK code was a nightmare. Some of my colleagues even switched to .NET due to flawless rapid GUI development experience. Colleague of mine who spent 2 weeks on a commercial project building GUI in Eclipse did most of work in few days alone by himself in .NET and convinced him to switch to that technology. Maybe you wonder why I mentioned that at all. Apparently I am sole maintainer of open source eclipse plugins and from time to time when I have some free time I spend on that project. I am big fan of VS Code and I've felt in love in that. I was shocked how fast VS Code got Java support and it works pretty well. Then I reali...