Sunday 31 March 2019

Hybris miscellaneous topics

1) How to add message property with css

JSP:
<formElement:formCheckbox idKey="add-mycompany-checkbox" labelCSS="checkbox-wrapper m-b-1" labelKey="mycompany.select.termsandconditions"  path="termsAndConditions" mandatory="true" />

base.properties
mycompany.select.termsandconditions = <span class="checkbox-text ma-label-font">I confirm that the information I have provided is accurate, and I agree to Mycompany <a class="a-link" target="_blank" href="https://www.mycompany.govt.nz/Pages/terms-and-conditions.aspx"> terms and conditions </a> and <a class="a-link" target="_blank" href="https://www.mycompany.govt.nz/Pages/privacy-policy.aspx"> privacy policy</a>. </span>


2)  How to add Dynamic parameters
jsp:
<spring:theme code="mycompany.property.invalid.attempts.count.max.message" arguments="${jalosession.tenant.config.getParameter('mycompany.max.failed.attempts.count')} ,${jalosession.tenant.config.getParameter('mycompany.max.failed.attempts.hour')}" htmlEscape="false"></spring:theme>

base.properties
mycompany.property.invalid.attempts.count.max.message=<h5 class="ma-h5"> Account locked</h5><p>You have entered the incorrect number and PIN combination {0} times. You will not be able to add another property for {1} hours.</p>


3) How to read property key in jsp

<spring:theme code="mycompany.property.invalid.attempts.count.max.message" arguments="${jalosession.tenant.config.getParameter('mycompany.max.failed.attempts.count')} ,${jalosession.tenant.config.getParameter('mycompany.max.failed.attempts.hour')}" htmlEscape="false"></spring:theme>

mycompany.max.failed.attempts.count key defined in project.properties or base.properties

4) How to check anonymous customer in jsp
jalosession.attributes['user'].anonymousCustomer

5) Delete typecode from deployment table - same typecode for multiple items ( old one removed but still in deployment table)

DELETE FROM <YOUR DB NAME>.ydeployments WHERE Typecode=18001(deployment code);

change the development code what ever you have conflicts in my case its 18001 is the conflicting deployment code.

1 comment: