Dotnetdreamer's Weblog

SharePoint, Silverlight and Azure

Posts Tagged ‘Microsoft’

Setting up Windows Azure .net development environment

Posted by Ramprasad Navaneethakrishnan on February 21, 2013

I recently started Azure development and thought maybe this post would be useful for future developers. It’s basically about setting up Windows Azure development environment for .NET

  1. Download and Install Windows Azure SDK.
  2. Download and Install NuGet package Manager. Nuget package manager is a easy way to download and reference the needed libraries to your project.
  3. Setup a Windows Azure account from Windows Azure Website. Microsoft provides 90 day free trial to use the Azure cloud resources. During the registration process, it asks for credit card details to validate the authenticity. They do not charge the card.

Assuming you have Visual Studio already installed, that’ pretty much it. 

Advertisements

Posted in MOSS 2007 | Tagged: , , , , , , | Leave a Comment »

Silverlight 3 – Out-of-the-Browser Applications

Posted by Ramprasad Navaneethakrishnan on April 24, 2009

Hi fellas,

This post was in my draft for quite a time now. Finally publishing it. 🙂

Silverlight 3 Beta is released and have already written a post on ‘Element to Element Binding’ which is one of the coolest additions to the latest version of Silverlight. When explored further, I came across this astonishing feature called Out-of-the-Browser Applications – which means your Silverlight Apps can run without the browser, in offline, just like a normal desktop applications will. Remember this kind of feature is not even present in Adobe AIR or Flash.

Now the obvious question in your mind is, should I write additional code to take advaentage of this feature? No there is no extra coding involved. However you need to make samll changes in the AppManifest.xml file. What are those changes?

  • Add two properties ‘EntryPointAssembly’ and ‘EntryPointType’ in the Deployment tag.  EntryPointAssembly should contain the value of your application name and EntryPointType should have the value of your applicationname.App. It should look like this.

<Deployment xmlns=”http://schemas.microsoft.com/client/2007/deployment” xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml EntryPointAssembly=”YourApplicationName” EntryPointType=”YourApplicationName.App”

  • Now add the following section under the deploument tag

<Deployment.ApplicationIdentity> 

<ApplicationIdentity ShortName=”Your Application’s Name” Title=”Your Applications’s Title”>

<ApplicationIdentity.Blurb>

Type text that will be displayed as tooltip for your application

</ApplicationIdentity.Blurb>

</ApplicationIdentity>

</Deployment.ApplicationIdentity>

  • Now run your application. Right click on your browser screen. You will get an option “Install this application onto your computer” in addition to the “Silverlight Configuration” option. Select “Install this application onto this computer” option. Now windows will prompt for the shortcut locations to select.  When clicked Ok, the application will be installed locally.

 

Pleasea leave your comments. 

Thanks.

 

Posted in Silverlight | Tagged: , , , , , | Leave a Comment »

Silverlight 3 – Element to Element Binding

Posted by Ramprasad Navaneethakrishnan on April 24, 2009

Hi Folks..

Silverlight 3 Beta 1 is released and as expected, Microsoft has added some cool features. I am very excited about this new feature called Element to Element binding and lets do a walk through.

Element To Element Binding let binding a control’s property directly with another control’s property. For example, we can bind the value property of a slider control directly to the width property of a Rectangle control in the XAML iteself. Let’s see the example..

  1. Make sure you have installed the followng Silverlight 3 sdk and tools
  2. Create a Silverlight application in the visual studio and in Page.xaml paste the following lines
  3. < Grid x:Name=”LayoutRoot” Background=”White”>  <RowDefinition></RowDefinition>

     <RowDefinition ></RowDefinition>

     </Grid.RowDefinitions>

      <Slider x:Name=”mySlider” Grid.Row=”0″ Minimum=”0″ Maximum=”400″ Value=”50″ Orientation=”Horizontal” ></Slider>

      <Image Source=”DSC00443.JPG” Width= “{Binding Value, ElementName=mySlider}” Height=”{Binding Value, ElementName=mySlider}” Grid.Row=”1″ ></Image>

    </Grid>

     

     

    <Grid.RowDefinitions> Note that we have binded the width property of the image with the value property of the Slider control like this

    1. Width =”{ Binding Value, ElementName=mySlider}”
  4. Now go ahead and hit the F5 button
  5. Drag the Slider control and see the width of the image getting changed according to the value of the Slider control.

Cool. Isn’t it.

Please give your feedback on this post.

 Thanks,

Ramprasad

 

