React with Redux

 What is  React?

Basically react is a frontend development tool to develop an application. 

It helps in making our application more robust and easier.

What is redux?

It is state management library of React which is used to transfer data from one component to another by keeping the data collection in a generalized store. The data are store in the store through this way.

1st:- component: it passes data to action 

2nd:- Action: here we do the required change in the data if it is needed

3rd:- Reducers:- from here Data is passed to store 


finally, from the store, the data is fetched using the connect method in the component.

So basically the call flow goes like this.

component :- action:- reducers:- store:- component


#for sending data from component to action then reducers we have to use mapDispatchToProp to make sure that component data dispatches to reducers otherwise data will not enter in State.


For making the store available throughout the application the app (in index.js ) must be wrapped with the provider. 

Also, make sure in App.js store is initialized and exported otherwise we can create separate store class also.


Stream API

In java stream api is used to fetch something and then filter the result according to the requiremnt.

It is a generic approach which is used on Generic class.
The Stream api is used to fetch the stream, the filter api to filter the required information  ,the map api is used to map the function which are filtered and the  forEach  api to display the filtered mapped output.

given an example :-


package com.test;

import java.util.ArrayList;
import java.util.List;

class productPrice {
    int price;

    public productPrice(int price) {
        super();
        this.price = price;
    }

}

public class TestStream {

    public static void main(String[] args) {
        List<productPrice> abc = new ArrayList<productPrice>();
        abc.add(new productPrice(4));
        abc.add(new productPrice(9));
        abc.add(new productPrice(8));

        abc.stream().filter(k -> k.price > 4).map(r -> r.price)

                .forEach(System.out::println);
        ;

    }

}

************************** OUTPUT ****************************************

9
8

Why CAA get huge attention..

India is a country of politics and Reliance Jio lies on top of it
and it is worth living in such type of country.
 
Now, coming to CAA why these fucking morons are shouting about CAA.
CAA is a pre  planned agenda of  BJP party to create polarisation in the country and he sucedded in his attempts.

Reason we all  know that BJP could not fulfill his promises and to diverse the mind of the people he has to something to engage the  people.

These are a part of story and the other part is that CAA(Citizen Amendment Act) is one of the toughest and boldest decision towards India Development.

 
why other communities are opposing it because they have sympathy for their community who are refuges. This is called religious emotions. Moreover, the other community were silent on the act of government like "Triple talaq", "Aydhoya" and "article 370,35A" so they have not a chance to protest against the government so this they are using their all force to create pressure on the government.

From my view, it is good to do protest but breaking the properties of innocent people under the name of protest should not be accepted. Moreover, the police who breaks the properties of common people should also be punished.

Now, coming to the title ...

why CAA got huge attention???

After CAA there were a huge protest all over the country the major outrage was broken at jamiya and  jnu college of Delhi.When the student came out in large numbers and started  with the silent protest. The protest suddenly took a violent turn and it moved to vandalizing the public properties like buses and throwing stones on police officers. In return, police enter the campus and beat those miscreants. Now, this became a hot issue in the news channel. All channel telecast this in different perspectives. Thus, a rise of violent protest under the name of silent protest rose all across the country. Large group of Muslim religion came out in street and started vandalizing public properties.
Though the mob include other communities too who may be so called by rumors about bill.


In the course of this event, the illiterate people have made it a hub to seek attention of media.
The student are now angry with everything  now even if something is not happening in the country then they will raise an irrelevant issue and  start protesting. They know if someone wanna get attention in this country then he/she has to go offtrack. This is how leaders are born.

Now, if they are not getting attention they start rejecting the regular classes and also not letting the professors to enter the premises. These are the things which attract media and display the student activities on screen.













At end, i would like to conclude with a message that India is not a such a good country where we would live and waste our life good moments for the sake of  cheap politics or viewpoint of people.
There are other develop countries in the world where we can spend our time and give our self a good living. It is as simple as it is "If you want to live in this country ... tolerate what is going on or leave this country" and nothing is more beautiful than leaving your country for the sake of good life.

Difference between public private and protected


 Key difference is


in public access modifier, we can access the data type anywhere in the project with extending that class.

In protected access modifier, we can access the data type anywhere but in other class, we have to inherit that class.

In default, we can access that variable in that same package only.

In private access modifier, we can access that variable only in that class and not in any other class even by inheriting them.


**********************************Example**************************************








the picture shows that by making the object of the same class we can access the public and protected variables of the parent class.

Note:- please do it by yourself in your pc to get understanding .. as if you will not do.. u may not get up to what which you should. Next, it is up to you. My work is done.



***************************************Example***********************************

Now, we are not extending to parent class present in another package.






In this case, we have to make an object of that class whose variable we need to fetch.

thus only public variable is accessible here.

***********************************Example ***********************************

Now, we are accessing a private variable in another class.






In this case all public, protected and default variable is accessible but not the private one.






























Steps to enter a node in hybris

In sap hybris, if we wish to insert node we need to add the following attributes in the Impex file.

The Impex file is a file to insert data in the database

# create a navigation node
# create update link
# create linkComponent

Fire all these Impex in the console.

then go to back-office and search synchronized.
Then synchronized it. While synchronizing the content from staged will go to online.

After that, it will reflect on the website.


*********************************** Example *************************** ***********




Impex for Pack node:-
$contentCatalog=b2ctelcoContentCatalog
$contentCatalogName=B2C Telco Content Catalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged]
$productCatalog=b2ctelcoProductCatalog
$productCatalogName=B2C Telco Product Catalog
$productCV=catalogVersion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
$medias=medias(code, $contentCV);
$product=product(code, $productCV)
$category=category(code, $productCV)
$siteResource=jar:de.hybris.platform.b2ctelcostore.constants.B2ctelcostoreConstants&/b2ctelcostore/import/sampledata/contentCatalogs/$contentCatalog
$jarResourceCms=jar:de.hybris.platform.b2ctelcostore.constants.B2ctelcostoreConstants&/b2ctelcostore/import/sampledata/cockpits/cmscockpit
$addonExtensionName=stltelcoaddon
$mediaContainer=media(qualifier, $contentCV);
$asmAddonExtensionName=assistedservicestorefront
$lang=en
INSERT_UPDATE PageTemplate;$contentCV[unique=true];uid[unique=true];name;frontendTemplateName;restrictedPageTypes(code);active[default=true]



INSERT_UPDATE CMSNavigationNode;uid[unique=true];$contentCV[unique=true];name;parent(uid, $contentCV);links(&linkRef);&nodeRef
;PackNavNode;;Pack;MyAccountNavNode;;PackNavNode

# Create CMS Link Components For My Account Pages
INSERT_UPDATE CMSLinkComponent;$contentCV[unique=true];uid[unique=true];name;url;&linkRef;target(code)[default='sameWindow']
;;PackLink;Pack Link;/my-account/pack;PackLink
# Create CMS Navigation Entry For Navigation Child Nodes
INSERT_UPDATE CMSNavigationEntry;uid[unique=true];$contentCV[unique=true];name;navigationNode(&nodeRef);item(&linkRef)
;PackNavNodeEntry;;Pack Nav Node Entry;PackNavNode;PackLink

UPDATE CMSLinkComponent;$contentCV[unique=true];uid[unique=true];linkName[lang=$lang]
;;PackLink;"Pack"


INSERT_UPDATE ContentPage;$contentCV[unique=true];uid[unique=true];masterTemplate(uid,$contentCV);label;defaultPage[default='true'];approvalStatus(code)[default='approved'];homepage[default='false']
;;pack;DashboardPageTemplate;/my-account/dashboard