Month: February 2013

My prototype development experience with Magento

Magento is an ecommerce framework vendor where we recently developed a prototype. I started off with installing Magento Community Edition from http://www.magentocommerce.com/download

Magento offers demo data as optional installation. If you are installing for first time it’s recommended to also download the demo data.

Before installing you need a Wamp or XAMP installed on your windows machine. If you install the latest version it may not be supported as yet so do check the System Requirements from http://www.magentocommerce.com/system-requirements page before copying downloaded files in your web folder. Load the sample data in magento database and point to your browser to magento web folder. Rest of the installation is straightforward and once you setup the passwords you are done.

Browse to the admin panel and there are plenty of things to configure from extensions to add-ons to third party integrations. The crux of the magento is in these configurations. Once configured the payment method and other customizations you are done! Now next step is to add modify the product catalog. Since we loaded the sample data its already there. Your first magento application is now ready.

If don’t want to do even these steps there is a easier way out to directly go for hosted solution checkout http://go.magento.com/plans/

Conclusion: eCommerce app development couldn’t get easier than this!

Advertisements

JMeter Introduction for beginners…

What is Jmeter?

Apache JMeter is used as a load testing tool for analyzing and measuring the performance of a variety of services of web application.

Jmeter is a java based open source software tool.

JMeter can help you to do regression testing of your application by creating test scripts for web services.

JMeter runs in two modes:

  1. GUI mode (which runs on windows)
  2. Non-GUI mode (which runs on Linux)

 

Use of Jmeter?

JMeter can be used as a unit test tool for database connections, web services, etc.

Jmeter uses to test the load and performance of the web services.

Running Jmeter in GUI mode (which runs on windows)

Installation:

1. Install Java run time in your PC
url:- http://www.java.com/en/download/index.jsp

2. download Jmeter release.
url:- http://jmeter.apache.org/download_jmeter.cgi