Posted in Silverlight | Tagged: , , , , , , , , , | 2 Comments »

Business Data Catalog in MOSS 2007

Posted by Ramprasad Navaneethakrishnan on September 26, 2008

Overview

As per Microsoft, Business Data Catalog (BDC) is a “new business integration feature available in Microsoft Office Sharepoint Server 2007. It is a shared service and it enables MOSS 2007 to surface business data from back-end server applications without any coding.”

Why BDC?

All the data entered into the Sharepoint system gets stored in the content database of that particular Sharepoint application. So by default, a Sharepoint site will get information from its content database. But it is quite natural for an organization to have information stored in multiple databases by numerous applications throughout the organization. For example, inventory software stores its data in a database that is different from a CRM software storing data in a database. But people will find is extremely useful if provided with a space where they can have every bit of information from each and every department in the organization ranging from the up-to-minute logistics information to the up-to-date sales analysis. The BDC feature of Microsoft Office Sharepoint Server 2007 provides the needed business integration for integrating the line of business (LOB) applications with the Sharepoint.

What is BDC?

Business Data Catalog provides built in support for displaying data from two data sources.

·         Databases

·         Web Services

Microsoft promises a “no coding” approach for integrating LOB applications with Sharepoint. Business Data Catalog provides access to the data sources through a metadata model that provides a consistent and simplified client object model. So it is the metadata authors who describe the API of the business applications in xml. After this, the administrators will associate this metadata with the Sharepoint application after which the LOB data is available in the Sharepoint system.

 


Development Environment

The walkthrough below will guide in developing a simple BDC application in MOSS 2007. The following states the database and MOSS settings used by this walkthrough.

MOSS Settings

·         Microsoft Office Sharepoint Server 2007 Enterprise Edition Installed.

o   Standard Edition of MOSS 2007 does not have BDC feature

·         Created a new web application named “KnowMax-1234” from Central Administration.

·         Use the default Shared Services Provider (SSP) associated with the created web application or create a new SSP for the web application KnowMax-1234.

Database details of LOB application

·         Database Server : TARGETMC-VM\SQLEXPRESS

·         Database Name : Test

·         Table Name : dbo.Product

·         Snapshot of the LOB Database :

 

Walkthrough:  Creating a product BDC from LOB database

Objective

The objective of this walkthrough is, “To access the LOB application’s data through BDC and display it in the Sharepoint site inside the Business Data Lists Webpart.” This Webpart will get the ‘ProductID’ as input from the user and gets the corresponding product details from the LOB database. The following is the snapshot of the output.

 

 

 

The “ProductID” is given as 1. And the product detail for this product id is obtained from the LOB database.

 

Authoring Metadata

Authoring the metadata forms the heart of the development process involved in creating the BDC application. Though there are many tools that promises to simplify this process, most of them are ambiguous or non freewares. Some of those tools are

·         Microsoft Business Data Catalog definition editor

o   Gets shipped with the Sharepoint 2007 SDK which is available free for download

·         Metaman

o   Metaman is supposedly good but it comes with a cost as Metaman is not a freeware

 

So avoiding all those ambiguities, let us start writing the BDC metadata in xml. To start of the process, open a notepad and follow the steps below

1.    Since the metadata is an xml file, it starts off with the following lines just like all xml documents

<?xml version=1.0 encoding=utf-8 standalone=yes?>

2.    The LobSystem tag defines the namespaces, the name of the LOB system, the type of the system (Database or Webservice) and the version of the system

<LobSystem xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd Type=Database Version=1.0.0.0 Name=ProductBDC1

xmlns=http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog>

3.    Then create a new instance for this Lob system using the following lines

<LobSystemInstances>

<LobSystemInstance Name=ProductBDC1 >

4.    Define the database, connection and authentication properties of the Lob system using the properties tag.

<Properties>

        <Property Name=rdbconnection Data Source Type=System.String>TARGETMC-VM\SQLEXPRESS</Property>

        <Property Name=rdbconnection Initial Catalog Type=System.String>Test</Property>

        <Property Name=rdbconnection Integrated Security Type=System.String>SSPI</Property>

        <Property Name=DatabaseAccessProvider Type=Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider>SqlServer</Property>

        <Property Name=AuthenticationMode Type=Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAuthenticationMode>PassThrough</Property>

        <Property Name=RdbConnection Pooling Type=System.String>false</Property>

      </Properties>

    </LobSystemInstance>

</LobSystemInstances>

