How Are You

373 views
327 views

Published on

A microblogging and user sentiment capture, analysis and visualization infrastrsucture

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
373
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

How Are You

  1. 1. Consumer Mood Capture Through Microblogging And Sentiment Analysis By Shivanshu Kumar Singh
  2. 2. Copyright © 2011Shivanshu Kumar Singh
  3. 3. ABSTRACT Consumer Mood Capture Through Microblogging And Sentiment Analysis By Shivanshu Kumar Singh For analyzing what consumers are thinking and how they feel about a specificbrand, company, store, product, etc. there are many mechanisms that exists or are in theworks that aim at understanding what event or reason was the driving force behind thesuccess or failure of a product or service or what made a consumer’s perception andfeeling for something, change for better or worse. In the micro-blogging area, attemptshave been made and are still being made to analyze streams of user activity and updatesto decipher the context behind what a user’s activity really means, the success of whichhas been limited. Traditionally sales data has been analyzed to understand how tomaximize profit and to see which products are popular and which aren’t. Similarlyconsumer reports, cities and governments try to capture the satisfaction and happinessindexes etc. for consumers and citizen to see how they or various companies orgovernments fare in keeping the consumers happy. There are three key elements that aremissing today in all these approaches, first being the exact information related to user’sperception i.e. if the user is happy or not regarding something, without having to say a lotof words for the same, second is the fact that all the current analyses are done after thefact i.e. popularity or satisfaction index is attained only after the damage has been doneand not at the time or before the damage occurs and third a clearer understanding of whatexactly affects this perception or satisfaction e.g. sales of wireless contracts do not reallymean that the users are very happy with the company. This work aims at coming up withan infrastructure and a set of primitives that can be used to improve upon all of the above. iii
  4. 4. AcknowledgmentsThe authors are deeply indebted to Prof. Dan Harkey, for his invaluable comments and guidance in the preparation of this study. iv
  5. 5. Table of ContentsChapter 1. Project Overview ............................................................................................1   Introduction .................................................................................................................1   Proposed System Description And Contribution ........................................................3  Chapter 2. System Architecture .......................................................................................5   Introduction .................................................................................................................5   Architecture Subsystems .............................................................................................6   Core Components ................................................................................................6   Secondary Components .......................................................................................7  Chapter 3. Technology Descriptions ................................................................................8   Middle-Tier Technologies ...........................................................................................8   Data-Tier Technologies ...............................................................................................8   Client Technologies .....................................................................................................9  Chapter 4. System Architecture and Design .................................................................10   Middle-Tier Design and API Description .................................................................10   Data-Tier Design .......................................................................................................15   Client Design .............................................................................................................18  Chapter 5. Implementation Details ................................................................................26   Middle-Tier Implementation .....................................................................................26   Data-Tier Implementation .........................................................................................33   Client Implementation ...............................................................................................36  Chapter 6. Deployment....................................................................................................45  Chapter 7. Summary, Conclusions, and Recommendations ........................................47   Summary & Conclusions ...........................................................................................47   Recommendations for Further Research and Development ......................................47  References .........................................................................................................................51  Appendices ........................................................................................................................52   Appendix A. Description of CDROM Contents........................................................52   v
  6. 6. List of FiguresFigure 1 – Proposed System Core Architecture ............................................................... 5Figure 2 – Core Component Common Design ............................................................... 10Figure 3 – ‘How Are You?’ Client Architecture ........................................................... 19Figure 4 – ‘How Are You?’ app – typing out a new post - iOS .................................... 20Figure 5 – Sample client app on iOS ............................................................................. 20Figure 6 – Disabling Geolocation .................................................................................. 21Figure 7 – Showing geolocation of a user activity ........................................................ 21Figure 8 – web app on iOS – showing the checked in place with geolocation .............. 21Figure 9 – web app on iOS - Past User Activity ............................................................ 21Figure 10 – HowAreYou? web app on Firefox, OS10.7 - New Post and Past User Activity ....................................................................................................... 22Figure 11 – Web app - creating a new place with composite geometry definition for visualization purposes ................................................................................ 23Figure 12 – Visualization of user mood data over a period of time with granularity of one day .............................................................................................................. 24Figure 13 – Visualization and the ability to compare, zoom in, focus and filter specific time periods ................................................................................................ 25Figure 14 – Deployment Strategy Overview ................................................................. 42 vi
  7. 7. List of Code SnippetsSnippet 1 – Creating New Post - PostHandler ............................................................... 26Snippet 2 – POSTHandlerDAO and DBHandler for MySQL DB ................................. 28Snippet 3 – LOCATIONManager – checking for the availability of a new place name and separation of concerns ................................................................................ 31Snippet 4 – ‘HowAreYou’ Web App – Bare minimum initial HTML code to setup the UI ..................................................................................................................... 36Snippet 5 – Generating the complete UI in JavaScript depending upon user triggered events .......................................................................................................... 36Snippet 6 – On Event, user data processing and AJAX request creation ...................... 38Snippet 7 – AJAX infrastructure developed in-house ................................................... 39Snippet 8 – HTTP POST requests relay proxy developed in PHP ................................ 40Snippet 9 – HTTP GET requests relay proxy developed in PHP .................................. 41Snippet 10 – Tomcat WEB-INF/web.xml configuration file ......................................... 43 vii
  8. 8. 1Chapter 1. Project OverviewIntroduction Brand Management, sales predictions, maximizing profits and anticipatingconsumer needs and sentiment etc. all have traditionally relied on data like sales figuresfor products, consumer reports and surveys and more recently on analyzing user’sactivities and updates in the world of social networking and micro blogging. When itcomes to having a complete picture of what a user is thinking, what is his / her outlookand perception of a company or a product, companies like Amazon.com and Walmart, i.e.brick and mortar stores as well as online shopping websites and other retailers have reliedon sales data, figuring out what to have a focus on at what time and for whom in order tomaximize sales and/or have competitive pricing, co-branding etc. for certain productswhich are generally bought together or during a particular time of the year or by aparticular segment of the market. Consumer reports study the satisfaction levels ofconsumers by doing surveys about companies, brands and products to gauge the level ofsatisfaction that the users have with a particular product or service and the various playersin that area. All of these lack something or the other and fail to paint a complete picture.For example the sales data tells us what is popular only after the sales have been made sothat this can be used at a later stage. It cannot provide more real time or prompt insightinto how sales might change for reasons directly or indirectly related to the product(s) inquestion. Moreover something being popular at one time doesn’t always mean that it is arecipe for success at all times. Consumer reports also do a survey about products,services, companies etc. and governments come up with happiness and satisfaction
  9. 9. 2indexes but this is done way after the fact. These approaches have two shortcomings: onebeing as usual that they are not the more current or recent indicators of the state of affairsand two: they have no guarantee of accurate information as interpretations can be farfrom reality. Understanding what a customer is feeling about a brand is also done by doingsurveys. The problem with this as numerous studies have shown, is that people do nottend to give out accurate information if they are needed to write long descriptions of whatthey are feeling and why. Moreover if this is asked of them after a good amount of timehas passed since the time that a certain event or any reason caused them to develop acertain feeling and perception towards a brand, the details captured in this way might befar from accurate. Microblogging wing to its concise and on the spot nature solves thisproblem to some extent and captures what happens and why, quickly and in a moreaccurate and concise way. Making use of this a number of data stream analyzers havebeen developed in the recent past to monitor sentiment about something but the nextproblem that comes with just using user’s text input and natural language to understandthe correct emotion behind it is the fact that it is very hard to do, time consuming as wellas a good number of discrepancies may creep in if dealing with sarcastic statements andreviews. This approach however useful to some extent, again does not have the completeinformation or might fail to capture the complete or the real emotion informationassociated with a user activity / update. This work aims at bringing together the various approaches that exist forcapturing user sentiment as well as doing it in a novel way such that the information
  10. 10. 3about how a product or brand is perceived and how consumers feel about it, can becaptured close to real time, paints a complete picture for better understanding and so thatit can be attained earlier than later so that this insight can be used to take steps to furtherimprove sales, satisfaction or what have you of the consumers.Proposed System Description And Contribution To address the issues mentioned above, proposed here is a system that would bringtogether the best practices for capturing user sentiment and which can be used forvisualizing this information close to real time. The proposed system would consist of a set of primitives in the form of datacapture and query/visualization services that can be used to build multiple applications ontop for various computing platforms (user-facing or otherwise). In order to have acomplete picture of how a user’s perception changes with time, it is proposed that thefollowing information be captured from the user in as concise a way as possible: 1. Location of the user 2. Meta Data about the location i.e. the business, city, country etc. related information 3. Short description of what the user wants to say (Microblogging) so that it is clear and concise and to the point 4. An Explicit mood or emotion information that is associated with this. The explicit mood information e.g. Happy or Angry helps in doing away with thecomplexity of having to decipher the mood from text by applying complex processing
  11. 11. 4and having to deal with secondary meanings and sarcasms etc. The location informationhelps in tying this update or mood to a particular geo location and if available, to somemeta data as well about this location which might help in getting to know more aboutwhat this geolocation means and also at the same time having the flexibility ofinterpreting a geolocation as per the needs of mood and sentiment analysis. The set of primitives proposed here would be something of the equivalent of webservices that enable developing focused or general applications for both capturing such orrelated information and then visualizing or querying it in numerous ways as needed. Theyalso should have the ability to be adapted for any other kind of usage scenarios beyondjust mood or sentiment capture and analysis. The visualization and data query component of the proposed system should havethe following abilities: 1. Ability to be queried for a certain geolocation or an area or combinations thereof. 2. Ability to query for the aforementioned geolocations for a certain time period 3. (1) and (2) above for a given granularity of time, e.g. year or month or day etc. being the unit time intervals for the data requested. 4. The ability to query for one or more locations for any given time period and granularity, or comparison purposes. The subsequent section of this report describe how the proposed system’srequirements were met and describe in detail the development of a sample application foruser sentiment and related data capture and visualization.
  12. 12. 5Chapter 2. System ArchitectureIntroduction To meet the proposed system requirements as described earlier the system isdivided into multiple components. Figure 1 – Proposed System Core Architecture showsa high level architecture of the proposed system. Client Calls HTTP Authentication Dispatcher Cache/Index User Registration DATA LOCATION POST Server QUERY manager handler handler PRIVACY Storage Figure 1 – Proposed System Core Architecture The next section provides a description of the components shown in the figureabove.
  13. 13. 6Architecture Subsystems The proposed system is divided into the following broad subsystems:Core ComponentsPost Handler This component is associated with any and everything related to the data generatedfrom the user. This includes the geo location tagging, text, mood and related informationalong with a timestamp. It also serves as the handler for requests regarding user activitytimeline data.Location Manager This component handles all the requests and services related to the geo location andthe metadata related to a location. Custom places can be defined using this componentand then used accordingly when searching for user data and mood information for thatparticular place.Data Query Handler This is the component responsible for providing mood data for one or morelocations or places over a specified period of time for a given granularity of time. Clientscan make calls to this component to query mood data that can then be used forvisualization purposes.
  14. 14. 7Storage The Database and storage component, responsible for storing all the user, pose andlocation information.Dispatcher Reads the incoming requests and dispatches then accordingly to the rightcomponent. All requests pass through the Dispatcher.Secondary ComponentsUser registration Responsible for registering usersPrivacy Applied on a system wide level when any data is accessed on a client request. Thisis the layer responsible for ensuring that any data that goes out is in accordance to theprivacy rules set for the data that is being sent out.Authentication Used for authenticating client / API requests / calls.Server Cache / Index Maintained by the authentication component to speed up the authentication processfor each client request. Recommended implementation using DHT solutions.
  15. 15. 8Chapter 3. Technology Descriptions An array of web technologies can be used for the development of the proposedsystem. With the limited time and resources at hand only the core components of thesystem were developed. These primitives complete the desired core functionality and thesecondary components can easily be developed on top of this to achieve the full fledgedfunctioning of the proposed system. The primitives developed were also used to developa sample web based mobile client application for consumer mood capture andvisualization and named as ‘How Are You?’ A description of the various technologiesused for the development of the various components and the sample client are as follows:Middle-Tier Technologies The components: Post handler, Location manager and the Data Query handler weredeveloped as POJOs in java with Jersey as the reference implementation for providing aRESTful API for data capture, storage and retrieval. JDBC was used as the connectorbetween the Data Tier (Storage) and the middle tier of the system. The Jersey referenceimplementation for REST which involves having a servlet, mapping the various URLs tofunction calls and dispatching requests, was used make the functions available asRESTful web services and acting as the Dispatcher for client requests.Data-Tier Technologies For the scope of this project, the data tier was implemented in MySQL. Tables forstoring user data and location information were used along with heavy indexing of the
  16. 16. 9data which is frequently accessed upon client requests. As a future work and as arecommendation for the implementation of the component for Server Cache / Index thatserves the Authentication component, DHT, Key-Value storage solutions like voldemortor mongo DB can be used to quickly maintain info about authenticated sessions and usethat to authenticate client requests.Client Technologies For the sample application ‘HowAreYou?’ developed for this project, the clientwas developed solely in HTML and JavaScript. This was done in order to demonstratethat the client can be extremely lightweight, run solely in a browser without any externalsupport of any third party plugins or any other software and be extremely platformindependent with a deep reach into a plethora of computing platforms that exist today. Asimple webserver with a HTTP Get and POST request relay proxy, developed in PHPwas also used as a way to satisfy the browser security requirements when using AJAXcalls to the API offered by the core system.
  17. 17. 10Chapter 4. System Architecture and Design Described in this chapter is the detailed design of the proposed system. Thefollowing sections in this chapter discuss the design for various components, divided intothree groups: the database and storage layer, the middle or business layer and the sampleclient side design.Middle-Tier Design and API Description The middle layer for this system consists of the core functionality or service-providing portion of the system along with the other functions that need to be performedfor successfully serving the client requests. The components: Location manager, DataQuery handler and Post Handler are each implemented using the Data Access Object(DAO) / DAO Factory design pattern. This has been done to keep the business logicseparate from the storage related functions. The design was kept pretty simple andstraightforward as the number and kind of functions needed to serve the required Core Component Common Design Request Handler Pre-Process DB Conn HandlerDAO Dispatcher JSON Pkging. Pool Response Post-Process Storage Figure 2 – Core Component Common Design
  18. 18. 11functionality was pretty basic in nature, it’s the way that the various actions triggeredupon client requests are coordinated and managed that was more important in this case.Figure 2 – Core Component Common Design shows a high level view of how each of thecore components of the middle tier are designed and how the service invocation that takesplace. The middle tier is what essentially exposes the API that the clients can use tobuild an app on top of the system. The API is restful in nature implying that HTTP basedrequests are handled by the system where a specific url would refer to a specific functionbeing served. Assuming the ‘BASEURL’ for this suite of services is known, the details ofthe API exposed are as follows:1 User Data Capture related:1.1 New Post Http request Type: POST Path: BASEURL/post/create Params: a. lat: Latitide of the geolocation of the user b. lng: Longitude of the geolocation of the user c. mood: A numeric value indicating the level of the mood of the user (depends upon the application on how it wants to interpret this value) .
  19. 19. 12 d. post: the test of the user’s post. This text is also scanned for the hashtags i.e. any text between a # and the following psace (‘ ‘) and all such tag information is also stored in the system for use later. e. username: the unique username of the user f. place: (optional): if available, the meta data about the geo location1.2 Get Past User Activity Http request Type: GET Path: BASEURL/post/list/paginated/{username}/{start}-{count}-{incdec} Params: Over here, currently Path Parameters are being used. The values within curlybrackets in the Path defined above, are the parameters for this request For example avalid request can be: BASEURL/post/list/paginated/user/last-25-0 . The request URLthus should be formed in this fashion. a. username: the unique username of the user whose past activity is being requested b. start: the starting postId from which onwards the posts are requested. Possible values: I. ‘first’: if the user activity being requested is since the beginning of time for that user II. ‘last’: if the user activity being requested is the latest one or starting from the latest one III. postId: the post id from which the user activity is requested.
  20. 20. 13 c. count: the number of user posts requested d. incdec: this is a flag (0 or 1) which denotes which way to retrieve the user activity with respect to the ‘start’ postId where 1 is for forward and 0 for moving backward chronologically.2 Data Query and Visualization related:2.1 Define a New Place Http request Type: POST Path: BASEURL/place/create Params: a. name: name of the new place being defined. This has to be unique. b. geometry: the geometry of the place as a JSONArray string. This json array contains one or more geometry-sub-components that’s together define the geometry of the place. Each geometry-sub-component in turn has teo geo components and a type associated with it. The structure of this JSONArray should be as follows: [ { “component1”: component1Value, "component2":component2Value, "type": typeOfGeometry },
  21. 21. 14 {…, …, …}, {…, …, …} ] The “type” currently can have one of the following two values: ‘point’ or ‘area’. Ifit is a point, the component1 is the latitude of the geometry-sub-component andcomponent2 the latitude. If its an area, then component1 is latitude1,longitude1 andcomponent2 should be the latitude2,longitude2 where component1 defines the top-leftcorner and the component2 the right-bottom corner of a rectangle and this area geometry-sub-component. c. description: (optional): description of the place.2.2 Check If Place Name Is Available Since the name of any place defined in the system should be unique, this api can beused as a lookup service to see if a desired name is available. Http request Type: GET Path: BASEURL/place/check Params: name: the name of the new place being created. e.g. a valid request would look like this: BASEURL/place/check?place=placename Response: A JSON object string which can be of three types: {"status", "ok"} OR {"status","exists"} OR {"status", "error"}. They are self descriptive in nature.
  22. 22. 152.3 List All Places Http request Type: GET Path: BASEURL/place/list2.4 Query Mood Data Http request Type: GET Path: BASEURL/mood-data Params: a. place: a CSV list of the places for which averaged mood data is requested b. from: timestamp from which the data is requested. In the format: ‘YYYY-MM- DD hh:mm:ss’ e.g. 2010-10-11 14:01:05 c. till: timestamp till which the data is requested. In the format: ‘YYYY-MM-DD hh:mm:ss’ d. granularity: granularity defines the unit of time over which mood readings should be averaged out. Possible values are: year, month, day, hour, minute and second.Data-Tier Design In order to achieve the functionality discussed above, tables were created to storethe generated information as well as indexing n highly queried fields and compositefields was also done to speed up the querying process.
  23. 23. 16 Here is a description of the database schema: 1. The main table for the system is `userposts`. This is the place to store all the useractivity and related information. The table’s structure is as follows: CREATE TABLE IF NOT EXISTS `userposts` ( `id` int(255) NOT NULL AUTO_INCREMENT, `username` varchar(500) NOT NULL, `lat` double DEFAULT NULL, `lng` double DEFAULT NULL, `mood` int(11) NOT NULL COMMENT mood associated with the post, `post` varchar(1000) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `place` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id`), KEY `lat` (`lat`), KEY `lng` (`lng`), KEY `loc` (`lat`,`lng`), KEY `place` (`place`), KEY `post` (`post`), KEY `username` (`username`), KEY `time` (`time`), FULLTEXT KEY `post_fulltext` (`post`), FULLTEXT KEY `place_fulltext` (`place`)
  24. 24. 17 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5772; 2. The table named `place` contains the meta data about a place, i.e. a name anddescription of the place along with a unique identified for the place for internal use. Tablestructure for it is as follows: CREATE TABLE IF NOT EXISTS `place` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(1000) NOT NULL, `description` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ; 3. The geometry details of all places are stored in the `placedetails` table. Tablestructure for it is as follows: CREATE TABLE IF NOT EXISTS `placedetails` ( `placeid` int(11) NOT NULL, `component1` varchar(1000) DEFAULT NULL, `component2` varchar(1000) DEFAULT NULL, `type` varchar(1000) NOT NULL, KEY `placeid` (`placeid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  25. 25. 18 4. ‘tags’ table contains the hashtag information associated with user posts. Tablestructure for table `tags` is as follows: CREATE TABLE IF NOT EXISTS `tags` ( `tag` varchar(500) NOT NULL, `postid` int(11) NOT NULL, `mood` int(11) NOT NULL, `lat` double DEFAULT NULL, `lng` double DEFAULT NULL, KEY `tag` (`tag`,`postid`,`mood`), KEY `loc` (`lat`,`lng`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;Client Design The sample client developed for the backend infrastructure developed, as describedin the preceding sections, was done completely in Javascript and HTML. The entiresystem was designed so as to keep the client lightweight and also allow integration /usage of the system by third party solutions. The infrastructure essentially exposedRESTful APIs so HTTP requests can simple be used to make use of the API and developany application / client / UI – lightweight or heavy, for this. As far as the ‘HowAreYou?’ application goes, the Figure 3 – ‘How Are You?’Client Architecture shows the client side architecture and interaction.
  26. 26. 19 Google Location MetaData, Core Client Charts API User Data Handler Event User Input, Validator and GeoLocation Processor Browser HTML JSON Processor AJAX Request AJAX Builder Response Handler Backend REST API JSON HTTP Proxy Figure 3 – ‘How Are You?’ Client Architecture As can be seen in the figure, the client runs inside the browser – and is writtenpurely in javascript with bare essential HTML. It gets the user data and the geolocationdata from the browser. The meta data about the location is fetched from Google’s Placesjavascript web service API. All this information is processed and an ajax requested isconstructed for a HTTP proxy. The http proxy is simply a relay service between the clientand the backend system’s API for data storage and retrieval. The visualization is alsodone partly by fetching the user data and then using the Charts API provided by google tovisualize this on a timeline. The client as well as the HTTP proxy need to be on the same
  27. 27. 20web server and can be fetched using any browser on a device with Internet access. Theuser of the HTTP proxy is necessary due to the client side web browser securityrestrictions for cross-domain Ajax calls. The client thus developed can be accessed from any web browser, be it a mobiledevice like iPhone, iPod or any android phone as well as laptops and desktops, tvs, gameconsoles, what have you – anything that lets you access the web and supports javascriptwould be able to access the client. For devices where native apps are needed or which donot support a web browser and JavaScript, the system’s easy RESTful API can be used tobuild custom applications for the target platform. Here are a few screenshots showing theclient application live on iPhone as well as a traditional browser. Figure 5 – Sample client app on iOS Figure 4 – ‘How Are You?’ app – typing out a new post - iOS
  28. 28. 21Figure 8 – web app on iOS – showing Figure 9 – web app on iOS - Pastthe checked in place with geolocation User Activity Figure 6 – Disabling Geolocation Figure 7 – Showing geolocation of a user activity
  29. 29. 22Figure 10 – HowAreYou? web app on Firefox, OS10.7 - New Post and Past User Activity
  30. 30. 23Figure 11 – Web app - creating a new place with composite geometry definition for visualization purposes
  31. 31. 24Figure 12 – Visualization of user mood data over a period of time with granularity of one day
  32. 32. 25Figure 13 – Visualization and the ability to compare, zoom in, focus and filter specific time periods
  33. 33. 26Chapter 5. Implementation Details This section discusses the implementation efforts and the approach taken whendeveloping the various layers and components of the system. Before getting into moredetails, a note about the design and development approaches is that the object here was tokeep the design and the code as easy, simple and straight forward as possible. Discussedhere are code snippets from the actual code, available as an attachment with this report.Middle-Tier Implementation The middle tier implementation was done using POJOs along with Jerseyreference implementation for REST to expose a set of RESTful web services. In generalthe DAO / DAO factory design pattern was implemented as far as possible and effortswere made to separate out the concerns for handling requests, getting data and formingthe response to enable high maintainability in case the response delivery mechanismswere to be altered at a later point in time. The snippets below show a sampleimplementation for a service to create a new POST. Here the part for checking theincoming request is kept separate from the DB related part where actually a record of theuser post is made.@Path("")public class POSTHandler { @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Path("post/create") public void newPost(@FormParam("lat")String lat, @FormParam("lng")String lng, @FormParam("mood")String
  34. 34. 27mood, @FormParam("post")Stringpost,@FormParam("place")String place,@FormParam("username")String username) { if( !(null==mood || "".equals(mood) ||"".equals(mood.trim()) || null==username ||"".equals(username) || "".equals(username.trim()))) { Double latDouble=null, lngDouble=null; if(null!=lat && null!=lng &&!("".equals(lat.trim()) || "".equals(lng.trim()))) { latDouble= Double.parseDouble(lat );lngDouble= Double.parseDouble(lng ); } if(null==post || "".equals(post)) post=""; if(null==place || "".equals(place)) place =""; //trimming: mood=mood.trim(); username=username.trim();place=place.trim(); post=post.trim(); lat=lat.trim();lng=lng.trim(); StringTokenizer postSplits=newStringTokenizer(post,",""); post=""; while(postSplits.hasMoreTokens()) post+=postSplits.nextToken(); String postForTags=post+" "; String tags=""; while(postForTags.contains("##")) postForTags=postForTags.replace("##","#"); for (int x=0; x<postForTags.length();x++) { intstartThisTag=postForTags.indexOf(#, x); if(startThisTag>=0) { intendThisTag=postForTags.indexOf( , startThisTag);
  35. 35. 28 if(startThisTag+1!=endThisTag) { StringthisTag=postForTags.substring(startThisTag+1,endThisTag).toLowerCase(); tags+=thisTag+","; } x=endThisTag; } else x=post.length(); } post= post.trim(); POSTHandlerDAO pOSTHandlerDAO = newPOSTHandlerDAO(); pOSTHandlerDAO.create(latDouble, lngDouble ,Integer.parseInt(mood), post, place, tags,username.toLowerCase()); } }} Snippet 1 – Creating New Post - PostHandler So as seen above all the processing and checking (and cleansing) of the user datais done ahead of moving on to creating a record. The part for creating a record andhandling the details regarding constructing the right queries for the right tables etc is doneseparately in POSTHandlerDAO, which in turn uses a DB handler to perform statementconnection and query execution etc for the specific database / storage system in use. Thislayering and separation of concerns helps in making the system more maintainable andable to apply aspects like privacy or other system wide or specific business rules andregulations if needed at a later point in time. The snippets below show the details of the
  36. 36. 29POSTHandlerDAO handling the user data recording and the DB handler for the MySQLDB.public class POSTHandlerDAO { private static final String posttable="userposts"; private static final String tagstable="tags"; public String create (Double lat, Double lng, intmood, String post, String place, String tags, Stringusername) { int x=0; Connection conn= (Connection) DBC.getDBC(); try { Statement st=(Statement)conn.createStatement(); String query="INSERT INTO "+posttable+"(lat, lng, mood, post, place, username) VALUES("+lat+","+lng+","+mood+","+post+","+place+","+username+")"; x=st.executeUpdate(query, 1); ResultSet keys = st.getGeneratedKeys(); int lastKey = 1; while (keys.next()) { lastKey = keys.getInt(1); } keys.close(); StringTokenizer tokens=newStringTokenizer(tags, ","); int tokenflag=0; if(tokens.hasMoreTokens()) { query="INSERT INTO "+tagstable+" (tag,postid, mood, lat, lng) VALUES ";query+="("+tokens.nextToken()+","+lastKey+","+mood+","+lat+","+lng+"), "; tokenflag=1; while(tokens.hasMoreTokens())query+="("+tokens.nextToken()+","+lastKey+","+mood+","+lat+","+lng+"), "; }
  37. 37. 30 if(tokenflag==1) { query= query.substring(0, query.length()-2); x=st.executeUpdate(query, 1); } conn.close(); }catch(Exception e) { e.printStackTrace(); } JSONObject js = new JSONObject(); try { js.put("status", x);//x>0 means thatsomething was updated inserted. } catch (JSONException e) { e.printStackTrace(); } return js.toString(); }}public class DBC { public static void testDBConnection() { try { System.out.println("..Testing DBC MySQLConnection ..n....Getting Connection"); Connection conn = getDBC(); // If a SQLWarning object is available,print its // warning(s). There may be multiplewarnings chained. SQLWarning warn = conn.getWarnings(); while (warn != null) { System.out.println("....SQLWarning...."); System.out.println("....SQLState: " +warn.getSQLState()); System.out.println("....Message: " +warn.getMessage()); System.out.println("....Vendor: " +
  38. 38. 31warn.getErrorCode()); System.out.println("................"); warn = warn.getNextWarning(); } // Do something with the connection here... conn.close(); // All done with that DBconnection } catch (Exception e) { System.out.println("Database access failed" + e); } } public static Connection getDBC() { Connection conn = null; String url = "jdbc:mysql://localhost:3306/"; String dbName = "hru"; String driver = "com.mysql.jdbc.Driver"; String userName = "root"; String password = ""; try { Class.forName(driver).newInstance(); //DriverManager.setLogWriter(newPrintWriter((System.err))); conn = DriverManager .getConnection(url + dbName,userName, password); } // end try catch (Exception e) { return conn; } return conn; } public static ResultSet executeQuery(String statement) { Connection conn=getDBC(); ResultSet rs=null; try { Statement st = conn.createStatement(); rs=st.executeQuery(statement); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }
  39. 39. 32 return rs; } public static int executeUpdate(String statement) { Connection conn=getDBC(); int rs=0; try { Statement st = conn.createStatement(); rs=st.executeUpdate(statement); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return rs; }} Snippet 2 – POSTHandlerDAO and DBHandler for MySQL DB Another example of how separation of concerns between internal data query andprocessing and constructing response depending upon the technologies in use can be seenin the snippet below. Here the code is trying to check if the requested Place Name isavailable or not. The checkup is made and then accordingly a response is constructed andreturned.@Path("place")public class LOCATIONManager { @GET @Produces(MediaType.TEXT_HTML) @Path("check") public StringcheckPlaceNameAvailability(@QueryParam("place") StringnameToCheck) { JSONObject result= new JSONObject();
  40. 40. 33 System.out.println("checking availabilityof="+nameToCheck); try { result.put("status", "error"); LOCATIONManagerDAO lOCATIONManagerDAO=newLOCATIONManagerDAO(); if(lOCATIONManagerDAO.checkNameAvailability(nameToCheck)) result.put("status", "ok"); else result.put("status", "exists"); } catch (Exception e) { e.printStackTrace(); } return result.toString(); }} Snippet 3 – LOCATIONManager – checking for the availability of a new place name and separation of concernsData-Tier Implementation The data tier implementation for the scope o the project was done using MySQLand using a DBHandler to pool and manage connections and well as execute statementson the middle tier side – JDBC as the connector. Four tables were used to store the userdata. The description of the tables is as follows:Table: USERPOSTS (for storing the user activity, mood data and related)Structure:Field Type Null Extra Defaultid int(11) No auto_increment None
  41. 41. 34username varchar(500) No Nonelat double Yes NULLlng double Yes NULLmood int(11) No Nonepost varchar(1000) Yes NULLtime timestamp No CURRENT_TIMESTAMPplace varchar(1000) Yes NULLIndexes:Keyname Type Unique Packed Field NullPRIMARY BTREE Yes No idlat BTREE No No lat YESlng BTREE No No lng YESloc BTREE No No lat YES lng YESplace BTREE No No place YESpost BTREE No No post YESusername BTREE No No usernametime BTREE No No timepost_fulltext FULLTEXT No No post YESplace_fulltext FULLTEXT No No place YESTable: TAGS (for storing the tags found in user activity)
  42. 42. 35Structure:Field Type Null Defaulttag varchar(500) No Nonepostid int(11) No Nonemood int(11) No Nonelat double Yes NULLlng double Yes NULLIndexes:Keyname Type Unique Packed Field Nulltag BTREE No No tag potid moodloc BTREE No No lat YES lng YESTable: PLACE (for storing the place meta-data)Structure:Field Type Null Extra Defaultid int(11) No auto_increment Nonename varchar(1000) No unique Nonedescription varchar(1000) Yes NULLIndexes:
  43. 43. 36Keyname Type Unique Packed FieldPRIMARY BTREE Yes No idname BTREE Yes No nameTable: PLACEDETAILS (for storing the place composite geometry data)Structure:Field Type Null Defaultplaceid int(11) No Nonecomponent1 varchar(1000) Yes NULLcomponent2 varchar(1000) Yes NULLtype varchar(1000) No NoneIndexes:Keyname Type Unique Packed Fieldplaceid BTREE No No placeidClient Implementation The smaple client implementation was done purely in java with minimal HTMLupfront – required to start up a UI in a browser. For any general activity e.g. user activitycapture or visualization, a general approach was followed: on any event, certain functionsare called which pre process the incoming raw data and validate it to form an AJAXrequest while constructing json objects or arrays if needed to be passed on with therequest. This is then sent to a HTTP request relay proxy, which then contacts the system
  44. 44. 37API to fetch results. The response is then relayed back, processed, decoded and so on andfinally the required HTML is generated whaich is then shown on the browser. Shownhere are a few code snippets that detail the processes just discussed. Shown in Snippet 4 – ‘HowAreYou’ Web App – Bare minimum initial HTMLcode to setup the UI – is the initial HTML code that is used. Not much is done here andthis enables quick UI loading with all the manipulation being done in javascriptdepending upon the user input. <html> <head> <link rel="icon" href="hruicon.png" type="image/x-icon"> <link rel="shortcut icon" href="hruicon.png" type="image/x-icon"> <link rel="apple-touch-icon" href="hruicon.png"/> <title>HowAreYou?</title> <!--meta name="viewport" content="initial-scale=1.0, user- scalable=no" /--> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <script type="text/javascript" src="jquery- 1.6.2.js"></script> <script type="text/javascript" src="hru.js"></script> <script type="text/javascript" src="hruajax.js"></script> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=plac es&sensor=false"></script> </head> <body onload="initialize(activity)"> <div id=menu_activity onclick="javascript:initialize(activity);">Timeline</div > <div id=menu_post onclick="javascript:initialize(post);">New Post</div> <div id=page_activity></div>
  45. 45. 38 <div id=page_post></div> </body> </html> Snippet 4 – ‘HowAreYou’ Web App – Bare minimum initial HTML code to setup the UI Now as can be seen in the snippet below the initialize() function takes care of whatUI has to be generated depending on what the user has requested amongst other eventinformation. function initialize(page) { detectBrowser(); var menu_post=document.getElementById(menu_post); var menu_activity=document.getElementById(menu_activity); var div_post=document.getElementById(page_post); var div_activity=document.getElementById(page_activity); if(page==activity) { document.getElementById(page_post).innerHTML=""; document.getElementById("page_activity").innerHTML="< br/><div id=page_activity_inner_content ></div><div id=page_activity_inner_more ></div>"; seeAllActivity(last, 10); menu_activity.style.color="#eeeeee"; menu_activity.style.backgroundColor="#444444"; menu_post.style.color="#5a5a5a"; menu_post.style.backgroundColor="#eaeaea"; div_post.style.height=0px; div_post.style.visibility=hidden; div_activity.style.height=auto; div_activity.style.visibility=visible; } else if(page=="post") { document.getElementById("page_activity").innerHTML="" ;
  46. 46. 39 document.getElementById(page_post).innerHTML=<spanstyle="padding:10px; padding-top:20px;margin-top:20px;color:#666666">so, how are you?</span><imgstyle="padding-top:10px;vertical-align:bottom;"src="alpha.jpg" width="10" /> <br/>+<div align="center"><textarea id="userpost"style="margin:5px;padding:5px;width:98%; height:100px;font-family:sans serif, arial,lucida,verdana; font-size:18px; color:#444444;background-color:#eeeeee;border:2px solid #8B8989;" maxlength="240" onkeydown="javascript:showCharsRemaining();"></textarea></div>+<span style="float:right;color:#666666;padding-right:15px;font-size:15px;" id="charsremaining"></span>+<span style="float:right;color:#565656; padding-right:15px;font-size:15px;"> Characters left: </span>+<br/>+<button STYLE="background-color:transparent;border:0px;float:right;margin-top:7px;margin-right:0px;padding:0px;"onClick="javascript:newpost();" id="postbtn"><imgsrc="greenbtn.png" width="155"/></button> +<button id="radar" onClick="javascript:toggleLoc();"></button>+<button id="moodimg"onClick="javascript:changeMood();"><imgsrc="emoticons/3.png" width="53"/></button>+<div id="placesdiv"></div>+<inputstyle="visibility:hidden;height:0px;width:0px;float:left;"id="lat" hidden></input>+<inputstyle="visibility:hidden;height:0px;width:0px;float:left;"id="lng" hidden></input>+<inputstyle="visibility:hidden;height:0px;width:0px;float:left;"type="int" id="mood" value="3" hidden></input>+<inputstyle="visibility:hidden;height:0px;width:0px;float:left;"id="placetext" hidden></input>+<div id="map_canvas" style="width:100%;height:0%;"></div>; refreshLoc(); menu_post.style.color="#eeeeee"; menu_post.style.backgroundColor="#444444";
  47. 47. 40 menu_activity.style.color="#5a5a5a"; menu_activity.style.backgroundColor="#eaeaea"; div_activity.style.height=0px; div_activity.style.visibility=hidden; div_post.style.height=auto; div_post.style.visibility=visible; placesradius=0; moodtoggle=1;//1 better 0 lower. var userpost=document.getElementById(userpost); userpost.value=""; var usermood=document.getElementById("mood"); usermood.value=3; var usermoodimage=document.getElementById("moodimg"); usermoodimage.innerHTML=<img src="emoticons/+usermood.value+.png" width="53"></img>; } } Snippet 5 – Generating the complete UI in JavaScript depending upon user triggered events For constructing an AJAX request, the user data is processed and AJAX requestparameters are built. Separation of concerns has been done to separate out the AJAXprocess with the other processing like gathering data and so on. Shown in the scriptbelow is this separation of responsibility into different functions – this has beenmaintained in separate .js files that can be maintained separately and just loaded by anypage that wants to use this system. function newpost() { var userlat=document.getElementById("lat"); var userlng=document.getElementById("lng"); var userplacetext=document.getElementById("placetext"); var usermood=document.getElementById("mood"); var userpost=document.getElementById(userpost);
  48. 48. 41 var params="mood= "+usermood.value+"&lat="+userlat.value+"&lng= "+userlng.value+"&post="+encodeURIComponent(userpost.value)+"&place="+userplacetext.value+"&username=encodeURIComponent(getCurrentUsername())"; ajaxRequestPOST("post/create", params, initialize);} Snippet 6 – On Event, user data processing and AJAX request creationfunction getProxyURL(type) { if (type == "get") return "hru_get_proxy.php?call_path="; else if (type == "post") return "hru_post_proxy.php";}function initAjaxRequest(callbackFunction) { var ajaxRequest; try { // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e) { // Internet Explorer Browsers try { ajaxRequest = newActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { ajaxRequest = newActiveXObject("Microsoft.XMLHTTP"); } catch (e) { // Something went wrong alert("Your browser broke!"); return null; } } } ajaxRequest.onreadystatechange = function() { if (ajaxRequest.readyState == 4) { if (callbackFunction) callbackFunction(ajaxRequest);
  49. 49. 42 } }; return ajaxRequest;}function ajaxRequestGET(thePath, paramString,callbackFunction) { /********************************************* NOTE: 1. CURRENTLY paramString MUST BE "" 2. thePath MUST be the complete path except for thebase uri without query parameters OR with each queryparameter uriencoded and then theentire queryparameter string starting at ? includingthe ? again uriencoded, an example: var asas="place="+encodeURIComponent(sampleplace) +"&from="+encodeURIComponent(2011-10-1123:31:54) +"&till="+encodeURIComponent(2011-10-1123:32:00); ajaxRequestGET("mood-data"+encodeURIComponent("?"+asas), "", function(returnData){}); **********************************************/ var ajaxRequest = initAjaxRequest(callbackFunction); var reqString = getProxyURL("get") + thePath +"&call_params=" + paramString; ajaxRequest.open("GET", reqString, true); ajaxRequest.send(null); for(var asas=0; asas<10;asas++) {var sasa=asas*2;}}function ajaxRequestPOST(thePath, paramString,callbackFunction) { var ajaxRequest = initAjaxRequest(callbackFunction);
  50. 50. 43 paramString = "call_path=" + thePath + "&" + paramString; ajaxRequest.open("POST", getProxyURL("post"), true); // Send the proper header information along with the request ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajaxRequest.setRequestHeader("Content-length", paramString.length); ajaxRequest.setRequestHeader("Connection", "close"); ajaxRequest.send(paramString); for(var asas=0; asas<10;asas++) {var sasa=asas*2;} } Snippet 7 – AJAX infrastructure developed in-house Lastly, the pHTTP request relay proxies were also developed so as to satisfy thecross-domain AJAX call browser security restrictions. All that the proxy does is listen tothe incoming HHTP requests from the client (browser) and while sitting on a simple webserver, relay it to the backend system API, get results and relay them back to the client onthe browser. The following code shows the HTTP proxies developed. <?php define (HOSTNAME, hru-server.dyndns.org/hru/); $path = ($_POST[call_path]) ? $_POST[call_path] : $_GET[call_path]; $url = HOSTNAME.urldecode($path); $session = curl_init($url); if ($_POST[call_path]) { $postvars = ; while ($element = current($_POST)) { $postvars .= urlencode(key($_POST)).=.urlencode($element).&; next($_POST); } curl_setopt ($session, CURLOPT_POST, true); curl_setopt ($session, CURLOPT_POSTFIELDS, $postvars); }
  51. 51. 44curl_setopt($session, CURLOPT_HEADER, false);curl_setopt($session, CURLOPT_RETURNTRANSFER, true);$resp = curl_exec($session);echo $resp;curl_close($session);?> Snippet 8 – HTTP POST requests relay proxy developed in PHP<?phpdefine (HOSTNAME, http://76.103.136.59/hru/);$path = $_GET[call_path];$params=$_GET[call_params];$url = HOSTNAME.$path;$session = curl_init($url);curl_setopt($session, CURLOPT_HEADER, false);curl_setopt($session, CURLOPT_RETURNTRANSFER, true);$resp = curl_exec($session);echo $resp;curl_close($session);?> Snippet 9 – HTTP GET requests relay proxy developed in PHP
  52. 52. 45Chapter 6. Deployment The deployment of the system is pretty straightforward. The middle tier – exposingthe RESTful API is deployed on Tomcat – version 7.0, the database instance on aMySQL Server and the Client portion can be anything. For the client developed here, asimple web server would have the initial HTML, JS and the HTTP relay proxies. Shownbelow is a coarse overview of how this deployment would more or less look like. Apache Web Tomcat v 7.0 + Server HTML JS Middle Tier API Web Application HTTP relay Proxy MySql Server Storage Figure 14 – Deployment Strategy Overview The RESTful API is exposed via a servlet that maps a url path to the package andclass serving the associated functions. Furthermore Jersey reference RESTimplementation is used and the mapping between specific URLs and the servingfunctions are done using @Path java annotations. For this to work i. to redirect any callscoming on a specific RESTful service to the appropriate package, a web.xml has to be
  53. 53. 46written and deployed in WEB-INF folder with the web archive on Tomcat the details of itare as follows: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>hru</display-name> <servlet> <servlet-name>HowAreYou</servlet-name> <servlet- class>com.sun.jersey.spi.container.servlet.ServletContaine r</servlet-class> <init-param> <param- name>com.sun.jersey.config.property.packages</param-name> <param-value>hru</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HowAreYou</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> Snippet 10 – Tomcat WEB-INF/web.xml configuration file
  54. 54. 47Chapter 7. Summary, Conclusions, and RecommendationsSummary & Conclusions This work aimed at bringing together the various elements when it comes tocapturing user mood and understanding in a holistic way what that mood or sentimentmeans and how it affects perceptions, and gains. Proposed was a complete system whichfills the gaps in the sentiment capture and analysis method that exist today and developedwere a set of primitives – a RESTful API that can be used to capture the user activity andsentiment and what enables analysis and visualization of it. Also developed on top of thisAPI one of the numerous possible applications, to capture user activity, mood and relatedlocation and metadata and visualize it over time for a given granularity of time as well asdo things like create custom places for which mood data is visualized, compare the moodchange over time for one or more such places and so on. The possibilities are endless and the work doesn’t stop here. It forms the basis of anumber of things that can be done on top of this. Recommendations for enhancementsand future work / research issues have been discussed in the next section.Recommendations for Further Research and Development The possibilities with the infrastructure that has been developed so far aretremendous and virtually endless with a number of avenues for a range of innovativeapplication as well as directions for interesting and significant research.
  55. 55. 48 The work done, as a part of this project is an initiation of a world of completeinsight into user preference and perception change that lies ahead. It is not just one apprather it is an infrastructure for developing a host of web and native applications on top ofthe API that has been developed. Possible enhancements to the work done include first ofall to develop the secondary components like authentication and server side caching /indexing for faster processing, applying privacy as an aspect on the system which is easyto do owing to the superb separation of concerns that exists and the layered approach thatwas taken. A layer of privacy or even other such layers, which take care of other businessrules and aspects, can be easily introduced to enforce those future requirements. Another possible immediate enhancement that can be made and something thatwasn’t done due to the lack of enough time and resources is having the user the ability tosee his/her own timeline and overlaying this information with how the world events tookplace. This way the user can see how they grew and evolved with the world and whatwere the kind of things that probably affected them the most. Even just being able towhat amount of earth they covered over time and when is an interesting visualization andinsight into the lives of the users and for them. On the functional and the business side, the next most important step would be tobring this system closer to painting a complete picture of how a user or userbase’ssentiment changes over time. This can be done by enabling the business or government orother providers to make the sales and other such data as well as a timeline of thedecisions they took, the changes they made available to this system and overlaying thatwith other world events like a holiday or a disaster and so on and overlaying all of this on
  56. 56. 49top of how a user-base’s sentiment and perception towards a product or brand etc.changed over time. This will give invaluable insights into what affects the success andfailure of a certain brand in a way that has never been done before, earlier than ever andcloser to real time. The benefits need not be explained, as they are pretty obvious andsignificant. More possibilities exist e.g. linking the updates feed to twitter, facebook andthe rest and having the ability to add photos, videos, links etc. tag places as you see themand so on. The next step and something that is more of a research issue is to take each of theuser activity – the user’s post- associated with each update and analyze that or a bunch ofthem in combination or mutual context to gain a better understanding of what is beingtalked about what are the real reasons for the mood that has been indicated and theavailability of a tangible, direct mood and perception metric would act as a very solidfoundation towards deciphering the correct meaning out of the text and getting evencloser to an even more complete picture. These findings again have numerouspossibilities, for example with changing mood and by know exactly what a user is saying,it is easier to determine what would be of interest to that user at a given point in time – ina particular month, year and so on and this data can be used to say provide productsuggestions at the right time or augment this with the user’s geolocation to make thesuggestions even more effective. This system can hence be enhanced in multipledirections for numerous users in various domains. The infrastructure that has been developed here sis not just limited to user data.With only slight modifications which mostly are about that the services offered through
  57. 57. 50the API are named, it can be used to develop applications for which this infrastructurewill act like a place in the cloud, IaaS, DBaaS etc. and other jargons come to mind if wethink about the possibilities that exust. For instance this system is essentially a set ofprimities that lets one collect data over time associated with something. This thing can beany survey, status reports, monitoring of something like carbon monoxide levels,temperatures or even voters’ perception towards various political parties and candidatesbefore an election season with abilities to visualize and compare the performance ofdifferent parties and candidates and so on. This can easily enable applications for allthese domains that can use this system as a data capture, management and visualizationinfrastructure in the cloud, which can be subscribed to for a pay-as-you-go kinda usage.Ofcourse this isn’t the one size fits all solution for everything imaginable but can indeedbe a good solution for applications similar in nature technologically, as the one developedas a demo in this work.
  58. 58. 51References
  59. 59. 52 AppendicesAppendix A. Description of CDROM Contents1. Directory: BackendSystemAll the source code and other artifacts required for the system backend, offering aRESTful API.1.1 Middle Tier Source Code – along with the components that expose the functionality as a RESTful API1.2 Tomcat configuration web.xml file1.3 Required JAR files – for the middle tier, to me deployed along with the application on a Tomcat – or similar – server.2 Directory: StorageSQL scripts for Database creation3 Directory: HowAreYou_App‘HowAreYou’ Client code and HTTP request relay proxy code4 Directory: ReportPDF version of this report.

×