Backoffice Customizations in SAP Commerce: Explorer Tree, Search, List View ,Label & Wizard

When to create new navigation node in backoffice
a)When we want to access an item-type very frequently because Business User will not be more technical guy to open type node and search for particular node.
b)For Navigation Nodes we can specific access restrictions through roles.

Example:- If we mention principal="backofficeadministratorrole" for our new node , Only those specific users with this current role can see and access the Node in Backoffice. This ensure only authorized users can see and access the node.

Step 1:Create SampleB2CStore item type with attributes like storeId,storeName,storeLocation,storeOwner,storeGstNumber in samplecore-items.xml
<itemtype code="SampleB2CStore" autocreate="true" generate="true">
    <deployment table="SampleStore" typecode="15786" />
    <attributes>
        <attribute qualifier="storeId" type="java.lang.String">
            <description>Unique Store Identifier</description>
            <modifiers unique="true" read="true" search="true" write="true"/>
            <persistence type="property" />
        </attribute>
        <attribute qualifier="storeName" type="java.lang.String">
            <description>Store Name</description>
            <modifiers read="true" write="true" search="true"/>
            <persistence type="property" />
        </attribute>
        <attribute qualifier="storeLocation" type="java.lang.String">
            <description>Store Location Name</description>
            <modifiers read="true" write="true" search="true"/>
            <persistence type="property" />
        </attribute>
        <attribute qualifier="storeOwner" type="java.lang.String">
            <description>Store Owner Name</description>
            <modifiers read="true" write="true" search="true"/>
            <persistence type="property" />
        </attribute>
        <attribute qualifier="storeGstNumber" type="java.lang.String">
            <description>Store GST Number</description>
            <modifiers read="true" write="true" search="true"/>
            <persistence type="property" />
        </attribute>
    </attributes>
</itemtype>

Step 2:Do ant all ,make server up and update Hac

Step 3: Define Unique identifier for the navigation node i.e Under SampleStore(some identifier) i want to add SampleB2CStore node
location:samplebackoffice/resources/samplebackoffice-backoffice-config.xml Add below configuration for Custom Node in above file
<context component="explorer-tree" parent="auto" merge-by="principal" principal="backofficeadministratorrole">
    <explorer-tree:explorer-tree xmlns:explorer-tree="http://www.hybris.com/cockpitng/config/explorertree">
        <explorer-tree:navigation-node id="hmc_typenode_sample_b2c_store">
            <explorer-tree:type-node code="SampleB2CStore" id="hmc_typenode_sample_b2c_store_node" />           
        </explorer-tree:navigation-node>
    </explorer-tree:explorer-tree>
</context>

Step 4: Add below properties in /samplebackoffice/resources/samplebackoffice-backoffice-labels/labels_en.properties
hmc_typenode_sample_b2c_store = SampleStores
hmc_typenode_sample_b2c_store_node = SampleB2CStore

Step 5: Add below configuartion for listview in samplebackoffice-backoffice-config.xml
<context type="SampleB2CStore" component="listview">
    <list:list-view xmlns:list="http://www.hybris.com/cockpitng/component/listView">
        <list:column qualifier="storeId" />
        <list:column qualifier="storeName" />
        <list:column qualifier="storeLocation" />
        <list:column qualifier="storeOwner" />
        <list:column qualifier="storeGstNumber" />
    </list:list-view>
</context>

Step 6: Add below properties in /samplebackoffice/resources/localization/samplebackoffice-locales_en.properties
type.SampleB2CStore.name=SampleB2CStore
type.SampleB2CStore.storeId.name=StoreId
type.SampleB2CStore.storeName.name=StoreName
type.SampleB2CStore.storeLocation.name=StoreLocation
type.SampleB2CStore.storeOwner.name=StoreOwner
type.SampleB2CStore.storeGstNumber.name=StoreGstNumber

Step 7: Add below configuartion for simple search in samplebackoffice-backoffice-config.xml
<context merge-by="type" type="SampleB2CStore" component="simple-search">
    <yss:simple-search xmlns:yss="http://www.hybris.com/cockpitng/config/simplesearch">
        <yss:field name="storeId" />
        <yss:field name="storeName" />
    </yss:simple-search>
</context>


Step 8: Add below configuartion for Advance search in samplebackoffice-backoffice-config.xml
<context type="SampleB2CStore" component="advanced-search">
    <as:advanced-search xmlns:as="http://www.hybris.com/cockpitng/config/advancedsearch" connection-operator="AND">
        <as:field-list>
            <as:field name="storeId" operator="equals" selected="true"/>
            <as:field name="storeName" operator="equals" selected="true"/>
            <as:field name="storeGstNumber" operator="equals" selected="true"/>
        </as:field-list>
    </as:advanced-search>
</context>
Step 9: Add below configuartion for wizard component in samplebackoffice-backoffice-config.xml
<context component="create-wizard" type="SampleB2CStore">
    <wz:flow xmlns:wz="http://www.hybris.com/cockpitng/config/wizard-config" id="sampleb2cstoreWizard" title="create.sampleb2cstore.general.label">
        <wz:prepare id="sampleb2cstore">
            <wz:initialize property="sampleb2cstore" type="SampleB2CStore"/>
        </wz:prepare>
        <wz:step id="step1">
            <wz:content id="step1.content">
                <wz:property-list root="sampleb2cstore">
                    <wz:property qualifier="storeId"/>
                    <wz:property qualifier="storeName"/>
                    <wz:property qualifier="storeGstNumber"/>
                </wz:property-list>
            </wz:content>
            <wz:navigation id="step1.navigation">
                <wz:cancel />
                <wz:done>
                    <wz:save property="sampleb2cstore"/>
                </wz:done>
            </wz:navigation>
        </wz:step>
    </wz:flow>
</context>

Step 10: Add below proprties for wizard component in labels_en.properties
hmc_typenode_sample_b2c_store = SampleStores
create.sampleb2cstore.general.label = SampleB2CStore Wizard
Step 11: Add Configuration for base component in samplebackoffice-backoffice-config.xml
<context type="SampleB2CStore" component="base">
        <y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
            <y:labels>
                <y:label>storeId + '-' + storeName + '-' + storeGstNumber</y:label>
            </y:labels>
        </y:base>
</context>

Step 12: Do Hac update by selecting specific(samplecore & samplebackoffice) extensions and by checking Update running system & Localize types

Step 13:After Update is Done ,Open Backoffice click on f4(Orchestra Mode) ,then click on Reset Everything

Step 14: Check our Custom Navigation Node SampleB2cStore,listview,simple & advance search,base component and wizard.

Comments

Anonymous said…
Very helpful content bro.
Anonymous said…
Nice work 👏
Anonymous said…
Great explaination
Anonymous said…
Great documentation
Anonymous said…
Good presentation
Anonymous said…
Good one
Anonymous said…
Good content
Anonymous said…
Good Work , Keep Given us more content on SAP commerce

Popular posts from this blog

Latest SAP Commerce (Hybris) Interview Questions

Steps to Install SAP Commerce Cloud 2211/Install SAP Hybris 2105 to 2211

OCC Webservices in SAP Commerce(hybris) 2211 using YOCC template – Part 1