5.    Now, create an entity and define its properties

  <Entities>

    <Entity EstimatedInstanceCount=100 Name=Product>

      <Properties>

<Property Name=Name Type=System.String>Name</Property>

      </Properties>

      <Identifiers>

   <Identifier Name=ProductID TypeName=System.String /></Identifiers>

These tags define the entity called Product and its two members, Name and ProductID.

6.    There should be a method that gets the details of the entity based on the input parameters.  The following tags define a method called “GetProducts” which has a query that gets the name and productid of the products entity based on the entered productid. Also the input parameter is defined using the parameter tag with Direction attribute as “In”. The output is the product entity having two members namely name and productid which is defined in the parameter tags with the Direction attribute as “Return”.

      <Methods>

        <Method Name=GetProducts>

          <Properties>

            <Property Name=RdbCommandText Type=System.String>

              SELECT ProductID, Name FROM Product WHERE ProductID = @ProductID

           </Property>

            <Property Name=RdbCommandType Type=System.Data.CommandType>Text</Property>

          </Properties>

          <FilterDescriptors>

            <FilterDescriptor Type=Comparison Name=ProductID>

              <Properties>

                <Property Name=Comparator Type=System.String>Equals</Property>

              </Properties>

            </FilterDescriptor>

          </FilterDescriptors>

          <Parameters>

            <Parameter Direction=In Name=@ProductID>

              <TypeDescriptor TypeName=System.String IdentifierName=ProductID AssociatedFilter=ProductID Name=ProductID>

                <DefaultValues>

                  <DefaultValue MethodInstanceName=ProductFinderInstance Type=System.String > 1 </DefaultValue>

                </DefaultValues>

              </TypeDescriptor>

            </Parameter>

            <Parameter Direction=Return Name=Products>

              <TypeDescriptor TypeName=System.Data.IDataReader, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

IsCollection=true Name=ProductDataReader>

              <TypeDescriptors>

                <TypeDescriptor TypeName=System.Data.IDataRecord, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

                                Name=ProductDataRecord>

                  <TypeDescriptors>

                    <TypeDescriptor TypeName=System.String IdentifierName=ProductID Name=ProductID>

                      <LocalizedDisplayNames>

                        <LocalizedDisplayName LCID=1033>ProductID</LocalizedDisplayName>

                      </LocalizedDisplayNames>

                    </TypeDescriptor>

                    <TypeDescriptor TypeName=System.String Name=Name>

                      <LocalizedDisplayNames>

                        <LocalizedDisplayName LCID=1033>Name</LocalizedDisplayName>

                      </LocalizedDisplayNames>

                      <Properties>

                        <Property Name=DisplayByDefault Type=System.Boolean>true</Property>

                      </Properties>

                    </TypeDescriptor>

                  </TypeDescriptors>

                </TypeDescriptor>

              </TypeDescriptors>

              </TypeDescriptor>

            </Parameter>

 </Parameters>

7.    Then create an instance for the “GetProducts” method like this.

<MethodInstances>

            <MethodInstance Name=ProductFinderInstance Type=Finder ReturnParameterName=Products />

          </MethodInstances>

 

The complete metadata definition xml is as follows. Copy it into a notepad and save as “ProductBDC.xml”.

<?xml version=1.0 encoding=utf-8 standalone=yes?>