3. Extract in your specify folder like as C://
run the file (C://jakarta-jmeter-x.x/bin/jmeter.bin)

Start the Jmeter interface, i.e. jMeter windows batch file from bin folder.

 

How to run JMeter?

Steps to run JMeter are as follows,

  1. Start JMeter windows batch file from bin folder, it will open interface as shown in below:Image
  2. Create your first test plan by creating thread group:Image
  3. Added Thread group:Image

Here thread group consists of 3 main properties,

a. Number of threads(users): It consists of number of requests you want to run in one test plan.

b. Ramp-up period (in seconds): It tells us how long all requests takes time to run. If there are multiple requests, then all requests get run one by one.

c. Loop count: It shows count that all requests get run in how many loops.

All samplers and listeners are involved in thread group.

4. Adding sampler:Image

Samplers describes that “Jmeter sends web requests to server and wait till response comes.”

5. Sampler (e.g: Http Request):Image

In this sampler, you can add parameters to send request to server to run the service.

6. Add listener:Image

Listener,  where test data and result get stored and it displays the output in different ways. Here added listener is “View as a tree”.

7. Run the test plan with result tree:

Now Select listener and run the test plan.Image

In this listener, output gets display in detail with,

a. Sample result: Where load time, sample count get displays to you.

b. Request: What request you send to server.

c. Response data: The exact output comes from server.

8. Run the test plan with result table: Here, table shows all results in tabular form with no. of requests and average time for all requests.Image

In this way your simple test plan of a web service get executed.

Lync Introduction

Lync 2010 is a communication product of Microsoft. That allows users to communicate, at any where any time .The main features of Lync  – audio and video calls, instant messaging and sending files. We are very familiar with Skype so the suddenly a very next question comes in our mind “What is the difference between Lync and Skype?”

Well, though Lync loos like a Skype , Lync 2010 has a lot of additional functionalities. First of all it should be mentioned that Lync  provides better quality calls than Skype. Microsoft Lync 2010 supports HD-video with 720p resolution (but, naturally, it also depends on user’s computer video device). This service is a combination of features necessary for business – IM (instant messaging), voice, video and audio conferencing (up to 250 attenders) in one. Beside these, users are able to set up unscheduled meetings, add distribution lists to their contacts, share their desktops, use whiteboard for presentations and control the other computer remotely.

Also very convenient feature of Lync is integration with Microsoft Office Applications – Exchange 2010, SharePoint 2010 and Outlook 2010. When using Exchange, presence indicators appear so that users can detect another user’s availability and call or send an IM in one-click. So the users can click on the status indicator and initiate communication. That is called “click to communicate” feature. Also one of the elements of integration is the button “New Online Meeting” that helps to create and reserve a room and time for meeting in the Calendar.

Currently, this feature is not available while using Lync with VoIP call. The service enables users to make PC-to-PC calls only at the moment.

And at the last the most important thing about any application which is running on internet is Security. Lync  2010 provides users with new level of security. It is Intelligent Instant Message Filter (IIMF) that protects messaging from viruses and spam. So you can run Lync 2010 without any security concern.

So from where we can start ? its very easy to use for that we have need to install Lync Client on our system.

If we observe  Lync Provides number of great features than Skype. Corporative people’s first choice is Lync  rather than Skype. So in last we can say that Lync is used for corporative work.

difference

Consuming Webservices & Parsing JSON Response Tutorial :Part 2

Hi Folks,

This is the Part 2 of  Consuming Webservices & Parsing JSON Response Tutorial

Previously we have consumed webService using NSURLConnection and got the response successfully .

Now time to parse the JSON response and populate data on UITableView.So the question is Is There any external library to parse raw JSON string?

Yes, there is numbers of external JSON framework which makes developers job easy.For this tutorial we are going to use SBJson framework

You can grab this framework from here and if you have not read part 1 just go through it here

How to install JSON framework?

The simplest way to start using JSON in your application is to copy all the source files (the contents of the Classes folder) into your own Xcode project.

  1. In the Finder, navigate into the Classes folder.
  2. Select all the files and drag-and-drop them into your Xcode project.
  3. Tick the Copy items into destination group’s folder option.
  4. Use #import “SBJson.h” in your source files.

Parsing Raw JSON

The first thing you should do, if you do not understand exactly what’s going on, is to NSLog thedescription of the JSON parser output. This will be a “list” of NSDictionary and NSArray, and when you see the description output you will understand that there is a one-to-one mapping of JSON “object” to NSDictionary

I have created one method where my parsing logic goes

declare it in .h file

-(NSMutableArray *)parseJsonResponse:(NSString *)rawJsonResponse;

in .m file implement this method as

-(NSMutableArray *)parseJsonResponse:(NSString *)rawJsonResponse

{

NSArray *responseKeyValueArray;

NSError *error;

SBJSON *json = [[SBJSON new] autorelease];

NSDictionary *responseKeyValueDict = [json objectWithString:rawJsonResponse error:&error];

#if DEBUG

NSLog(@”JSON parsing responseKeyValueDict: %@”, responseKeyValueDict);

#endif

if (responseKeyValueDict == nil)


{

#if DEBUG

NSLog(@”JSON parsing failed: %@”, [error localizedDescription]);

#endif

}

else {

if([responseKeyValueDict  valueForKey:@”list”] )

{

responseKeyValueArray  =[responseKeyValueDict  valueForKey:@”list”];

#if DEBUG

NSLog(@”responseKeyValueArray ::%@”,responseKeyValueArray);

#endif

if ([responseKeyValueArray isKindOfClass:[NSArray class]])

{

NSMutableArray *artistdetails = [[NSMutableArray alloc]init];

for(int i=0;i<[responseKeyValueArray count];i++)

{

NSDictionary *keyValueIndex = [responseKeyValueArray objectAtIndex:i];

#if DEBUG

NSLog(@”keyValueIndex::%@”,keyValueIndex);

#endif

Artist *artist=[[Artist alloc]init];

artist.imageName=[keyValueIndex objectForKey:@”image”];

artist.artistName=[keyValueIndex objectForKey:@”name”];

#if DEBUG

NSLog(@”artist.artistName::%@”,artist.artistName);

#endif

[artistdetails addObject:artist];

[artist release];

}

#if DEBUG

NSLog(@”artistdetails %d”,[artistdetails count]);

#endif

return [artistdetails autorelease];

}

else

{

return nil;

}

}

}

return  nil;

}

Call this method in connectionDidFinishLoading .modify it as

– (void)connectionDidFinishLoading:(NSURLConnection *)connection

{

// do something with the data

// receivedData is declared as a method instance elsewhere

NSLog(@”Succeeded! Received %d bytes of data”,[receivedData length]);

NSString *responseString = [[[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding] autorelease];

NSLog(@”Succeeded! Received JSON String %@ “,responseString);

// parse raw json response

parsedResponseData=[self parsedJsonResponse:responseString];

// release the connection, and the data object

[connection release];

[receivedData release];

}

Now we have Artist information, populate data over UITableView.To achieve this reload tableview and modify you cell for row method as below.

– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

static NSString *CellIdentifier = @”ArtistCell”;

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {

cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

}

if([parsedResponseData count]!=0)

{

// Configure the cell.

Artist *a = [parsedResponseData objectAtIndex:indexPath.row];

NSLog(@”artist name isin cellfor index path %@”,a.artistName);

NSLog(@”artist image link is %@”,a.imageName);

cell.imageView.image=[self displayImage:a.imageName];

cell.textLabel.text=a.artistName;

}

else

{

if(indexPath.row==0)

{

cell.textLabel.text=@”No Data”;

}

}

return cell;

}

 

To display images to UIImage of table view cell add and implement one more method

-(UIImage*)displayImage:(NSString *)imageUrl

{

NSData* imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:imageUrl]];

UIImage* image = [[UIImage alloc] initWithData:imageData];

return image;

}

Done 🙂

Note:Although you might expect some UI Freeze while scrolling as there is no Lazy Loding of image.To resolve this just keep it your uitableview scroll disable.

Hit run and  output looks like this

 

Artist List