• Entries (RSS)
  • Comments (RSS)

How to create vanity url for HANA services

Posted by | Posted in HANA | Posted on 10-02-2014

Tagged Under : ,

How to create vanity url for HANA services using URL Rewriting

SAP HANA provides an option to create an alias or vanity URL for services created in HANA. This will help HANA developers not to expose the internal service path to the external service users. It also helps the developers to keep the url intact even when the internal service implementation has changed. Developers can write URL rewrite rules using JavaScript regex syntax inside the HANA Application access file (.xsaccess) to provide the alias for a service. The rewrite rules are specified as source and target values. The source can be a JavaScript regex. Follow the below steps to rewrite your urls in SAP HANA.

The source service url you have is http://server:port/services/com/example/path/salesOrders.xsjs?salesOrderNumber=1234 and you want to access the service using a different url like http://server:port/services/salesorders/1234/. The first step in creating a vanity url like the above is to create an .xsaccess file inside your services directory in SAP HANA studio. The contents of the .xsaccess file will be like the following

	"rewrite_rules" : 
				"source": "/salesorders/(\\d*)/", 
				"target": "/com/example/path/salesOrders.xsjs?salesOrderNumber=$1"

In the above example $1 will be replaced by the value entered by the user(1234). If you have more than one input to accept, you can use $2, $3 etc to get the user input.

Animations in JavaScript

Posted by | Posted in JavaScript | Posted on 25-02-2013

Tagged Under :

Websites are so generic when they have nothing but texts and images for presentation. Without any flashy designs and nifty innovations in w3, people would tend to look away and just look for other websites that have those cool lightshows and animations to feature. If you’re a master in the lore of Javascripts, then you might still be able to capture people’s attention and make them stay.

Do take note that programming is by no means easy. It requires hard work, patience, and hundreds to thousands of laborious hours just to get things done. So before you begin, prepare yourself and savor your final moments before heading to programming hell.

1. Show Loading Progress Percentage

<script language="JavaScript" type="text/JavaScript">function showprogress() {if (document.images.length == 0) {returnfalse;}var loaded = 0;for (var i=0; i<document.images.length; i++) {if (document.images[i].complete) {loaded++;}}varpercentage = Math.round(100 * loaded / document.images.length);document.getElementById("progress").innerHTML =percentage + "% loaded";if (percentage == 100) {window.clearInterval(ID);}}var ID = window.setInterval("showprogress();", 500);</script><p name="progress">0% loaded</p>

2. Create an Animated Progress Bar

<script language="JavaScript"type="text/JavaScript">function progress() {if (document.images["bar"].width < 200) {document.images["bar"].width += 5;document.images["bar"].height = 5;} else {clearInterval(ID);}}var ID;window.onload =function() {ID = setInterval("progress();", 500);}</script><img src="black.gif" name="bar" />

3. Animation Images With Javascript

<script language="JavaScript" type="text/JavaScript">var urls;function animate(pos) {pos %= urls.length;document.images["animation"].src = urls[pos];window.setTimeout("animate(" + (pos + 1) + ");", 500);}window.onload = function() {urls = new Array("0.png", "1.png", "2.png", "3.png","4.png", "5.png", "6.png");animate(0);}</script><img src="0.png" name="animation" />

4. Preload Images With Javascript

<script language="JavaScript"type="text/JavaScript">function preloadImage(url) {var i = new Image();i.src = url;}</script><body onload="preloadImage('active.gif');"></body>

5. Preloading Multiple Images in Javascript

<script language="JavaScript"type="text/JavaScript">function preloadImages(urls) {var img = new Array();for (var i=0; i<urls.length; i++) {img[img.length] = new Image();img[img.length - 1].src = urls[i];}}window.onload = function() {var img = new Array("active.gif", "inactive.gif", "other.gif");preloadImages(img);}</script>

6. Change Images On Mouse Over and Out in Javascript

<script language="JavaScript"type="text/JavaScript">function changeImage(name, url) {if (document.images[name]) {document.images[name].src = url;}}</script><imgname="myImage"src="inactive.gif"onmouseover="changeImage('myImage', 'active.gif');"onmouseout="changeImage('myImage', 'inactive.gif');"/>

7. Create Mouse Sensitive Buttons in Javascript

<img src="inactive.gif"onmouseover="this.src='active.gif';"onmouseover="this.src='inactive.gif';" />

WebSphere Commerce Build and Deploy Tool and Rational Team Concert integration

Posted by | Posted in RTC, WebSphere Commerce | Posted on 28-01-2013

Tagged Under : , , , ,

WebSphere Commerce Build and Deploy Tool and Rational Team Concert integration

Recently I came across a scenario where I need to integrate WebSphere Commerce Build and Deploy Tool with Rational Team Concert. We are using Rational Team Concert as our SCM tool. RTC has a lot of features where it can be used from project planning to deployment. Since we wanted everything integrated in RTC, we thought of using RTC for our build process too. Creating a build definition in RTC to use the WCBD tool is relatively easy. After integrating WCBD tool with RTC, requesting a build was just one click from within our WCS work space.

Integrating WCS with RTC offers a lot of advantages like continuous integration, one click build and deploy, personal builds, linking work items and source code to a build, comparing two builds etc.

Please follow the below steps if you are planning to integrate RTC with WCBD tool.
Read the rest of this entry »

Keep the generated JSP Source file in WebSphere Application Server

Posted by | Posted in WebSphere | Posted on 30-05-2011

Tagged Under : ,

Keep the generated JSP Source file in WebSphere Application Server

We all know the location of generated Java source file from JSP in WebSphere Commerce. Suppose you are working in an WebSphere Application Server environment, not in WebSphere Commerce and you want to see the JSP source files generated by WAS. If you look in the temp directory of WebSphere, we can see only the .class files. Not the source file. WebSphere Application Server by default does not keep the generated Java source file. However we can instruct WebSphere to keep the generated Java source file in the temp directory. The location where WebSphere keeps the generated Java source file remains same. Of course you can change it, if you want to, by specifying some other configuration parameters.
Read the rest of this entry »

Creating a Hello World RESTful web service with RAD and WebSphere Application Server using IBM JAX-RS

Posted by | Posted in WebSphere | Posted on 22-05-2011

Tagged Under : , , ,

Creating a Hello World RESTful web service with RAD and WebSphere Application Server using IBM JAX-RS

REST is the buzzword now. So its time to learn how to create a RESTful web service now. Here is my simple hello world tutorial on creating a RESTful web service using Rapid Application Developer and IBM JAX-RS. JAX-RS is a Java API for developing REST applications. JAX-RS 1.0 defines a server-side component API to build REST applications. This ia an implementation of the JAX-RS (JSR 311) specification.

All the REST implementations I have seen need a minimum Java 1.5 to run. All these implementations use annotations. So my code will not work on WebSphere Application Server 6 and below versions. The minimum required version is WebSphere Application Server 6.1. I have tested these examples only in WAS 7. You need to have Feature pack for Web 2.0 for WebSphere installed on your application server. So once you have your app server ready with Web 2.0 feature pack installed then you have pretty much everything to get started. Follow the below steps to create your first hello world RESTful web service with RAD and WAS 7. For my development purposes I was using RAD 7.5. But I am sure that the following steps will work even for other RAD version too.
Read the rest of this entry »