Skip to end of metadata
Go to start of metadata

Purpose

When we need to develop a new feature to enhance exist function in hybris backoffice, we hope that shouldn't rewrite the whole page and only need to modify the part that we must do. Here is a example how to add a new textbox embed editarea for enhance the function. The most important is that I feel this design is very useful that we should more use this design for otherplace to improve the availability of our code.

Overview

  • New feature and present situation description
  • How to add new textbox embed editarea

New feature and present situation description

  • Our new feature is that we shoud add a text field for showing coupon url in existed promotion page's others part at backoffice.
  • We sholud not directly modify the origin source code. 
  • Only custom install our new created extension it will work.

How to add new textbox embed editarea

  • Find the promotion page editarea config.
    In B2C environment, the promotion page is consists of two extension config.xml files, the first file is ruleenginebackoffice-backoffice-config.xml, the second file is promotionenginebackoffice-backoffice-config.xml.
  • ruleenginebackoffice-backoffice-config.xml editarea config is:
     

     

     
    <context merge-by="type" parent="GenericItem" component="editor-area">
    			<editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea" logic-handler="versionedRuleEditorAreaLogicHandler">
    				<editorArea:tab name="tab.configuration.abstractrule">
    				     <editorArea:section name="sec.configuration.abstractrule.details">
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="code"/>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="name"/>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="description"/>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="version" readonly="true"/>		            
    				    </editorArea:section>
    					<editorArea:section name="sec.configuration.abstractrule.rulemanagement">
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea"
    													 qualifier="priority"/>
    				        <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="stackable"/>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="ruleGroup"/>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="startDate"
    								label="ruleengine.abstractrule.startdate">
                                <editorArea:editor-parameter>
                                    <editorArea:name>timeZoneReadOnly</editorArea:name>
                                    <editorArea:value>false</editorArea:value>
                                </editorArea:editor-parameter>
                                <editorArea:editor-parameter>
                                    <editorArea:name>selectedTimeZone</editorArea:name>
                                    <editorArea:value>GMT+00:00</editorArea:value>
                                </editorArea:editor-parameter>
                                <editorArea:editor-parameter>
                                    <editorArea:name>displayedTimeZones</editorArea:name>
                                    <editorArea:value>GMT-12:00,GMT-11:00,GMT-10:00,GMT-09:30,GMT-09:00,GMT-08:00,GMT-07:00,GMT-06:00,GMT-05:00,GMT-04:30,GMT-04:00,GMT-03:30,GMT-03:00,GMT-02:00,GMT-01:00,GMT+00:00,GMT+01:00,GMT+02:00,GMT+03:00,GMT+03:30,GMT+04:00,GMT+04:30,GMT+05:00,GMT+05:30,GMT+05:45,GMT+06:00,GMT+06:30,GMT+07:00,GMT+08:00,GMT+08:30,GMT+08:45,GMT+09:00,GMT+09:30,GMT+10:00,GMT+10:30,GMT+11:00,GMT+12:00,GMT+12:45,GMT+13:00,GMT+14:00</editorArea:value>
                                </editorArea:editor-parameter>
                            </editorArea:attribute>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="endDate"
    								label="ruleengine.abstractrule.enddate">
                                <editorArea:editor-parameter>
                                    <editorArea:name>timeZoneReadOnly</editorArea:name>
                                    <editorArea:value>false</editorArea:value>
                                </editorArea:editor-parameter>
                                <editorArea:editor-parameter>
                                    <editorArea:name>selectedTimeZone</editorArea:name>
                                    <editorArea:value>GMT+00:00</editorArea:value>
                                </editorArea:editor-parameter>
                                <editorArea:editor-parameter>
                                    <editorArea:name>displayedTimeZones</editorArea:name>
                                    <editorArea:value>GMT-12:00,GMT-11:00,GMT-10:00,GMT-09:30,GMT-09:00,GMT-08:00,GMT-07:00,GMT-06:00,GMT-05:00,GMT-04:30,GMT-04:00,GMT-03:30,GMT-03:00,GMT-02:00,GMT-01:00,GMT+00:00,GMT+01:00,GMT+02:00,GMT+03:00,GMT+03:30,GMT+04:00,GMT+04:30,GMT+05:00,GMT+05:30,GMT+05:45,GMT+06:00,GMT+06:30,GMT+07:00,GMT+08:00,GMT+08:30,GMT+08:45,GMT+09:00,GMT+09:30,GMT+10:00,GMT+10:30,GMT+11:00,GMT+12:00,GMT+12:45,GMT+13:00,GMT+14:00</editorArea:value>
                                </editorArea:editor-parameter>
                            </editorArea:attribute>
    					</editorArea:section>
    					<editorArea:section name="sec.configuration.abstractrule.others">
    						<editorArea:panel colspan="4" name="messageFiredPanel">
    							<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="messageFired"/>
    						</editorArea:panel>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="status" readonly="true"/>
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="deployments" readonly="true"/>
    					</editorArea:section>
    				</editorArea:tab>
    				<editorArea:tab name="hmc.administration">
    			        <editorArea:section name="sec.configuration.abstractrule.ruleadministration" position="0">
    						<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="maxAllowedRuns"/>
    				        <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="allDocuments" readonly="true"/>
    	 			        <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="comments" readonly="true"/>
    				        <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="uuid" readonly="true"/>
    				        <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="synchronizedCopies" readonly="true" merge-mode="remove"/>
    				        <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" qualifier="synchronizationSources" readonly="true" merge-mode="remove"/>
    					</editorArea:section>
    	            </editorArea:tab>
    			</editorArea:editorArea>
    		</context>


    promotionenginebackoffice-backoffice-config.xml editarea config is:

     

     



  • Customize the config file in our new created extension.
  • Create a new render to render the textbox.

Related Content

Related Documents

Insert SAP Help links or other WIKI content link.
Please hyperlink the title of the related document

Example: Explanation about how to create a WIKI page

Related SAP Notes/KBAs

Insert links to any related SAP Notes/KBAs that support your topic or are related. Please hyperlink ONLY SAP Note or KBA number.
Example:

SAP Note 83020: What is consulting, what is support

SAP KBA 12345: This is an example KBA link

(Use the following Hyperlink with SAP Note/KBA number at end: https://launchpad.support.sap.com/#/notes/123456)

  • No labels