<LobSystem xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd Type=Database Version=1.0.0.0 Name=ProductBDC1 xmlns=http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog>

  <LobSystemInstances>

    <LobSystemInstance Name=ProductBDC1 >

      <Properties>

        <Property Name=rdbconnection Data Source Type=System.String>TARGETMC-VM\SQLEXPRESS</Property>

        <Property Name=rdbconnection Initial Catalog Type=System.String>Test</Property>

        <Property Name=rdbconnection Integrated Security Type=System.String>SSPI</Property>

        <Property Name=DatabaseAccessProvider Type=Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider>SqlServer</Property>

        <Property Name=AuthenticationMode Type=Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAuthenticationMode>PassThrough</Property>

        <Property Name=RdbConnection Pooling Type=System.String>false</Property>

      </Properties>

    </LobSystemInstance>

  </LobSystemInstances>

  <Entities>

    <Entity EstimatedInstanceCount=100 Name=Product>

      <Properties>

        <Property Name=Name Type=System.String>Name</Property>

      </Properties>

      <Identifiers>

        <Identifier Name=ProductID TypeName=System.String />

      </Identifiers>

      <Methods>

        <Method Name=GetProducts>

          <Properties>

            <Property Name=RdbCommandText Type=System.String>

              SELECT ProductID, Name FROM Product WHERE ProductID = @ProductID

            </Property>

            <Property Name=RdbCommandType Type=System.Data.CommandType>Text</Property>

          </Properties>

          <FilterDescriptors>

            <FilterDescriptor Type=Comparison Name=ProductID>

              <Properties>

                <Property Name=Comparator Type=System.String>Equals</Property>

              </Properties>

            </FilterDescriptor>

          </FilterDescriptors>

          <Parameters>

            <Parameter Direction=In Name=@ProductID>

              <TypeDescriptor TypeName=System.String IdentifierName=ProductID AssociatedFilter=ProductID Name=ProductID>

                <DefaultValues>

                  <DefaultValue MethodInstanceName=ProductFinderInstance Type=System.String > 1 </DefaultValue>

                </DefaultValues>

              </TypeDescriptor>

            </Parameter>

            <Parameter Direction=Return Name=Products>

              <TypeDescriptor TypeName=System.Data.IDataReader, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

                              IsCollection=true Name=ProductDataReader>

              <TypeDescriptors>

                <TypeDescriptor TypeName=System.Data.IDataRecord, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

                                Name=ProductDataRecord>

                  <TypeDescriptors>

                    <TypeDescriptor TypeName=System.String IdentifierName=ProductID Name=ProductID>

                      <LocalizedDisplayNames>

                        <LocalizedDisplayName LCID=1033>ProductID</LocalizedDisplayName>

                      </LocalizedDisplayNames>

                    </TypeDescriptor>

                    <TypeDescriptor TypeName=System.String Name=Name>

                      <LocalizedDisplayNames>

                        <LocalizedDisplayName LCID=1033>Name</LocalizedDisplayName>

                      </LocalizedDisplayNames>

                      <Properties>

                        <Property Name=DisplayByDefault Type=System.Boolean>true</Property>

                      </Properties>

                    </TypeDescriptor>

                  </TypeDescriptors>

                </TypeDescriptor>

              </TypeDescriptors>

              </TypeDescriptor>

            </Parameter>

          </Parameters>

          <MethodInstances>

            <MethodInstance Name=ProductFinderInstance Type=Finder ReturnParameterName=Products />

          </MethodInstances>

        </Method>

      </Methods>

    </Entity>

  </Entities>

</LobSystem>

 

After authoring the metadata for the Lob system, we have to just associate this with a web application to make use the BDC.

 

1.    Go to the central administration and select your SSP.

2.    Under Business Data Catalog, click Import application definition

 

 

3.      Choose your metadata file and click “Import”

 

 

 

4.       A warning message will come. Click “Ok” as of now.

5.      You can see your imported application by clicking “View Application” under Business Data Catalog for your SSP

 

 

6.      Now, go to your Sharepoint site and click “Edit Page” under Site Actions

7.      Click “Add a Web Part”

8.      Select the “Business Data List” Web Part under Business Data and click Add

 

 

 

9.      In the newly added Business Data List Web Part click Edit and select Modify Shared Web Part

 

  10.  In the type textbox, click Browse

 

 

 

 

 

 

 

 

 

11.  In the Business Data Type Picker dialog box, select your BDC file and click Ok.

 

 

12.  Click Ok in the business data list properties window (screen shot in step 10.)

13.  Now the Webpart will look like the following.

 

 

 

 

14.  Enter 1 in the productid textbox and click “Retrieve Data”.

15.  The product name associated with the product id in the LOB database gets retrieved like the following.

 

 

Posted in MOSS 2007 | Tagged: , , , , , , , , , | 5 Comments »

Next Generation Applications – The Microsoft Way

Posted by Ramprasad Navaneethakrishnan on June 11, 2008

Doing business is difficult, more so in today’s open era it is even more difficult. And things are not going to be any easier in the future. If you have to work twice as hard to stay in your current place, then what would you have to do in order to move ahead of competitors???. Not many businesses are enjoying significant market shares and most of the businesses are living on the edge. One bad quarter, One bad quarter is all it takes to let your market share go down and let your competitor take your position. You will need the next quarter to straighten out the things that went wrong in the previous quarter. By that time, you would have lost the race in the current quarter!. This is how business is now. If you sell products, you have to sell more products in the coming quarter which calls for introducing newer products into the market, aggressive marketing for existing products and so on. There is one easy way to do all this. If the customer, instead of just liking, loves your product, then doing business is easy!. At least relatively!.

