Quantcast
Channel: Infragistics Community
Viewing all 2223 articles
Browse latest View live

Infragistics Web Design Council

$
0
0

Hey, do you know about the Infragistics Web Design Council? If not, read on!

What is the Infragistics Web Design Council?
It’s a select group of Infragistics customers who want to have early access to what we are working on to provide early feedback and help shape the Web products to better suit your needs.

Why join?
In this program, you will have access to exclusive information, early-preview software, and avenues of feedback. Under a mutual Non-Disclosure Agreement, we can more freely share information that is not released publicly yet and thereby better integrate you into our design and development process, which means you know what is coming and, more importantly, you get to help shape the future of Infragistics Web tools to maximize your productivity and effectiveness.

How does it work?
The primary mode of involvement is through a private mailing list. Once you are a member, you will be able to send to and receive from that list. When we are ready to share new software builds, we’ll email the list to let you know about it and how to get it, as well as the timeframe for feedback.

If you are interested, you can grab it, try it out, and let us know how you think it could be tweaked to help you and your company more.

We may also just ping you with general questions, maybe even share some prototypes, design docs, etc. Our goal is to get you involved more and earlier so that what we make is as close as it can be to what you need.

How much time does it take?
That’s pretty much up to you. It’s not going to be a high volume list most of the time. Traffic will come in spurts around when we send out questions/things for review. It’s totally up to you if you respond and participate at any given time.

Okay! How do I apply?
Send an email to igniteui [at] infragistics [dot] com with your customer information and asking to join our private Web Design Council. We will then pass along our mutual NDA form that we’ll need you to sign for your company and either scan and email or fax back to us. After that, we will add you to the email list, and you’re in!

(If you think you already are under an NDA with us, let us know who your account rep is so that we can verify.)

That’s it. We hope you will join—we want our customers to feel empowered to shape the future of Infragistics Web tools.

Oh, and by the way, another great way to contribute to the future of our products is by suggesting and voting on product ideas—we use that to help us prioritize what we do for you! Drop by any time—we want to hear from you!


Android L Developer Preview

$
0
0

During the Google I/O conference yesterday, Google revealed their brand new Android L Developer Preview. This is actually the FIRST time Google is releasing a developer preview, so it’s a pretty big deal.  Not only does Android L have a new enhanced look, but it also has deeper ties to the web making it more user friendly. 

For More In-Depth Info about Android L from Industry Pros, Check Out:

Releasing Update 1 for Indigo Studio (v3)

$
0
0

In version 3, we added the capability to create custom UI libraries using screenparts. If you haven't tried this yet, you are missing out :D.This was one of the top requested ideas. And with that, it's time to move on to even bigger and better things. Keep the ideas rolling in!

To kick off the "update" season for Version 3, we added the following new features in update 1:

  • Image thumbnails in the prototype viewer
  • New fonts for offline/online use in your prototypes
  • Minor UI improvements

Image thumbnails in Prototype Viewer

When we have shipped the Table of Contents in the prototype viewer, it showed the names of the screens. We figured viewing the screen thumbnails makes it a more recognizable experience. So now when you pull out the table of contents, you see screen names + thumbs. I know, not earth shattering, but it's a nicer experience.

Prototype Viewer Table of Contents

New Fonts for Designing Prototypes

Quite of few of you have been requesting more fonts for Indigo. It's not because we aspire to be stingy about this, but given the focus on rapid prototyping, we felt a smaller font list will be quicker to help you pick a reasonable one, and move on the bigger things :D. But we understand that sometimes fonts can set the mood, and may be important. With this update, we added support for Source Sans Pro, Roboto and Roboto Condensed.

Font Cards

There are a few reasons why we are adding fonts (and font weights in the future) carefully. A primary driver has been the need to embed fonts in the prototype so that we can support both offline and online uses. The last thing we want is you being unable to render the prototype correctly when offline. The other aspect we considered is that viewers of the prototype may not have the prototype font, and license restrictions may prevent us from embedding it. In either case, we are exploring ways to incorporate more open fonts and use it seamlessly whether online or offline. For now, your viewers will see exactly the same font you designed with.

Minor UI Improvements

  • The lock and visibility icons were tweaked to better communicate its current state.
  • The IX explorer is now visually integrated with the state name.

How to Get This update?

Here's how to update the version of Indigo Studio installed on your machine:

  • If you have the option to automatically check for updates on startup checked, you should see a dialog box pop up when you launch Indigo. Simply click update, and Indigo Studio will do the rest. This is the easier approach.
  • If for some reason you chose not to automatically check for updates, go to MENU > HELP & ABOUT and use the "CHECK FOR UPDATES" option. Checking for Updates

About Indigo Studio for Interaction Prototyping

Don't have Indigo Studio? Download a free 30-day trial which will let you try all of the prototyping goodness.

Download Indigo Studio

Looking to suggest improvements and new ideas for Indigo Studio?

Submit a new idea

If for some reason you are having trouble with Indigo Studio, check out our help topics, forums or contact support.

Get Support

Follow us on Twitter @indigodesigned

Releasing Update 2 for Indigo Studio (v3)

$
0
0

In this update, we added several visual improvements to the look and feel of Indigo Studio in addition to adding some requested features. These include the following:

Project Home UI Tweaks

We finally got around to making some UI improvements to the project home. This involved making some of the toolbar actions more obvious.

The RUN button has a more consistent position in the app overall. We made the search feature more prominent and also unified the look of the design thumbnails and titles. Let us know how it's working our for you.

AFTER Update 2, your project home should look like this: Project home-after

This is how it looked BEFORE:Project-home-before

And by the way, the project home will remember the sort order when you relaunch the app (i.e., by name, recently changed).

Clipboard Paste for Images

Quite a few of have been using tools like snagit to capture screenshots. A lot such tools copy the image captured to the clipboard. So we have now made it easier for you to quickly paste it inside Indigo Studio without have to explicitly save this image first.

clipboard paste

This works with other image editing tools as well (e.g., Preview on OSX, GIMP, MS Paint). When editing an image, you can select a region, copy it and paste it on the Indigo Studio design surface.

Recently Used Colors and Eye-Dropper

This feature does not need much explanation :D. It would suffice to say that with addition of recent colors (row), you don't have to look up the color values ;).

color picker

The eye-dropper, like in other tools, will let you sample and match colors from other images or colors on the design surface.

Recently Used Fonts and Font Picker

In update 1 (for v3), we introduced three new fonts. With update 2, once you pick a font, Indigo will remember it for the project. So if you started with Roboto, you can continue to create new text based elements without having to set it again.

font picker

On a related note, we minimized the font list when you initially load it up. This way you don't have to hunt for the new fonts we added. The open fonts we have selected to include for now are pretty resilient and should serve you well. You can, of course, expand to view all the supported fonts. Indigo warns you about unsupported system fonts (on OS X).

How to Get This update?

Here's how to update the version of Indigo Studio installed on your machine:

  • If you have the option to automatically check for updates on startup checked, you should see a dialog box pop up when you launch Indigo. Simply click update, and Indigo Studio will do the rest. This is the easier approach.
  • If for some reason you chose not to automatically check for updates, go to MENU > HELP & ABOUT and use the "CHECK FOR UPDATES" option.

Checking for Updates

About Indigo Studio for Interaction Prototyping

Don't have Indigo Studio? Download a free 30-day trial which will let you try all of the prototyping goodness.

Download Indigo Studio

Looking to suggest improvements and new ideas for Indigo Studio?

Submit a new idea

If for some reason you are having trouble with Indigo Studio, check out our help topics, forums or contact support.

Get Support

Follow us on Twitter @indigodesigned

SQLSaturday #313 Rheinland, Germany – Event Recap

$
0
0

Infragistics Inc. was a sponsor of SQLSaturday #313 Rheinland, Germanu. Company provided licenses for the event raffle.  

Infragistics also was presented at SQLSaturday Rheinland by me by me as a speaker.

The event was held on Saturday, June 28th  at Hochschule Bonn-Rhein-Sieg Campus Sankt Augustin ( an university in Sankt Augustin, near Bonn, Germany).

There also was a big data hackathon, organized during the previous day – 27th of June.

Administrators of the conference were Olivel Engels , Tillmann Eitelberg and  Kostja Klein .

They organized an amazing team of volunteers who did an  awesome event.

This was the first Microsoft Data Platform event with Infragistics in Germany. Infragistics Inc. was the only one component vendor with a speaker at the conference. Participants gave a good feedback about the company presentation.  There was also an interest in the  Infragistics solutions, related to Development Tools,  Data Visualization and Business Solutions. Infragistics presentation samples for Node.js and SQL Server  included solutions implemented with the company products like  Ignite UI. Hope in the near feature to have more closer contacts with professionals, community  members and companies from this region.

Summary:

  • There was 31 presentations in 5 tracks.
  • More than 250 attendees
  • 28 Speakers from 10 countries: Austria, Denmark, UK, USA, Slovenia, Bulgaria, Russia, Portugal, France and Germany

 

A Big Data Hackathon before SQLSaturday Rheinland

 

 

SQLSaturday Rheinland sessions…

 

 

 

During the breaks…

 

and more…

 

Infragistics participation in the event:

Follow news from Infragistics for more information about new Infragistics events.

As always, you can follow us on Twitter @mihailmateev and @Infragistics and stay in touch on Facebook, Google+ andLinkedIn!

 

VIDEO: Exploring the WPF Ribbon Control

$
0
0

In this video, we're going to take a look at the new XAM ribbon and XAM ribbon window features that have been added in Infragistics Ultimate 14.1 to help give your applications a Microsoft Office 2013 look and feel.

[youtube] width="640" height="360" src="http://www.youtube.com/embed/e_fhsVAEkM8" [/youtube]

TRANSCRIPT:

Here we have an existing WPF application that uses a ribbon and a XAM ribbon window. As you can see, we have a home tab with a few buttons, as well as, the Office 2010 blue theme applied.

If we run the application, we'll notice that we have our XAM ribbon window, and we also have a Backstage, which mimics the Office 2010 backstage.

In order to give this application a new Office 2013 look and feel, the easiest way to do that is to simply set the theme property of the XAM ribbon to Office 2013. Immediately, you're going to see the designer reflect a clean, modern Office 2013 look and feel.

Now when we run the application, you’ll notice that the application now has the Office 2013 look and feel. It also has the new Office 2013 backstage. (You can see with the back arrows how you would now escape the backstage. ) But pay specific attention to the window chrome. The chrome also has the new Office 2013 window look- that clean, modern, thin border around the window chrome.

But that's not all we can do with this. Let's say that we want to change the accent color of our ribbon and window chrome. We can change the accent color application by setting the “application accent color” property to a value of our choice. For example, let's look at what red looks like. By setting that single property, we've now changed the color of the border of our chrome of the window, as well as the backstage and file/menu options.

Another feature that's been added in 14.1 is what's called a “tap item tool bar”. Due to time constraints, I'm going to go paste in some pre-existing code. As you can see, I've created a new tab item area tool bar object: a “stack panel”, which contains a toggle button that has a control template. Basically what we're doing is mimicking that login functionality that you’ll find in current Microsoft Office products.

So now when I run this application, we’ll see that we now have this tab item area tool bar available to our end users. Notice that when I show the backstage, it stays in view just like the current Office products behave.

You could put any control you want in this area. You're not limited to specific object types here. You’ll also notice that this tab item area tool bar has an overflow. So when you minimize or resize your window, you have an overflow icon that allows you to access those items that you have placed in your tab item area tool bar.

Now, all these features are great for the main window of your application, but what about all the other dialogs and windows that show throughout your application? Luckily, you can easily apply the same window chrome to all the other windows by simply removing the ribbon.

Let's remove all that work we just did - we'll remove the ribbon and now we're going to set the theme property on the ribbon content host of the XAM ribbon. We'll set it to Office 2013 and run the application.

Even though we're not using the ribbon, we can still use the XAM ribbon window without a ribbon in order to give the rest of the windows, dialogs and pop-ups within our application a similar Office 2013 look and feel. This keeps your application consistent, and looks great.

You can also modify the application accent color by setting the application accent color property. But in this case, we have to use an attached property. We're going to say “ribbon window content host dot application accent color” and we'll just choose red again. We'll run the application again, and as you can see, we now have our XAM ribbon with no ribbon, but we're still able to leverage our accent color to keep our application consistent with the main window of our application!

How to Create a Quick Access Toolbar

$
0
0

In our latest how-to video, we show you how to create an Office-inspired Windows Forms application, complete with a Quick Access Toolbar! Check it out: 

[youtube] width="640" height="360" src="http://www.youtube.com/embed/CYQ7dR_gijE" [/youtube]

TRANSCRIPT:

First, we’ll open up Visual Studio, and go to "File," "New," "New Project," and start with the Windows Forms application. First let's make it larger. To start, we’re going to go to the Toolbox to add the UltraToolbarsManager. When we add that to the form, we're going to get prompted: do we want to add a Panel control? Let’s say yes and add a Panel control to the form, which is going to hold our control. We'll pick the middle option which is the lighter-weight Panel control.

So now what we’ll do is click "Show Ribbon" and right here at the top is a Quick Access Toolbar. To add a new tool here, simply click "Insert New Tool" and it's going to be type “button”, and let’s select “Cut”. At this point, let’s go ahead and add a little Cut button, like Cut and Paste. We’ll hit "Add" and "Close," and now you'll see that the button was added here but it has no image. So let's go ahead and add an image! We’ll right click on that, and under Images, I'm going to say "Set Small Image". I’ll navigate to an image - for a small button, you're going to want to use the image of size 24 x 24. So I’ll select the image called Cut. Click "OK," and click "OK" again, and there you have it. Now, you can see we have a Quick Access Tool right here: Cut. We’ll hit F5 to see what it looks like – and great! It looks good to me!

Now, the only thing we need to do is to handle the click event, and there’s a really easy way to do that. Click on the UltraToolbarsManager, open up the properties, and at the bottom right you'll notice “Generate Tool Click Code”. Let’s click that. Right now, I only have one command but just imagine if you had around 10 or 20 commands here. You're going to hit "Select All" and on the right, you'll see that the code is generated to handle that click event. So we’ll say Select All, Copy To Clipboard, close this, and now we need to get inside that click event of the toolbar. So let's double click to get to the UltraToolbarsManager_ToolClick event. Here we'll paste in our code that was generated for us.

Basically, here's what's happening: in this event, you get a ToolClickEventArg and you're basically just interrogating that object and looking at the key property and doing a case statement, so you might have a case for a copy, case for paste, etc. In this example, we're just going to have a cut, so let's just throw up a quick message - that looks good to me! Now let's hit F5, and there we go! I've gotten a Quick Access Tool here. I'll click it, and there we go. You can see that we've successfully invoked our code and that's all there is to it. To add more, you simply click on that new icon right next to it and just continue adding.

