Tuesday, November 22, 2011

Facebook Like/Share button in your site

Reference page http://developers.facebook.com/docs/reference/plugins/like/

Include the JavaScript SDK on your page once, ideally right after the opening <body> tag.

<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Place the code for your plugin wherever you want the plugin to appear on your page.
<div class="fb-like" data-href="www.we4you.co.cc" data-send="true" data-layout="button_count" data-width="450" data-show-faces="false" data-font="tahoma"></div>

Thursday, November 17, 2011

Configuring proxy settings in Java


System.getProperties().put("http.proxyPort", "someProxyPort");
System.getProperties().put("http.proxyUser", "someUserName");
System.getProperties().put("http.proxyPassword", "somePassword");
System.getProperties().put("http.proxyHost", "someProxyURL");

Courtesy by: Harish Gokavarapu

Saturday, May 14, 2011

IBM Learning video, audio and pdf available for free

IBM Education Assistance

This is a free site, any body can access and go through the learning sessions provided by them.

For WebSphere Commerce Suite learning, please visit the following url

http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.wcs/plugin_coverpage.html

In the left side menu items of the loaded page search for "WebSphere Commerce"

Friday, May 13, 2011

How to get the Date and Time for client TimeZone in Java class


You need to get the timeZoneOffSet from browser by using the following javascript snippet:
<script type="text/javascript">
   var dateObj = new Date()
   var timeZoneOffsetInMins = dateObj.getTimezoneOffset();
   document.getElementById("bTimeZoneOffset").value = timeZoneOffsetInMins;
</script>

<form>
  <input id="bTimeZoneOffset" type="hidden" />
</form>

Java Class Method:::
private String getClientDateTime(String strFormat, long timeZoneOffSet){
    SimpleDateFormat sdf = new SimpleDateFormat(strFormat);
    TimeZone timeZone= TimeZone.getTimeZone("UTC");

    if(timeZoneOffSet < 0){
        timeZoneOffSet = -1 * timeZoneOffSet;
    }
    timeZoneOffSet = timeZoneOffSet * 60000;
    timeZone.setRawOffset(timeZoneOffSet);
    
    sdf.setTimeZone(timeZone);
    
    return sdf.format(new Date());
}

Tuesday, April 26, 2011

Converting special Characters in properties file to UTF8 using native2ascii


Eg: Converting poland special charectres to native language
1.  Rename the file provided by the customer (i.e., storetext.properties) to storetext.nta
2.  Run the following command:                                                 C:\WebSphere\IBM\SDP\runtimes\basev7\java\bin\native2ascii -encoding utf-8 <.nta-file locaiton> <target file name with path>
3.  Target properties file is your converted file.