tag:blogger.com,1999:blog-69784350935226650882024-02-06T20:36:02.961-08:00Obed's Tech Blogobedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.comBlogger110125tag:blogger.com,1999:blog-6978435093522665088.post-2998153452347035712023-05-31T16:01:00.002-07:002023-05-31T16:01:35.655-07:00CommerceTools Import API for Setting Reference Set Attributes Using Key<div class="separator" style="clear: both; text-align: center;"></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAZYqqSI4C12kDWBp4jpE_paiW26lUUhHNNhHk3qamIw9WRI_GhGnM-nZ2rf025rOHzPW-9cziMX05zbOJFkS1qa5ya2fPriiP3iYPPOtizic1Cx4LeKe0VFDQaqjQEwUd5SXoAjAukUaV-WSKgwsoa2_qHol2kVGcrJTPgtr5RAAanJ75qRavCFT7/s1120/keyboard-key-success-online-39389.webp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="750" data-original-width="1120" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAZYqqSI4C12kDWBp4jpE_paiW26lUUhHNNhHk3qamIw9WRI_GhGnM-nZ2rf025rOHzPW-9cziMX05zbOJFkS1qa5ya2fPriiP3iYPPOtizic1Cx4LeKe0VFDQaqjQEwUd5SXoAjAukUaV-WSKgwsoa2_qHol2kVGcrJTPgtr5RAAanJ75qRavCFT7/w640-h428/keyboard-key-success-online-39389.webp" width="640" /></a></div><br /><div><br /></div><div><br /></div>Commercetools allows you to create attributes set that points to references, to be able to set those using keys you need to use this format that is not yet documented:<div><br /></div><script src="https://gist.github.com/obedmhg/13d676e63ec6978e8c66881ee5a5c701.js"></script>
<div><br /></div><div><br /></div><div>With this you will be able to set references using Key</div><div><br /></div><div><br /></div><div><br /></div><div>What is documeted is using Id which is a little bit different:</div><div><br /></div>
<script src="https://gist.github.com/obedmhg/3cc4bb937c3373e564e48474b1d39ff9.js"></script>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-14175260685227940082022-11-10T15:29:00.003-08:002022-11-10T15:30:26.654-08:00Percy - Set Basic Auth to your Percy scripts<p><span style="font-family: helvetica;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: helvetica;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg_zc8U4tV0-uT5vjOWeyxV3sQNa0b2esvPb2Rljy1K_Ui--yGkqB2YXLRoStlvWPglYcfygx-YtFyJbL-YFzLjMuH_s3CsDqICU6jsT7Fos_vzBcy-pMcnw5PR6WQh_2o_wtA8A54cmEDQ9BNOoibmXFyqTuMEJCcsGHs1wlK-l1f_j4XCmVYoLZmk" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="750" data-original-width="1125" height="426" src="https://blogger.googleusercontent.com/img/a/AVvXsEg_zc8U4tV0-uT5vjOWeyxV3sQNa0b2esvPb2Rljy1K_Ui--yGkqB2YXLRoStlvWPglYcfygx-YtFyJbL-YFzLjMuH_s3CsDqICU6jsT7Fos_vzBcy-pMcnw5PR6WQh_2o_wtA8A54cmEDQ9BNOoibmXFyqTuMEJCcsGHs1wlK-l1f_j4XCmVYoLZmk=w640-h426" width="640" /></a></span></div><span style="font-family: helvetica;"><br /><br /></span><p></p><p><span style="font-family: helvetica;">Percy will be able to use basic auth on restricted site, you just need to configure the <span color="var(--color-fg-default)" style="background-color: white; font-size: 16px;"><b>.percy.yml</b> at the root of your project, Percy will read this and use the credentials for each request that needs it.</span></span></p><p><span style="font-family: helvetica;"><span color="var(--color-fg-default)" style="background-color: white; font-size: 16px;">Use this as template:</span></span></p>
<script src="https://gist.github.com/obedmhg/6266a809e2effd7ca05c2195a904fc79.js"></script>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-29868288672464902052022-11-10T15:21:00.002-08:002022-11-10T15:22:42.390-08:00BCC Error getting current deployment : CONTAINER:atg.deployment.common.DeploymentException: A system error was encountered trying to lookup the RMI URI<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgUec6OJpEZnlw-Edv8sQnQrbZAxmgU4-gYetX7oN4bNoEsZ-Bj11gclouPtxBEo18gw-34crKiTmzuQgkxxJVSL3DgrYFllJw9W3KC7ledClcWIq7v0g89ULb6xXGd_pf_QBYVexiQrRNBF-ZwD2nRjNl3NsxsQ7LBmky7jqB1LGpTwNKOtyq_OAAi" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="750" data-original-width="1128" height="426" src="https://blogger.googleusercontent.com/img/a/AVvXsEgUec6OJpEZnlw-Edv8sQnQrbZAxmgU4-gYetX7oN4bNoEsZ-Bj11gclouPtxBEo18gw-34crKiTmzuQgkxxJVSL3DgrYFllJw9W3KC7ledClcWIq7v0g89ULb6xXGd_pf_QBYVexiQrRNBF-ZwD2nRjNl3NsxsQ7LBmky7jqB1LGpTwNKOtyq_OAAi=w640-h426" width="640" /></a></div><br /> I found this problem on a client.<p></p><p>After reviewing all the Configurations for RmiServer there was nothing wrong, only thing is that for some reason the default port was set when a deployment was created leading to an exception like this:</p><p>
<script src="https://gist.github.com/obedmhg/44239cd50b2adc213b4f4028cb49ad68.js"></script>
</p>
<br />That means that the deployment was created with the default port:<div><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg-ijlEEB4pXz5jARZCo1SxoxlodpnphLLlZDfY7k0gfyDftbqzcSe0Pe-lXgqV1pC5sdgxWAoiGP0n3xqg27J1s5w2JJFkfoog6KvwEzYlYBja8vzqd0ZoPcnYfEnAGcfKRnJCia2tmyxDuQtkGztWrL5DZVp7CgBpRDhRswwJ-ILyW9Ka3zeHwYJb" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="231" data-original-width="1095" src="https://blogger.googleusercontent.com/img/a/AVvXsEg-ijlEEB4pXz5jARZCo1SxoxlodpnphLLlZDfY7k0gfyDftbqzcSe0Pe-lXgqV1pC5sdgxWAoiGP0n3xqg27J1s5w2JJFkfoog6KvwEzYlYBja8vzqd0ZoPcnYfEnAGcfKRnJCia2tmyxDuQtkGztWrL5DZVp7CgBpRDhRswwJ-ILyW9Ka3zeHwYJb=s16000" /></a></div><br /><br /></div>In order to solve this you just need to update the deployment to have the correct RMI port:</div><div><br /></div><div>
<script src="https://gist.github.com/obedmhg/38d0dec9852562f07431146d11b7e7fe.js"></script>
<br /></div>
Once this is complete you can go back and see that BCC is working as expected.obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-10412111749586121892021-12-13T12:02:00.002-08:002021-12-13T12:03:06.106-08:00Solve CVE-2021-44228<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhLddG36I69ULJKRxG_GTZiHPJIxyka_5jsODhAxpUFK-T2Soeedr0EES26Xy7nR-Ih-DvMJCuDvzJk3ibGIHSPF1pF1QGJTErJ0FpVwDpssZlP1HuYjJRyY075eGJhGNgDakMMPMfGYq6GoEl5skE4eKCzh7zwHR6Rd2mxIAFxisULE7Nv4kopiJEy=s1082" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="556" data-original-width="1082" height="205" src="https://blogger.googleusercontent.com/img/a/AVvXsEhLddG36I69ULJKRxG_GTZiHPJIxyka_5jsODhAxpUFK-T2Soeedr0EES26Xy7nR-Ih-DvMJCuDvzJk3ibGIHSPF1pF1QGJTErJ0FpVwDpssZlP1HuYjJRyY075eGJhGNgDakMMPMfGYq6GoEl5skE4eKCzh7zwHR6Rd2mxIAFxisULE7Nv4kopiJEy=w400-h205" width="400" /></a></div><br /><p>On Dec 10 2021 log4j vulnerability was published at <a href="https://nvd.nist.gov/vuln/detail/CVE-2021-44228">https://nvd.nist.gov/vuln/detail/CVE-2021-44228</a> this allow attackers to remote access servers via http request.</p><p>Any Java application that uses logging with log4j 2.1x to 2.14.x have this problem, in order to solve this you can do the following options:</p><p>Upgrade to log4j 2.15 which solves the problem </p><p>Add the following JVM arguments to your startup</p><p><span style="font-family: courier;">-Dlog4j2.formatMsgNoLookups=true</span></p><p></p><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: left;">There are other options on other places to solve, you can find this at <a href="https://www.govcert.ch/blog/zero-day-exploit-targeting-popular-java-library-log4j/ ">https://www.govcert.ch/blog/zero-day-exploit-targeting-popular-java-library-log4j/ </a></div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbgnWK8I-dodFD07WLFVrER3uuZx0378OPP4PatFLT4mbMb1dqI07N2-401rFS7VqcnX77CWXLmjTrHm-RCCfXHHSEK5T0iKU4RFh6dcAtjTcfclF3gseR4jlZfS7KOQgXJR4v4rStUWo/" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="814" data-original-width="1204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbgnWK8I-dodFD07WLFVrER3uuZx0378OPP4PatFLT4mbMb1dqI07N2-401rFS7VqcnX77CWXLmjTrHm-RCCfXHHSEK5T0iKU4RFh6dcAtjTcfclF3gseR4jlZfS7KOQgXJR4v4rStUWo/s16000/image.png" /></a></div><br /><br /></div><br /><br /><p></p>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-12466777244659242812021-12-03T12:55:00.005-08:002021-12-03T12:57:32.377-08:00Install Jenkins on Oracle Cloud<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixBcmp3Qdyv8HL2JqDktZHaN7E0EwY0OBwbZ11krTBw8158djSK8GjhsxRJRTKdGIWgTXidN7yWuCuRijRaWlndb2XBbFcAqrtEujdk2OkXUf7netXmj2kvv1TO2gLJtTQBzeRBiWz2Dk/s601/2021-12-03+13_56_12-pexels-bernyce-hollingworth-2095716.jpg+%25E2%2580%258E-+Photos.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="437" data-original-width="601" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixBcmp3Qdyv8HL2JqDktZHaN7E0EwY0OBwbZ11krTBw8158djSK8GjhsxRJRTKdGIWgTXidN7yWuCuRijRaWlndb2XBbFcAqrtEujdk2OkXUf7netXmj2kvv1TO2gLJtTQBzeRBiWz2Dk/w640-h466/2021-12-03+13_56_12-pexels-bernyce-hollingworth-2095716.jpg+%25E2%2580%258E-+Photos.png" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div>There are very few steps you need to install Jenkins, here are listed<p><br />
<script src="https://gist.github.com/obedmhg/746ec5afcf1fa11a90a0118c99ed41a2.js"></script>
</p><p>After this is done you need to tell OCI to export the 8080 port.</p><p>You can do that by selecting clicking on the subnet of your instance:</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgnA6KputgmN0WO9jX8ymndW3pmI_U6lmefTWqrSsp0r288eit2Tq-zq1M8c9NicgaoJjAJyC8ogKqjwh5PaUt135Fsa0ZzceIJDkLgmzEzHD3clvR89TRq6r1Sr8iAv2F-Y0VAcWkWp4/s1691/subnet.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="849" data-original-width="1691" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgnA6KputgmN0WO9jX8ymndW3pmI_U6lmefTWqrSsp0r288eit2Tq-zq1M8c9NicgaoJjAJyC8ogKqjwh5PaUt135Fsa0ZzceIJDkLgmzEzHD3clvR89TRq6r1Sr8iAv2F-Y0VAcWkWp4/w640-h322/subnet.png" width="640" /></a></div><p>Then add a security List, by default you should have one already, click on it.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfK5iV-7wpluelD6wmwvZdNgoscRKdqkI5bBvcBF36lGePUW_NH5VE1-J17zCxg94fMPYsN7-AnNsy_fGtmKJOiLMOpYzFszhy6C8EmTxbLEcvmIkWCCZ5sTAA1TQOSFRgLjGY0TVNK9E/s1835/securityList.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="797" data-original-width="1835" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfK5iV-7wpluelD6wmwvZdNgoscRKdqkI5bBvcBF36lGePUW_NH5VE1-J17zCxg94fMPYsN7-AnNsy_fGtmKJOiLMOpYzFszhy6C8EmTxbLEcvmIkWCCZ5sTAA1TQOSFRgLjGY0TVNK9E/w640-h278/securityList.png" width="640" /></a></div><p>Then Add an Ingress Rule to open the port as follows:</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigD9qW-NI48kQgeN3aagtwFNaR4I0h-8-6xxIH8Dn0FmKUNYowb-StLZrL5QvQEvocUEOTOgHtRsFjYg8bm5lLB9FHscLll5FeS9sl0K0x8LDBTH8MtlPIO3FIlZ-FVUTLYu99Og1_QM0/s1594/Ingress+Rule.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="798" data-original-width="1594" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigD9qW-NI48kQgeN3aagtwFNaR4I0h-8-6xxIH8Dn0FmKUNYowb-StLZrL5QvQEvocUEOTOgHtRsFjYg8bm5lLB9FHscLll5FeS9sl0K0x8LDBTH8MtlPIO3FIlZ-FVUTLYu99Og1_QM0/w640-h320/Ingress+Rule.png" width="640" /></a></div><p>Once you are done you can go to Jenkins and Install just go to http://<oci_ip>:8080/</p><p>It will ask for a password on a particular file on your instance.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlW9o3tJpVZGkP9eYyQ1-wpspKJ63AqLSX7-PvxFu08FK_e0_fILIPUGDQUM3Qbkuksc1Zdep-HHb3F0hmmJdR8HQ4gGNO1mUxDmXhR4OAeaLVZpquSvHm3L53bs_yaTuwiGrGeZ-qQhc/s1031/installing.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="917" data-original-width="1031" height="570" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlW9o3tJpVZGkP9eYyQ1-wpspKJ63AqLSX7-PvxFu08FK_e0_fILIPUGDQUM3Qbkuksc1Zdep-HHb3F0hmmJdR8HQ4gGNO1mUxDmXhR4OAeaLVZpquSvHm3L53bs_yaTuwiGrGeZ-qQhc/w640-h570/installing.png" width="640" /></a></div><p>Afterwards you will see a page like this with the summary and the Jenkins will be live for you to start working with it.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw7a5qj2JM-PMBLqybT2onYRzkppZz87S1oFe22u9wP1FYhjzLIAsUndeSDxhgoIl8W7NGjJoCZBn5A9jVZbKNYGiD-3iumKmxtu7g2EW2OfIQ5wEs2fGyiAmI3hxevm6wa0ZNvCBj70k/s1908/done.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="692" data-original-width="1908" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw7a5qj2JM-PMBLqybT2onYRzkppZz87S1oFe22u9wP1FYhjzLIAsUndeSDxhgoIl8W7NGjJoCZBn5A9jVZbKNYGiD-3iumKmxtu7g2EW2OfIQ5wEs2fGyiAmI3hxevm6wa0ZNvCBj70k/w640-h232/done.png" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: left;">There are official documentation on how do to this more elegant with terraform you can visit: <a href="https://docs.oracle.com/en/solutions/jenkins-master-agent-mode/">https://docs.oracle.com/en/solutions/jenkins-master-agent-mode/</a> </div><p><br /></p><p><br /></p>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-13897425997845447522021-12-01T15:54:00.007-08:002021-12-01T15:58:59.929-08:00Akamai Pragma Header <div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtT9itEgpbFe50O3hctJPi-RCFi-mmyVzd6Z3e5SHjgMZXeN6zvbxGB87nhkMMJEesy2W8K1sQ5XPg8LbrMsIL1GEQbu-bhbiAHmNPsCMsDGbYi_osFxj4I7miGVMKDglwJuRphW9s5o0/s996/2021-12-01+16_53_23-Brown+and+White+Squirrel+on+Brown+Wooden+Surface+%25C2%25B7+Free+Stock+Photo.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="629" data-original-width="996" height="404" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtT9itEgpbFe50O3hctJPi-RCFi-mmyVzd6Z3e5SHjgMZXeN6zvbxGB87nhkMMJEesy2W8K1sQ5XPg8LbrMsIL1GEQbu-bhbiAHmNPsCMsDGbYi_osFxj4I7miGVMKDglwJuRphW9s5o0/w640-h404/2021-12-01+16_53_23-Brown+and+White+Squirrel+on+Brown+Wooden+Surface+%25C2%25B7+Free+Stock+Photo.png" width="640" /></a></div><br /><p><br /></p><p>When using Akamai for caching your static files sometimes you need to validate the custom cache information stored on Akamai, for that you can use <a href="https://learn.akamai.com/en-us/webhelp/cloudtest/cloudtest/GUID-15C82BC2-4C32-47C5-837F-ED5CFCE2DA43.html">Akamai Pragma Header</a> to get the details on what it is the configuration for a particular asset, the output of this gives us additional detail to troubleshoot issues and to help determine how well we are load balancing.</p><p>Just add the Pragma header needed and you will get the info.</p><p><br /></p><p><script src="https://gist.github.com/obedmhg/0d66d3c1766ad27b8e45381d7ee4ad79.js"></script><br /></p><p><br /></p>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-25599753047236769052021-11-14T21:25:00.003-08:002021-11-14T21:25:52.405-08:00DASH - DynAdmin SHell<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsjT4wa5jvOL8cf1BnmAFCqdYBCx6kn19wsccOh3gqJMakFZ0qRnZKDWg1DfE3OkgF59u2djOg9odYUR_gwg2O_-5sGGhrRfovBPK0VUSL_pru6l9QOZzffF8o2tYsj3-8XkFTdutQsuM/s2048/dashIm.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1361" data-original-width="2048" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsjT4wa5jvOL8cf1BnmAFCqdYBCx6kn19wsccOh3gqJMakFZ0qRnZKDWg1DfE3OkgF59u2djOg9odYUR_gwg2O_-5sGGhrRfovBPK0VUSL_pru6l9QOZzffF8o2tYsj3-8XkFTdutQsuM/w640-h426/dashIm.jpeg" width="640" /></a></div><p>Better /dyn/admin have integrated a tool called Dash (DynAdminSHell), with Dash you can execute methods set values to properties, do queries and more, to open Dash just click on <b>Dash >_</b> button at the top right corner of the screen or with <b>alt + ctrl + t</b> here are some examples of the multiple features you can have:</p><p><br /></p><p><script src="https://gist.github.com/obedmhg/3ea207fc693ec07384e2b7c96ddeea62.js"></script><br /></p><p>The Screen looks as follows:</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguTndZdpP_3JrPZk08Jmz2ESKwsljt-hEZOxCRtsANaJPkr7OD-_KVeCgIrIgUYmnLj_7pJ703eL1URv9BJgnqjj7diKyNRQzDrSt8gGD6Uqq7AJ38E-WXDwM87rGsWB9gFAEc_XFaq8E/s1751/dash.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="828" data-original-width="1751" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguTndZdpP_3JrPZk08Jmz2ESKwsljt-hEZOxCRtsANaJPkr7OD-_KVeCgIrIgUYmnLj_7pJ703eL1URv9BJgnqjj7diKyNRQzDrSt8gGD6Uqq7AJ38E-WXDwM87rGsWB9gFAEc_XFaq8E/w640-h302/dash.png" width="640" /></a></div><br /><p><br /></p><p>Additionally you can save scripts to reuse them easily, you can do this with this tool bar</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5uo3lhDZEeWEBYZj919GcxVFXbbPWvlVO0XxGsB55hm0vwQkyxsTAvYar_iK6ifVtyUP8eN7z7QhzEZ_4GCPnXKM2qjhVHvTyy1kcNe8Zv2rlr8RwSCVW2G8el41Mp931s6aVoD7otSI/s912/savedsc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="342" data-original-width="912" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5uo3lhDZEeWEBYZj919GcxVFXbbPWvlVO0XxGsB55hm0vwQkyxsTAvYar_iK6ifVtyUP8eN7z7QhzEZ_4GCPnXKM2qjhVHvTyy1kcNe8Zv2rlr8RwSCVW2G8el41Mp931s6aVoD7otSI/s16000/savedsc.png" /></a></div><br /><p><br /></p><p><br /></p>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-63842442433541596552021-11-14T17:24:00.006-08:002021-11-19T09:56:14.639-08:00Use Jenkins to return files as output<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOud9eb2hRXCj47uOZtDUtuIQm3xYbnJ1Q17vtfdCJ4NpqruqF4Wg8uoUE6MRCmEb9YWl1VFKfGXbguptlbfakqn-NQ0i9bsqEckaQrIH4cENMNGGZoOlKBgRG35u7nzqKFKtAdhyphenhyphenBVwc/s2048/pexels-photo-1181772.jpeg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1365" data-original-width="2048" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOud9eb2hRXCj47uOZtDUtuIQm3xYbnJ1Q17vtfdCJ4NpqruqF4Wg8uoUE6MRCmEb9YWl1VFKfGXbguptlbfakqn-NQ0i9bsqEckaQrIH4cENMNGGZoOlKBgRG35u7nzqKFKtAdhyphenhyphenBVwc/w640-h426/pexels-photo-1181772.jpeg" width="640" /></a></div><br /><p>Jenkins it is a powerful tool that have lots of features built on it, one of them is that you can put files inside your job directory and those can be downloaded by the users inside the Jenkins build.</p><p>This is as easy as just making sure your files are copied on the following path:</p><p><span style="background-color: #cccccc; font-family: courier;"><jenkinsPath>/workspace/<buildName>/$BUILD_NUMBER</span></p><p>Using the variable <span style="font-family: courier;"><b>$BUILD_NUMBER</b></span> is a good idea so you can organize your build files with the corresponding build.</p><p>There is an example of how you can see them on your Jenkins on the following path<b> http://<jenkinsHost>/job/<jobName>/ws/<buildNumber>/ </b></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg97QhRBavpgX3tZtCvMxWrGbk1BiGw9pBw2bKwHDiTzR3HaLmknhdmZrQp-HCS3g2piwgprAQGuZXgszih3m8i0iiBxtGNYa39MXyhytAarmMDZj_houukekIR8I5LJ59F_gERQZzfDiI/s981/jenkins.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="612" data-original-width="981" height="399" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg97QhRBavpgX3tZtCvMxWrGbk1BiGw9pBw2bKwHDiTzR3HaLmknhdmZrQp-HCS3g2piwgprAQGuZXgszih3m8i0iiBxtGNYa39MXyhytAarmMDZj_houukekIR8I5LJ59F_gERQZzfDiI/w640-h399/jenkins.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: left;">This is a good feature that will allow you to output data from a Jenkins job, such as the example above, there are some output files from a log Crawler job that will be available to be downloaded directly from Jenkins without the need to ssh to the box.</div><br /><p>This is just an explanation of what you can find here <a href="https://stackoverflow.com/questions/23670260/how-to-download-a-file-from-the-jenkins-job-build-folder">https://stackoverflow.com/questions/23670260/how-to-download-a-file-from-the-jenkins-job-build-folder </a></p><p><br /></p><p><br /></p>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-67371280311449159252021-03-03T08:00:00.002-08:002021-03-03T08:09:52.477-08:00How to unzip file using Java and shell command<div style="display: none;"></div><div style="display: none;"></div><p> </p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJb-JYebx2z1KrQvq_L1Yohoiiownc5-m4AO-zcOcDkZBzXWkIgcgmQEsn7Re9qXEX8ZDJsNT0_1C5Puv7nTP3o6utQhyphenhyphenHruJVQbT0x_wkZxIzrzWYyg_MOQbQEaKweKA3xD-cMOOyFD8/s1413/unzip.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="663" data-original-width="1413" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJb-JYebx2z1KrQvq_L1Yohoiiownc5-m4AO-zcOcDkZBzXWkIgcgmQEsn7Re9qXEX8ZDJsNT0_1C5Puv7nTP3o6utQhyphenhyphenHruJVQbT0x_wkZxIzrzWYyg_MOQbQEaKweKA3xD-cMOOyFD8/w640-h300/unzip.png" width="640" /></a></div><br /><p></p><p><br /></p><p>I had a simple task to complete, unzip a file using java, because I wanted to it multiple times by reading a config file, the code was supposed to be very easy.</p><p><br /></p><p>Something like this:</p><p><br /></p>
<script src="https://gist.github.com/obedmhg/37c5ffa3e8bf9f5941e682d677af99ed.js"></script>
<p><br /></p><p>But it turns out that calling unzip hangs forever, so I found an stackoverflow post (<a href="https://stackoverflow.com/questions/34088099/executing-unzip-command-programmatically">https://stackoverflow.com/questions/34088099/executing-unzip-command-programmatically</a>) that had the solution, and I ended doing it like this:</p><p><br /></p><p><br /></p>
<script src="https://gist.github.com/obedmhg/a9a67d620a5240f57acaf967eb8c50f3.js"></script>
<p>
As you can see this is a little bit different, it calls <span style="background-color: white; color: #032f62; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px; white-space: pre;">unzipFile.sh</span> that basically does execute unzip command with the parameters passed by. </p><p>I was not alone with this problem, there are plenty of posts and questions about this on stackoverflow, but for some reason these did not work for me:</p><p><a href="https://stackoverflow.com/questions/40484180/unzip-command-is-not-working-from-java-code?noredirect=1&lq=1">https://stackoverflow.com/questions/40484180/unzip-command-is-not-working-from-java-code?noredirect=1&lq=1</a></p><p><a href="https://stackoverflow.com/questions/50288224/tar-command-stuck-while-generating-tar-file-from-java-process">https://stackoverflow.com/questions/50288224/tar-command-stuck-while-generating-tar-file-from-java-process</a></p><p><a href="https://mkyong.com/java/how-to-execute-shell-command-from-java/">https://mkyong.com/java/how-to-execute-shell-command-from-java/</a></p><p><a href="https://www.baeldung.com/run-shell-command-in-java">https://www.baeldung.com/run-shell-command-in-java</a><br /><br /></p>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-55500890128110549392021-02-22T16:29:00.006-08:002021-03-05T07:32:57.662-08:00Create an SMTP Server on Oracle Cloud for Free<div style="display: none;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu49z8obNDs5-58UeISwaj-hFdY19y7C67mLGoD531XDQJqS230z5yp_91wc2xjBOPqa-Y92jjYal1fQtgCueaxyGAh3riH2vRTIpaf_kN03tGGNzzDY2dL9iaOtFSKitsypXAQAITBp8/s1425/email.jpg.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="727" data-original-width="1425" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu49z8obNDs5-58UeISwaj-hFdY19y7C67mLGoD531XDQJqS230z5yp_91wc2xjBOPqa-Y92jjYal1fQtgCueaxyGAh3riH2vRTIpaf_kN03tGGNzzDY2dL9iaOtFSKitsypXAQAITBp8/w400-h204/email.jpg.png" width="400" /></a></div><br /><div><br /></div>Create an Oracle always free account at <a href="https://www.oracle.com/cloud/free/">https://www.oracle.com/cloud/free/</a> <div>This will create an Oracle Cloud tenancy for you. </div><div>Once you have your account create a VM instance using this quick action. that guides you to create the instances and how to do ssh to it.<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNduJQYYq8Jxo1d3EJztAvuC_5kGTCwojhll5YP-TdhNg195ZBvdvJ8Urnpt70bwYqegCnQnVGjaKfA0SbB1J3r_4tiLRjIoFubPNWc3OPOSmSkNJMnY_oavmML5LQ9jWZvbdIcSZ1kVM/s0/createInstance.png" style="display: block; padding: 1em 0px; text-align: center;"><img alt="" border="0" data-original-height="145" data-original-width="403" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNduJQYYq8Jxo1d3EJztAvuC_5kGTCwojhll5YP-TdhNg195ZBvdvJ8Urnpt70bwYqegCnQnVGjaKfA0SbB1J3r_4tiLRjIoFubPNWc3OPOSmSkNJMnY_oavmML5LQ9jWZvbdIcSZ1kVM/s0/createInstance.png" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNduJQYYq8Jxo1d3EJztAvuC_5kGTCwojhll5YP-TdhNg195ZBvdvJ8Urnpt70bwYqegCnQnVGjaKfA0SbB1J3r_4tiLRjIoFubPNWc3OPOSmSkNJMnY_oavmML5LQ9jWZvbdIcSZ1kVM/s0/createInstance.png" style="display: block; padding: 1em 0px; text-align: center;"><br /></a></div>
Once you have your instances just run the following commands:</div><div><br /></div><div><br /></div><div><br /><script src="https://gist.github.com/obedmhg/3ab1626fa0e1ff01459f8067c4b27619.js"></script></div><div>Now open the port on Oracle Cloud, this is done by creating and Ingress rule on your instance VirtualCloudNetwork as follows:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZTC8nGku-TKLfBeIdVXqKH2bDIEkkBSd9HZtkFETOqNl66NTL9giSXP_ImsG3OEkgDwo2Yif6FTKGFaH2OMnqkvryqrcdUvMQKez-7kM-hkF8JsTQ0Rsj3Ix4syazPTz79O5pxW2PxT8/s943/ingressRule.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="448" data-original-width="943" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZTC8nGku-TKLfBeIdVXqKH2bDIEkkBSd9HZtkFETOqNl66NTL9giSXP_ImsG3OEkgDwo2Yif6FTKGFaH2OMnqkvryqrcdUvMQKez-7kM-hkF8JsTQ0Rsj3Ix4syazPTz79O5pxW2PxT8/w640-h304/ingressRule.png" width="640" /></a></div><br /><div>If all is ok, you will be able to send an email from the server with </div><div><br /></div><div><span style="background-color: #cccccc; font-family: courier; font-size: x-small;">echo "Test Email using Oracle Cloud" | sudo sendmail example@gmail.com</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh75fsGR3jmZCyoZRAGvPijYDCd33UYagJy5JlTtKKa29CyFpf5LjkI7iVN6yEW7dcZbX4obKOzVAWwjS4TksGabejg2pFTQIbrZC2I6pt9HG3HU-4f3Hzh7BE9x64HC5hzg-LxstfiB0g/s725/testEmail.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="278" data-original-width="725" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh75fsGR3jmZCyoZRAGvPijYDCd33UYagJy5JlTtKKa29CyFpf5LjkI7iVN6yEW7dcZbX4obKOzVAWwjS4TksGabejg2pFTQIbrZC2I6pt9HG3HU-4f3Hzh7BE9x64HC5hzg-LxstfiB0g/w640-h244/testEmail.png" width="640" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><div>To avoid your email going to spam you can configure a DNS for your server.</div><div><br /></div><div>This post does guide you to all the steps to configure a custom domain for your server and much more <a href="https://www.unixmen.com/configuring-sendmail-smtp-server-on-centos-a-scientific-linux/">https://www.unixmen.com/configuring-sendmail-smtp-server-on-centos-a-scientific-linux/ </a> this is not specific to oracle cloud.</div><div><br /></div><div><br /></div><div><br /></div>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-66388371364664005012020-04-15T12:23:00.001-07:002020-04-15T12:24:16.721-07:00Query Assets count per BCC projects <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRCq_soJLHBKonBIVJmjDHUbpnKbn6d5HB1nfS4Z2J8i5uhI4YvZSeC1t5MlfXdDh8T-APhnkjIxt7vSd59ienqg7vVOtyyNbiB1O7B4oiv8fUVKEfnRW5t0wAfsPXnL6V0MTD2BD5Q4o/s1600/assetsCountByProject.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="698" data-original-width="930" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRCq_soJLHBKonBIVJmjDHUbpnKbn6d5HB1nfS4Z2J8i5uhI4YvZSeC1t5MlfXdDh8T-APhnkjIxt7vSd59ienqg7vVOtyyNbiB1O7B4oiv8fUVKEfnRW5t0wAfsPXnL6V0MTD2BD5Q4o/s640/assetsCountByProject.png" width="640" /></a></div>
<br />
BCC can tell you the items that edit a project, however this query can help you to get just product,sku and categories.<br />
The items that will be indexed on a baseline.<br />
<br />
<br />
<script src="https://gist.github.com/obedmhg/94a50c6436d6a8f3c40fcddce5cdbe21.js"></script>
Special thanks to Roberto Ibarra, here you can find more bcc specific queries.<br />
<a href="http://betoit.blogspot.com/2019/08/bcc-project-details-with-sql-queries.html">http://betoit.blogspot.com/2019/08/bcc-project-details-with-sql-queries.html</a><br />
<br />obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-15790136663727783062020-03-11T12:06:00.001-07:002020-03-11T12:06:23.381-07:00RQL Non common queries and opperations<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjETKLIhKl8qy1FKXbw7ncL3E7qyMFrO4N4g44Yyqe08NR2z5srLCgJrmxv1ONn7HXImhAgrSbCVjTM0sTLqFapzMq6zJdSCnSVg2hBJQTsfNDhC3Rx4L6MTjYyMkJUF90NiigqVhDslnA/s1600/rql.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="665" data-original-width="945" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjETKLIhKl8qy1FKXbw7ncL3E7qyMFrO4N4g44Yyqe08NR2z5srLCgJrmxv1ONn7HXImhAgrSbCVjTM0sTLqFapzMq6zJdSCnSVg2hBJQTsfNDhC3Rx4L6MTjYyMkJUF90NiigqVhDslnA/s400/rql.png" width="400" /></a></div>
<br />
Here is a list of non common rql commands you can use, since this is a <b>gist </b>will be updated with more examples, so feel free to bookmark this.<br />
<br />
<script src="https://gist.github.com/obedmhg/b289f9b1f4e25cd4aa80d0fd3062b77b.js"></script>
All of them can be found at:<br />
<a href="https://docs.oracle.com/cd/F25148_01/Platform.11-3-2/ATGRepositoryGuide/html/index.html">https://docs.oracle.com/cd/F25148_01/Platform.11-3-2/ATGRepositoryGuide/html/index.html</a>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-67493648120153967692020-03-09T16:38:00.001-07:002020-03-09T18:22:59.769-07:00JRebel and Weblogic as remote server.<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj39nPRUepR4yw47cYd-wjKWc6yTUWwrq-Tv__-tH0ZscS6DIvcKkTCxo3y4lICeNYugPwrRUDWlRjt8vG-XudVlTZGWtsSdMql356BgPeSKemA1QO1Ax9KnFO0WR1IoS7aiHTVGR0QgZE/s1600/post.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="655" data-original-width="940" height="444" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj39nPRUepR4yw47cYd-wjKWc6yTUWwrq-Tv__-tH0ZscS6DIvcKkTCxo3y4lICeNYugPwrRUDWlRjt8vG-XudVlTZGWtsSdMql356BgPeSKemA1QO1Ax9KnFO0WR1IoS7aiHTVGR0QgZE/s640/post.png" width="640" /></a></div>
<br />
Now days developers have cloud environments to run their code, it is possible for JRebel to configure a remote server so it reload your changes on it.<br />
<div>
<br />
<div>
In order to make this possible some steps need to be done.</div>
<div>
<br /></div>
<div>
First of all, download jrebel from <a href="https://www.jrebel.com/products/jrebel/download/prev-releases">https://www.jrebel.com/products/jrebel/download/prev-releases</a> </div>
<div>
<br /></div>
<div>
Once you have this get it and install (unzip jrebel.zip) it on your remote server at a location that you can call <b><span style="font-family: "courier new" , "courier" , monospace;">JREBEL_HOME</span></b>.</div>
<div>
<br /></div>
<div>
Once is installed, your weblogic instance start up parameters needs to be updated to contain the following:</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;">-agentpath:$JREBEL_HOME/lib/libjrebel64.so -Drebel.remoting_plugin=true</span></div>
<div>
<br /></div>
<div>
Once this is done the server will show something as follows:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguzGjJvyvJ05k7XmZBGhObkZ-Buhvt3_tL1JOPb_y6gS5JWr1jCwUw7X6hGED5k14FGXL5uZqcSsD87LkQRdItmnuTXEhhpz1JQkt2odSJtYhXWsSOvWdUICW6YeudAOQssBjoCCgveR4/s1600/startup.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="212" data-original-width="565" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguzGjJvyvJ05k7XmZBGhObkZ-Buhvt3_tL1JOPb_y6gS5JWr1jCwUw7X6hGED5k14FGXL5uZqcSsD87LkQRdItmnuTXEhhpz1JQkt2odSJtYhXWsSOvWdUICW6YeudAOQssBjoCCgveR4/s400/startup.png" width="400" /></a></div>
<div>
<br /></div>
<div>
Now on your local environment you need to install jrebel plugin for it, I use intellij, you can get the specifics for many popular IDEs here <a href="https://www.jrebel.com/products/jrebel/quickstart/intellij">https://www.jrebel.com/products/jrebel/quickstart/intellij</a>, just follow the steps for your ide and you will be all set.</div>
<div>
<br /></div>
<div>
You will need 2 files, these are generated by your plugin, per project module.</div>
<div>
<br />
<script src="https://gist.github.com/obedmhg/c226455c5f2d21c8c5692b9e3fd7f1b5.js"></script>
</div>
<div>
and</div>
<div>
<br />
<script src="https://gist.github.com/obedmhg/94661ce93f49dba2d7f8da147048e035.js"></script>
</div>
<div>
Once you have this, next step is to configure the remote server.<br />
<br />
This is configured within your IDE's plugin, IntelliJ shows as follows:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA3K-njIci5XBru46nIVxZplGjtCsTLH_WTXWI09dlE5oAKGgN5PLpat4Z3PaTZTIAqZQD4DEevziTXN3DMf61ODJHbiOiSR4AqYlx2E5vel1lbQFHCLW7MNPkhR8vSe6lraFxtJfq0dA/s1600/newRemoteServer.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="442" data-original-width="494" height="357" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA3K-njIci5XBru46nIVxZplGjtCsTLH_WTXWI09dlE5oAKGgN5PLpat4Z3PaTZTIAqZQD4DEevziTXN3DMf61ODJHbiOiSR4AqYlx2E5vel1lbQFHCLW7MNPkhR8vSe6lraFxtJfq0dA/s400/newRemoteServer.png" width="400" /></a></div>
<br /></div>
<div>
<br /></div>
<div>
Once Test connection works fine you are all set..<br />
<br />
Your changes will be deployed automatically by JRebel to your remote Server!!</div>
<div>
<br /></div>
<div>
JRebel documentation about this can be found at: <a href="https://manuals.jrebel.com/jrebel/remoteserver/serverconfiguration.html#">https://manuals.jrebel.com/jrebel/remoteserver/serverconfiguration.html#</a></div>
</div>
obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-33820175526309552682019-10-22T15:33:00.001-07:002019-10-22T15:34:09.666-07:00Oracle Commerce - Refresh Dimension Value Cache<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqQWPs0uHP9GRkCEj2Cb7geB1gTS_BywQgqS4g2PVE3YsEHFFjdPTbAqXPTIlNukDhBdTLDNz9v5FZeIzR1OcqpAOor3Cme98mNJVbflDakrwv4OTif93MhNVFO8pAKdjbCokjMuktJGg/s1600/refreshDVC.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="744" height="344" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqQWPs0uHP9GRkCEj2Cb7geB1gTS_BywQgqS4g2PVE3YsEHFFjdPTbAqXPTIlNukDhBdTLDNz9v5FZeIzR1OcqpAOor3Cme98mNJVbflDakrwv4OTif93MhNVFO8pAKdjbCokjMuktJGg/s640/refreshDVC.png" width="640" /></a></div>
<br />
DimensionValueCache holds the relationship with Categories and Endeca Dimensions, this component is often used to generate the navigation menu.<br />
<br />
In order to refresh this there is a method called refreshCache which does the job however it does check for some properties before actually refresh, so in order force the refresh you need to set some properties to comply with the OOTB code.<br />
The Following script on dash can take care of setting the properties we need to do the refresh<br />
<br />
<br />
<script src="https://gist.github.com/obedmhg/785cf77a2da1ed407b0394ca7764248b.js"></script>
<br />
<br />
To run this script just click on <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3LoB0M2GKubv9CQBk8OZyC99LlwgWeHthqXpjr-vEPc-mNnbQY8_vkJE6MbdqXSOpkcuzBrppzQUl6vfmJZaaL5-Chf9BXYMH7uWCQMjzt49M9kVFxuMHGTf64OMyWswO1s2w_yr6j8Y/s1600/dashButton.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="68" data-original-width="487" height="44" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3LoB0M2GKubv9CQBk8OZyC99LlwgWeHthqXpjr-vEPc-mNnbQY8_vkJE6MbdqXSOpkcuzBrppzQUl6vfmJZaaL5-Chf9BXYMH7uWCQMjzt49M9kVFxuMHGTf64OMyWswO1s2w_yr6j8Y/s320/dashButton.png" width="320" /></a><br />
<br />
And you will see a screen like this:
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9DB90MaQsZNWM77Jj-7nlzX-f7blbolUtatlTFRcySTr-4gd-m_iC5dFyu2WNiH31QlKh2RaHh0JJq9-Sw_7ka3eW1oqokohBV6rfxEGB3g06orRC72_z-7ohPKx1_Cvp0ujgQjQJu2c/s1600/dash.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="714" data-original-width="1600" height="284" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9DB90MaQsZNWM77Jj-7nlzX-f7blbolUtatlTFRcySTr-4gd-m_iC5dFyu2WNiH31QlKh2RaHh0JJq9-Sw_7ka3eW1oqokohBV6rfxEGB3g06orRC72_z-7ohPKx1_Cvp0ujgQjQJu2c/s640/dash.png" width="640" /></a></div>
<br />
After running this dash execute each step as follows:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieQvLj4B2DYyFO1HCYXIBP8eVrUyO_Oxd0cNNe5fNJXLmZLI47ckf7xHWMz0V-OLDp6oT_qutWWpQ7pLGnMHXdC0SdGQalQbGxhIkJ4lqCRSiIOX9hN6mk7USxvsrYiNW422o4W9en7cE/s1600/image+%25282%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="262" data-original-width="850" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieQvLj4B2DYyFO1HCYXIBP8eVrUyO_Oxd0cNNe5fNJXLmZLI47ckf7xHWMz0V-OLDp6oT_qutWWpQ7pLGnMHXdC0SdGQalQbGxhIkJ4lqCRSiIOX9hN6mk7USxvsrYiNW422o4W9en7cE/s640/image+%25282%2529.png" width="640" /></a></div>
<span id="goog_220655197"></span><span id="goog_220655198"></span><br />
<br />obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-36915236738817245822019-09-02T12:24:00.000-07:002019-09-02T12:24:25.126-07:00Oracle Commerce - Creating Dynamic Item Types and Properties <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi748uYzX3M_ymv4N5oQs3UaroKbg6-iOKTTr82S2yvalr8jLaCShpLTlQrsq-ITXwSjbP4xX_mTiR4V8-GC6CsKONZ94DUV3_d2AETmzAS0u50_5kEJbe2iJ8ZE_ui0dQKlIN9Qm9kNb8/s1600/thumb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="706" data-original-width="1418" height="318" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi748uYzX3M_ymv4N5oQs3UaroKbg6-iOKTTr82S2yvalr8jLaCShpLTlQrsq-ITXwSjbP4xX_mTiR4V8-GC6CsKONZ94DUV3_d2AETmzAS0u50_5kEJbe2iJ8ZE_ui0dQKlIN9Qm9kNb8/s640/thumb.png" width="640" /></a></div>
<br />
Oracle Commerce 11.3 provide a Dynamic Meta Data Repository that allows you to create Dynamic properties and dynamic types.<br />
<br />
This is a feature that you can take advantage to quickly add a new property to your repository.<br />
<br />
As an example we will add a dynamic property to product on our product catalog.<br />
<br />
This will be a Boolean property at product level.<br />
<br />
First you need to create a <b>New CA Project</b><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4knvOJe-50g6LRCQyOaEO4R7C4V6kbghdxgs2X8DfzaH2cRCXFFi_fQ_ArlHQUnkv9Q2eiUpm6jLHTHi6bJhfnY44o3_Z7JbHd3PAkeIabsrAr8CpcvDEIdRxcdnAflk1UP_JYy-W1Kc/s1600/ap1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="297" data-original-width="581" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4knvOJe-50g6LRCQyOaEO4R7C4V6kbghdxgs2X8DfzaH2cRCXFFi_fQ_ArlHQUnkv9Q2eiUpm6jLHTHi6bJhfnY44o3_Z7JbHd3PAkeIabsrAr8CpcvDEIdRxcdnAflk1UP_JYy-W1Kc/s640/ap1.png" width="640" /></a><b><br /></b><br />
<b><br /></b>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Then Add An asset of Repository Dynamic Metadata Repository<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1rjhkbU68EphLDr9PVqEE8NRKpR1-w0hw7E2zxuHF3yXv1B_4muTkI8livjbbLNTnUbU6NWYb5BwkQn-r2yaaNgTHpOm-pcI2-IvCo2FvkQRVpajPNt_kh1yHDwO58JS0REgRJ7sIb6E/s1600/ap2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="506" data-original-width="459" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1rjhkbU68EphLDr9PVqEE8NRKpR1-w0hw7E2zxuHF3yXv1B_4muTkI8livjbbLNTnUbU6NWYb5BwkQn-r2yaaNgTHpOm-pcI2-IvCo2FvkQRVpajPNt_kh1yHDwO58JS0REgRJ7sIb6E/s640/ap2.png" width="580" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
And Configure it as follows:<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjScfp9OZh4ROo8Ync6Jv7z-ZB73amgCl5Y8JHzptJCwHBuJGwNALUiQ7fgmfVzyaIvZ3XPZYRXd9qtwbp0CVklM8ZnDqCLtmuUroCD3qYoAcEbDmTQzWgOIe6r2_dSiCzTTTTIENNdlks/s1600/ap3.png" imageanchor="1" style="clear: right; display: inline !important; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="830" data-original-width="661" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjScfp9OZh4ROo8Ync6Jv7z-ZB73amgCl5Y8JHzptJCwHBuJGwNALUiQ7fgmfVzyaIvZ3XPZYRXd9qtwbp0CVklM8ZnDqCLtmuUroCD3qYoAcEbDmTQzWgOIe6r2_dSiCzTTTTIENNdlks/s640/ap3.png" width="508" /></a><br />
<br />
Once this is deployed you will be able to see the property on Merchandising, and you will be able to edit and deploy changes to it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaVE50fsRXM1HKrm5ieJM4KQEEFXQOldtmOlx0MshpVFVJ7BnAapUYN0eK_HwmhF_jV2ExOj5UJdUZIRySyUGooi1a6gXENtcHA3goITIbHlt7_8tKmtUlHP_TmilCvTVQsca3SxnpL5M/s1600/ap4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="444" data-original-width="1162" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaVE50fsRXM1HKrm5ieJM4KQEEFXQOldtmOlx0MshpVFVJ7BnAapUYN0eK_HwmhF_jV2ExOj5UJdUZIRySyUGooi1a6gXENtcHA3goITIbHlt7_8tKmtUlHP_TmilCvTVQsca3SxnpL5M/s640/ap4.png" width="640" /></a></div>
<br />
<br />
<br />
Use this only when the data will apply just to some items and not the whole universe of items, use but do not abuse, this is not as good on performance as extend the catalog.<br />
<br />
This can be found on the Documentation at : <a href="https://docs.oracle.com/cd/E69533_01/Platform.11-3/ATGContentAdminProgGuide/html/s1401creatingdynamicitemtypesandprope01.html">https://docs.oracle.com/cd/E69533_01/Platform.11-3/ATGContentAdminProgGuide/html/s1401creatingdynamicitemtypesandprope01.html</a>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-1617375688348293602019-07-31T15:53:00.001-07:002019-07-31T15:56:01.366-07:00PropertyDescriptor to get value from map property<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO3yYIlONopBFWv3LzKhvZEC5qLXtXIVKVa5SPYfxg7-22E9zEUOwVV-oCz-EdWUboOS-TgcBuwU1bcsq770mX18gAJlaX2mbdCOqLS3QXJNognPCMO19aKYM7TZlf-hyYJ5007bIaWsk/s1600/postMain.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="423" data-original-width="928" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO3yYIlONopBFWv3LzKhvZEC5qLXtXIVKVa5SPYfxg7-22E9zEUOwVV-oCz-EdWUboOS-TgcBuwU1bcsq770mX18gAJlaX2mbdCOqLS3QXJNognPCMO19aKYM7TZlf-hyYJ5007bIaWsk/s640/postMain.png" width="640" /></a></div>
<br />
Oracle Commerce have <a href="https://docs.oracle.com/cd/E41069_01/Platform.11-0/ATGRepositoryGuide/html/s1801propertyderivation01.html">derivations</a>, however you can't get a derivation expression from a map.<br />
<br />
But you can make this happen with a <a href="https://docs.oracle.com/cd/E26180_01/Platform.94/RepositoryGuide/html/s0715implementingauserdefinedproperty01.html">property descriptor</a>.<br />
<br />
This is kind of properties are needed often within projects to have access to a particular property within a property.<br />
<br />
An example of this is when customer have custom image properties to hold all the image scales on a map, something like this:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7j0Z261-ZI928cYXly1M58KJtEBOx4IattShyphenhyphen3hI8RcoDS0mg22OvLqA5TPu3yhuWk42CZwWi4JGN3X6wBsyiJ9DHIfndmBQFGXa1xAaGpWPnTMxm5vWOPfcmWglhjjE1dXa2ilsXGsk/s1600/imagesMap.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="219" data-original-width="688" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7j0Z261-ZI928cYXly1M58KJtEBOx4IattShyphenhyphen3hI8RcoDS0mg22OvLqA5TPu3yhuWk42CZwWi4JGN3X6wBsyiJ9DHIfndmBQFGXa1xAaGpWPnTMxm5vWOPfcmWglhjjE1dXa2ilsXGsk/s400/imagesMap.png" width="400" /></a></div>
<br />
<br />
Now, lets assume we need a particular image url from this map to be exposed as a property.<br />
<br />
Here is how you can make it:<br />
<br />
<script src="https://gist.github.com/obedmhg/c0f1cc64f0902ca2754253b1eee85386.js"></script>
Above you see the definition of a property that uses ValueFromMapPropertyDescriptor, this will require two attributes, the property which needs to be a map, and the key which needs to be a string.
<br />
<br />
Having this property descriptor, the repository will be able to return the thumbnail Image from the images map.<br />
<script src="https://gist.github.com/obedmhg/17fbfab579ead5ab29a40731ef2b67fd.js"></script>
With this approach I was able to get bcc being able to display thumbnail images for products and skus.
This is docummented at: <a href="http://obed33.blogspot.com/2015/11/make-thumbnails-on-bcc-use-image-you.html">http://obed33.blogspot.com/2015/11/make-thumbnails-on-bcc-use-image-you.html</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzlnsAR-pDhJbL11RqDdkzxRktKWPMGOvZUhlg4t_Eu3MPOLRxoT8CwbRJKOeoevvHLLV3vZIHt4bku7lqlvYl2ScXQI5MFNpHz5N1eOOyZa3T-RvTJmOdIcJqvNuUVe_GQIf7A8G0rPw/s1600/bccThumbs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="434" data-original-width="913" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzlnsAR-pDhJbL11RqDdkzxRktKWPMGOvZUhlg4t_Eu3MPOLRxoT8CwbRJKOeoevvHLLV3vZIHt4bku7lqlvYl2ScXQI5MFNpHz5N1eOOyZa3T-RvTJmOdIcJqvNuUVe_GQIf7A8G0rPw/s640/bccThumbs.png" width="640" /></a></div>
<br />obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-41167276975662313992019-07-25T14:40:00.002-07:002019-07-25T14:41:23.465-07:00custom format Assembler parameter name<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV2HWDAxrPJIMPj4kVmWnC-0Op7-_RTIjc_Y5g1WoPZGLuSoDjVhGyR2Gbjx4o7753lKPBnSdZ1NiFJ177rmltqz0BFFTA0Xyd0kn_uXv_nKqcUV2lIRDRY7fq018XZjG-yyHlW8eRPPA/s1600/pexels-photo-450035.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1067" data-original-width="1600" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV2HWDAxrPJIMPj4kVmWnC-0Op7-_RTIjc_Y5g1WoPZGLuSoDjVhGyR2Gbjx4o7753lKPBnSdZ1NiFJ177rmltqz0BFFTA0Xyd0kn_uXv_nKqcUV2lIRDRY7fq018XZjG-yyHlW8eRPPA/s320/pexels-photo-450035.jpeg" width="320" /></a></div>
<br />
Assembler can return the response in the format you like, json or xml, this is by using <b> format </b> parameter on your assembler instance as query parameter.<br />
<br />
i.e:<br />
<span style="background-color: #eeeeee;">https://www.mysite.com/home?format=json</span><br />
<br />
Given this is an Standard any developer with experience can access this data if infra team have it open, however this can be changed to be the value you want to be at:<br />
<br />
<b>/atg/endeca/assembler/AssemblerPipelineServlet </b>component<br />
<br />
<script src="https://gist.github.com/obedmhg/9f085a6172bde372754f9262d4176d1b.js"></script>
Once this is set you can still get the info but as follows:<br />
<br />
<span style="background-color: #eeeeee;">https://www.mysite.com/home?myCustomNotEasyToGuessName=json</span><br />
<br />
This parameter is great for debugging, so change the name is a good idea to have this exposed for troubleshoot given it will not be easy for people to get the information.<br />
<br />
I hope you find this useful for your project.obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-70613680536143521732019-06-19T08:41:00.002-07:002019-06-19T08:48:21.801-07:00PL/SQL to desc all tables on the database schema<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjejLFtJUVDH_w9Fd0sI9k_2eOGTmCNdCX-adsmoFaZhZBQRi7waGdbMrJCdQtMqgALwlu_BXAWMm0Ag5_x5q1s9kuHI-ACOqktnI3UjpH7CxdA1G6m57I4jd3lmfC9WXeO7mUyEs5JCDk/s1600/blogpost.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="639" data-original-width="1387" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjejLFtJUVDH_w9Fd0sI9k_2eOGTmCNdCX-adsmoFaZhZBQRi7waGdbMrJCdQtMqgALwlu_BXAWMm0Ag5_x5q1s9kuHI-ACOqktnI3UjpH7CxdA1G6m57I4jd3lmfC9WXeO7mUyEs5JCDk/s400/blogpost.png" width="400" /></a></div>
<br />
I had the need to compare two database schema in terms of DDLs, some definitions were not exactly the same when they were supposed to be, so in order to find out all those differences I created this script:<br />
<div>
<br /></div>
<script src="https://gist.github.com/obedmhg/9937d5fec2da4779ab1d12f93428b9d8.js"></script>
<br />
<div>
It will return into the dbms output the tables along with their columns and their data definition, this does not take in consideration any constraints of compare, just table names and columns.<br />
<br />
The output of this will be something like this:<br />
<br />
<script src="https://gist.github.com/obedmhg/5b77893f04f84efe0197ff3f6d81c920.js"></script>
</div>
<div>
<br /></div>
<div>
So I used it to get all data from 2 database schema and compare, I hope you find this useful for yourself.</div>
obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-27828098544670432912019-05-29T13:31:00.003-07:002020-04-30T15:07:45.862-07:00How to add a class as hotfix to ATG Dynamo<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-PdFUqh3H1G3qLdSuyeSF97Zj8o7JDr66rcsivEs7iOdPq1OqLmGbBN5LLcwJraUA5CRvEiLdUKibA-qN1hVW25HkSqVTSltvAgKG0mSDs5ZqJMfuLAr99eKVhG8ZAuELKiwMm3xdngE/s1600/CRAFTING+a+good.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="315" data-original-width="560" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-PdFUqh3H1G3qLdSuyeSF97Zj8o7JDr66rcsivEs7iOdPq1OqLmGbBN5LLcwJraUA5CRvEiLdUKibA-qN1hVW25HkSqVTSltvAgKG0mSDs5ZqJMfuLAr99eKVhG8ZAuELKiwMm3xdngE/s400/CRAFTING+a+good.png" width="400" /></a></div>
<br />
Sometimes there are issues that go to production, and the solutions can be as simple as a code change on a single line on a java class, however the deployment of this is not as easy, if this is an emergency you can deploy a class file directly to your application without to run a build process just need to go to the following path:<br />
<br />
<b style="background-color: #eeeeee;"><span style="font-family: "courier new" , "courier" , monospace;">.../my-app.ear/atglib/_atghome_slocallib</span></b><br />
<br />
Please note the following on the README.txt<br />
<br />
<b>Very Important Note:</b> You need to create the package and deploy the .class in the package that it belongs as follows:<br />
<br />
<b style="background-color: #eeeeee;"><span style="font-family: "courier new" , "courier" , monospace;">mkdir -p .../my-app.ear/atglib/_atghome_slocallib/com/myapp/commerce/</span></b><br />
then add your class to this directory.<br />
<b style="background-color: #eeeeee;"><span style="font-family: "courier new" , "courier" , monospace;">.../my-app.ear/atglib/_atghome_slocallib/com/myapp/commerce/MyPatch.class</span></b><br />
<br />
MyPatch.class will have be inside package com.myapp.commerce;<br />
<br />
<br />
<script src="https://gist.github.com/obedmhg/3ba4ffd9b19d2fec9f33bf64fdce8f3b.js"></script>
This means simple code fixes can be added here, please do not abuse of this feature, is there just for emergency not for deploy patches at will.<br />
<br />obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-21309407700432733472019-05-08T14:12:00.003-07:002019-05-08T14:12:57.602-07:00Disabling Chrome Autofill on ReactThere was an issue where chrome was doing autocomplete on one of my fields always even by setting flag autocomplete to be false or of, there are a lot of questions about this on stackoverflow:<br />
<br />
Here are some of them:<br />
<a href="https://stackoverflow.com/questions/15738259/disabling-chrome-autofill">https://stackoverflow.com/questions/15738259/disabling-chrome-autofill</a><br />
<a href="https://stackoverflow.com/questions/12374442/chrome-ignores-autocomplete-off">https://stackoverflow.com/questions/12374442/chrome-ignores-autocomplete-off</a><br />
<br />
Browsing I found this solution:<a href="https://medium.com/paul-jaworski/turning-off-autocomplete-in-chrome-ee3ff8ef0908">https://medium.com/paul-jaworski/turning-off-autocomplete-in-chrome-ee3ff8ef0908</a><br />
<br />
The solution to this is on the top comment Which is basically wrap your input inside a form, and that's it.:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8kVrtde9Uzs9TWdIwbiSlfX6x2QY5rQ9BQ_MX_8uHBc7BRSrrtPQdipsECqiJ3f2xwFKjSkjZhIV_X9jQrsKnywrBUPXt_-sdIwLhCZtMNtd3Sq6ooq_L4xK2uwYYb3kT0ABtDwiQ5Pc/s1600/post.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="320" data-original-width="653" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8kVrtde9Uzs9TWdIwbiSlfX6x2QY5rQ9BQ_MX_8uHBc7BRSrrtPQdipsECqiJ3f2xwFKjSkjZhIV_X9jQrsKnywrBUPXt_-sdIwLhCZtMNtd3Sq6ooq_L4xK2uwYYb3kT0ABtDwiQ5Pc/s640/post.png" width="640" /></a></div>
<br />
<br />
But this introduced bugs on my react application:<br />
<br />So here is other solution without making your input part of a form<br />
<br />
<script src="https://gist.github.com/obedmhg/7c9f7c6717f51363e979a64a146555e3.js"></script>
As you can see 2 things are happening here:<br />
<ul>
<li>randomId is being generated, this is needed so chrome does not try to autocomplete</li>
<li>fake password input was added, this is to aoid chrom trying to use the first input found on the DOM being used as password</li>
</ul>
<div>
This solved the issue for me, and is the combination of several solutions on the posts above.</div>
<div>
<br /></div>
<div>
I hope this works for you as well</div>
obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-67584537616965455682019-04-29T12:36:00.001-07:002019-04-29T13:16:33.788-07:00How to print div as pdf<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLwF44sk4cb1L9k8dxISs8Us1lhrLaQBWvxCi_w_d5dtIGWrNWkbTd5o3VjQkrGP8i6r2jNpaoSpqTKAeX-VAFh9vrBPlNomb6YBwfMIk2m35fe48kGT2zs2seJpbX7j2wD3HngXYg_eg/s1600/thumb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="566" data-original-width="1298" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLwF44sk4cb1L9k8dxISs8Us1lhrLaQBWvxCi_w_d5dtIGWrNWkbTd5o3VjQkrGP8i6r2jNpaoSpqTKAeX-VAFh9vrBPlNomb6YBwfMIk2m35fe48kGT2zs2seJpbX7j2wD3HngXYg_eg/s400/thumb.png" width="400" /></a></div>
<br />
Working on a project we got the the requirement of printing a recipient from the website.<br />
<br />
The solution we got is a simple as use: <a href="https://github.com/jasonday/printThis">https://github.com/jasonday/printThis</a><br />
This will allow us to do something like this:<br />
<br />
<script src="https://gist.github.com/obedmhg/3360aced8b0c20b16c43de1f6b867a6e.js"></script>
Most browsers can handle this with print, however chrome mobile version does not support this.<br />
<br />
So the option was to create a pdf with the recipient by using: <a href="https://parall.ax/products/jspdf">https://parall.ax/products/jspdf</a><br />
<br />
However they don't support print with your css, so this could not be used as side solution, so there is this other tool: <a href="https://html2canvas.hertzen.com/">https://html2canvas.hertzen.com/</a><br />
<br />
Combine both and you have what you need, using code similar to this: <a href="https://github.com/MrRio/jsPDF/issues/434">https://github.com/MrRio/jsPDF/issues/434</a>, I say similar because this code no longer work since <b>onrendered</b> is deprecated, so here is the version I used.<br />
<br />
<script src="https://gist.github.com/obedmhg/1321976c3c6a9667566ec5b1ce96f1a1.js"></script>
You can tell html2canvas to ignore compoents when creating the canvas for your div as follows:<br />
<br />
<script src="https://gist.github.com/obedmhg/484b180e71c85c74eb58767ebcd1c5d5.js"></script>
I hope this helps you :)
obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-66162645000661539482019-04-24T16:33:00.002-07:002019-04-24T16:34:20.390-07:00reactjs + herokuHere is a video that shows how to deploy a reactJS app to heroku using github.<br />
<br />
<div style="text-align: center;">
<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/Cj5WEO5lvOE" width="560"></iframe><br /></div>
<br />
Any feedback is appreciated!obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-88309839761103433192019-04-24T16:19:00.001-07:002019-04-24T16:21:01.461-07:00Orders Per Day Query ATG (Oracle Commerce)Here is a simple query to get orders per day on ATG.<br />
<br />
<script src="https://gist.github.com/obedmhg/3a5f986e4d2e158b5b363982fc68a28a.js"></script>obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-39340691530509095212019-01-21T11:06:00.000-08:002019-01-21T11:06:45.692-08:00Enable/Disable CMS after BCC DeploymentBCC can run CMS (Catalog Maintenance System) after each deployment, this happen on one of the server agents configured on it.<br />
In order to make this happen component /<b>atg/epub/CatalogMaintenanceHelper/</b> needs to be active.<br />
This component come as part of <b>DCS.PublishingAgent</b>.<br />
<br />
So Basically enable this as follows:<br />
<h3 style="background-color: white; color: #00214a; font-family: arial, sans-serif;">
<youapppath>/modules/Commerce/config/atg/epub/CatalogMaintenanceHelper.properties</youapppath></h3>
<pre style="background-color: white;"><code class="properties hljs" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; display: block; overflow-x: auto; padding: 0.5em; text-size-adjust: none;"><span class="hljs-setting"><span style="color: #333333;">active=</span><span style="color: #dd1144;">true</span></span></code></pre>
<br />
As this is triggered by BCC the following things need to happen:<br />
<br />
<ul>
<li>Agent Needs to exist on BCC</li>
<li>Agent Needs to be configured as Essential</li>
<li>Agent Needs to have active on /atg/epub/CatalogMaintenanceHelper/ (if is not present make sure you have running DCS.PublishingAgent)</li>
<li>Only one agent needs to be configured likewise </li>
</ul>
<div>
<br /></div>
<div>
You can also manually run this by going into: <yourserver>/dyn/admin/atg/commerce/admin/en/maintenance/startService.jhtml?process=BasicMaintProcess</yourserver></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrrdMb8fKTVO_xKISB8Pl0s-Z6z-sre8-avRI7sT5jiaxvJ9VAeGavgv_NAe0Cg8K_t73rfCi6LKu1ZzHUC7Y479yYrHb4wlHomT-5XdGA2aaT9Z357xMG3_a_8mbDDmIhUpJKGWmP70w/s1600/cms.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="454" data-original-width="903" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrrdMb8fKTVO_xKISB8Pl0s-Z6z-sre8-avRI7sT5jiaxvJ9VAeGavgv_NAe0Cg8K_t73rfCi6LKu1ZzHUC7Y479yYrHb4wlHomT-5XdGA2aaT9Z357xMG3_a_8mbDDmIhUpJKGWmP70w/s320/cms.png" width="320" /></a></div>
<div>
And click on <b>Start Process</b></div>
<div>
<br /></div>
<div>
CMS is needed to create the relationships across products/skus/categories/sites so Endeca will need these relationships to be properly set, here is an other blog post that talks about this:</div>
<div>
<a href="http://ravihonakamble.blogspot.com/2016/04/atg-catalogmaintenanceservice-is-not.html">http://ravihonakamble.blogspot.com/2016/04/atg-catalogmaintenanceservice-is-not.html</a></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<div>
Official documentation can be found at: <a href="https://docs.oracle.com/cd/E69533_01/Platform.11-3/ATGCommProgGuide/html/s0402catalogmaintenanceservice01.html">https://docs.oracle.com/cd/E69533_01/Platform.11-3/ATGCommProgGuide/html/s0402catalogmaintenanceservice01.html</a></div>
<div>
<br /></div>
<div>
</div>
<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0tag:blogger.com,1999:blog-6978435093522665088.post-3024227785120547362019-01-16T14:11:00.001-08:002019-01-16T14:12:39.394-08:00Better Dyn Admin OOTB Favorite Components You can use the following code to import the OOTB favorites:<br />
<br />
<script src="https://gist.github.com/obedmhg/b7e5a82b6c41f32eae1f80421fb5606f.js"></script>
<br />
Also, here is a video on how to create them:<br />
<div style="text-align: center;">
<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/P8kkKF57Hvg" width="560"></iframe></div>
obedmhghttp://www.blogger.com/profile/15077263959520023182noreply@blogger.com0