How to Create an Office-Inspired Ribbon

$
0
0

In this video, we walk through the steps you'll need to take to create a Windows Forms application with a Microsoft-Office-inspired ribbon. Check it out below:

[youtube] width="640" height="360" src="http://www.youtube.com/embed/nu15-C43Fgg" [/youtube]

TRANSCRIPT:

Before we get started, I’m just going to pull up Microsoft Word to point out some of the pieces of the ribbon and talk about the object hierarchy.

At the top here you have the quick access toolbar, which is used to hold tools and commands that are available to your end user regardless of whatever tab they’re on, and regardless of whatever context they’re in.  Below that you have the ribbon itself, which is composed of tabs.  Each tab has one or more groups, such as clipboard, font, paragraph, et cetera, and each group has one or more tools, such as paste, cut and copy.

Now, let’s go ahead and open up Visual Studio and start building this app. We’re going to start by creating a new Windows Forms project.  I’m just going to go ahead and use the defaults, so I’ll hit okay.  The first thing that we’re going to do is make the form a little bit bigger to hold our toolbar.  To achieve that ribbon, the first thing that you should do is go to the toolbox and search for the UltraToolbarsManager and double click it.

Now that that’s added to the project, the first thing that happens is that you’re going to be prompted to add a panel. We’ll choose the middle option, which adds a lightweight panel control.

To start building the ribbon, let’s click show ribbon, and to create a new tab, click this button right here. Right away, you have your first tab. Again, in this video, we’re trying to build something very similar to Word, so let’s go ahead and just start building it out.

Here you have our first tab.  I’m going to hit F4 to bring the properties up, then I’ll choose select object, and we’ll see that the caption is “ribbon one” – let’s change that to “home”. Under home, you’ll see one group called ribbon group one.  Again, we’re just going to click this, hit F4, and change the caption.  We’ll call this clipboard.

Next we’re going to add the tools “paste, cut and copy” to this clipboard group of the tab called home.  We’re going to click insert new tool, and create three buttons. The first one will be called paste.  The next one will be called cut.  Finally we’ll do copy.  Now that we have our tools established, which are going to be “button”, let’s go ahead and configure that.

For the paste button, we want that to be large, and we want cut and copy to be small.  To do that, we right click on paste, choose preferred size, select large, and then we’re going to set its image by right clicking on it and clicking set large image.  We can import an image for a large tool button, so we’re going to want to use an image that’s 32 by 32.  Once we find that, we’ll use that as “paste” and it’s large, just like we wanted.

Now, let’s quickly do the same thing for cut and copy, but in this case we’re going to leave them at default size, a small image. We’ll do the same thing and import, look for “cut”, and again we’re going to use 24 by 24 because it’s going to be the smaller version.  Now we have cut. Let’s just quickly do the same for copy.  Set small image, import, and let’s find copy.  And there we go! Now we have paste, cut and copy. 

Let’s just hit F5 and run this to see what it looks like so far.  Here we have our ribbon and we have paste, cut and copy.  It looks perfect.  Now all we have to do is figure out how to get to the click event to actually wire up our logic.  There’s a very easy way to do this.  I’m going to click on UltraToolbarsManager, hit F4 to bring up properties, and right over here, at the bottom, you’ll see generate tool click code.  I’m going to click that. Here you can see I’ve got a list of all of my commands.  I’m going to click select all, and you’ll see that there’s going to be some code generated for me.

I’ll select all, copy to clipboard, hit close, and now just simply do a quick double click on the ribbon, and you’ll see the click event, with the UltraToolbarsManager.  We’ll go ahead and paste in the code, and do a quick test here. That looks good to me!

Basically, what’s passed in is this ToolClickEventArgs, and you’re just interrogating the key.  Based on the key, you’re going to write some code to handle it.  In this case we’re just handling paste.  Let’s hit F5, and there we go.  That’s all there is to it!


Infragistics WinRT SR Notes – July: 14.1, 13.2, 13.1

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

WinRT 2014 Volume 1 Service Release (Build 14.1.20141.2082)

Notes in PDF Format
Notes in Excel Format

WinRT 2013 Volume 2 Service Release (Build 13.2.20132.2094)

Notes in PDF Format
Notes in Excel Format

WinRT 2013 Volume 1 Service Release (Build 13.1.20131.2278)

Notes in PDF Format
Notes in Excel Format

Infragistics WinPhone SR Notes – July: 14.1

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

WinPhone 2014 Volume 1 Service Release (Build 14.1.20141.2071)

Notes in PDF Format
Notes in Excel Format

Absolute beginner's guide to C#

$
0
0

C# is an object oriented programming language developed by Microsoft. The C# language is designed to be platform independent, and borrows its syntax heavily from both Java and C++ (so any experience of those languages will help those starting out). The name comes from the musical notation, and indicates a progression or incremental verison of C++.

C Sharp (programming language)C# is part of the wider Microsoft .NET Framework. The .NET framework is a set of libraries and standards that can be used across a variety of languages (including C#). The framework offers support for a number of user interface, data access and web application libraries and is the primary means of creating modern Windows applications.

Why use C#?

C# has become the goto language for Windows application developers for a number of reasons. Firstly it is heavily promoted in this way by Microsoft, and they offer a strong suite of tools to support it - Visual Studio being the most obvious example.

C# is also a popular language for projects involving the .NET Framework. Included with the Windows operating system (Windows Server 2008 and Windows Vista shipped with .NET 3.0. Version 3.5 was included with Windows 7 and Windows Server 2008 R2. Windows 8 includes version 4.5 by default) .NET has been adopted as somewhat of a standard for applications on the platform.

The .NET framework has been implemented on other platforms (such as Linux), by the Mono Project, so those wanting to develop away from Windows have options. Xamarin also offer a number of products that allow developers to create mobile applications in C#. Microsoft recently unveiled news of a new open source compiler for .NET called Roslyn with which they are plotting the future of both Visual Basic and C#.

Performance wise C# was never designed to challenge languages like C or C++, running as it does on top of a ‘Just In Time’ (JIT) compiler (Languages like C++ are compiled for specific platforms). Its design goals are centered more around sound object oriented principles, and providing resilience and relatively easy debugging. That said for hardware independent projects it is a more than capable modern language. Rosyln is part of a wider project by Microsoft to open source a lot of its development technologies, which many expect will help improve both compatibility and performance in the future.

Useful tools to look out for

Visual Studio (more information on Update 2 for Visual Studio 2013 here) is the obvious tool for anyone wanting to get serious about C# development. As well as offering the features you would expect (syntax highlight, intelligence, integration with other Microsoft tools and technologies) it is also extremely well supported by the wider development community. 

However Visual Studio is far from the only tool the budding C# developer should be aware of. Here are a couple more:

  1. User interface developer tools from Infragistics - Our own set of tools are perfect for anyone getting serious about C# Development. Our Windows Forms tools are particularly popular with C# developers.
  2. Reshaper - Code refactoring and inspection all integrated into Visual Studio. A very useful tool.
  3. GhostDoc - A Visual Studio extension to aid code documentation.

More information

Hopefully this article has given you a good feel for C#, what it is, and how you can make it work for your projects. Those wanting to continue their education should have a look at the following links and resources:

  1. Our blog - The Infragistics blog contains a wealth of useful information for the budding C# developer.
  2. The Scott Hanseman Blog - Scott works on the web platform team at Microsoft and runs a well known blog covering a host of technical subjects. Well loved by developers, there are always interesting posts covering C# and the .NET framework.
  3. Visual C# resources from Microsoft - A great set of guides for those just starting out.
  4. Bill Wagner blog - Bill is a C# MVP (Microsoft ‘Most Valued Professional’) and the author of many C# books. His blog is very in-depth, and often technical, but is a valuable resource from a real subject matter expert.

