<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amit Jha on Medium]]></title>
        <description><![CDATA[Stories by Amit Jha on Medium]]></description>
        <link>https://medium.com/@amit740jha?source=rss-09bf961d224c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*LKAs2UZhnyuKay6O</url>
            <title>Stories by Amit Jha on Medium</title>
            <link>https://medium.com/@amit740jha?source=rss-09bf961d224c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:19:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amit740jha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Increase the default size of the any attribute in Hybris/ SAP Commerce Cloud]]></title>
            <link>https://medium.com/@amit740jha/increase-the-default-size-of-the-any-attribute-in-hybris-sap-commerce-cloud-676c0721ee25?source=rss-09bf961d224c------2</link>
            <guid isPermaLink="false">https://medium.com/p/676c0721ee25</guid>
            <category><![CDATA[hybris]]></category>
            <category><![CDATA[sapcommercecloud]]></category>
            <category><![CDATA[scripting]]></category>
            <dc:creator><![CDATA[Amit Jha]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 06:27:09 GMT</pubDate>
            <atom:updated>2025-11-11T06:27:09.075Z</atom:updated>
            <content:encoded><![CDATA[<h3>Requirement :</h3><p>There is an existing attribute named <strong>name</strong>, defined as a <strong>String</strong> with a default character limit of <strong>255 characters</strong>. The requirement is to increase this limit to a custom size (e.g., <strong>5000 characters</strong>).</p><p>To achieve this, the following script needs to be executed <strong>only once</strong> in the environment where the character size needs to be increased.</p><pre>import de.hybris.platform.core.Registry;<br>import de.hybris.platform.core.Tenant;<br>import de.hybris.platform.util.Utilities;<br>import java.sql.Connection;<br>import java.sql.PreparedStatement;<br>import java.sql.SQLException;<br>import javax.annotation.Resource;<br>import javax.sql.DataSource;<br><br>Connection conn = null;<br>PreparedStatement pstmt = null;<br><br>try{<br>final Tenant t = Registry.getCurrentTenant();<br>conn = t.getDataSource().getConnection();<br>stmt = conn.prepareStatement(&quot;alter table customer alter column p_name varchar(5000)&quot;);<br><br>stmt.execute();<br>}<br>catch (final SQLException e){<br><br>println(&quot;Unable to modify database column!&quot;);<br>println(e.getMessage());<br>} finally {<br>Utilities.tryToCloseJDBC(conn, pstmt, null, true);<br>}</pre><blockquote><strong>NOTE </strong>: The above script is applicable to OOTB attributes as well, but ensure you reference the correct table and attribute names.</blockquote><ul><li>First, run the script in <strong>normal mode</strong> and review the output in the result window.</li><li>If the output shows <strong>false</strong>, then proceed to run the script in <strong>commit mode</strong> from the scripting console in HAC.</li><li>If <strong>false is not printed</strong>, do <strong>not</strong> execute the script in commit mode.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6R2ZdLbjV5okF_QO9205g.png" /><figcaption>hac</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=676c0721ee25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Query Collection in Hybris using Flexible search]]></title>
            <link>https://medium.com/@amit740jha/how-to-query-collection-in-hybris-using-flexible-search-fb0e0510a0b8?source=rss-09bf961d224c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb0e0510a0b8</guid>
            <category><![CDATA[flexible-search]]></category>
            <category><![CDATA[hybris]]></category>
            <dc:creator><![CDATA[Amit Jha]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 06:13:30 GMT</pubDate>
            <atom:updated>2025-11-11T06:13:30.577Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Query on Collection Attributes in FlexibleSearch (Hybris)</h3><p>Sometimes, certain attributes store multiple values (such as IDs or item references) as a serialized string rather than using a proper relation. In such cases, we can still perform lookups using LIKE and CONCAT within FlexibleSearch.</p><h3>✅ Example query using serialized string matching</h3><pre>SELECT {item.pk}<br>FROM {MainItem AS item<br>      JOIN RelatedType AS relType<br>      ON {item.serializedAttribute} LIKE CONCAT(&#39;%&#39;, {relType.pk}, &#39;%&#39;)}<br>WHERE {item.serializedAttribute} IS NOT NULL<br>  AND {relType.code} NOT LIKE &#39;%FILTER%&#39;</pre><h3>🔍 What this does</h3><ul><li>serializedAttribute contains a comma-separated list or serialized representation of multiple IDs.</li><li>LIKE CONCAT(&#39;%&#39;, {relType.pk}, &#39;%&#39;) checks if a particular ID exists in that string.</li><li>The filter condition excludes unwanted items based on a pattern.</li></ul><h3>⚠️ Notes &amp; Caveats</h3><ul><li><strong>Performance:</strong> LIKE &#39;%value%&#39; can slow down queries on large datasets because it prevents index usage.</li><li><strong>Accuracy:</strong> Without clear delimiters, substring matches can produce false positives.</li><li><strong>Best Practice:</strong> Whenever possible, define proper relations instead of storing collections as serialized strings. This results in better performance, cleaner data modeling, and more maintainable queries.</li></ul><h3>✅ Example using proper relations (recommended approach)</h3><pre>SELECT {item.pk}<br>FROM {MainItem AS item<br>      JOIN Item2TypeRelation AS rel ON {rel.source} = {item.pk}<br>      JOIN RelatedType AS relType ON {relType.pk} = {rel.target}}<br>WHERE {relType.code} NOT LIKE &#39;%FILTER%&#39;</pre><p>This method leverages the relation table, avoids string parsing, and is significantly more efficient and reliable</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb0e0510a0b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Override OOTB file in CCv2/ and Adding new image type in SmartEdit]]></title>
            <link>https://medium.com/@amit740jha/override-ootb-file-in-ccv2-and-adding-new-image-type-in-smartedit-387219d95154?source=rss-09bf961d224c------2</link>
            <guid isPermaLink="false">https://medium.com/p/387219d95154</guid>
            <category><![CDATA[hybris]]></category>
            <dc:creator><![CDATA[Amit Jha]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 05:59:39 GMT</pubDate>
            <atom:updated>2025-11-11T05:59:39.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>Override OOTB file in CCv2/Hybris and Adding new image type in SmartEdit</h3><p>Requirement was to enable more file format (webp) in Smartedit which can allow to upload the images of the webp format after the implementation.</p><p>To achieve this we have two option to do so out of which onehas been explained below.</p><ol><li>Upload the whole <strong>smartedit extention</strong> to your repository For this Approach, you need keep your <strong>smartedit</strong> extension updated <strong>manually</strong>, Because it cannot get update automatically.</li><li>Modify this file in OOTB smartedit extention<br>/hybris/bin/modules/smartedit/smartedit/apps/smartedit-commons/src/services/fileValidation/FileValidationService.ts</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1w_p8UsqakftcgYKp_K4wQ.png" /><figcaption>FileValidationService.ts</figcaption></figure><p>Update the file format in the <strong>ACCEPTED_FILE_TYPE </strong>here as per my requirement I have added the <strong>webp </strong>file type in <strong>IMAGE</strong> and <strong>DEFAULT </strong>type</p><blockquote>Make sure there’s a whitespace before the added file type.</blockquote><p>3. Upload the whole smartedit extension to your repository like blow :<br>/core-customize/smartedit</p><p>4. Add, <strong>webp </strong>to value of property <strong>media.allowed.extensions.for.ClassLoader</strong> OOTB definition of <strong>smartedit.validImageMimeTypeCodes</strong> is in <br>/hybris/bin/platform/resources/advanced.properties</p><p>5. But you may override it in other file, for example:<br>/core-customize/environments/local.properties</p><p>6. or if that is <strong>common </strong>for all the environment than put that in <br>core-customize/environments/common.properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FjWUcckx18r2a3qGIv7pNA.png" /><figcaption>common.properties</figcaption></figure><blockquote>Make sure this properties file is included in in /core-customize/manifest.json</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*UEw0kvpVC0-Tw_Dgi3mpqA.png" /><figcaption>manifest.json</figcaption></figure><p>7. Add <strong>25504446, 52494646, 57454250</strong> to value of property <strong>smartedit.validImageMimeTypeCodes</strong><br>OOTB definition of <strong>smartedit.validImageMimeTypeCodes</strong> is in /hybris/bin/modules/smartedit/smartedit/project.properties</p><p>But you may override it in other file, for example:<br>/hybris/config/local.properties</p><p>or if that is <strong>common </strong>for all the environment than put that in <br>core-customize/environments/common.properties</p><p>52494646 and 57454250 are <strong>Hex</strong> Signature of <strong>webp</strong></p><p>8. Trigger a build using your repositoy Check the build log, you should see logs similar as following ones:<br>stdout: [ysetplatformproperties] Ignoring duplicate extension smartedit at /opt/workspace/build/commerce-suite/hybris/bin/modules/smartedit/smartedit because it’sconfigured at /opt/workspace/build/customer-project/core-customize /smartedit.</p><p>smartedit -&gt;(springintegrationlibs,smartedittools,webservicescommons) 2211.9 [cibw] path:/opt/workspace/build/customer-project/core-customize/smartedit</p><p>9. Adding new image format for Media Conversion In SAP Commerce Cloud, a variety of image formats are natively supported, such as <em>jpeg, jpg, gif, bmp, tiff, vcard, templ, tif, csv, eps, pdf, and png.</em><br>ImageMagick relies on Mime Type detection on file extensions. This means to convert a media to a specific Mime Type, the file extension of the output file must be set accordingly.<br>To introduce a new Mime Type/file extension pair <strong>WebP </strong>in our case, we add the following properties to <strong>common.properties</strong> :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPFZdd8jCRC5UVcAYEfa5A.png" /><figcaption>common.properties</figcaption></figure><p>10. Deploy it to your environment</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=387219d95154" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>