Tuesday 9 April 2024

Send request to OCC API from Postman

 Access the swagger first and it will give all the list of API details like URL and request body parameter and path params etc.




send the request to the same request URL in postman. you will get the response.






Friday 11 January 2019

How to debug Hybris project in eclipse


As a developer its very important to debug the code.

Hybris project has 500 extensions approximately. The code complexity is more and you can’t understand without debugging knowledge.

In this post, I will help you to debug the Hybris project, Follow below steps


Step 1:- Start the server in debug mode like this   /hybrisserver.bat debug


Step 2:- Make sure this line of description shown in the console.


Step 3:- Put Some debug points like this, Here blue dot we call as debug points



Step 4:- Just right click on the class and select the option debugconfigurations.


Step 5:- Select Remotejavaapplication and give the port number that is shown in the console and click on debug. Then debug process starts,


Step 6:- If you get this error log in the middle just click on ok and Debug button in eclipse toolbar.





Step 7:- Once the debug process done you will see this popup and click on proceed.






Step 8:- Goto the site and give request.




Step 9:- You will see the green mark like this,




Step 10:- In the following image you can see the debugging option. F5 (to get into the code), F6 (goto next line), F7(return to the previous line), F8 (goto next debug point).





Step 11:- To check the data at the particular line just select that line and click  ctrl+shift+i.




Step 12:- We can also change the attribute values at runtime.




I hope you will get the process and keep debugging the code become good developer.

How to stop initialization in Hybris

In this blog post, I am going to explain how can we stop others to do initialization from HAC.

In real time projects if a developer did initialization means all the developed code will be lost to prevent this situation we need to lock the initialization process.

In the following steps, I guide you to stop the initialization process.

Step 1:- Add the below properties in local.properties file.
                 system.unlocking.disabled=true

Step 2:-  Do ant build & start the server.



Step 3:-  Login to HAC and check Platform/Initialization


 Note:-  We can also do this from HAC without restarting the server.
    * Goto Platform/Configuration and search for this property and make it true.

Monday 24 December 2018

Change site URLs in Hybris


* We can change the site URLs in Hybris with below properties

* Add the below properties to local.properties or project.properties

website.electronics.http=http://electronics.local:9001
website.electronics.https=https://electronics.local:9002
hybrisinstructivestorefront.webroot=
storefrontContextRoot=
hac.webroot=/hac

* Do ant all
* start server

* Access the site.

Thursday 6 December 2018

Modulegen in hybris

*  ant modulegen command used to generate sets of dependent extensions to quickly start new projects or create new applications.
 *  The modulegen tool replaces the schema, package name, extension class prefixes, and some other properties across a set of extensions
 * 7 extensions generate for b2c & b2b accelerator.


Follow the below steps to generate a set of extensions,

Step 1:- Go to platform directory and run ‘ant modulegen’ command.

ant modulegen -Dinput.module=accelerator -Dinput.name=training -Dinput.package=de.hybris.training -Dinput.template=develop
· input.module parameter: Defines the accelerator module.
· input.name value: Prefix that is added to the new extensions generated by modulegen.
· input.package value: Defines the package prefix.
· input.template parameter: Defines how to use Hybris Commerce 
configuration.

Step 2:- A set of extensions will be generated and place that extensions in localextensions.xml file.




Step 3:- remove any of the following extensions that might appear in your localextensions.xml file
yacceleratorcore
yacceleratorfacades
yacceleratorstorefront
yacceleratorinitialdata
yacceleratortest
yacceleratorcockpits
yacceleratorfulfilmentproces

Step 4:- start the server


Step 5:- initialize the system from HAC.




Step 6:- you must have the following entry in your computer's hosts file:

127.0.0.1   electronics.local 






Step 7:- Access the site with below URl

https://electronics.local:9002/hybrisinstructivestorefront/


EXTGEN in hybris

  
*  SAP Commerce comes with an extension generator system called extgen.
*  You can create new extensions based on extension templates. 
*  To add your own template extension to the selection of extgen templates please add the following line to the extensioninfo.xml of your extension.
<meta key="extgen-template-extension" value="true" />

Follow the steps to create custom backoffice extension.

Step 1:- Go to platform directory and run ant extgen command.



Step 2:- Select the extension template you want to generate.(ybackoffice)





Step 3:- Enter the extension name.



Step 4:- Enter the package name.



Step 5:- Register as a SASS extension? ([true], false)
If you select ‘true’ the generated extension contains Sass registration in the buildcallbacks.xml file.

The variables file myextension-variables.scss is also created in the myextension/backoffice/resources/scss directory


Step 6:- Create a sample widget? ([true], false)

    It will decide if you want a sample widget to be generated. If not, do not forget to manually create a widgets folder in myextension/backoffice/resources directory.

Here, you can add a new directory for each component that you create.



Step 7:- Create sample style sheets? (true, [false])

Decide if you want a sample style sheets to be generated



Step 8:- Add the new extension to your localextensions.xml file (config folder).



Note:- To load all custom extensions automatically into the localextensions.xml file, add the following line, at the beginning of the file.
<path autoload="true" dir="${HYBRIS_BIN_DIR}/custom"/>

Step 9:- Do ant all & start the server.