NucliOS Release Notes - July: 13.2.179, 14.1.79 Service Release

$
0
0

Introduction

With every release comes a set of release notes that reflects the state of resolved bugs and new additions from the previous release. You’ll find the notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release Notes: NucliOS 2013 Volume 2 Build 179 and NucliOS 2014 Volume 1 Build 79

ComponentProduct ImpactDescriptionService Release
IGPieChartViewBug Fix

Labels don't resize properly when their text is overridden.

Note: When using the IGPieChartView delegate method to change labels, new labels will get repositioned based on the new text.

13.2.179, 14.1.79
IGPieChartViewBug Fix

During initial rendering, the label that is set via the delegate method is not used by the legend.

Note: The legend now picks up pie slice labels set in the delegate.

13.2.179, 14.1.79
IGChartViewBug Fix

Null reference exception tapping a spot around the axis labels.

Note: Added null checks to chart's hit testing.

13.2.179, 14.1.79
IGChartViewBug Fix

De-allocating the chart can cause a crash in handleGridAreaRectChanged method.

Note: Fixed a weak reference being created while the chart is deallocating.

14.1.79
IGChartViewBug Fix

The tapForSeries method is not called after adding and removing the series multiple times.

Note: Fixed an issue that caused the chart to return wrong series index when hit testing.

13.2.179, 14.1.79
IGChartViewBug Fix

Legend markers are not shown when the chart uses custom markers.

Note: Added a new delegate method that gets called for the legend item badges.

chartView:viewForLegendItemInSeries:

This is only used when showing custom markers.

13.2.179, 14.1.79
IGChartViewBug Fix

Crash occurs when binding a data model greater than 2500 data points.

Note: Fixed memory allocation bug when inserting a range of values.

13.2.179, 14.1.79
IGChartViewBug Fix

DashArray property has no effect for IGScatterLineSeries.

Note: Scatter line series will correctly show stroke dash array and stroke dash cap.

13.2.179, 14.1.79
IGChartViewBug Fix

The method insertItemAtIndex doesn’t consider the source parameter and inserts all point in all sources.

Note: Fixed a case when two series start out empty, inserting into one series will also insert into the other.

13.2.179, 14.1.79
IGChartViewBug Fix

NSRangeException is thrown when trying to add values to an empty AsyncDataSourceHelper.

Note: Fixed an index out of range exception in async helper.

14.1.79
IGCalendarViewBug Fix

Appointments spanning over two months are shown only in the month they start.

Note: N/A.

13.2.179, 14.1.79
IGChartViewBug Fix

IGValueOverlay doesn’t work with DateTime axis.

Note: IGValueOverlay now works with the IGCategoryDateTimeXAxis.

13.2.179, 14.1.79
IGCalendarViewBug Fix

Appointments overlap when there is a 5th week displayed in the MonthView.

Note: N/A.

13.2.179, 14.1.79
IGChartViewBug Fix

Not being able to get a fragment series inside the chartView:viewForMarkerInSeries method.

Note: Added a property to the options parameter that returns a stacked fragment.

13.2.179, 14.1.79
IGOverlayViewBug Fix

When rotating the screen the IGOverlayView is not resized properly.

Note: The IGOverlayView now properly resizes when in landscape orientation.

13.2.179, 14.1.79
IGChartViewBug Fix

ReverseLegendOrder doesn’t work for IGStackedColumnSeries.

Note: ReverseLegendOrder will reverse the stacked series items in the legend.

13.2.179, 14.1.79
IGChartViewBug Fix

Exception raised when using autolayout and NAN values.

Note: Having NANs is the datasource no longer crashes the chart.

13.2.179, 14.1.79
IGCalendarViewBug Fix

Larger font makes day numbers unreadable.

Note: N/A.

13.2.179, 14.1.79

By Torrey Betts

Dealing with Node.js and Microsoft SQL Server: Part-2

$
0
0

In the previous post we did an overview of the different Node.js drivers for Microsoft SQL Server. There was a comparison between different modules for SQL Server and were considered and their advantages and disadvantages

Developers who work mainly with Node.js and open source technologies have experience how to build and debug Node applications.  People, dealing with Microsoft SQL Server usually have more experience with Visual Studio and Microsoft platforms. It is also possible to use SQL Server Data Tools with VS

 

Node.js Tools for Visual Studio:

Node.js Tools for Visual Studio is a good solution if you want to get advantages from both – Node.js and SQL Server ( it is not a requirement – it just make development suing both technologies easier ).

The first public Alpha is released in November, 2013. Beta 1.0 is available from April, 2014 and in July is relapsed Beta 2.0

 

 

Node.js Tools for Visual Studio, aka NTVS, is a free/OSS plug-in that turns Visual Studio into a Node.js IDE. It only takes a few steps to get setup so let's jump right into it.

You need to have installed:

 

 

NTVS supports Editing, Intellisense, Profiling, npm, TypeScript, Debugging locally and remotely (Windows/ Mac OS /Linux), as well Azure Web Sites and Cloud Service.

It id designed, developed, and supported by Microsoft and the community.

 

The interactive window is part of NTVS

 

IntelliSense exposes results of analyzing your programs in three different forms: completions, signature help, and quick info.

 

Node.js Tools allows you to create projects using the Visual Studio project system. Project files (.njsproj) reference all the source and content files associated with your project, showing them all in the Solution Explorer window and enabling NTVS to most efficiently work with your files.

 

 

You can use templates to create Node.js projects – console applications, web applications, Node.js + Express apps and Microsoft Azure Node.js apps/

 

You can also use the integrated debugger in Visual Studio

 

Below you can find examples how to start with the most popular Node.js drivers for Microsoft SQL Server

 

  • node-sqlserver-unofficial

 

The connection string – the example is given with Azure SQL database, but you can adapt it for SQL Server on premises.

   1:var sql = require('node-sqlserver-unofficial');
   2:  
   3:var conn_str = "Driver={SQL Server Native Client 11.0};
   4: Server=tcp:[database-server].database.windows.net,1433;
   5: Database=[your-database];
   6: Uid=[user]@[database-server].database.windows.net;Pwd=[your-password]; 
   7: Encrypt=yes; Connection Timeout=30;";

 

Create query using Node.js and node-sqlserver-unofficial

   1: sql.query(conn_str, "SELECT TOP 10 FirstName, LastName FROM Person.Person", function (err, results) {
   2:if (err) {
   3:         res.writeHead(500, { 'Content-Type': 'text/plain' });
   4:         res.write("Got error :-( " + err);
   5:         res.end("");
   6:return;
   7:     }
   8:     res.writeHead(200, { 'Content-Type': 'text/plain' });
   9:for (var i = 0; i < results.length; i++) {
  10:         res.write("FirstName: " + results[i].FirstName + " LastName: " + results[i].LastName );
  11:     }
  12:     res.end("; Done.");
  13: });

 

  • tedious

 

Configuration – how to configure credentials for SQL Server Database with Node.JS + tedious

 

   1:var Connection = require('tedious').Connection;
   2:var Request = require('tedious').Request; 
   3:var config = {
   4:  server: '[db-server].database.windows.net',
   5:         userName: '[user]@[db-server].database.windows.net',
   6:         password: [password],
   7:         database: ' [database] ' ,
   8:         encrypt: true// for Azure users
   9: }

 

