Tuesday, February 21, 2023

HCL Commerce ACP policy

MERGE

INTO

  ACRESCGRY acresgry

USING

  (

    SELECT ACRESCGRY_ID, RESCLASSNAME FROM (

  SELECT (SELECT MAX(ACRESCGRY_ID)+1 FROM acrescgry) ACRESCGRY_ID, 'com.XYX.commerce.usermanagement.commands.XYZProfileTypeCmd' RESCLASSNAME FROM SYSIBM.SYSDUMMY1 

  )

  ) t

ON

  (

    acresgry.RESCLASSNAME = t.RESCLASSNAME

  )

WHEN MATCHED THEN

  UPDATE SET

  acresgry.RESCLASSNAME = t.RESCLASSNAME

WHEN NOT MATCHED THEN

  INSERT (acresgry.ACRESCGRY_ID, acresgry.RESCLASSNAME)

  VALUES (t.ACRESCGRY_ID, t.RESCLASSNAME)

;



MERGE

INTO

  ACRESACT acresact

USING

  (

    SELECT ACRESCGRY_ID, ACACTION_ID FROM (

  SELECT (SELECT ACRESCGRY_ID FROM acrescgry where RESCLASSNAME like 'com.XYX.commerce.usermanagement.commands.XYZProfileTypeCmd') ACRESCGRY_ID, (SELECT ACACTION_ID FROM acaction where action = 'Execute') ACACTION_ID FROM SYSIBM.SYSDUMMY1 

  )

  ) t

ON

  (

    acresact.ACRESCGRY_ID = t.ACRESCGRY_ID and acresact.ACACTION_ID = t.ACACTION_ID 

  )

WHEN NOT MATCHED THEN

  INSERT (acresact.ACRESCGRY_ID, acresact.ACACTION_ID)

  VALUES (t.ACRESCGRY_ID, t.ACACTION_ID)

;



MERGE

INTO

  ACRESGPRES acresgpres

USING

  (

    SELECT ACRESGRP_ID, ACRESCGRY_ID FROM (

  SELECT (SELECT ACRESGRP_ID FROM ACRESGRP where GRPNAME = 'RegisteredUserCmdResourceGroup') ACRESGRP_ID , (SELECT ACRESCGRY_ID FROM acrescgry where RESCLASSNAME like 'com.XYX.commerce.usermanagement.commands.XYZProfileTypeCmd') ACRESCGRY_ID  FROM SYSIBM.SYSDUMMY1 

  )

  ) t

ON

  (

    acresgpres.ACRESGRP_ID = t.ACRESGRP_ID and acresgpres.ACRESCGRY_ID = t.ACRESCGRY_ID 

  )

WHEN NOT MATCHED THEN

  INSERT (acresgpres.ACRESGRP_ID , acresgpres.ACRESCGRY_ID)

  VALUES (t.ACRESGRP_ID,  t.ACRESCGRY_ID )

;

Wednesday, December 28, 2022

java was started but returned exit code=-805306369

 Issue : java was started but returned exit code = -805306369 C:\Windows\System32\javaw.exe -jar C:\Program Files\Java\eclipse-jee-helios-SR2-win32-x86_64\eclipse\plugins\org.eclipse.equinox.launcher_1.11.1.R36x_v20101122_1400.jar


Resolution : Update eclipe.ini file located in C:\IBM\SDP. Update below 2 highlighted value



-Dorg.eclipse.swt.browser.IEVersion=11001

-Xquickstart

-Xms1024m

-Xmx1536m

-Xmnx64m

-XX:MaxPermSize=1024M


Monday, July 5, 2021

SonarQube Setup Guide

 

                                    SonarQube Setup Guide

Download the SonarQube Community Edition

Note : SonarQube requires disk space of around 100 GB.



2. Unzip it, let's say in C:\sonarqube or /etc/sonarqube.

3. Install java 11 and set the path.

4. Edit the wrapper.conf file from the sonar and set the path location of java.



5. Start the SonarQube Server.



6. Log in to http://localhost:9000 with System Administrator credentials (admin/admin)

7. Download sonar scanner from the given link. SonarScanner | SonarQube Docs



8. Create sonar-project.properties file in the project folder which is to be scanned and configure the project properties.



9. Set user variable for the sonar scanner.

10. Run sonar-scanner.bat command on command prompt from the project folder.

11. Log in to http://localhost:9000 with System Administrator credentials (admin/admin) to check the scan results.

REFERENCES:

https://github.com/SonarSource/sonar-.net-documentation/blob/master/doc/installation-and-configuration.md#:~:text=In%20the%20extracted%

20folder%20navigate,the%20currently%20in%20use%20ports.

Wednesday, June 9, 2021

Adding trace in ts-app container in HCL commerce

 


Adding new trace from ts-app container : Execute you container then from there run :


run set-dynamic-trace-specification com.ibm.commerce.*=all

To Revert:

run set-dynamic-trace-specification *=severe

Wednesday, January 27, 2021

Installing NetBeans12.2

 

Download NetBeans : https://www.apache.org/dyn/closer.cgi/netbeans/netbeans/12.2/Apache-NetBeans-12.2-bin-windows-x64.exe



open NetBeans installer location in command prompt and type: netbeans*****.exe --javahome "C:\Program Files\Java\jdk"


e.g. C:\Users\Documents\>Apache-NetBeans-12.2-bin-windows-x64.exe --javahome "C:\Program Files (x86)\Java\jdk1.8.0_281"

Tuesday, December 15, 2020

Input validation of number in JSP

 As per one security flaw in security scan Input Validation : We have to validate input is number or not .

Use below code for same


<jsp:forward page="AccessError.jsp">

<jsp:param name="storeId" value="${WCParam.storeId}" />

<jsp:param name="langId" value="${WCParam.langId}" />

<jsp:param name="catalogId" value="${WCParam.catalogId}" />

</jsp:forward>


Solution used was: 

<c:set var="storeId">
		<c:if test="${WCParam.storeId.matches('[0-9]+')}">
<c:out value="${WCParam.storeId}"/>
</c:if></c:set>

Thursday, August 20, 2020

RestTemplate to POST with UTF-8 encoding

Sometime we see extra character in rest response like Â, â. To overcome this issue We need to add StringHttpMessageConverter to rest template's message converter with charset UTF-8. Like below


RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters()
        .add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8));


Refer : UTF encoding from rest response