A web-based system for notifying environment violation.doc

56 410 0
A web-based system for notifying environment violation.doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

A web-based system for notifying environment violation

Table of Contents List of Figures v List of Tables vi Notions and Abbreviations vii Geographically Encoded Objects for RSS feeds vii Chapter Introduction 1.1 Introduction 1.2 Our approach .1 1.3 Thesis structure Chapter Web-based system: model, architecture .3 2.1 Introduction 2.2 Web-based system model .3 2.2.1 Static web model 2.2.2 Dynamic web model 2.3 Dynamic web-based system architecture .6 2.3.1 Three-tier architecture 2.3.2 Client design: Thin client and rich client 10 2.4 Web 2.0 and virtual community 11 2.5 Summary 12 Chapter 3: .13 Web-based Geographic Information System 13 3.1 Geographic Information System overview 13 3.1.1 Definition 13 3.1.2 Data representation in GIS system 13 3.1.3 Other terms in GIS system 15 3.2 Web-based Geographic Information System 15 3.3 Microsoft Virtual Earth 17 3.4 Summary 18 Chapter 4: 19 GreenPeace system 19 4.1 Introduction .19 4.2 Functional and non-functional requirements .19 4.2.1 Functional requirements 19 4.2.1 Non-functional requirements .20 4.3 System architecture 20 4.3.1 Presentation tier 21 4.3.2 Business logic tier 22 4.3.3 Data access tier 23 4.4 Summary 23 Chapter 5: 24 GreenPeace implementation 24 5.1 Introduction .24 5.2 Virtual Earth map control 24 5.2.1 Properties 24 5.2.2 Methods .25 5.2.3 Events 25 5.3 Silverlight control 27 5.3.1 Host control .28 5.3.2 Popup control .29 5.4 GeoRSS data collection 30 5.5 Windows Communication Foundation web services 31 5.6 RSS Feed with proxy 35 5.7 Database access 37 5.8 Summary 38 Chapter 6: .39 Demonstration .39 6.1 System Requirements 39 6.1.1 Client Side 39 6.1.2 Server Side 39 6.2 Use cases 39 6.2.1 First look at GreenPeace 39 6.2.2 Sign in 40 6.2.3 Work with GreenPeace 40 6.2.3.1 Home menu .41 6.2.3.2 Features menu 42 6.2.3.2 Services menu 43 6.2.4 Context menu .45 6.3 Application evaluation .47 6.3.1 Benefits of application .47 6.3.2 Application scopes .47 Chapter 7: 48 Conclusion 48 List of Figures Figure 2.1 Static web model Figure 2.3 Three-tier architecture Figure 3.1 Raster map image Figure 3.2 Vector map image Figure 3.3 Three-tier model in Web GIS system Figure 3.4 Virtual Earth in action Figure 4.1 System Architecture Figure 5.1 Web service model Figure 5.2 Database diagram Figure 6.1 Full view of GreenPeace Figure 6.2 Sign in form Figure 6.3 Docklet menu Figure 6.4 Image viewer Figure 6.5 Bookmark block Figure 6.6 Tag block with information box Figure 6.7 Events box Figure 6.8 Statistic box Figure 6.9: Search Block and result Figure 6.10: Routing on the map List of Tables Table 2.1 ASP.Net simple code Table 2.2 ASP.Net output Table 2.3 Simple HTML code Table 2.4 ASP.Net code to query SQL Server Table 5.1 GeoRSS format Table 5.2 VEMap event handler Table 5.3 Silverlight declaration Table 5.4 Silverlight event handler Table 5.5 WCF proxy at Silverlight control Table 5.6 GeoRSS generator Table 5.7 WCF Service declaration Table 5.8 WCF Service implementation Table 5.9 Statistic web service implementation Table 5.10 Proxy implementation Table 5.11 GeoRSS format Table 5.12 RSS Feeder Notions and Abbreviations GIS Geographic Information System SMS Short Message Service RSS Really Simple Syndication HTML Hypertext Markup Language ASP Active Server Page JSP Java Server Page XML Extensible Markup Language WCF Windows Communication Foundation SOAP Simple Object Access Protocol GeoRSS Geographically Encoded Objects for RSS feeds Chapter Introduction 1.1 Introduction The development of human society makes a change of environment to satisfy their needs It produces consequently destructive effects to the environment In the reverse direction, environmental changes affect human being deeply, such as forest destroyed, the global warming, etc It is the ring alarm about World Environment which is in danger nowadays The importance of environmental protection was realized and mentioned many years ago In November 11th, 1997, Kyoto Protocol[1] of reducing Greenhouse was agreed, covers more than 170 countries in practical actions According to Word Resources Institute, over 10000 non-governmental organizations which work in environment preserving field were established up to first decade of 21th century Regardless all protective activities, the global environment is getting worse, because the efforts to fight for environmental protection is too small while the world’s population is raising up very rapidly People with their activities such as consuming, producing, building and so on harm the environment daily Unfortunately, almost of them ignore or not realize it The perceptive ones not know the best way to share with others, to react for better place Modern technologies with their innovative products such as Internet, World Wide Web and Mobile Phone are powerful tools which can help to solve all problems above GreenPeace is an instance of these solutions, a web-based system for community to incorporate to monitor and notify all environments problems to government and corresponding offices With GIS built in, it is the open information channel for all of people to join in monitoring environment In next chapters, we will explain in details the structure and works of GreenPeace 1.2 Our approach This web-based application changes the way people get and share environmental information, in which users can submit or get environmental information about every place all over the world with the use of modern communication technologies such as Internet and mobile network An exciting looked, GIS-based digital map Virtual Earth empowered with productive database platform SQL Server, and comprehensive data communication component Windows Communication Foundation, allows information to be updated immediately, visually and easily In case of emergency, the processing speed of GreenPeace is a key factor which helps people, Government and related organization together react sudden environmental problems efficiently On the other hands, GreenPeace also supports people in notifying environmental hazards as well as in searching not only the information but also the solution for problems from professional resources Every individual can contribute effort to react environmental events happening around us By making a social network, GreenPeace improves the quantity and quality of members who take part in protecting environment campaign People will raise their perception and skills from other friends, they also can help others In summary, GreenPeace supplies users a virtual visual environment to preserve, lead to help people protect their live environment 1.3 Thesis structure The rest of this thesis is organized as below: Chapter 2: gives an overview of web based system Chapter 3: introduces the web-based GIS Virtual Earth Chapter 4: presents the GreenPeace system with system architecture and implementation Chapter 5: demonstrate GreenPeace system with use cases Chapter 6: gives a summary and objectives in the future public { public { // if { class UserService : IUserService int GetLogin(string ID, string password) Query the database for authentication ((ID == "Admin") && (password = "123")) return 3; } else return -1; } public UserInfo GetUserInfo(string ID) { if (ID == "Admin") { return new UserInfo() { levelID = 3, EmailAddress = "Admin@website.com" }; } return null; } } Table 5.8: WCF Service implementation The GreenPeace system implements various web services for many purposes: - PointService: Provide detailed information about each location, permit to submit new location, new report - StaticService: Provide statistic information, such as top new locations, most viewed reports… - UserService: Provide user functions, such as login, get preference - SearchService: Provide search database function - CommService: Provide communication functions, such as Email or SMS The code below shows a function implemented in StaticService The others are implemented by the same way: 34 public List viewMax(int number) { SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["SqlConn"] ConnectionString) ; string sqlStr = "select top " + number + " locations.ID, title, longitude, latitude, url_icon from locations join locationTypes "+ "on locations.typeID = locationTypes.ID " + "order by (views) DESC"; SqlCommand cmd = new SqlCommand(sqlStr, sqlConn); sqlConn.Open(); SqlDataReader dr = cmd.ExecuteReader(); List result = new List(); while (dr.Read()) { Location aNewLoca = new Location() { title = (string)dr["title"], longitude = (double)dr["longitude"], latitude = (double)dr["latitude"], icon_url = (string)dr["url_icon"], id = (int)dr["id"] }; result.Add(aNewLoca); } } return result; Table 5.9: Statistic web service implementation 5.6 RSS Feed with proxy GreenPeace supports feeding RSS data from remote source at client side, using Silverlight to parse the contents and display them However, because of the crossdomain issue, Silverlight does not support direct connection to remote server, it supports only the local domain To solve this problem, we build an internal proxy at server side, using this proxy to connect to remote server and return the contents to the Silverlight control which queries remote connection through proxy We create a web proxy (Proxy.aspx) at server side, with parameter passed is the URL of remote RSS address When called, this proxy parses this URL, makes a WebClient() object to connect to the URL provided, downloads content of this URL as string, then responses it to client We implement the proxy by this code below: 35 string url = Request.QueryString["url"], if (url != null) { WebClient wclient = new WebClient(), try { string s = wclient.DownloadString(url), Response.Write(s), } catch { Response.Close(), } } Table 5.10: Proxy implementation At client side, Silverlight control gets the content of remote URL by calling, for example: "Proxy.aspx?url= http://www.nytimes.com/services/xml/rss/nyt/Environment.xml" After content of remote URL is loaded from proxy, Silverlight control simply parses this RSS content and display it The RSS content has a format like that: New Climate Report Foresees Big Changes http://www.nytimes.com/2008/05/28/science/earth/28climate.html? partner=rssnyt&,emc=rss A new federal report says the rise in levels of atmospheric carbon dioxide is influencing climate patterns and will produce an uneven national map of harms and benefits Table 5.11: RSS format In Silverlight control, we create a XML reader to parse through RSS content: StreamReader streamreader = new StreamReader(content, true), XmlReader xr = XmlReader.Create(streamreader), while (xr.ReadToFollowing("item")) { xr.ReadToFollowing("title"), title = xr.ReadElementContentAsString(), xr.ReadToFollowing("link"), hlink = xr.ReadElementContentAsString(), } Table 5.12: RSS Feeder 36 Now we can use information we loaded from remote server through a proxy to perform our own functionality In GreenPeace, we display newest news from RSS at the footer of web page as breaking news 5.7 Database access GreenPeace uses Microsoft SQL Server Express version 2005 to store data The schema of this database is shown below: Figure 5.2: Database diagram 37 We describe some important tables in this database: - LocationTypes(ID, url_icon, description) – Classify the location types on the map - ReportTypes(ID, title, description, url_icon) – Classify report type in specified location - Locations(ID, typeID, userID, title, description, longitude, latitude, submitdate, views, tags) – Save the location identified on the map - Reports(ID, typeID, locationID, userID, description, ranking, title, elementID, submitdate, views, tag) – Save the report about specified location - Users(ID, userName, password, authority, liveID, preference, defaultLat, defaultLong, avatar_url, rss_url) – Save information about user - Bookmark(userID, locationID) – Save the location marked by user - Comments(ID, userID, reportID, ranking, title, submitdate, views) – Save the comment about each report - Media(ID, userID, title, description, media_url, sticky) – Save the media URL of image, video using for displaying - Smses(ID, locationID, phoneNumber, description, isProcess, typeSMS, submitdate) – Save the incoming and outgoing SMS of application 5.8 Summary This chapter gives explainable view about the actual work of this system by discovering the implementation of some important controls of GreenPeace system This is not full implementation, just the short description about considerable points of each control The full implementation is included on the source code attached In next chapter, we introduce the demonstration of GreenPeace Seeing it in actual work provide us more images about it 38 Chapter 6: Demonstration 6.1 System Requirements 6.1.1 Client Side - Silverlight 2.0 beta runtime - Internet Explorer 7.0 6.1.2 Server Side - DotNet Framework 3.5 - ASP.Net 2.0 or later - SQL Server 2005 Express Edition 6.2 Use cases 6.2.1 First look at GreenPeace Figure 6.1: Full view of GreenPeace 39 6.2.2 Sign in People have Guest accout in default With the Guest Account, people can view information (overall and in details) for each location located in the map If they sign in, they will have User Account or Admin Account (User Account and Admin Account have more authority to interactive with the map and locations) Click on the Sign in to login system Figure 6.2: Sign in form After authenticated, users can use the application with their full permission Alternatively, people can login with the Live Account as secondary login system 6.2.3 Work with GreenPeace Move mouse on top, the menu Docklet will appear Figure 6.3: Docklet menu 40 Click on one icon, one function of website will work Move the mouse out of menu, it will automatically hide and user can see the Image Slide Show, it shows the hot news pictures about environment around us, click on one image, the image viewer will appear, click the viewer to close it Figure 6.4: Image viewer 6.2.3.1 Home menu Home menu includes functions focusing about user navigation, such as bookmark, preference: - Bookmark: list of locations that have event about environment such as has: Fire, Water Contamination, and Air Pollution which are bookmarked, in order to easy to view when access the website 41 Figure 6.5: Bookmark block User can uncheck a location to remove it out of Book Mark list Beside, to get more details about it, user can click on a location of the list, the detailed information box will appear as center of screen 6.2.3.2 Features menu Feature menu contains many exciting functions of GreenPeace system, such as Filter, Tags, Notice, Calendar and SMS block: - Filter Block: There is a list check box type of location to show on the map and list of report type to filter For more information, user can show only locations in which have, for example fire reports or Litter report… - Notice: List some location which has high danger ranking then give notification for people who live near it For example, a location has too many rubbish, it can have more chance of having overload rubbish At this case, many virus and disease can grow up Another example about this function, when the root of river is contaminated, high chance for places along with this river will be contaminated in short time - Calendar: When user chooses a day, it will list all report from this day to now Click on a report title, there is box of details (comments, pictures…) will appear and map will be centralized the location which has this report - Tags: Tags block gives a list of top key words accessed Click on a key word, there is a list of location related to this key word, then click on a location of this list, user can have further information 42 Figure 6.6: Tag block with information box 6.2.3.2 Services menu Services menu contains the feeder for outside service, such as RSS Feed about environment news, and Environmental Events about international conference news - RSS Feed: RSS Feed allows user choose a feed site to get headline information about environment around us, - Environmental Events: gives the list of all events in the world to user Figure 6.7: Events box 43 6.2.3.3 Statistic menu Statistic menu provide top high mark locations follow: Top Reported Locations, Top Visited Locations, Top Newest Location and Top Danger Ranking Locations, as below: Figure 6.8: Statistic box 6.2.3.4 Search menu - Search location: find the locations in the map follow name - Search content: find locations which has comments, report all details information match with the content user want to search, for example, searching Fire will list all the locations where has fire reports, fire comments or have fire in the past if it is informed to the system - Search where in the map: Find a place 44 Figure 6.9: Search Block and result 6.2.4 Context menu Context menu appears in the pointer position when user right clicks on the map Context menu contains: - New Location: Create new location at the position mouse clicked - New Location from GPS: Create new location with information from a GPS image - New Report: Submit new report about the clicked location - Start draw route here: Mark start point to draw guide route - Draw route to here: Draw guide route from start draw point to the end draw point - Bookmark this location: Add the location to user’s bookmark - Stick this location: Stick a location, its image will be shown at the banner with its description Use to warning about hot location (Only admin can use this feature) - Set default location: Set default location to show on map when logged in - Report to Government: Report about the location to Government or responsible people (Only admin can use this feature) - Delete this location: Delete a location on map (Only admin or user created location can use this feature) Some of important functions appear when right clicking: 45 - Submit New Location: People submit new location to show on the map in order to give information to all users in the world People can choose the image, type the description, tags Choose the type of location, title and so on - Submit New Report: A location can have many reports Each report notices an event occurring in this location User can submit report in order to inform the event - Draw the routing: Choose the start location by Start draw route here and destination by Draw route here, the system will draw the route from start location to the destination and give the list of turn directions beside the length of route Figure 6.10: Routing on the map 46 6.3 Application evaluation 6.3.1 Benefits of application This application provides high effective information channel on communicating, reporting and associating between individuals, organizations and community GreenPeace can affect on human perception about global environment It is designed for all of people to take part in, strengthen the wave of environmental protection to each individual Each individual shines, community shines Application creates motivated contribution for improving tourism, especially ecotourism It helps to advertise the image of each country and each local into the world Furthermore, it helps to predict the new affect and scope of specified environmental zone and related ones In addition, GreenPeace can be broadened not only for environment field, but also for all of map based services, such as disaster notification, hydrometeorology forecasting, tour guide, etc 6.3.2 Application scopes GreenPeace web-based system is used for communication among wide range of community, Environmental Groups and Governmental Institutions Moreover, it is used for people to immediately and continuously update information as well as notice about environmental problems around Furthermore, this product is used for providing data and information to many animal protection organizations, agricultural developing Institutions or various companies of Ecotourism GreenPeace Website product is the first step of a plan that uses DotNet Technology in developing products for Tourism, Public Order and so on 47 Chapter 7: Conclusion In this thesis, we have studied a lot about web system, model and architecture, the trend of technology, especially web technology We also have studied about the latest technologies to develop the comprehensive web application Upon it, we proposed an application for our idea “action for global environment” GreenPeace will be the special link that pulls people, Environmental Groups and Governmental Institutions closer in the road of building Green-Clean-Beautiful World Sustainable Environment We believe that our application will be the confident propaganda channel for Environmental problems It will strengthen people’s awareness of the contamination of environment around the world In the future, we would like to enrich the application by adding more detailed database with high accuracy Security, load capability must be considered more carefully But the most important thing is that we need to bring it to the community worldwide, make it the good place for people to join in, and together, we make a better world 48 ... Geographic Information system (GIS) is any system integrates hardware, software, and data for capturing, managing, analyzing, and displaying all forms of geographically referenced information... operating system - Easy to manage, update database: Database is located at dedicated server that managers can maintain and update it easily - Quick delivery: web-based model make it portable to... 2.3.2.3 Data access tier It consists of the database server that contains all logic data of application Separating logic data from application into it will make program scalable and higher performance

Ngày đăng: 27/10/2012, 16:40

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan