Skip to main content

Posts

Beanshell/Groovy example - Change Local.properties permanently using script

Sometimes we need to change some of values defined for properties key in local.properties/project.properties. There are three ways to do it Update via HAC Update Local.properties Update using beanshell/groovy script If we use the first process, after server re-start, changes will go. So, the value will remain in the system memory till the server got re-started. Here, will give an example how to change local.properties and changes remain even after rebuild. Run the below script in the HAC script tab with "commit" on. import org.apache.commons.configuration.PropertiesConfiguration; import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; //The new value to be stored in the key/value pair in local.properties. String changedValue = "NEW_VALUE"; //Key name in the local.properties String propertyName = "test.properties.value"; PropertiesConfiguration config = new PropertiesConfiguratio...
Recent posts

SAP Commerce License

There are two types of license for SAP commerce application. Temporary license (valid for 90 days). Permanent license Will discuss how to install both the type of license one by one. Before that, let’s discuss few details about the SAP Commerce License. ·        Unlike other SAP products, SAP commerce license is not used for any specific H/W. So, the field HARDWARE-KEY in the license file is filled with some preset values. ·        Usually customer will choose three letter system ID (SID – SAPSYSTEM) while creating the SAP license. This SID must be configured in the local.properties # System ID license.sap.sapsystem=XYZ If this is omitted, system will think that CPS as the default value. Installing the temporary license ·        Run license.bat from the platform folder license.bat -temp CPS_SQL In the above, license type is temporary (-temp) for the dev environm...

PK in item models in Hybris

While working with model, the property of modelservice amazes me is, if you search an item with PK, you’ll get the result. If the item is search in HMC or backoffice, while returning the search result, it also gives the type code. How is this possible? All the items are stored in single DB table? In that case also, how come when a deleted item is searched, it returns the type code? See the screen shot below where item is deleted and item search returns type code Fig – 1: Searching item (System-Types-Items)        Fig 2: The PK is appended with Type code defined in items.xml PK is generated with the following combination. ·        Type code       Time stamp (create time) If you make the PK in binary number and take last 14 digit and convert back to decimal and you’ll get the type code. Consider the example I have. PK is 8842394501143. If I convert in Binary, it comes as 0000000000000000000010...

Hybris Beanshell and Groovy script example

While doing support, we need to check some of the scenario and their result in the production server. The beanshell and groovy script comes very handy on this. Below are the few example of how I used/using it in my various project. This is very handy to test your data as well 1.        Check the log: Sometimes getting server access is very painful in the enterprise landscape. However, person joined in the project is required to work as soon as they inducted in the project. In this scenario, below groovy script is very useful.   Please note, run these in the rollback mode unless and until the otherwise is required. a.        The application is running from the container. For the POC, it was running in the tomcat server (tomcat/bin). To know the exact directory, run the below script in groovy console println "pwd".execute().text Below will be printed in the output tab /usr/sap/hybris/bin/platform/tomcat/bin ...

SonarCube and Hybris integration

There are some issues reported for SonarCube 6.7 integration with Hybris. The recommended version is Sonar 6.4 or less. For Sonar 6.4, there is no need to build the database. Please follow the below steps to use sonarcube with Hybris. For the POC, we have used Hybris 6.4.0.2 and sonar 6.4. Sonar Cube configuration 1.        Download sonar 6.4 and install/unzip. 2.        For the POC, we have used Embedded Database (default). But multiple database is supported. Access management can also be implemented. However, for the simplicity purpose, it is not used for the POC 3.        The java properties can be set at the sonar.properties file (not used in our case). Example of the property is sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError which can be enabled in the sonar.properties file under conf folder of the installed folder. 4.      ...

Famous Five - Five things I have learned about Project Management from Enid Blyton's series

​During this summer, my wife and I introduced my eight years kid to Enid Blyton's series Famous Five. I was very delighted as this was one of my favourite series in my childhood and we're hoping that my son will also enjoy it the same way.  After buying the book, my son and me were ready the book together. Much to my surprize I have learnt quite a good few tricks in Project Management and I want to share with you top Five tricks. 1. Planning : As said in PMBOK, planning is most crucial part of project management and without planning one is planning to fail. so does in Famous Five series. While they plan to explore the treasure Island, they jot down all the resources they might need for successful execution of the exploration. From food to axe, they listed everything they might require. Also, they planned for 3 days resources. So, identifying appropriate tools is very essential to be successful project execution. 2. Team : While work in a team, we need to understand that...

Hybris Datahub 5.3 - Composition Issue

​In one of the project, when we are using Datahub to load data from SAP to Hybris, we have find a strange issue. We are loading customer data with one flag (say ship-Together) is loading properly first time. But, after that, if the value is changes at the source (SAP), the changed value in Hybris is not showing always. Sometimes corrected value is updated and sometimes not. The reason is very trivial and depends on the Item status and life cycle. The life cycle of the canonical items is as below 1. For new data set, canonical items are created. 2.   If the canonical item was composed successfully with no errors, the newly created canonical item gets assigned a status of SUCCESS. Only canonical items with a status of SUCCESS are published to a target system, any other items are ignored during publication. There can only be one canonical item with a status of SUCCESS per integration key in the same pool.  2A. In case the items was not composed properly, the status c...