There is a saying like ‘Men always go behind beautiful women and Women always go behind rich men!’. Like that, a customer always goes behind a product that is both

  • Rich (in features) and
  • Beautiful (in User Interface).

So coming to the industry, whose employees get blamed for the increase in house rent, vegetable prices and auto fares, also the industry which is famous for its rapidness in growth and change, The Software Industry; the number of applications available in the market to perform a set of business needs are in large number. Further, many applications can be customized to target specific customer needs have also begun to crop up. So what will drive a customer to choose a particular product or application? Here are some of the attributes..

  1. Rich Feature Sets
  2. Rich User Interface

There are innumerable numbers of other attributes like cost, marketing, services etc. As they are not within the scope of this blog, let’s focus on Rich Feature Sets and Rich User Interface.

Rich Feature Sets. Hmm. Now who has product that will do a wide range of functionalities that are not even present in another product? Or how many features that a product have over its nearest competitor? Even if the product has a lot additional features, what is its significance? One product in a segment? or two? . But not more than that. In this present world, the number of products and the competition between them is so huge than no one gives his competitor a significant lead by letting him have additional features that he don’t have in his product. Everyone continuously innovates or at the least tries to innovate. Everyone learns from others. Every product has one or more features inspired from a competitor’s product. So, the rich feature sets in your product is not going to give you a competitive edge in the near future, as almost everyone has it.

Aestheticism:

If this was the 1930’s, aestheticism would be synonymous to Howard Hughes.After all, who would ruin a billion dollar airplane contract, just because he did not feel good with the shape of the Yoke! (Rent a DVD and watch “The Aviator“). However today(and also for the past two decades), if there is one thing that rings a bell when we think of aestheticism, it has to be APPLE Inc.

Why do people buy Apple products? What is the primary reason? Why is an Apple product costly, despite the fact that its performance is similar to that of its competitor? Why do people pay more to get an Apple? Why are people proud to own an Apple? Is it because Apple products have features that no other products have? No. It’s because of its superior, incomparable and elegant User Interface. You would have heard of the saying that an An Apple’s back is more beautiful than many other products front!. True.

Over the past two decades, Apple has never failed to impress its dedicated followers, and also many others with its products that is rich in User Interface. Why should it, as its founder and CEO, Steve Jobs’s only professional certification being “Calligraphy”!.

The reason for all the above adjectives (examples) is to stress the verb (fact) that the product which is rich in user interface and also easy to use is what is going to give a competitive edge to the business! Gone are the days where you can tell System configurations, Network bandwidth, and Browser features as reasons for not building applications that are not rich in user interfaces.

So by looking at an application’s GUI, the user should fall in love with it. When ever the user sees the application’s screen, his face should light up. Whenever he performs an operation in the application, it should be as easy, as the blink of the eye. Simply put, the user should look forward to use the application again and again.

We are done with the part ‘Why rich user interfaces are needed?’. Now comes How? How do you build a product that is rich in GUI, at the same time being efficient and quick? Although many technologies and tools are available, as a .net guy, I want to go by Microsoft’s way as I feel this is the easiest, efficient and fastest way of application development. Microsoft bets its life with the ROI on these technologies!

Hence I am introducing here, The Windows Presentation Foundation ( WPF ), though there is not going to be any tutorial here.. 🙂

WPF is Microsoft’s answer to building applications with rich UI needs like graphics and animations. WPF is a part of Microsoft’s ‘Next generation technologies’ or ‘WinFx technologies’ or ‘.net Framework 3.0, 3.5’. Others included are Windows Communication Foundation (WCF) , Windows Workflow Foundation (WF) and Cardspace.

Through WPF and EXtended Markup language (XAML), it has never been easier to create Rich UI, 2D, 3D animations and other UI gimmicks.

For example,Can u create an animation with a fewer lines of code than this?

<Page.Storyboards>
<SetterTimeline
TargetName=”
myButton ”
Path=”(Button.Background).(SolidColorBrush.Color) “>
<ColorAnimation
From=”
Blue ”
To=”
Yellow ”
Duration=”
0:0:5 ”
RepeatBehavior=”
Forever ” />
</SetterTimeline>
</Page.Storyboards>

To have a look at the the amazing features that WPF can provide, download the WPF samples from the following link.

http://wpf.netfx3.com/files/folders/applications/default.aspx

You will Relish!

So stop with ASP.NET. Start of with WPF, XAML and .NET 3.5. In future, not many customers are going to need a login page with just captions, labels, two textboxes and a Submit button!

Posted in The Future | Tagged: , , , , , , , , | 5 Comments »