NTLM support just landed in Tedious driver :

nerdventure.io/sql-server-and-node-js

 

Execute query using tedious.

   1:function executeStatement() {
   2:   request = new Request( "select 42, 'hello world'", function(err, rowCount) {
   3:if (err) {
   4:       console.log(err);
   5:     } else {
   6:       console.log(rowCount + ' rows');
   7:     }
   8:     connection.close();
   9:   });
  10:
  11:   request.on('done',function(rowCount, more) {
  12:     console.log(rowCount +' rows returned' );
  13:   });
  14: connection.execSql(request);
  15: }

 

Creating a connection to SQL Server using tedious.

   1:var connection = new Connection(config);
   2:  
   3: connection.on('connect' , function(err) {
   4:// If no error, then good to go...
   5:     executeStatement();
   6:   }
   7: );

 

Insert Query, using tedious Node.js driver.

   1: connection.on('connect', function(err){
   2:var request = new Request("INSERT INTO MyTable (uniqueIdCol, intCol, nVarCharCol) VALUES (@uniqueIdVal, @intVal, @nVarCharVal)",
   3:function(err){
   4:if(err){
   5:             console.log(err);
   6:         };
   7:     });
   8:  
   9:     request.addParameter('uniqueIdVal', TYPES.UniqueIdentifierN,'ba46b824-487b-4e7d-8fb9-703acdf954e5');
  10:     request.addParameter('intVal', TYPES.Int, 435);
  11:     request.addParameter('nVarCharVal', TYPES.NVarChar, 'hello world');
  12:  
  13:     connection.execSql(request);
  14: });

 

  • tedious-ntml

Tedious-ntlm is a  forked version of Tedious is a work in progress towards NTLM authentication.

Sample connection string is demonstrated below:

 

   1:var tds = require("tedious-ntlm");
   2:  
   3:var config = {
   4:     userName: 'dba',
   5:     domainName: "mydomain",
   6:     password: 'mypassword',
   7:     server: 'mssql-server',
   8:     options: {
   9:         instanceName: "SQL_Instance_Name",
  10:         database: "DemoDB",
  11:         debug: {
  12:             packet: false,
  13:             payload: false,
  14:             token: false,
  15:             data: false
  16:         },
  17:         encrypt: true
  18:     }
  19: };

 

  • Edge.js and edge-sql

 

Connection string / using environment variables

This is the default approach when you are using edge-sql

   1: SETX EDGE_SQL_CONNECTION_STRING "Data Source=localhost;Initial Catalog=node-test;Integrated Security=True"
   2:  

 

Query MS SQL Server directly using Edge.js

   1:var getTopUsers = edge.func('sql', function () { /*
   2:    SELECT TOP 5 * FROM SampleUsers ORDER BY CreateDate DESC
   3:*/ });

 

