Pragmatic Mash-Ups Andrew Filev Microsoft Certified Architect Murano Software Building POC of Web 2.0 application in one day with AJAX, Virtual Earth and.

Slides:



Advertisements
Similar presentations
What Is Microsoft Marketplace DataMarket What Is Microsoft Marketplace DataMarket? Michael Stiefel
Advertisements

LINQ and Collections An introduction to LINQ and Collections.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
Microsoft ® Official Course Client-Side SharePoint Development SharePoint Practice Microsoft SharePoint 2013.
L. Grewe. YQL – what is it Yahoo! Query Language.
Stanford University EH&S A Service Oriented Architecture For Rich Internet Applications Sheldon M. Heitz.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 JavaScript & AJAX CS , Spring JavaScript.
Building Ad-Hoc Reports using the SQL Server 2005 Reporting Services (SSRS) Report Builder (SQL307) Adrian Rupp Business Intelligence Solutions Specialist.
SharePoint 2010 Business Intelligence Module 3: Business Intelligence Center.
XML files (with LINQ). Introduction to LINQ ( Language Integrated Query ) C#’s new LINQ capabilities allow you to write query expressions that retrieve.
ASP.NET MVC Tips and Tricks Al Wilkinson. Hi! I’m Al  First program in Logo in 1985 in 1st grade #loveatfirstbyte  Started HTML in 1996, led to web.
LINQ Programming in C# LINQ CSE Prof. Roger Crawfis.
Interactive Web Application with AJAX
Introduction to AJAX AJAX Keywords: JavaScript and XML
Ajax Basics The XMLHttpRequest Object. Ajax is…. Ajax is not…. Ajax is not a programming language. Ajax is not a programming language. Ajax is a methodology.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 24 How Websites Work with Databases How Websites Work with Databases.
 Introduction  What is LINQ  Syntax  How to Query  Example Program.
In this tutorial, you are going to be exploring the structure and layout of websites. Activity: With a partner, discuss the websites you visit regularly.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
Intro to JavaScript Events. JavaScript Events Events in JavaScript let a web page react to some type of input Many different ways to handle events due.
Chapter 15: Using LINQ to Access Data in C# Programs.
Matrix Mapping Tool Sam Gross Internship at Virtual Technology Corporation.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
Neal Stublen How does XMLReader work?  XmlReader.Read() Advances to next node XmlReader properties access node name, value, attributes,
 Language Integrated Query  Make query a part of the language  Component of.NET Framework 3.5  Shipped with Visual Studio 2008.
Ajax In Action The Journey into Web2.0 Presented by Eric Pascarello.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
Virtual Earth Map Control V4 MARK MAGLIOCCO Phillydotnet.org 11/21/2006
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
Web Technology Introduction AJAXAJAX. AJAX Outline  What is AJAX?  Benefits  Real world examples  How it works  Code review  Samples.
School of Computing and Information Systems CS 371 Web Application Programming AJAX.
Jason Braun, Bryan Hurley, Anthony Varner, Andrew Winder snewsr The gnizr social news readr.
the acronym for Asynchronous JavaScript and XML.
Chris Pendleton Virtual Earth Technical Evangelist Microsoft Corporation.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Advanced Adhoc Reporting 2010 Visions Conference July 28, 2010.
 AJAX – Asynchronous JavaScript and XML  Ajax is used to develop fast dynamic web applications  Allows web pages to be updated asynchronously by transferring.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
The World Wide Web. What is the worldwide web? The content of the worldwide web is held on individual pages which are gathered together to form websites.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
AJAX AJAX Asynchronous JavaScript and XML --- MADHAVI
LINQ Language Integrated Query LINQ1. LINQ: Why and what? Problem Many data sources: Relational databases, XML, in-memory data structures, objects, etc.
21 Copyright © 2009, Oracle. All rights reserved. Working with Oracle Business Intelligence Answers.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
PHP and AJAX. Servers and Clients For many years we tried to move as much as possible to the server. Weak clients, poor bandwidth, browser compatibility..
1 AJAX. AJAX – Whatzit? Asynchronous (content loading)‏ Javascript (logic & control)‏ And XML (request handling)‏
What was new in VS Studio 2008 A bird eye view from the height of ft By: Shahzad Sarwar Software Architect Comsoft computer consultants.
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
Jim Fawcett CSE686 – Internet Programming Summer 2010
Introduction to Entity Framework
Web Mashups -Nirav Shah.
VB 2010 Pertemuan 10.
Presented by Paul James
CS 371 Web Application Programming
AJAX and REST.
Building REST API using SQL Server and JSON Functions
YQL Kevin Murphy CMPS 183.
Giuseppe Attardi Università di Pisa
JavaScript & jQuery AJAX.
An Electronic Borrowing System Using REST
<form> Handling
Visual Studio 2008.
.NET Framework V3.5+ & RESTful web services
Presentation transcript:

Pragmatic Mash-Ups Andrew Filev Microsoft Certified Architect Murano Software Building POC of Web 2.0 application in one day with AJAX, Virtual Earth and Linq

Idea, scope Implementation –Collecting data Getting web page Getting data with regular expressions Using REST based XML pages –Selecting data: Linq, DLinq, XLinq –Displaying data Displaying Virtual Earth map Adding pushpins Filtering pushpins Future directions

Idea To help people find their house by: Mashing-up real estate sales ads with house valuation service and displaying ones which are priced below valuation on the map

Example listing

Scope This presentation is not covering important aspects of the whole application: –Valuation might be incorrect –How to get permission for data and valuation It is focused on technologies It’s about POC in a a day, not about release in a …

Implementation at the high level Take listings Add valuation information Provide web-site to access this information

Getting web page WebClient client = new WebClient(); string pageContent = client.DownloadString(url)

Getting data: HTML+Regex yahoo map Regular Expression yahooStreetAddressParameter.Value = yahoo_address

Getting data: REST+XML XDocument doc = new XDocument(); doc.Load(String.Format(“ bservice/GetSearchResults.htm?address= {0}&citystatezip={1}”, yahooStreetAddress, yahooCityStateZip)); var result = doc.Descendants(“address”).First().Element(“street”); streetParameter.Value = (string)result;

.NET Language Integrated Query Integration into programming language and IDE Select, from, where, into, orderby … XML (XLinq) and SQL (DLinq) support

DLinq: Basics New item->DLinqObjects Drag table from Server Explorer Write queries in C# _context = new DataContext(connString) var results = from listing in _context.Listings where listing.Longitude <=… select listing; foreach (var item in results){ …item.Latitude… }

DLinq: Attributes [System.Data.DLinq.Table(Name="Listings")] public partial class Listing : System.Data.DLinq.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged … [System.Data.DLinq.Column(Name="YahooStreetAddress", Storage="_YahooStreetAddress", DBType="varchar NOT NULL")] public virtual string YahooStreetAddress { get {return this._YahooStreetAddress;} set { if ((this._YahooStreetAddress != value)) { this.OnPropertyChanging("YahooStreetAddress"); this._YahooStreetAddress = value; this.OnPropertyChanged("YahooStreetAddress"); }

Tip: how to pass connection string public partial class masterDataContext : System.Data.DLinq.DataContext { public masterDataContext(string connString) : base(connString) { }

DLinq+XLinq XDocument xmlDoc=new XDocument( new XDeclaration("1.0", "utf-8",null), new XElement("root", from listing in _context.Listings where listing.Longitude … select new XElement("item", new XAttribute("id",listing.ID), new XAttribute("lat",listing.Latitude), new XAttribute("long",listing.Longitude), new XAttribute("price",listing.Price), new XAttribute("est",listing.Zestimate), new XAttribute("details",listing.Street))));

Displaying map var map=null; function DrawMap(){ map = new VEMap('myMap'); map.LoadMap(new VELatLong(34, ), 10,'r', false); GetPushpins(); } …

AJAX request var xhr = null; function CreateXHR(){ var xhr; try{xhr = new ActiveXObject("Microsoft.XMLHTTP");} catch(e){try{xhr=new ActiveXObject("Msxml2.XMLHTTP");} catch(ex){xhr = false;}} if (!xhr && typeof XMLHttpRequest != 'undefined') {xhr = new XMLHttpRequest();} return xhr; } function GetPushpins() { map.DeleteAllPushpins(); xhr = CreateXHR(); xhr.onreadystatechange = ProcessPushpins; xhr.open("GET", "getInfo.aspx?action=getLocations"); xhr.send(); }

Tip: move pushpins with visible area function DrawMap(){…map.AttachEvent("onchangeview", GetPushpins);} function GetPushpins(){ … mapDiv = document.getElementById('myMap'); leftTopLatLong = map.PixelToLatLong(0, 0); rightBottomLatLong = map.PixelToLatLong(mapDiv.offsetWidth, mapDiv.offsetHeight); hr.open( "GET", "getInfo.aspx?action=getVisibleLocations&left=" + leftTopLatLong.Longitude + "&top=" + leftTopLatLong.Latitude + "&right=" + rightBottomLatLong.Longitude + "&bottom=" + rightBottomLatLong.Latitude); … } public string GetItems(RectangleF LatLongBounds) { … from listing in _context.Listings where listing.Longitude = LatLongBounds.Bottom

What might be next Atlas RSS consumption Intelligent data reload Adding/changing sources of data

Useful links