Posts

Showing posts with the label SAP hybris developer

SAP Hybris Installation and Deployment Architecture - [Part2]

If you not gone through Part1 , then please read it first. Centralized logging Hybris OOTB there is  centralized_logging  recipes, which can be used if you have  Docker  base setup. Anyway, you can set up your own  ELK Stack  (Elasticsearch-Logstash-Kibana), which is a good combination as Log Management Solution (Open Source). You can use Redis for the large enterprise solution to decouple the Log Server & Log Shipper. Tools: Logstash: As a log shipper and a log indexer Redis: As a broker – used as a queuing system ElasticSearch: As a log indexer – store and index logs Kibana: As a front-end viewer – a nice UI with useful extra features Install & configured  above stack to get consolidated logs from all application servers. Advanced Application Monitoring SAP Hybris Commerce Advanced Application Monitoring is a tool for analyzing network traffic within the Hybris system. Advanced Application Monitoring is vital for administrating and monitoring the he

How to set fix toAdress in Hybris for all email?

If you want to send all emails to some fix  toAddress , in that case, you need to override  email  and  displayName  in respective  *EmailContext  of  renderer template . Let's just assume you want to override  toAddress  in customer registration flow. So here you need to find context class name form Impex. Below are the renderer template for customer registration subject & body and  CustomerEmailContext  is the class name which will feed all data to this renderer. # Email velocity templates INSERT_UPDATE RendererTemplate ; code[unique=true] ; contextClass ; rendererType(code)[default='velocity'] ; powertools_Email_Customer_Registration_Body ; $emailPackageName.CustomerEmailContext ; powertools_Email_Customer_Regist

SAP Hybris Installation and Deployment Architecture - [Part1]

All references in this post are based on Hybris version 6.6 Hybris datahub server Datahub is nothing but the web application( datahub-webapp-x.x.x.x-RCx.war ), which can be deployed on Tomcat as the normal web application. You don't require to install whole Hybris suite to set up datahub. steps, you set up the basic prerequisites for installing Data Hub steps help you install Data Hub for use with the Hello World tutorial. Solr server By default, Solr server is installed/configured with Hybris suite, which will autostart and stopped with the Hybris platform. If you want to install standalone Solr server on the different sandbox, which can be managed individually then you need to configure below properties on your Hybris platform (server) local.properties file. solrserver.instances.default.autostart=true solrserver.instances.default.mode=standalone solrserver.instances.default.hostname=localhost solrserver.instances.default.port=8983 solrserver.instances.default.me

How to disable soft login in Hybris?

How to disable remember-me login in SAP Hybris? Requirement:  Every time request timeout, the user should ask for login. There shouldn't be soft login or remember me option. Hybris OOTB behavior:  In the B2B site, by default soft login is enabled. Means, users will be always auto login even session expired. Changes Required: Remove default remember me (soft login) behaviour Remove remember me references 1. Remove default remember me (soft login) behaviour Find file spring-security-config.xml  located in your storefront extension. Look for bean defaultRememberMeServices  definition, in which attribute alwaysRemember  has value true , that needs to be changed to  false . <alias name="defaultRememberMeServices" alias="rememberMeServices"/> <bean id="defaultRememberMeServices" class="com.mysite.storefront.security.AcceleratorRememberMeServices" > <property name="userDetailsService" ref="or

How to enable Remember me functionality in SAP Hybris?

Requirement:  While login, the user should have the option ( remember me checkbox ). If the user has selected checkbox, he/she should not ask to login again till remember me cookie expired. Hybris OOTB behaviour:  In the B2B site, there no remembers me checkbox, by default internally it's always selected. Means, soft login will work for all users. But Hybris also has a concept, Hard Login which matches secure  GUID  stored in session and cookie for all secured URL having the @RequireHardLogIn annotation. Changes Required: Remove default remember me (soft login) behaviour Add remember me checkbox in the login page Change Hard login behaviour, to regenerate  GUID  if auto-login perform for the current request. 1. Remove default remember me (soft login) behaviour Find file spring-security-config.xml located in your storefront extension. Look for bean defaultRememberMeServices definition, in which attribute alwaysRemember has value true , that needs to be changed to

How to configure MySQL Connector in SAP Hybris ?

Hybris OOTB shipped with  HSQL DB,  If you want to configure  MySQL  as Hybris DB then follow the below steps and you go!! Download  MySql connector  ( .jar ), as it is not shipped with Hybris OOTB suite Copy downloaded connector ( .jar ) file to  ${HYBRIS_BIN_DIR}/platform/lib/dbdriver directory Add below  properties  to your  local.properties  file db.url=jdbc:mysql://hostname:port/dbName?useConfigs=maxPerformance&characterEncoding=utf8&useSSL=false db.driver=com.mysql.jdbc.Driver db.username=root db.password=password Initialize the system ( ant initialize )

How to debug Hybris application?

As Hybris runs in builin server, you can debug it as Remote Java Application from Eclipse start the server with  hybrisserver.bat debug  (In windows) or  ./hybrisserver.sh debug  (In Linux) Import all required  extensions  in eclipse Open any Java file ( cartPageController.java ) Open  Run > Debug Configurations  (shortcut:  Alt + r + b ) check for  Remote Java Application  in your left panel of popup Right click on  Remote Java Applicaiton  and click on new Create a new configuration by clicking on  Apply Click on  Debug  to start your  debug mode Nowe enjoys the debugging by putting breakpoints.

How to prevent the system initialization in the Hybris HAC?

Lock the system initialization: You can avoid accidental initialization or update the system by locking those options from HAC. Now when we really want to perform this operation we can unlock it and use the functionality. To lock the system for initialization and update add the unlocking ( system.unlocking.disabled=true ) properties to your  local.properties  file and rebuild your system. Unlock the system initialization: Let's you want to perform an update system from HAC but that option is locked. Don't worry, you can easily unlock it without restarting the system and perform an operation. Set system.unlocking.disabled to false (HAC>configuration) Go to  /hac/platform/init , Click on Unlock. Wiki reference Block/Redirect URL from the webserver: In case, your business stakeholder wants to block initialization and update system from HAC. The idea here is to change its request mapping. If you have a web server in place for admin console, You can blo