Query SQL Server directly using Edge.js / code to set the connections in Node.js

   1:varparams = {
   2:     connectionString: "Data Source=IGBGSOFEV06\\SQLEXPRESS;Initial Catalog=NodeJS;Integrated Security=True“ ,
   3:     source: "SELECT TOP 5 * FROM SampleUsers ORDER BY CreateDate DESC"
   4: };
   5:  
   6:var getTopUsers = edge.func( 'sql‘ , params);

 

Handle query results ( edge-sql )

   1: getTopUsers(null, function (error, result) {
   2:if (error) { logError(error, res); return; }
   3:if (result) {
   4:         res.write("<ul>");
   5:         result.forEach(function (user) {
   6:             res.write("<li>" + user.FirstName + " " + user.LastName + ": " + user.Email + "</li>");
   7:         });
   8:         res.end("</ul>");
   9:     }
  10:else {
  11:         res.end("No results");
  12:     }
  13: });

 

 

  • Execute .NET code to query SQL Server

 

Edje.js ia a Node.js module, providing native binding to .Net world:

 

   1:var edge = require('edge') 
   2:var hello = edge.func(function() {/* async (input) => {
   3:    return ".NET welcomes " + input.ToString();     
   4:}*/})
   5: hello('Node.js', function(error, result) { 
   6:     error && throw error 
   7:     console.log(result)
   8: })

 

It is possible to create .NET library, implementing any queries, that you can create in .NET with ADO.Net and after that to import this library in your Node.js project and invoke methods using Edge.js module.

 

Create a .NET class library

   1:publicclass CSSample
   2:     {
   3:public async Task<object> Invoke(object input)
   4:         {
   5:             ....
   6:         }
   7:  
   8:public async Task<List<SampleUser>> QueryUsers(int pageNumber, int pageSize)
   9:         {
  10:             ....
  11:         }
  12:     }

 

   1:publicclass SampleUser
   2:     {
   3:publicint Id { get; set; }
   4:publicstring FirstName { get; set; }
   5:publicstring LastName { get; set; }
   6:publicstring Email { get; set; }
   7:public DateTime CreateDate { get; set; }
   8:     }

 

Import the .Net assembly and use it’s API in Node.js + Edge application  ( you should specify the method, that will be invoked )

   1:// Set up the assembly to call from Node.js
   2:var querySample = edge.func({
   3:     assemblyFile: 'EdgeSampleLibrary.dll',
   4:     typeName: 'EdgeSampleLibrary.CSSample',
   5:     methodName: 'Invoke'
   6: });

 

Invoke a specified method from Node.js

   1:// This is the data we will pass to .NET
   2:var data = { pageNumber: 2, pageSize: 3 }
   3:  
   4:// Invoke the .NET function
   5: querySample(data, function (error, result) {
   6:     ....
   7: });

 

 

The use of Node.js, Visual Studio and SQL Server makes it easy and flexible the creation of multiplatform data centric applications (on premises and in the cloud).

In the next part of this article you can learn how to use Node.js module for Microsoft  SQL Server / Azure SQL Database in Microsoft Azure applications (Azure Web Sites and Azure Cloud Services ). We will take a look at the best practices and cover different use cases.

 

 

If you want more information about how to use Microsoft SQL Server & Node.js feel free to contact me at mmateev@infragistics.com

You can learn more about Azure Bootcamp Bulgaria if you follow us on Twitter @mihailmateev  and @Infragistics and stay in touch on Facebook, Google+, LinkedIn and Infragistics Friends User Group !

Developer News - What's IN with the Infragistics Community? (7/14-7/20)

CloudConf Varna 2014 – Event Recap

$
0
0

The event was held on Saturday, July 26th at Best Western Park, Varna , Bulgaria. Cloud Conf  is a community event, a of the Bulgarian independent IT communities from Varna. This conference includes sessions, related to different cloud solutions based on  : Microsoft Azure, Amazon EC2, App Horbour, Heroku etc. The event also includes conceptual talks about the cloud technologies.

The main organizers  of Varna Conf were BeLean and AltScale . The event administrator was Nikolay Mitev.

Infragistics was presented by me as a speaker - Spatial Data and Microsoft Azure SQL Database

 

The CloudConf keynote:

 

CloudConf sessions:

 

 

 

 

Summary:

  • There was 6 presentations 
  • Around 70 attendees .
  • Cloud Conf Varna is the only one conference in Bulgaria, focused on Cloud In general (not on specific implementation)
  • The conference was the biggest cloud event in Bulgaria outside Sofia.

 

Infragistics participation in the event:

 

 

Follow news from Infragistics for more information about new Infragistics events.

As always, you can follow us on Twitter @mihailmateev and @Infragistics and stay in touch on Facebook, Google+ andLinkedIn!

 


How to rebrand exported documents with ReportPlus

$
0
0

ReportPlus version 3.0 added several options when it comes to exporting a dashboard. Previously it was only possible to generate a PowerPoint file, while now it´s possible to choose between PDF, Word, and CSV files as well. For each widget in a dashboard a new document page, or slide in the case of a PowerPoint is generated. In the case of CSV files, for each widget a new csv file is created and they are all packed in one zip file.

Despite the export choice, by default all exported documents display the logo of ReportPlus, and use a light shade of blue as the corporate color. Since version 1.0 one of the most repeated pieces of feedback we’ve heard from our user base was to allow for end users to be able to change the logo and color used to match their own company logo, and aesthetics. We’ll, I’m glad to tell you that now that is possible with version 3.0.

Export Settings

The first dialog displayed when you tap on the Export item of the Actions menu, shows the export formats available to choose from.

Export

If you pay attention there’s a new option on the top right of that dialog, which reads “Settings”. By tapping on this option we access the Export Settings dialog, which allows the following configurations:

  • Author Name, used as footer in PDF and Word document formats.
  • Company Name, used if the company logo is left empty.
  • Company Logo. Image to be displayed in the header of the exported document.
  • Company Color. Color used to render the title, and a separator line.
IMG 1222

By changing this attributes we can customize the look of the generated document.   The following are some examples of rebranded exported documents.

IMG 1228IMG 1230IMG 1227

Advanced Export Settings

Export settings also allow you to customize how information is trimmed when it comes to generating the document. For instance widgets may have data sets with tens of columns but it’s usually more confusing than anything else showing more than 7 (plus or minus 2 J ) columns. So ReportPlus allows you to top how many columns are generated in the document regardless of the volume of the data set used. The same goes for the number of rows generated in the document.

Annotating Exports

Beyond the new export rebranding support, version 3.0 introduces the ability to make annotations on top of the exported images. If you tap the detail of a page in the export wizard you are now presented with a new button labeled “Annotate” which allows you to add notes and shapes on top of the image to introduce another layer of information, providing more context, and allowing pay attention to the one important detail.

IMG 1223

Closing thoughts

Dashboards are dynamic, interactive, and meant to be understood at a glance, but sometimes you need to be able to communicate status in a different format. There are times when that message crosses organizational boundaries, or is meant to be archived and become a formal witness of the status of things at one point in time. For all these scenarios ReportPlus allows you to go from dynamic and interactive dashboards to documented and detailed reports that can be annotated and shared. As we’ve seen in this article, with ReportPlus version 3.0, the available options for these “reporting” scenarios have been expanded considerably.

Developer News - What's IN with the Infragistics Community? (7/21-7/27)

How to manage Microsoft Azure Table Storage with Node.js

$
0
0

Node.js is one one of the the most popular growing platforms for development.  I started a series of posts dedicated to Node.js , starting with two articles about Node.js and Microsoft SQL Server ( you can see part 1 and part 2 ) .  This blog discusses how you can use Node.js and Microsoft Azure Table Storage . Open source solutions (OSS),  are very suitable for the implementation of platform independent and/or cloud applications. Node.js is widely used in the actual implementation of such cloud applications. I will try demonstrate in several blogs some details how to use Node.js with  Microsoft Azure Storage .

 

What is Azure Storage?

Microsoft Azure storage services allow us to store/retrieve the NON RELATIONAL data to/from Microsoft Cloud environment. (For relational data, SQL Azure services are used).

In Microsoft Azure Storage, the data can be stored in 4 different formats (v.i.z. Blobs, Tables and Queues, File Storage (in preview )). The retrieval/storage of the above data is done in RESTful way.

  • Blob storage stores file data. A blob can be any type of text or binary data, such as a document, media file, or application installer.
  • Table storage stores structured datasets. Table storage is a NoSQL key-attribute data store, which allows for rapid development and fast access to large quantities of data.
  • Queue storage provides reliable messaging for workflow processing and for communication between components of cloud services.
  • File storage offers shared storage for legacy applications using the standard SMB 2.1 protocol. Azure virtual machines and cloud services can share file data across application components via mounted shares, and on-premise applications can access file data in a share via the File service REST API.

 

 

This article is focused on how to handle Azure Table services with Node.js

 

Table Storage

The Azure Table storage service stores large amounts of structured data. The service is a NoSQL datastore which accepts authenticated calls from inside and outside the Azure cloud.

The Table service contains the following components:

 

 

Table Entities:

Table entities represent the units of data stored in a table and are similar to rows in a typical relational database table. Each entity defines a collection of properties. Each property is key/value pair defined by its name, value, and the value's data type. Entities must define the following three system properties as part of the property collection:

  • PartitionKey– The PartitionKey property stores string values that identify the partition that an entity belongs to. This means that entities with the same PartitionKey values belong in the same partition. Partitions, as discussed later, are integral to the scalability of the table.
  • RowKey– The RowKey property stores string values that uniquely identify entities within each partition.
  • Timestamp– The Timestamp property provides traceability for an entity. A timestamp is a DateTime value that tells you the last time the entity was modified. A timestamp is sometimes referred to as the entity's version. Modifications to timestamps are ignored because the table service maintains the value for this property during all inserts and update operations.

 

Consider PartitionKey, RowKey in your design. Think of PartitionKey and RowKey as being a primary index.

 

Table Partitions:

Azure Tables use keys that enable efficient querying, and you can employ one—the PartitionKey—for load balancing when the table service decides it’s time to spread your table over multiple servers. A table doesn’t have a specified schema.

 

 

Partitions represent a collection of entities with the same PartitionKey values. Partitions are always served from one partition server and each partition server can serve one or more partitions.

 

 

Dealing with an Azure Table Storage

You can use different NodeJS packages to handle Azure Table Storage. In this post we will cover azure and azure-table-node Node packages.

 

  • Microsoft Azure SDK for Node.js

It is an official Microsoft Azure SDK for Node.js. This project provides a Node.js package that makes it easy to consume and manage Microsoft Azure Services.

The listed snippets below demonstrate how to manage Azure Table service using Microsoft Azure SDK for Node.js.

 

This is easy to do since the Azure SDK will look for credentials using environment variables first. The magical environment variable names are AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY.

 

  • Create a table service

Set credentials using environment variables

   1:var azure = require('azure');
   2:  
   3://using enviroment variables for credentials
   4:var tableService = azure.createTableService(); // implicitly use env variables
   5:
   6: tableService = azure.createTableService(
   7:   process.env.AZURE_STORAGE_ACCOUNT,
   8:   process.env.AZURE_STORAGE_ACCESS_KEY); // explicit
   9:  

 

Set credentials explicitly using local variables

   1:var accessKey = '[accountKey]';
   2:var storageAccount = '[accountName]';
   3:
   4:var tableService = azure.createTableService(
   5:   accessKey, storageAccount); // explicit

 

  • Insert an entity
   1:var tableService = azure.createTableService();
   2:  
   3://insert an entity
   4:var   task1 = {
   5:         PartitionKey : 'myPartitionKey',
   6:         RowKey: '1',
   7:         Description: 'Row description',
   8:         DueDate: new Date(2011, 12, 14, 12)
   9:  };
  10:
  11: tableService.insertEntity('tasktable', task1, function(error){
  12:if(!error){
  13:// Entity inserted
  14:     }
  15: });

 

  • Query entities
   1://query an entity
   2:var tableService = azure.createTableService();
   3: tableService.queryEntity('demotable', 'myPartitionKey', '1', function(error, serverEntity){
   4:if(!error){
   5:// Entity available in serverEntity variable
   6:     }
   7: });

 

 

  • azure-table-node:

It is a simplified Azure Table Storage client library for Node.js that supported:

  • creating, deleting and listing tables
  • creating, updating, querying and deleting entities
  • batch operation support
  • generating SAS (Shared Access Signature) and using it for authentication

 

Code samples below show how to use azure-table-node module to work with Azure Table Storage
 

  • Set Azure Storage credentials
   1:var azureTable = require('azure-table-node')
   2:  
   3://set azure storage credentials
   4: azureTable.setDefaultClient({
   5:     accountUrl: 'http://[accountName].table.core.windows.net/',
   6:     accountName: '[accountName]',
   7:     accountKey: '[accountKey]'
   8: });

 

  • Create an Azure Table
   1://create azure table
   2: app.get("/createTable", function (req, res) {
   3:  
   4:var client = azureTable.getDefaultClient();
   5:     client.createTable('testtable', function (err, data) {
   6:     });
   7:  
   8:     client.insertEntity('testtable', {
   9:         PartitionKey: 'tests',
  10:         RowKey: '1',
  11:         value1: 'ABCDEFG'
  12:     }, function (err, data) {
  13:         res.write("Got error :-( " + err);
  14:     });
  15:  
  16:     res.end("Table created.");
  17: });

 

  • Display an Azure Table
   1://display an azure table
   2: app.get("/displayTable", function (req, res) {
   3:  
   4:var client = azureTable.getDefaultClient();
   5:  
   6:     client.queryEntities('testtable', {
   7:         query: azureTable.Query.create('PartitionKey', '==', 'tests') 
   8:  
   9:     }, function (err, data, continuation) {
  10:if (err) {
  11:             res.writeHead(500, { 'Content-Type': 'text/plain' });
  12:             res.write("Got error :-( " + err);
  13:             res.end("");
  14:return;
  15:         }
  16:  
  17:var json = JSON.stringify(data);
  18:         res.writeHead(200, { 'Content-Type': 'text/plain' })
  19:  
  20:         res.end("Table displayed: " + json);
  21:        });
  22:  
  23: });

 

 

  • List  all Azure Tables
   1://list all azure tables
   2: app.get("/listTables", function (req, res) {    
   3:  
   4:var client = azureTable.getDefaultClient();
   5:  
   6:     client.listTables(function (err, data, continuation) {
   7:if (err) {
   8:             res.writeHead(500, { 'Content-Type': 'text/plain' });
   9:             res.write("Got error :-( " + err);
  10:             res.end("");
  11:return;
  12:         }
  13:  
  14:         res.writeHead(200, { 'Content-Type': 'text/plain' })
  15:  
  16:for (var i = 0; i < data.length; i++) {
  17:             res.write("Table[" + i + "]: " + data[i] + " " );
  18:         }       
  19:  
  20:         res.end("Tables listed." + data);
  21:     });
  22:  
  23: });

 

 

  • Delete an Azure Table
   1://delete azure table
   2: app.get("/deleteTable", function (req, res) {
   3:  
   4:var client = azureTable.getDefaultClient();
   5:     client.deleteTable('testtable', function (err, data) {
   6:     });
   7:     res.end("Table testtable has been deleted.");
   8:  
   9: });

 

 

There’s so much more to learn about Azure Table services and Node.  The features and capabilities of table storage continue to grow. This post is just an intro how to start, covering the base cases and most popular Node.js modules for Azure Tables. It will be useful for both – JavaScript developers who don’t have experience with Microsoft Azure and Azure developers who have less experience with JavaScript and/or Node.js.

Developers on the Microsoft Azure Platform should become familiar with how Table Storage works and how it differs from the relational databases they are used to. Knowing how table storage works will help you determine if it is a good fit for your particular requirements.

 

You can download source code from Git repository .

 

If you want more information about how to use Microsoft Azure Storage  & Node.js feel free to contact me at mmateev@infragistics.com

You can learn more about Node.js , Microsoft Azure and related events like Azure Bootcamp Bulgaria if you follow us on Twitter @mihailmateev  and @Infragistics and stay in touch on Facebook, Google+, LinkedIn and Infragistics Friends User Group !

How to manage Microsoft Azure Blob Storage with Node.js

$
0
0

Node.js is one one of the the most popular growing platforms for development. The language, used with Node.js is JavaScript - he #1 most-used language on GitHub, and this trend is only going to increase (Forbes, 14 of July, 2014) : 

 

 

I started  several articles, describing some details how to use Node.js with Microsoft SQL Server ( you can see part 1 and part 2 ) and   Microsoft Azure Storage (the post about Azure Table Storage is available here) .   This blog is about how you can use Node.js and Microsoft Azure Blob Storage . 

You will learn how to start with Node and Blob Storage, covering the most often seen cases.

 

Microsoft Azure Blob Storage

Microsoft Azure storage services allow us to store/retrieve the NON RELATIONAL data to/from Windows Cloud environment. In Microsoft Azure Storage, the data can be stored in 4 different formats (v.i.z. Blobs, Tables and Queues, File Storage (in preview )). More details about what is Microsoft Azure Storage in general you can read in my previous post.

 

What is a Blob?

Azure Blob storage is a service for storing large amounts of unstructured data that can be accessed from anywhere in the world via HTTP or HTTPS. A single blob can be hundreds of gigabytes in size.

The Blob service contains the following components:

  • Storage Account: All access to Azure Storage is done through a storage account.

  • Container: A container provides a grouping of a set of blobs. All blobs must be in a container. An account can contain an unlimited number of containers. A container can store an unlimited number of blobs.

  • Blob: A file of any type and size. There are two types of blobs that can be stored in Azure Storage: block and page blobs. Most files are block blobs. A single block blob can be up to 200 GB in size. This tutorial uses block blobs. Page blobs, another blob type, can be up to 1 TB in size, and are more efficient when ranges of bytes in a file are modified frequently.

 

Blob stands for 'binary large object', which is an array of raw bytes. The following figure shows the hierarchical structure used for the Blob storage in Windows Azure:

 

Azure Storage Account can have multiple Containers. A Container can be considered as an array or collection of one or more Blobs. Also, each Blob can have one or more metadata properties to define what the Blob content is all about. The metadata properties are Name-Value collection of strings.

As mentioned before, the contents of every Blob on Microsoft Azure can be accessed by browsing its corresponding URI (REST). The URI is usually of the following format:

https://<Account>.blob.core.windows.net/<Container>/<BlobName>

 

How to use Blob Storage and Node.JS?

You can use different NodeJS packages to handle Azure Blob Storage. In this post we will cover azure Node package ( an official Microsoft Azure SDK ).

 

  • Microsoft Azure SDK for Node.js

The  official Microsoft Azure SDK (npm page:  https://www.npmjs.org/package/azure , homepage: http://github.com/WindowsAzure/azure-sdk-for-node  ) for Node.js.  provides a Node.js package that makes it easy to consume and manage Microsoft Azure Services.

The listed snippets below demonstrate how to manage Azure Blob service using Microsoft Azure SDK for Node.js.

 

  • Create an Azure Blob Service
   1:var azure = require('azure');
   2:  
   3:var accessKey = '[accountKey]';
   4:var storageAccount = '[accountName]';
   5:var containerName = 'nodejs';
   6:  
   7://create a blob service set explicit credentials
   8:var blobService = azure.createBlobService(storageAccount, accessKey);

You can create Azure Blob Service using the environment variables to store the credentials  in the same way like for Azure Table service ( look at this post ).

 

  • List blobs in Azure Blob Storage

 

JavaScript code:

   1:var azure = require('azure');
   2:  
   3: exports.blobs = function (request, response) {
   4:  
   5:var accessKey = '[accountKey]';
   6:var storageAccount = '[accountName]';
   7:var container = 'nodejs';
   8:  
   9:var blobService = azure.createBlobService(storageAccount, accessKey);
  10://render blobs with blobs.jade view
  11:     blobService.listBlobs(container, function (error, blobs) {
  12:         response.render('blobs', {
  13:             error: error,
  14:             container: container,
  15:             blobs: blobs
  16:         });
  17:     });
  18: }

 

A jade view ( using Express.js )

   1: extends layout
   2:
   3: block content
   4:     h1 Blob listing for #{container}
   5:
   6:if error
   7:         h3= error
   8:
   9:if blobs
  10:         h3= container
  11:         table
  12:             tr
  13:                 th Name
  14:                 th Properties
  15:             - each blob in blobs
  16:                 tr
  17:                     td= blob.name
  18:                     td
  19:                         ul
  20:                             - each value, name in blob.properties
  21:if value
  22:                                     li= name + ":" + value

 

 

  • Upload file to Azure Blob Storage

One approach is to use multiparty node module. It is multipart/form-data parser which supports streaming.  Using Multiparty(npm install multiparty), a fork of Formidable, we can access the multipart data. This module will not stream the file to disk unless you tell it to.

   1://upload a file to azure blob storage
   2: app.get('/upload', function (req, res) {
   3:     res.send(
   4:'<form action="/upload" method="post" enctype="multipart/form-data">' +
   5:'<input type="file" name="snapshot" />' +
   6:'<input type="submit" value="Upload" />' +
   7:'</form>'
   8: );
   9: });
  10:  
  11: app.post('/upload', function (req, res) {
  12:var multiparty = require('multiparty');
  13:var accessKey = '[accountKey]';
  14:var storageAccount = '[accountName]';
  15:  
  16:var container = 'nodejs';    
  17:var blobService = azure.createBlobService(storageAccount, accessKey);
  18:var form = new multiparty.Form();
  19:
  20:     form.on('part', function (part) {
  21:if (part.filename) {
  22:
  23:var size = part.byteCount - part.byteOffset;
  24:var name = part.filename;
  25:
  26:             blobService.createBlockBlobFromStream(container, name, part, size, function (error) {
  27:if (error) {
  28:                     res.send(' Blob create: error ');
  29:                 }
  30:             });
  31:         } else {
  32:             form.handlePart(part);
  33:         }
  34:     });
  35:     form.parse(req);
  36:     res.send('OK');
  37: });
  38: //end of upload a file to azure blob storage

 

Screens below demonstrate how to upload file to Azure Blob Storage using the sample demo  application.

 

 

  • Download files from Azure Blob Storage

To download the blob and write it to the file system, a similar getBlob or getBlobToFile  methods can be used.

 

The snipped below demonstrates how to use  getBlob:
   1:var azure = require('azure');
   2:  
   3:var blobService = azure.createBlobService();
   4:  
   5://using getBlob to save a file from Azure Blob
   6: blobService.getBlob('[containerName]', '[blobName]').pipe(fs.createWriteStream('[myFileName]'));

 

Code below is part of the demo application, demonstrating how to download file from Azure Blob Storage using getBlobToFile :

   1:  
   2://download azure blob storage cotent
   3: app.get('/downloadBlob', function (req, res) {
   4:     res.send(
   5:'<form action="/downloadBlob" method="post" >' +
   6:'<input type="text" name="blobFile" value="C:\\temp" />' +
   7:'<input type="submit" value="Download" />' +
   8:'</form>'
   9: );
  10: });
  11:  
  12: app.post('/downloadBlob', function (req, res) {
  13:var fs = require('fs');
  14:
  15:if (!fs.existsSync) {
  16:         fs.existsSync = require('path').existsSync;
  17:     }
  18:var destinationDirectoryPath = req.body.blobFile;
  19:var accessKey = '[accountKey]';
  20:var storageAccount = '[accountName]';
  21:var containerName = 'nodejs';
  22:  
  23:var blobService = azure.createBlobService(storageAccount, accessKey); //ok
  24:
  25:if (!fs.existsSync(destinationDirectoryPath)) {
  26:         console.log(destinationDirectoryPath + ' is an invalid directory path.');
  27:     } else {
  28:         downloadFilesParallel(res, blobService, containerName, destinationDirectoryPath);
  29:     }
  30:  
  31: });

 

downloadFilesParallel function, used in the code above:

   1:function downloadFilesParallel(res, blobService, containerName, destinationDirectoryPath) {
   2:     blobService.listBlobs(containerName, function (error, blobs) {
   3:if (error) {
   4:             console.log(error);
   5:         } else {
   6:var blobsDownloaded = 0;
   7:             res.writeHead(200, { 'Content-Type': 'text/plain' })
   8:             blobs.forEach(function (blob) {
   9:                 blobService.getBlobToFile(containerName, blob.name, destinationDirectoryPath + '/' + blob.name, function (error2) {
  10:                     blobsDownloaded++;
  11:
  12:if (error2) {
  13:                         console.log(error2);
  14:                     } else {
  15:                         res.write('\nBlob ' + blob.name + ' download finished.');
  16:
  17:if (blobsDownloaded === blobs.length) {
  18:// Wait until all workers complete and the blobs are downloaded
  19:                             res.end('\nAll files downloaded');
  20:                         }
  21:                     }
  22:                 });
  23:             });
  24:         }
  25:     });
  26: }

 

Screenshots from the sample app, demonstrating how to download a file from Blob Storage.

 

 

 

Specialists can learn much more details about Azure Blob services and Node.  Microsoft continues to grow and improve blob storage. This post describes how to start, covering the base cases and most popular Node.js modules for Azure Blob Storage. It will be useful for both – JavaScript developers who don’t have experience with Microsoft Azure and Azure developers who have less experience with JavaScript and/or Node.js.

Developers on the Microsoft Azure Platform should become familiar with how Azure Blob Storage works and how to handle unstructured data in the Microsoft cloud. Knowing how blob storage works will help you determine if it is a good fit for your particular requirements.

 

You can download source code from Git repository .

 

If you want more information about how to use Microsoft Azure Storage  & Node.js feel free to contact me at mmateev@infragistics.com

You can learn more about Node.js , Microsoft Azure and related events like Azure Bootcamp Bulgaria if you follow us on Twitter @mihailmateev  and @Infragistics and stay in touch on Facebook, Google+, LinkedIn and Infragistics Friends User Group !

Creating an App from Start to Finish

$
0
0

Have you ever looked at an app and wondered how it came to be? Of course you have – you’re a developer.

Well, in a recent video, Infragistics takes you inside the creation of Infragistics’ newest app: SBViz. From its humble beginnings as sketches on a pizza box to a fully-featured app (available on iTunes), this video covers it all.

[youtube] width="640" height="360" src="http://www.youtube.com/embed/k7UFvR9_C50" [/youtube]

Have you checked it out yet? This app is is pretty cool – it was even featured on eweek.com! For more information or to see how you can get it for free, check out SBViz.com and get in the game today!

Viewing all 2223 articles
Browse latest View live