CZECH TECHNICAL UNIVERSITY IN PRAGUE FACULTY OF ELECTRICAL ENGINEERING Master s Thesis Microsoft Dynamics CRM and Social Networks integration Bc. Petr Vůjtěch Supervisor: Ing. Pavel Náplava Study Programme: Electrical Engineering and Information Technology Field of Study: Computer Science, Software Engineering May 2012
Acknowledgements I would like to thank to Ing. Pavel Náplava, the supervisor of the thesis for his guidance, patience, valuable advices and comments. I thank to Zbyněk Pavelek (Zenithies group) for his assistance with CRM connection. I would also like to express my gratitude to my family and my girlfriend for necessary support that helped me to finish this thesis. I am thankful to my grandmother for her tasty lunches. My thanks belong also to Coca-Cola for inventing black sparkling drink that kept me awake during late night hours. v
Declaration I hereby declare that I have completed this thesis independently and that I have listed all the literature, publications and external sources used. I have no objection to usage of this work in compliance with the act x60 Zákon c. 121/2000Sb. (copyright law), and with the rights connected with the copyright act including the changes in the act. In Kynšperk on May 10, 2012 Bc. Petr Vůjtěch vii
Abstract The aim of the diploma thesis is to analyze, implement and test new software component that enables integration of social networks into Microsoft Dynamics CRM. This project is divided in two sections. First section is focused on the analysis of social networks and the capabilities of its connectivity to other systems. There is mentioned an overview of key features of Microsoft Dynamics CRM. The analysis leads to the specification of functional concepts whose usage is described. Technically the analysis is focused on API interface that is used for the integration. The outputs from the first section are used as inputs for the second section that deals with the implementation and testing of the software component. The appropriate technology has to be chosen first. The component will connect Microsoft Dynamics CRM with selected social networks. The testing will be accomplished based on the user experience and the requirements will be generalized. The final conclusion will summarize the technical and functional requirements for the social network integration. Abstrakt Cílem diplomové práce je navrhnout, implementovat a otestovat novou softwarovou komponentu, která umožní do existujícího produktu Microsoft Dynamics CRM integrovat funkčnost sociálních sítí. Práce bude rozdělena do dvou částí. První je zaměřena na analýzu sociálních sítí, možnosti jejich napojení do jiných systémů a seznámení se s produktem Microsoft Dynamics CRM. Smyslem analýzy je po funkční stránce specifikace bloků systému, které budou prostřednictvím komponenty na sociální sítě napojeny, a způsob jejich používání. Po stránce technické bude provedena analýza a návrh API rozhraní, přes které budou sociální sítě napojeny. Výstupy analytické části poslouží jako zadání pro druhou část, která bude zaměřena na vývoj a otestování komponenty. Prvním krokem bude výběr vhodné technologie pro realizaci komponenty. Následně bude komponenta vytvořena, napojena na produkt Microsoft Dynamics a na vybraných sítích ověřena její funkčnost. Ve spolupráci s reálnými uživateli bude vyhodnocena smysluplnost komponenty a budou zobecněny požadavky na používání komponenty. Tj. bude vyhodnoceno, co musí sociální sítě pro napojení do produktu splňovat jak po technické, tak i funkční stránce. ix
Contents List of Tables... xv List of Figures... xvi 1 Introduction... 1 1.1 Motivation for chosen topic... 1 1.2 Microsoft assignment... 1 1.3 The goals of the thesis... 1 1.4 Integration vision and contribution... 2 1.5 Social Networks... 2 1.6 CRM Customer relationship management... 3 2 Functional Analysis... 5 2.1 Social networks... 5 2.1.1 Business usage of social networks... 5 2.1.2 Classification of social networking... 5 2.1.3 Major social networks... 6 2.2 Microsoft Dynamics CRM... 8 2.2.1 Entities involved in the project... 8 2.3 Integration possibilities... 13 2.3.1 Facebook... 13 2.3.2 Twitter... 15 2.3.3 LinkedIn... 15 2.3.4 Google+... 16 2.3.5 Blogs, RSS feeds... 16 2.3.6 Messenger... 17 2.3.7 YouTube... 17 2.3.8 MySpace... 18 2.4 Commercial solutions for MS Dynamics CRM... 18 2.4.1 Vibe... 19 2.4.2 Parrot... 20 2.4.3 InsideView... 21 2.4.4 Summary... 21 xi
2.5 Functional analysis evaluation...22 3 Technical Analysis...23 3.1 Facebook...23 3.1.1 Facebook applications...23 3.1.2 SKD...24 3.1.3 Graph API...24 3.1.4 JSON object...24 3.1.5 Examples for calling Graph API and getting response...25 3.1.6 Graph API Explorer...26 3.1.7 Authentication...27 3.1.8 Permission types...28 3.1.9 FQL Facebook Query Language...29 3.2 Twitter...30 3.2.1 Twitter applications...30 3.2.2 Twitter SDK...31 3.2.3 REST API...31 3.2.4 Streaming API...31 3.2.5 Search API...31 3.2.6 API explorer developer console...32 3.2.7 Authentication...33 3.3 OAuth...34 3.4 Microsoft Dynamics CRM...35 3.4.1 Solutions...35 3.4.2 Microsoft Dynamics CRM 2011 Software Development Kit.35 3.4.3 Web Services...36 3.4.4 Silverlight...36 3.4.5 Microsoft Dynamics CRM Online Authentication...36 3.5 Application programing interface...37 3.6 UML model...37 3.6.1 Requirements...38 3.6.2 Use Case...39 3.6.3 Component diagram...40 3.6.4 User interface layout...41 3.6.5 Class model...42 xii
3.7 Programing language preference... 43 4 Implementation... 45 4.1 Running environment... 45 4.2 Web Application... 45 4.3 Database... 47 4.4 Microsoft Dynamics CRM integration... 47 4.4.1 Access and login information... 47 4.4.2 Create marketing campaign... 48 4.4.3 Add campaign responses... 49 4.5 Facebook integration... 50 4.5.1 Facebook application setup... 50 4.5.2 PHP SDK... 52 4.5.3 Facebook initiation... 52 4.5.4 Authentication against Facebook... 52 4.5.5 Publish to Facebook... 53 4.5.6 Gather from Facebook... 54 4.5.7 Gathering personal data... 56 4.6 Twitter integration... 56 4.6.1 Twitter application setup... 57 4.6.2 Twitter initiation... 58 4.6.3 Authentication against Twitter... 58 4.6.4 Publish to Twitter... 60 4.6.5 Gather from Twitter... 60 4.6.6 Gathering personal data... 61 5 Testing... 63 5.1 Authentication... 63 5.2 Publish stream... 63 5.2.1 Publish stream with short time interval for monitoring the campaign... 63 5.2.2 Publish stream with post to Facebook user wall... 63 5.2.3 Publish stream with post to Facebook Page wall... 64 5.2.4 Imperfections discovered during first iteration... 64 5.3 Gather stream... 64 5.3.1 Gather from Facebook user wall... 65 5.3.2 Gather from Facebook Page wall... 65 xiii
5.3.3 Gather from Twitter...66 6 Key issues and interests...67 6.1 Research and relevant information...67 6.2 Microsoft Dynamics CRM integration development...67 6.2.1 First solutions...67 6.2.2 Sitemap customization...68 6.2.3 Silverlight...68 6.2.4 Cooperation with WBI Aleš Novotný...69 6.2.5 Cooperation with Zenithies Zbyněk Pavelek...69 6.3 Changes in analysis of twitter interaction...69 6.4 Gathering personal data from social networks...70 6.5 Gathering only newly added responses...70 6.6 Performance optimization...70 6.7 Further usage of gathered campaign responses...71 6.8 Marketing responses from the same user...72 7 Conclusion...73 7.1 The thesis summarization...73 7.2 Meeting the assignment and goals...73 7.3 Project contributions...74 7.4 Personal satisfaction...74 7.5 Future upgrades of the application...74 7.5.1 Gather relevant responses from social networks...75 References...77 Appendix...79 xiv
List of Tables Table 1: Number of social network users [2]... 6 Table 2: Facebook and CRM integration... 14 Table 3: Twitter and CRM integration... 15 Table 4: LinkedIn and CRM integration... 15 Table 5: Google+ and CRM integration... 16 Table 6: Blogs, RSS feeds and CRM integration... 16 Table 7: Messenger and CRM integration... 17 Table 8: YouTube and CRM integration... 17 Table 9: MySpace and CRM integration... 18 Table 10: User and friends email permission [22]... 56 xv
List of Figures Figure 1: Sales pipeline...4 Figure 2: Types of social networks [1]...6 Figure 3: Social networks area segmentation [3]...7 Figure 4: MS Dynamics CRM Online Dashboard page...8 Figure 5: Account...9 Figure 6: Contact...9 Figure 7: Lead...10 Figure 8: Campaign...11 Figure 9: Product...12 Figure 10: Case...12 Figure 11: Activities...13 Figure 12: Vibe [5]...19 Figure 13: Parrot [6]...20 Figure 14: InsideView [7]...21 Figure 15: Facebook application...23 Figure 16: Graph API Explorer...26 Figure 17: Request for permission to Manage pages and Posts on them27 Figure 18: Access_token sequence [10]...27 Figure 19: Permission types 1...28 Figure 20: Permission types 2...28 Figure 21: Permission types 3...29 Figure 22: Twitter application...30 Figure 23: Twitter API explorer [12]...32 Figure 24: Twitter authorization...33 Figure 25: OAuth Authentication Flow [13]...34 Figure 26: Solutions View...35 Figure 27: API design...37 Figure 28: UML Requirements...38 Figure 29: UML Use Case...39 Figure 30: UML Component diagram (version 1)...40 Figure 31: UML Component diagram (version 2)...40 Figure 32: User interface...41 xvi
Figure 33: UML Class Model... 42 Figure 34: Web application index.php... 46 Figure 35: Campaign Fields... 49 Figure 36: Facebook application settings... 51 Figure 37: Facebook application advanced settings... 51 Figure 38: Facebook permissions approval... 53 Figure 39: Twitter application settings... 57 Figure 40: Twitter login and authorization page... 59 Figure 41: Iframe in MS Dynamics CRM contact entity... 68 Figure 42: Campaign response actions... 71 Figure 43: Convert campaign response... 71 Figure 44: New type of Campaign: Social Media... 80 xvii
CHAPTER 1. Introduction 1 Introduction 1.1 Motivation for chosen topic The topic of the thesis was chosen based on my personal experience with information systems. In last few years I have been interested in ERP systems (Enterprise Resource Planning), CRM systems (Customer Relationship Management), Accounting systems. I also focus on internet marketing, SEO (Search Engine Optimization) and business process management. I have deployed various information systems as CRM, Accounting systems, Online booking systems. In 2010 I spent one semester in Singapore at Nanyang Technological University as an exchange student. The University is open to new trends and actual topics were discussed during lessons. I attended Managing Information Systems class and Knowledge Management class. In both classes the social networking issue was discussed and new applications used worldwide were presented as case studies. I find social networks interesting because they attract many users worldwide and they are dynamically improved. At Czech Technical University I studied classes (CPM Corporate Performance Management, ISP Information Systems and Processes) that are very close to my point of interest. These classes were organized by CZM (Centrum znalostního managementu Knowledge Management Center). Based on contact with CZM I could choose the topic of the thesis. Microsoft offered diploma thesis topics dealing with CRM, Social networks or Project management. 1.2 Microsoft assignment During meeting with Ing. Petr Hampejs (product manager Microsoft Dynamics CRM) we agreed on topic that combines Social networks and CRM. Petr Hampejs is the opponent of the thesis. The aim of the project has been to analyze the possibilities of integration social networks and Microsoft Dynamics CRM. Based on the analysis the software component should have been implemented and tested. My motivation was enhanced when Petr Hampejs suggested that successful project can be launched as commercial solution. This project should provide working application that might be foundation for future commercial application. 1.3 The goals of the thesis The aim of the diploma thesis is to analyze, implement and test new software component that enables integration of social networks into Microsoft Dynamics CRM. 1
CHAPTER 1. Introduction The analysis will present the integration possibilities from functional and technical perspective. The implementation will be realized according to chosen part of the analysis. That will be marketing information publishing on social networks. The implemented software component will be tested and testing results will be used to improve the application. 1.4 Integration vision and contribution Social networks have attracted enormous number of users in last few years. Social networking is a very dynamic environment that provides various pieces of information and therefore offers countless opportunities but also threads. Let s focus on the business view of this topic. Several companies use or deploy Customer Relationship Management information systems. The goal of using this system is to gather and organize data about customers. If we have a room full of information called social network the idea and questions are obvious. We should connect social networks with CRM systems! What piece of information should we gather? How to manage this information? How to improve the knowledge about our customers? The project should clarify how can be social networks used in companies. The project provides marketing tool that can publish text to social networks and gather the social networks interaction. All this activities are monitored in MS Dynamics CRM. 1.5 Social Networks Social network is a medium that enables its users to keep connection with the community. This connection is based on different types of communication. Mostly the user has to create personal or business profile first. The user can share information directly to other users or widely among the community. The piece of information can be represented as text message, picture, movie, link, reference to his activity, etc. Social networking has very dominant world-wide representatives as Facebook, Twitter, MySpace, LinkedIn, Delicious, etc. We can understand any discussion forum as a kind of social network. Blogs and its followers are also some community that shares information among each other. Chat, YouTube or any dating portals are also examples of social networks (in Czech Republic are popular following: Lide.cz, Spoluzaci.cz, LibimSeTi.cz). In international context I have to mention some social 2
CHAPTER 1. Introduction networks common in other countries (Russia Vkontakte, Brazil, India Orkut, China Qzone, South East Asia Friendster). The users of social networks are mostly considered as teenagers. But in fact the users are older - the majority is from 20 to 40 years old. This group of people is usually productive and that means they have purchase power. These users are suitable potential customers and the data about these customers can be managed by CRM software. Security is highly discussed topic in social networking. The more information user provide, the more it can be misused. On most networks the user can set-up visibility options and prevent the misuse but most users do not care much about this topic. 1.6 CRM Customer relationship management CRM is a system that manages information about customers. In last few years it has become a crucial data source for many companies worldwide. The company has to monitor the interactions with customers through several communication channels. Business activities are also monitored by CRM systems and that helps to meet customer requirements and needs. The business processes are supported by CRM software and internal workflows can automate some jobs as payment of the invoice, notifying expired contract or birthday wishes. Lots of CRM software presents the sales pipeline as a main reporting tool. The pipeline has the number of leads as an input and the number of closed cases as an output. In between there is business process defined by specific states. The pipeline is usually displayed as a cone. During the process some of the business opportunities fail and the count of business cases lowers. The cone can be evaluated in various measures as costs per unit, number of cases, total revenue, etc. 3
CHAPTER 1. Introduction Figure 1: Sales pipeline CRM systems require portability. Travelling salesman has to be able to access the data regardless the time and location. CRM should be accessible as offline client. The software should provide user interface that is suitable for mobile devices as tablets, smartphones or PDA. The security issue shouldn t be overlooked. The company uses personal information of the third party - about their customers. The law protects the customer personal information and the storage and usage of such data has to be managed. All users working with the data should follow the internal policies. 4
CHAPTER 2 Functional Analysis 2 Functional Analysis 2.1 Social networks 2.1.1 Business usage of social networks I have to mention some practical hints from personal experience. Social networks are used as potential source of leads and new business opportunities It is a quick research tool. You can get quick response on announced product/activity. The result depends on number and structure of followers/fans/friends. Social networks enable communication with customers The interaction with customers supports branding. That means that the brand (name of the company) builds customers loyalty. Only some social networks are used as tool for B2B (business to business) The main business goal of social networks is to build relationship between the company and the customer or business partner. 2.1.2 Classification of social networking In terms of defining the implementation part of the thesis I have to clear following classification of social networking. 2.1.2.1 Internal vs. external social networking Internal social networking means interaction among internal workers. It enables collaboration among employees, teams or coworkers. It supports information sharing and supports the community. Internal social networks can be build-in solutions for complex information systems, apparently also for CRM. External social networking supports the interaction with the customers, suppliers and vendors. In fact network is a specific communication channel. Communication can be done by private messages, chats or posting public information the business profiles. The thesis deals with external social networking that is oriented towards customers. The focus is put on marketing issues. 5
CHAPTER 2 Functional Analysis 2.1.2.2 Publish vs. Gather The publish stream represents primary purpose of active communication towards customers as e.g. marketing campaigns, actual news, business announcements. These information need to collect responses and reactions that should be evaluated or proceed. The gather stream means passive collection of information available on the social networks. We can gather data such interests, friendships, education and get to know the customer. Based on such data we can systematically adjust our offers to make it attractive for the customer. The thesis focuses on the publish stream. After publishing the information the responses have to be stored and processed. 2.1.3 Major social networks Social networks are used by specific communities. In this thesis we want to target customer worldwide with large base of users. We are aiming to publish information to external users (external social networking, publish stream). Figure 2: Types of social networks [1] Table 1: Number of social network users [2] 6
CHAPTER 2 Functional Analysis Figure 3: Social networks area segmentation [3] Based on specified needs I have chosen following social networks for deeper analysis. Facebook Twitter LinkedIn Google+ Blogs, RSS feeds Messenger (any type) YouTube MySpace 7
CHAPTER 2 Functional Analysis 2.2 Microsoft Dynamics CRM According to the thesis I had to study principles and functions of Microsoft Dynamics CRM very deeply. Microsoft Dynamics CRM offers a 360-degree view of the customers and the business. It is very powerful and robust tools that can easily collaborate with other Microsoft products. It has to be properly customized before it is used in a real business. The Microsoft Dynamics CRM can be used either Online as cloud solution or On-premise as an application built-in the Microsoft Outlook. For the purpose of the thesis the online account was set up. Figure 4: MS Dynamics CRM Online Dashboard page 2.2.1 Entities involved in the project Based on my studies I have identified following entities that are involved in the Social network integration. The screenshots show basic data that the entities work with. 8
CHAPTER 2 Functional Analysis 2.2.1.1 Account Accounts represent companies that the organization may do business with. Figure 5: Account 2.2.1.2 Contact Contacts are people who represent customers or potential customers, or someone related to an account (a company that might do business with the organization.) Figure 6: Contact 9
CHAPTER 2 Functional Analysis 2.2.1.3 Lead Leads represent potential customers who have not yet been qualified by the sales process. As leads are qualified, they can be converted to other types of records. For example: converting a campaign response to a lead, and then converting the lead to an account, contact, or opportunity. Figure 7: Lead 10
CHAPTER 2 Functional Analysis 2.2.1.4 Campaign Campaigns are marketing programs that use many communication vehicles to accomplish specific results. For example, using advertisements and direct mail to increase market share, introduce new products, or retain customers. Figure 8: Campaign 11
CHAPTER 2 Functional Analysis 2.2.1.5 Product Products are any items in the product catalog. Products can be linked to other records, including quotes, campaigns and cases. Figure 9: Product 2.2.1.6 Case A customer service issue or problem reported by a customer and the activities that customer service representatives use to resolve it. Figure 10: Case 12
CHAPTER 2 Functional Analysis 2.2.1.7 Activities Actions to be performed, such as tasks, or communication items that are sent or received, for example, e-mails, phone calls, letters, faxes, and appointments. The status of activities is tracked and the activity history is stored in the system, so users can view the open and closed activities. Figure 11: Activities 2.2.1.8 New sitemap item: Social Media New sitemap item means newly created section in the left menu that would manage social media. [4] 2.3 Integration possibilities Following table shows possible relationships between social networks and entities from MS Dynamics CRM. 2.3.1 Facebook CRM entity Account Facebook 1) Display the wall of Accounts business FB site. Given information is too general and not relevant 2) Upload profile picture from the network as company logo 3) Use the FB messages to communicate with the company 13
CHAPTER 2 Functional Analysis Contact Lead Campaign Product Case Activity New sitemap item: Social Media Table 2: 1) Display the FB wall of the contacts. Constraints by user s privacy policies. Given information represents recent activity of the user. 2) Publish information to the wall of contact to attract his friends as potential customers. 3) Use the FB messages to communicate with the contact. 4) Useful for HR department when recruiting 5) Upload profile picture from the network Lead was created by one of following social media interaction. 1) Someone liked (button like) marketing information on my company's Facebook wall. This lead was created as response to campaign that was presented in social media networks. Parameters: Source is Facebook. Source campaign is defined. 2) Someone liked company's profile on Facebook. 3) Internal worker converted one of customers Facebook activity into a lead 4) Internal worker converted one of the responses from social media type of campaign into a lead 1) Type of campaign is specified as Social media campaign. New Tab/Section allows posting information directly into the social media profile of the company. Responses (comments/likes) are automatically monitored as campaign responses. Campaign responses can be converted to leads by internal worker 2) Type of campaign is specified as direct social network message. Customized message is sent to customers as Facebook message. Responses and likes are automatically monitored as campaign responses. (campaign responses can be converted to leads by internal worker) I have specialized Facebook site or Facebook group for my product. I allow Facebook discussion about this product. This discussion can be displayed in the product entity in CRM. Case was created by one of following social media interaction. 1) Internal worker converted one of customers Facebook activity into a lead. Facebook activity means either post from customers wall or customers comment on company's Facebook site 2) Internal worker converted customers Facebook message into a case 1) In CRM new type of activity has to be created - Facebook message 2) Other activities have to be recorded, especially the connections of activities and entities Should allow managing company's public Facebook site and allow converting fans activities into leads or cases. Facebook and CRM integration 14
CHAPTER 2 Functional Analysis 2.3.2 Twitter CRM entity Twitter Account Contact Twitter functionality is very similar to Facebook. The functions should Lead be same as for Facebook. Twitter and Facebook are same in following: Campaign wall, private messages Product It differs in: Case Facebook sites don't exist in twitter. Twitter has only profiles. Activity Facebook friends refer to followers. New sitemap Facebook like refers to twitter favorite. item: Social Twitter is limited in the size of tweet (140 characters) Media Table 3: 2.3.3 LinkedIn CRM entity Account Contact Lead Campaign Product Case Activity New sitemap item: Social Media Table 4: Twitter and CRM integration LinkedIn 1) Enable to identify employees of the company and convert them into contacts 2) Useful to watch competitors and their employee potential 1) The best social network used by HR department for recruiting purposes 2) The contact details can be compared with the information filled in LinkedIn profile LinkedIn offers are presented as a place for business opportunities, but I don't find it relevant. The only way is to qualify lead from discussions from section Questions and Answers. I don't find it relevant. Product can be discussed in Questions and Answers section. From here we can identify leads. I don't find it relevant. In CRM new type of activity has to be created - LinkedIn message. That will be used just for HR department needs. Just for HR department needs. You can store the search results in the paid version of LinkedIn. That could be used for screening the specific segment. LinkedIn and CRM integration 15
CHAPTER 2 Functional Analysis 2.3.4 Google+ CRM entity Google+ Account Contact Lead Usable functions are: customer s wall and direct message via Gmail. Campaign Business pages were launched in spring 2012. Google+ can be used in Product similar mode as Facebook or twitter. Google+ is a big question for the Case future. We don't know if the competition with strong networks will be Activity successful. The development of this network is very intensive during New sitemap these months. item: Social Media Table 5: Google+ and CRM integration 2.3.5 Blogs, RSS feeds CRM entity Account Contact Lead Campaign Product Case Activity New sitemap item: Social Media Table 6: Blogs, RSS feeds 1) Display the blog of account. Given information is too general and not relevant 1) Display the blog of the contact. Given information represents recent activity of the user. Lead can be created from response in my company's blog. 1) Type of campaign is specified as Social media campaign. New Tab/Section allows publishing information into the blog as a new post. Responses (comments) are automatically monitored as campaign responses. (campaign responses can be converted to leads by internal worker) 1) Each product can have own blog. The blog can be managed directly from entity Product. 2) Comments can be converted to leads or cases. Case can be created from response in my company's blog. New CRM activities: post to blog, blog comment. Manage controlled blogs Blogs, RSS feeds and CRM integration 16
CHAPTER 2 Functional Analysis 2.3.6 Messenger CRM entity Messenger Account Contact Lead Campaign Messenger can be used as a communication tool. It involves defining Product new type of activity that is similar to email or direct Facebook/Twitter Case messages. Activity New sitemap item: Social Media Table 7: 2.3.7 YouTube CRM entity Account Contact Lead Campaign Product Case Activity New sitemap item: Social Media Table 8: Messenger and CRM integration YouTube 1) Display accounts channel. Given information is too general and not relevant 1) Display contacts channel. Given information represents recent activity of the user. Lead can be created from comment/like on YouTube movie/channel. YouTube used as marketing document for specific campaign Comments and likes can be sources for leads and cases. YouTube used as marketing document for specific product Case can be created from comment/like on YouTube movie/channel. New activities: channel comment, post movie Manage YouTube channel through IFRAME YouTube and CRM integration 17
CHAPTER 2 Functional Analysis 2.3.8 MySpace CRM entity My space Account Contact Lead Campaign Not part of this thesis. This social network is typical especially for US Product marketplace (not worldwide). The characteristics are similar to Case Facebook. Activity New sitemap item: Social Media Table 9: MySpace and CRM integration 2.4 Commercial solutions for MS Dynamics CRM When searching for existing solutions the term Social CRM has to be clarified. Social Networks + CRM = Social CRM Following solutions were discovered by searching following key words and their combinations: social networks, microsoft dynamics crm, social CRM, Facebook integration, twitter integration. This topic is discussed a lot but only 3 solutions were discovered. They are builtin MS Dynamics CRM: Vibe, Parrot and InsideView. I can declare that there is a lack of supply on the market. Quality new product seems to have quite good chance to succeed on the market. 18
CHAPTER 2 Functional Analysis 2.4.1 Vibe Vibe Social Networking for Microsoft Dynamics CRM producer location brief description link price - purchase Sonoma partners USA, Chicago Vibe is an internal social network integrated into MS Dynamics CRM. It enables collaboration among teams and users based on publishing updates, questions etc. with system generated notification. Users select the feeds to which they want to subscribe se they the most relevant information as resolving case, winning opportunity, milestones, etc. It rapidly lowers the number of internal emails. http://pinpoint.microsoft.com/en-us/applications/vibe-socialnetworking-for-microsoft-dynamics-crm-4295028209 on demand Figure 12: Vibe [5] 19
CHAPTER 2 Functional Analysis 2.4.2 Parrot Parrot - Social CRM for Microsoft Dynamics CRM producer location brief description link Webfortis USA, California Parrot is an external CRM integrated into Dynamics CRM. It is a single interface for Facebook, Twitter and LinkedIn. Responses can be converted to cases, leads, contacts or accounts. CRM graphical dashboards to track social media effectiveness and utilization. http://pinpoint.microsoft.com/en-us/applications/parrot-socialcrm-for-microsoft-dynamics-crm-12884912469/company price - purchase Figure 13: Parrot [6] 20
CHAPTER 2 Functional Analysis 2.4.3 InsideView InsideView producer location brief description link price - purchase InsideView Technologies, Inc. USA, San Francisco InsideView is external CRM with gathering features. The aim is to provide 360 degree information about the entity. This information is gathered from various social networks. With just one-click, InsideView enables you to add new or enrich existing data for Accounts, Leads, or Contacts with the most accurate and comprehensive company and contact information. Beyond LinkedIn, InsideView helps reps connect with prospects through their personal and extended professional networks including colleagues, former colleagues, and reference customers. InsideView can be integrated into several CRM systems. http://www.insideview.com/ different editions of system, prices from 29/user/month Figure 14: InsideView [7] 2.4.4 Summary Existing tools provide various functions. All of them are implemented as built-in solutions in MS Dynamics CRM. Vibe is used for internal purposes. Parrot needs to be monitored by internal worker. InsideView is quite costly solution. My idea of integration is similar to Parrot. I prefer to gather responses in more automated way. I prefer independent software component that can be connected not only with MS Dynamics CRM, but also with other CRM system. 21
CHAPTER 2 Functional Analysis 2.5 Functional analysis evaluation The analysis shows that there are several options for the integration of social networks and Microsoft Dynamics CRM. I would like to focus on the marketing CRM entity. In terms of marketing it could be very time consuming to manage several social networking sites. I suggest control social networks from one application. The CRM integration will be focused to marketing module creating new campaigns and collecting responses. Connected social networks will be Twitter and Facebook. The software component should be independent web application that posts information to social networks and creates marketing campaigns and collect interaction as marketing campaign responses. 22
CHAPTER 3 Technical Analysis 3 Technical Analysis The technical analysis represents the knowledge base necessary for the implementation. All important technical aspects of social networks and MS Dynamics CRM are clarified in this chapter. For implementation of the integration component this knowledge is essential. Following chapter Implementation assumes that user understands basic concepts described in this chapter. The programming language choice is discussed at the end of this chapter. 3.1 Facebook Facebook offers wide range of connectivity for the developers. All capabilities are documented at the Facebook developer site http://developers.facebook.com/. For two way communication with Facebook is used Graph API, that will be discussed later. Old REST API is still working but the official announcement in December 2011 deprecated the REST API. Note: Deprecating the REST API does not mean we are removing it, but we are actively encouraging all developers to use the Graph API for any new apps and to move existing apps to use it, as well. Moving forward, all new features will only be available in the Graph API and the level of support will be higher on a non-deprecated API. [8] 3.1.1 Facebook applications Facebook applications give the opportunity to integrate the core Facebook experience. We will go through setting up process of an application. Each app has Canvas Page. Canvas page is the Page in which your app is loaded. For the purpose of the thesis following app was created. Figure 15: Facebook application 23
CHAPTER 3 Technical Analysis 3.1.2 SKD SDK is used to facilitate the access to API. It enables to call functions of Graph API and authentication process. Several programing languages are supported by following development kits: JavaScript SDK PHP SDK (for PHP 5) Python SKD ios SDK (platforms for iphone, ipod, ipad) Android SDK Others Originally Facebook supported wide palette of programing languages but when Graph-API come to the scene at the end of year 2010 this support was finished. Other SDK packages are available from third parties for number of programming platforms (.NET SDK, java-facebook-api). 3.1.3 Graph API Graph API is new object oriented API for accessing Facebook data. It allows both read and write. Social graph is represented by objects (e.g., people, photos, events, and pages) and the connections between them (e.g., friend relationships, shared content, and photo tags). Every object in the social graph has a unique ID. With this ID the properties of the object can be accessed by posting https://graph.facebook.com/id 3.1.4 JSON object The result of the message https://graph.facebook.com/id is a JSON object. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. [9] JSON is built on two structures: A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array. An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence. 24
CHAPTER 3 Technical Analysis 3.1.5 Examples for calling Graph API and getting response 3.1.5.1 Example 1 For example, the official page for the Facebook Platform has id 19292868552, so you can fetch the object at https://graph.facebook.com/19292868552. You get the following response: { "name": "Facebook Platform", "website": "http://developers.facebook.com", "username": "platform", "founded": "May 2007", "company_overview": "Facebook Platform enables anyone to build...", "mission": "To make the web more open and social.", "products": "Facebook Application Programming Interface (API)...", "likes": 449921, "id": 19292868552, "category": "Technology" } 3.1.5.2 Example 2 Assume that ID 3243789208547 represents my last status. https://graph.facebook.com/3243789208547/likes - the response has names and IDs of people who liked my comment { "data": [ { "id": "1567232638", "name": "Tomas Turek" }, { "id": "100000505522318", "name": "Lukáš Jůza" }, { "id": "1436511625", "name": "Jirka Menšík" }, { "id": "689578115", "name": "Jakub Reznicek" } ], "paging": { "next": "https://graph.f acebook.com/ 3243789208547/likes?f ormat=j son&li mit=2 5&offset=25& after_id=689578115" }} 25
CHAPTER 3 Technical Analysis 3.1.6 Graph API Explorer GraphAPI Explorer is a tool that helps user to: Make requests to the Graph API and see formatted results in-line. Explore the connections for each object and view field descriptions to help you understand what the response means. Easily obtain an access_token with the specific permissions necessary to access the data you need to optimize your app for users. The Select Permissions dialog allows you to select the specific user data, friends data or extended permissions needed. The Explorer then shows you the same permissions dialog your users will see when you request these permissions in your production app. Figure 16: Graph API Explorer 26
CHAPTER 3 Technical Analysis 3.1.7 Authentication Authentication gives your app the ability to know the identity of a Facebook user, and to read and write data via Facebook's APIs. The Facebook Platform uses OAuth 2.0 for authentication and authorization. A successful authentication flow results in your application obtaining a user access_token which can be used to make requests to Facebook's APIs. Figure 17: Request for permission to Manage pages and Posts on them If user authorizes the application the permission is stored. During next access to the application the permission request is not displayed. Figure 18: Access_token sequence [10] 27
CHAPTER 3 Technical Analysis 3.1.8 Permission types Developers can access Permission documentation on this web address: https://developers.facebook.com/docs/authentication/permissions/ Figure 19: Permission types 1 Figure 20: Permission types 2 28
CHAPTER 3 Technical Analysis Figure 21: Permission types 3 3.1.8.1 Permission example It's possible to programmatically check which permissions a user has granted your application by performing an HTTP GET on: https://graph.facebook.com/me/permissions?access_token=user_access_token It s also possible to programmatically revoke a permission which a user has previously granted your application by performing an HTTP DELETE on: https://graph.facebook.com/me/permissions/permission_name?access_token=use R_ACCESS_TOKEN 3.1.9 FQL Facebook Query Language The FQL object enables running FQL queries using the Graph API. Facebook Query Language, or FQL, enables you to use a SQL-style interface to query the data exposed by the Graph API. It provides for some advanced features not available in the Graph API, including batching multiple queries into a single call. [11] 29
CHAPTER 3 Technical Analysis 3.2 Twitter Twitter is also opened to developers and the documentation is presented on site http://dev.twitter.com/. The developer site doesn t have simple examples but the discussion forums are good source of such information. Twitter offers REST API, Streaming API, Search API. It has also Twitter SDK for easier development on PHP platform. 3.2.1 Twitter applications The core principle of application is similar to previous Facebook applications. For the purpose of the thesis following app was created. Figure 22: Twitter application 30
CHAPTER 3 Technical Analysis 3.2.2 Twitter SDK Twitter supports @Anywhere SDK. Other SDKs especially for mobile devices or PHP can be searched on the internet. 3.2.3 REST API REST API is elementary API that supports gathering information from Twitter and publishing information to Twitter. By HTTP method GET we can display different statuses according to input parameters, search for posts or users, read private messages, get the list of friends, etc. Method POST publishes new posts, sends messages, follow some profile, etc. We have to have write permission. 3.2.4 Streaming API Streaming API is used only for reading tweets in real-time for large amount of user. User Streams: Nearly all data required to update a user's display. Requires the user's OAuth token. It provides public and protected statuses from followings, direct messages, mentions and other events taken on and by the user. A large number of User Streams may not be created from the same host or service. For example, an application that displays a few accounts at once may open a connection per account. The primary use case is providing updates to a Twitter client. Site Streams: BETA Allows multiplexing of multiple User Streams over a Site Stream connection. Once more than a handful of User Streams connections are opened from the same host or service, Site Streams must be used. The primary use case is website and other service integrations. 3.2.5 Search API Search API is used for quick search among tweets. The search area can be wide or reduced to tweets of one user. It has some limitations, parameters for number of results etc. but this API is not important for purposes of the thesis. 31
CHAPTER 3 Technical Analysis 3.2.6 API explorer developer console The API can be explored by using the console provided by user @apigee. Together with the REST API reference it is powerful tool to for exploring objects ant its parameters. Figure 23: Twitter API explorer [12] 32
CHAPTER 3 Technical Analysis 3.2.7 Authentication Twitter uses OAuth to provide authorized access to its API. It has following features Security - Users are not required to share their passwords with 3rd party applications, increasing account security. Standard - A wealth of client libraries and example code are compatible with Twitter's OAuth implementation. The application asks for authorization similarly as Facebook app. Figure 24: Twitter authorization 33
CHAPTER 3 Technical Analysis 3.3 OAuth In this paragraph will be described how the authentication process works. Imagine universal method that enables to access Twitter data without sending the password from your web application. In the web application the user selects to log into his Twitter account. In fact he is forwarded to twitter site where he can log in. In some kind of form he confirms that the web application has permission to access some kind of data for specified time. The key is exposed for specified service, specified purpose and specified time. That eliminates the risk of misuse. The valuable log-in data flow only between the user and Twitter. Figure 25: OAuth Authentication Flow [13] 34
CHAPTER 3 Technical Analysis 3.4 Microsoft Dynamics CRM Microsoft Dynamics CRM is based on.net platform that is opened for developers. Most information for developers is available on http://msdn.microsoft.com/. 3.4.1 Solutions Solutions are how customizers and developers author, package, and maintain units of software that extend Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online. Customizers and developers distribute solutions so that organizations can use Microsoft Dynamics CRM to install and uninstall the business functionality defined by the solution. There are two types of Microsoft Dynamics CRM solutions: Unmanaged and Managed. A managed solution is a completed solution that is intended to be distributed and installed. An unmanaged solution is one that is still under development or is not intended to be distributed. When the unmanaged solution is complete and you want to distribute it, export the unmanaged solution and select the option to package it as a managed solution. [14] Figure 26: Solutions View 3.4.2 Microsoft Dynamics CRM 2011 Software Development Kit The Microsoft Dynamics CRM 2011 Software Development Kit (SDK) is for developers, system customizers, and report writers. This SDK documentation contains information for developers writing server side code, custom business logic, integration modules, workflow assemblies, and plug-ins. It provides an architectural overview of Microsoft Dynamics CRM, the entity model, security model, and Web services. Sample code and walkthroughs are provided to guide you through the new features. It also contains information for developers customizing the Web client or Microsoft Dynamics CRM for Microsoft Office Outlook, including scripting, integration of custom Web 35
CHAPTER 3 Technical Analysis pages, and lots of sample code. SDK can be downloaded at: http://www.microsoft.com/download/en/details.aspx?id=24004 3.4.3 Web Services For Microsoft Dynamics CRM Online, the CrmDiscoveryService Web service can provide a list of Web service endpoint URLs for each organization that you are a member of. In addition, this Web service is used to obtain a policy and CrmTicket that are required for Windows Live authentication. This information is then used to configure the CrmService and CrmMetadataService Web service instances. [15] 3.4.4 Silverlight Silverlight is a powerful development platform for creating engaging, interactive user experiences for Web, Desktop and mobile applications when online or offline. [16] 3.4.5 Microsoft Dynamics CRM Online Authentication There are several methods of authenticating with Microsoft Dynamics CRM Online. Each depends on the type of application that is trying to authenticate. 3.4.5.1 Client-to-Server Authentication A client application (console application, or a Windows Forms application) authenticates with Microsoft Dynamics CRM Online by using a Client-to-Server scenario where Microsoft Dynamics CRM Online is the server. 3.4.5.2 Server-to-Server Authentication The Server-to-Server authentication scenario is used when a non-microsoft Dynamics CRM Web service, Windows service, or ASPX page has to authenticate and access the Microsoft Dynamics CRM Online Web services. This type of authentication scenario is typically performed in the background and requires no user interaction. 3.4.5.3 Server-to-Server Authentication with Impersonation The Server-to-Server with Impersonation scenario requires user interaction where the user fills out Microsoft Dynamics CRM Online logon information in a form. In that scenario, all Microsoft Dynamics CRM Online Web service calls are performed on the user's behalf by using impersonation. 36
CHAPTER 3 Technical Analysis 3.5 Application programing interface The web application has entries that represent application programing interface. For clearness the API is specified by the UML notation. The library for calling API functions is not part of the thesis. Figure 27: API design 3.6 UML model The UML model is a necessary part of the analysis. The UML documentation was made in Enterprise Architect 8.0. This environment enabled the automatic generation of the RTF documentation that was formatted for purposes of the thesis. Requirements and Use-case diagrams reflect the functional analysis results in the UML notation. The most important model for understanding the structure of the created web application is the Component diagram. The screen model clarifies the layout of the application. In more complex application with many user screens it is very helpful diagram. The Class diagram describes the database structure. 37
CHAPTER 3 Technical Analysis 3.6.1 Requirements The requirements model is one of the pillars of analysis. The aim is to specify the product characteristics. Requirements are clarified and used in use case diagram. Figure 28: UML Requirements 38
CHAPTER 3 Technical Analysis 3.6.2 Use Case Each use case represents action that can be done when using the system. The scenarios for each use case are represented by clicking on appropriate button, link or checkbox on the index page of the application. Figure 29: UML Use Case 39
CHAPTER 3 Technical Analysis 3.6.3 Component diagram A Component diagram illustrates the pieces of software, embedded controllers and such that make up a system, and their organization and dependencies. A Component diagram has a higher level of abstraction than a Class diagram. The first version of the diagram shows basic and components and their communication interfaces. The second version contains also other components that are necessary for the complex system. The second version emphasizes the component structure and therefor interfaces are not mentioned. Figure 30: UML Component diagram (version 1) Figure 31: UML Component diagram (version 2) 40
CHAPTER 3 Technical Analysis 3.6.4 User interface layout A Screen is used to prototype User Interface screen. By using UML features solid understanding of user interface can be built up without having to use code. This becomes an excellent means of establishing the precise behavior the system has from a user perspective, and in conjunction with the Use Case model, defines exactly how a user gets work done. Figure 32: User interface 41
CHAPTER 3 Technical Analysis 3.6.5 Class model The Class diagram captures the logical structure of the system. It is a static model, describing what exists and what attributes and behavior it has, rather than how something is done. Class diagrams are most useful to illustrate relationships between Classes and Interfaces. Generalizations, Aggregations and Associations are all valuable in reflecting inheritance, composition or usage, and connections, respectively. Figure 33: UML Class Model 42
CHAPTER 3 Technical Analysis 3.7 Programing language preference Social networks development prefers in general language PHP. It is mostly targeted to integrate social networks into websites or portals. In comparison with other programming languages the information about PHP is easier to reach. On the other hand Microsoft prefers.net platform. Preferred language is VisualBasic or C#. For Dynamics CRM integration purposes seems the ASP (Web application framework) most suitable. Silverlight is another technology that is focused on writing rich internet applications. Silverlight application (.xap) can be imported as web resource. Based on my experience with is the PHP programming language the most suitable choice. The issue of PHP and CRM connection has to be resolved to make the project successful. When using PHP languages HTML, CSS and MySQL DB has to be considered. 43
CHAPTER 4 - Implementation 4 Implementation The implementation chapter describes important parts of code. The chapter is divided into parts that correspond with single components from the UML Component Diagram. The PHP programming language was chosen because the author has already experience with it. PHP is the most suitable language for programming social networks interaction because PHP SDK libraries are available. The application was created also with other technologies: HTML, CSS, Javascript. 4.1 Running environment The application is running at personal domain http://unterkunftkarlsbad.de/petr/aplikacephp/. PHP Version: 5.3.12 Server: ONEbit.cz (Apache) MySQL version: 5.5.16 Charset MySQL: UTF-8 Unicode (utf8) With login information into MS Dynamics CRM anyone can use or test this application (Note: MS Dynamics CRM license will expire in July 2012). Server: https://crmintegrator.crm4.dynamics.com/ User (Windows Live ID): crmintegrator@hotmail.cz Password: petrvujtech 4.2 Web Application The main screen enables user to input text that he wants to publish in social media as Facebook or Twitter. The application can count number of characters because of Twitter tweet limitation. Maximum character count in the tweet is 140 chars. Javascript function tells user when the number of character exceed 140. Longer text can be entered. Each publish script reduces the length of publish stream as necessary. The user can choose by checkboxes which social network he wants to use. The user can also choose if he wants to store the post as a marketing campaign in MS Dynamics CRM. The post responses in social networks can be gathered by the application and they are stored into MS Dynamics CRM as campaign responses. For interaction with social networks the user has to authenticate first. Color status indicators represent authentication status (red not authenticated, green - authenticated). 45
CHAPTER 4 - Implementation Each campaign can be monitored for specified time. Responses are gathered only if the post was published into CRM. Responses of logged user are not gathered. The Facebook user can choose where he wants to post the text. First option is to post it on the user s wall. The second option is to post to Facebook page wall. The logged user has to be the administrator of such page. The post is made by the Facebook page (not by the page administrator). The Facebook page post is displayed in the timeline. Figure 34: Web application index.php 46
CHAPTER 4 - Implementation 4.3 Database The Web application needs to cooperate with database because of following reasons. Posts can be monitored for various time ranges. When gathering responses we need to distinguish responses that were already gathered and responses that are new and need to be processed. The database structure reflects the UML Class Diagram. The database create script is shown in the Appendix. 4.4 Microsoft Dynamics CRM integration Microsoft Dynamics CRM connection is realized through application provided by Zbynek Pavelek (Zenithies). The entities in MS Dynamics CRM are created when parameters are set appropriately. The script returns ID of the parameter. Initial problems with authentication and with Zenithies server firewall were solved. In MS Dynamics CRM was new user (crmintegrator@hotmail.cz) created (Settings -> System -> Administration -> Users). The user login data were stored to Zenithies server. 4.4.1 Access and login information There is 30-day free trial version of MS Dynamics CRM Online that provides full functionality. For the purpose of the thesis the 30-day license was extended for longer period until June 2012. Server: https://crmintegrator.crm4.dynamics.com/ User (Windows Live ID): crmintegrator@hotmail.cz Password: petrvujtech 47
CHAPTER 4 - Implementation 4.4.2 Create marketing campaign When creating marketing campaign the file crm/publish_dynamics.php is called. 4.4.2.1 Fundamental code elements By crul the main information is sent to server http://vujtech.zenithies.org/push.php. User and password information is stored on the Zenithies server. Entity name and parameters were set according to CrmService Entities library. [17] $target = 'http://vujtech.zenithies.org/push.php'; $post = array( 'data' => base64_encode(serialize( array( 'entity' => 'campaign', 'fields' => array( length is 128 'name' => substr($publish_stream, 0, 120), //max 'objective' => $publish_stream, // offer 'statuscode' => '2', //Launched 'typecode' => '100000001', // type 'proposedstart' => $today, // m.d.y 'proposedend' => $expire_date, // m.d.y 'actualstart' => $today, // m.d.y 'actualend' => $expire_date, // m.d.y ); )) ) ) $ch = curl_init ($target); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $post); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); $crm_newest_post_id = $result; Variable $publish_stream is set when submitting the form. The maximal length of the field name is limited up to 128 characters. [18] Other parameters such statuscode and typecode are set based on MS Dynamics CRM customization. The dates are calculated in the script by PHP. The script returns 48
CHAPTER 4 - Implementation ID of created campaign in CRM. It is stored as $crm_newest_post_id. The ID is used later for storing Campaign responses. 4.4.2.2 Customization of MS Dynamics CRM The CRM has to be customized first. Customizations are packed in the solution Marketing Campaign. The status code represents launched campaign. New type of campaign - Social Media was set. The customization process is attached in the Appendix. Following screenshot shows how to set the parameters. Figure 35: Campaign Fields The views for Campaigns were edited. All Campaigns and Campaign Templates view was set as default view. The structure of columns was edited. The views customization is attached in the Appendix. 4.4.3 Add campaign responses Campaign responses are stored to CRM when the gather script for Facebook fb/gather_facebook.php or script for Twitter tw/gather_twitter.php is in action. 4.4.3.1 Fundamental code elements The code for adding campaign responses is similar to the code for adding marketing campaigns except there are some changes in parameters. Following example represents gathering Facebook LIKE. Maximal length of field subject is 200 characters. [19] 49
CHAPTER 4 - Implementation $import_array = array ( 'subject' => 'LIKE', 'firstname' => $ret_obj_03[0]['first_name'], 'lastname' => $ret_obj_03[0]['last_name'], 'regardingobjectid' => $crm_post_id, // ID of parent campaign ); 'responsecode' => '100000001', // response Facebook LIKE 'channeltypecode' => '100000001', // channel Facebook 'prioritycode' => '0', // priority LOW 'receivedon' => $today, // m.d.y $post = array( 'data' => base64_encode(serialize( array( 'entity' => 'campaignresponse', 'fields' => $import_array ) )) ); For facebook comment and twitter retweet are gathered texts. The Campaign ID is represented by variable $crm_post_id. Parameter such responsecode and channeltypecode are set based on MS Dynamics CRM customization. Prioritycode is Low (0) for Facebook LIKE, Normal (1) for Facebook Comment and Twitter Retweet. The script returns ID of the response which is stored into database later. 4.4.3.2 Customization of MS Dynamics CRM Customizations are packed in the solution Marketing Campaign. The responsecode is Facebook LIKE (100000001), Facebook Comment (100000002) or Twitter Retweet (100000003). The channeltypecode is Facebook (100000001) or Twitter (100000002). The customization process is attached in the Appendix. 4.5 Facebook integration 4.5.1 Facebook application setup The Facebook application has to be setup first. The admin needs own Facebook account and access to https://developers.facebook.com/. The name of application created is Microsoft Dynamics CRM connector. App ID and App Secret are used in the program code. Sandbox mode can be switched on/off in advanced setting. If enabled, only app developers will be able to see app. It is good for testing purposes. The canvas URL means content pulled from this base URL to iframe on Facebook. 50
CHAPTER 4 - Implementation Figure 36: Facebook application settings Figure 37: Facebook application advanced settings App ID and App Secret have to be set in file: fb/config.php. The file is included into files index.php and fb/index.php. $app_id = "264087643628202"; $app_secret = "fd92ae61b63aac941ce824de8af2e9bc"; 51
CHAPTER 4 - Implementation 4.5.2 PHP SDK The PHP SDK is used in the application. The PHP SDK provides a rich set of server-side functionality for accessing Facebook s server-side API calls. These include all of the features of the Graph API, FQL, and the Deprecated REST API. TH SDK is stored in folder fb/fbsdk/. 4.5.3 Facebook initiation User can choose if he wants to post to his wall or if he wants to post to Facebook page wall that he administrates. Variable $facebook_id indicates the author of new post (it can be the user or the Facebook page itself). For this purposes we need also variables $fb_id_is_page and $facebook_logged_user_id. When posting as a page the $page_access_token['access_token'] is set. The index.php sets important variable $facebook that is used through the application for all API calls. $facebook = new Facebook(array( 'appid' => $app_id, 'secret' => $app_secret, 'cookie' => true, 'fileupload' => true, )); 4.5.4 Authentication against Facebook The key function finds if user is logged into Facebook if ($facebook->getuser()) The function returns logged user ID. If the result is empty user can log in <a href="fb/index.php">log INTO FACEBOOK</a> The permissions are specified array('scope' => 'read_stream, publish_stream, manage_pages, friends_website, user_website, email, user_photos')); The file fb/index.php redirects user to login URL $login_url = $facebook->getloginurl <script type="text/javascript">top.location.href = "'.$login_url. '"; </script> The user is redirected to login page 52
CHAPTER 4 - Implementation After login the user confirms required permissions Figure 38: Facebook permissions approval After the approval is the user redirected to the canvas URL. The canvas URL is set as fb/index.php. Based on the existing result of function $facebook->getuser() the user is redirected to the main script. Now we can use the main window as logged Facebook user. The important decision maker in fb/index.php is displayed below. if (! $facebook->getuser()) { echo '<script type="text/javascript">top.location.href = "'.$login_url.'";</script>'; exit; } else { echo '<script type="text/javascript">top.location.href = "../index.php";</script>'; } 4.5.5 Publish to Facebook Publishing to Facebook is enabled only to authenticated users. The script fb/publish_facebook.php is called. If the post is made as Facebook page the access token is used in the API call. $facebook->api("/".$facebook_id."/feed", "post", array( 'message' => $wallpost, 'access_token' => $page_access_token['access_token'], )); 53
CHAPTER 4 - Implementation The maximum length of a Facebook status update has been increased to 63,206 characters. So the length of the message parameter is not limited. [20] For future gathering we need to know the new post ID. It is retrieved from Facebook by FQL query and stored into variable $fb_newest_post_id. $fql = 'SELECT status_id FROM status WHERE uid='. $facebook_id; $ret_obj = $facebook->api(array( 'method' => 'fql.query', 'query' => $fql, )); $fb_newest_post_id = $ret_obj[0]['status_id']; 4.5.6 Gather from Facebook For gathering from Facebook the script fb/gather_facebook.php is called. When gathering from Facebook we have to identify relevant posts first. From the DB are selected posts that were stored into CRM. The posts have to be valid not expired. $SQL = "SELECT * FROM posts WHERE( (date_expire > curdate()) AND (publish_dynamics = 1) AND (publish_facebook = 1) );"; The FOR cycle works with all relevant posts. Each posts parameters id_facebook and id_dynamics are stored into variables $fb_post_id, $crm_post_id. 4.5.6.1 Gather Likes FQL query selects all users that Liked the post. In next FOR cycle are by FQL retrieved data of all such users. $fql_02 = "SELECT user_id FROM like WHERE object_id='".$fb_post_id."'"; $fql_03 = "SELECT name, first_name, last_name, contact_email, website FROM user WHERE uid='".$ret_obj_02[$i]['user_id']."'"; We don t want to gather the likes of logged user or the likes of the page we admin. This fact is represented by the IF construct. 54
CHAPTER 4 - Implementation if ($ret_obj_02[$i]['user_id']!= $facebook_id && $ret_obj_02[$i]['user_id']!= $facebook_logged_user_id) We need to check if the Like is stored in our DB. If the Like is not in the DB we can continue to send the Like into CRM. We store the information about Facebook user into the DB and we store the Like itself into DB. The primary key for the DB table Facebook_Likes is the combination of two foreign keys: post ID and user ID. $SQL2 = "SELECT COUNT(*) as pocet FROM facebook_likes WHERE FK_post = '".$fb_post_id."' AND FK_user = '".$ret_obj_02[$i]['user_id']."';" ; $result2 = mysql_query($sql2); $db_field2 = mysql_fetch_assoc ($result2); $exists = $db_field2['pocet']; if ($exists!= "1"){ The Facebook Like and user data is stored into CRM by curl. Than the user data is stored into DB table Facebook_Users. The primary key controls if the inserted user is not a duplicate of user stored in the DB. When storing duplicate user the mysql_error() is displayed. $SQL3 = "INSERT INTO facebook_users (id_user, name, first_name, last_name, website) VALUES ('".$ret_obj_02[$i]['user_id']."', '".$ret_obj_03[0]['name']."', '".$ret_obj_03[0]['first_name']."', '".$ret_obj_03[0]['last_name']."', '".$ret_obj_03[0]['website']."');"; The Facebook Like is stored into DB with other parameters such $crm_newest_response_id. The boolean parameter reported_to_crm indicates that the CRM import was made before. $SQL4 = "INSERT INTO facebook_likes (FK_post,FK_user,reported_to_crm,crm_id) VALUES ('".$fb_post_id."','".$ret_obj_02[$i]['user_id']."','1','".$crm_newest_res ponse_id."');"; 4.5.6.2 Gather Comments Gathering Facebook comments is made after gathering Likes. The principle is very similar. The difference is mainly in the structure of the DB table Facebook_Comments. Each comment has own Facebook ID that is also the primary key of the DB table. Following FQL code is used to gather comments of the post. 55
CHAPTER 4 - Implementation $fql_12 = "SELECT fromid, text, id FROM comment WHERE object_id='".$fb_post_id."'"; In the FOR cycle are by FQL retrieved data of the users. We need to check if the comment is not already stored in the DB. $SQL6 = "SELECT COUNT(*) as pocet FROM facebook_comments WHERE id_comment = '".$ret_obj_12[$i]['id']."';" ; $result6 = mysql_query($sql6); $db_field6 = mysql_fetch_assoc($result6); $exists6 = $db_field6['pocet']; if ($exists6!= "1"){ If we are allowed to continue The Facebook Comment and Facebook user data is stored into CRM. User data is stored into DB table Facebook_User. Comments are stored into DB table Facebook_Comments. 4.5.7 Gathering personal data Facebook doesn t allow gathering friend s personal data such phone number, email and address. The permissions user_address, user_mobile_phone, email only provide access to authenticated user, not his friend's addresses, mobile phone numbers or emails. [21] Table 10: User and friends email permission [22] 4.6 Twitter integration When implementing Twitter integration the programmer can use some libraries mentioned on the official developer website https://dev.twitter.com/docs/twitterlibraries#php. The library by Abraham Williams was used. [23] 56
CHAPTER 4 - Implementation 4.6.1 Twitter application setup The Twitter application has to be setup first. The admin has to own Twitter account and access https://dev.twitter.com/. The name of application created is Microsoft Dynamics CRM connector. Consumer Key and Consumer secret are used in the program code. The callback URL means the URL where to redirect after successful twitter authentication. Figure 39: Twitter application settings 57
CHAPTER 4 - Implementation In file tw/config.php has to be following constants defined define('consumer_key', 'zorx00dzz8ccrrmeuqyw'); define('consumer_secret', 'coxjmxusvcowjwjmrjv86g2w58ifn0cui446bkp3ax4'); def ine('oauth_callback', 'http://unterkunf t - karlsbad.de/petr/aplikacephp/tw/callback.php'); 4.6.2 Twitter initiation Twitter is using sessions for storing the access token. New connection is established first. $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']); 4.6.3 Authentication against Twitter User can authenticate by clicking on <a href="tw/redirect.php">log INTO TWITTER</a> File redirect.php builds TwitterOAuth object and gets temporary credentials. It builds authorized URL and redirects to Twitter. $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); $request_token = $connection->getrequesttoken(oauth_callback); switch ($connection->http_code) { case 200: $url = $connection->getauthorizeurl($token); header('location: '. $url); break; The user is redirected to Twitter login page where he authorizes the application to use his account. 58
CHAPTER 4 - Implementation Figure 40: Twitter login and authorization page After the authorization is the user redirected to the callback URL. The callback URL is set as tw/callback.php. The script creates TwitterOAuth object with data from default phase and requests access token from Twitter. The access token is stored in the session. Afterwards the user is redirected to the index.php. The session keeps access token. $connection = new T witteroauth(consumer_key, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']); $access_token = $connection-> getaccesstoken($_request['oauth_verifier']); $_SESSION['access_token'] = $access_token; if (200 == $connection->http_code) { $_SESSION['status'] = 'verified'; header('location:../index.php'); 59
CHAPTER 4 - Implementation 4.6.4 Publish to Twitter Publishing to Twitter is enabled only to authorized users. The script tw/publish_twitter.php is called. The Twitter object is created and through the API call is the status updated. The tweet is limited up to 140 characters. $access_token = $_SESSION['access_token']; $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']); $content = $connection->post('statuses/update', array('status' => substr($publish_stream, 0, 140) )); // chracter limit 140 For future gathering we need to know the new tweet ID. It is retrieved from the API post response and stored into variable $tw_newest_post_id. $tw_newest_post_id = $content->id_str; 4.6.5 Gather from Twitter For gathering from Twitter the script tw/gather_twitter.php is called. When gathering from Twitter we have to identify relevant posts first. From the DB are selected posts that were stored into CRM. The posts have to be valid not expired. $SQL = "SELECT * FROM posts WHERE( (date_expire > curdate()) AND (publish_dynamics = 1) AND (publish_twitter = 1) );"; The FOR cycle works with all relevant posts. Each posts id_twitter and id_dynamics are stored into variables $tw_post_id, $crm_post_id. 4.6.5.1 Gather retweets The retweets are discovered by the API call. $content = $connection->get('statuses/retweets/'.$tw_post_id); 60
CHAPTER 4 - Implementation We don t need to check for retweets of just logged user because Twitter doesn t allow to retweet own tweet. We need to check if the retweet is stored in our DB table Twitter_Retweets. Similarly as Facebook comments he primary key for the DB table Twitter_Retweets is ID of the retweet. $SQL32 = "SELECT COUNT(*) as pocet FROM twitter_retweets WHERE id_retweet = '".$content[$i] ->id_str."';" ; $result32 = mysql_query($sql32); $db_field32 = mysql_fetch_assoc($result32); $exists = $db_field32['pocet']; if ($exists!= "1"){ The retweet and user data is stored into CRM by curl. The user data is stored into DB table Twitter_Users. The primary key controls if the inserted user is not a duplicate of user stored in the DB. When storing duplicate user the mysql_error() is displayed. $SQL33 = "INSERT INTO twitter_users (id_user, name, website) VALUES ('".$user->id."', '".$user->name."', '".$user->url."');"; The retweet is stored into DB with parameters such $crm_newest_response_id. The boolean parameter reported_to_crm indicates that the CRM import was made before. $SQL34 = "INSERT INTO twitter_retweets (FK_post, FK_user, reported_to_crm, crm_id, id_retweet, text_of_retweet) VALUES ('".$tw_post_id."', '".$user->id."', '1', '".$crm_newest_response_id."', '".$content[$i]->id_str."', '".$content[$i] ->text."');"; 4.6.6 Gathering personal data Twitter offers only one filed for name. Therefore the name cannot be parsed as first name and last name. It is imported into CRM as last name. Email addresses or phone numbers are not available through the Twitter API. 61
CHAPTER 5 - Testing 5 Testing The purpose of testing was to verify all the functions of the Web Application. The testing met all specified requirements. The scenario of testing was built according to Use case model. Testing was realized in two iterations. First iteration discovered some drawbacks that were fixed. Second iteration was successfully functional. First version imperfections are discussed in paragraphs called Imperfections discovered. The screenshot documentation is attached in the Appendix. 5.1 Authentication The user did following Marketing user authenticates against Facebook Marketing user authenticates against Twitter RESULT: This scenario was successfully accomplished. 5.2 Publish stream 5.2.1 Publish stream with short time interval for monitoring the campaign Prerequisite for this scenario: User is authenticated against Facebook and Twitter. The Marketing user enters text and publishes to CRM (Creates new campaign in Microsoft Dynamics CRM), publishes to Facebook (New Facebook post), publishes to Twitter (New Twitter post). Published text: 01 Testovací příspěvek, který platí pouze jeden den Monitor the campaign for: 1 day RESULT: This scenario was successfully accomplished. 5.2.2 Publish stream with post to Facebook user wall Prerequisite for this scenario: User is authenticated against Facebook and Twitter. The Marketing user enters text and publishes to CRM (Creates new campaign in Microsoft Dynamics CRM), publishes to Facebook (New Facebook post), publishes to Twitter (New Twitter post). 63
CHAPTER 5 - Testing Published text: 02 Testovací příspěvek diplomové práce umístěný sociální sítě na profil Petr Vůjtěch. Odpovědi budou zaznamenány do MS Dynamics CRM. Řekněte, jaké je dnes u Vás počasí? Monitor the campaign for: 30 days RESULT: This scenario was successfully accomplished. NOTES: The Twitter character limit was exceeded. The application informed the user. The Twitter tweet was shortened to first 140 characters. 5.2.3 Publish stream with post to Facebook Page wall Prerequisite for this scenario: User is authenticated against Facebook. User stored ID of the Facebook page he wants to store as. The Marketing user enters text and publishes to CRM (Creates new campaign in Microsoft Dynamics CRM), publishes to Facebook (New Facebook post). Published text: 03 Testovací příspěvek diplomové práce umístěný sociální sítě na profil společnosti Microsoft Dynamics CRM connector. Řekněte, co budete dělat o víkendu? Monitor the campaign for: 30 days RESULT: This scenario was successfully accomplished. 5.2.4 Imperfections discovered during first iteration 5.2.4.1 Twitter post ID The database value of the twitter post id (table: posts, column: id_twitter) didn t correspond to twitter post id identified through API console explorer. The application stored ID of second most actual tweet because the ID was detected by API query. FIX: The application stores twitter ID that is parsed from the response when publishing. 5.2.4.2 Twitter ID vs. ID_STR Because the twitter ID is quite long number, Twitter recommends using id_str (string) parameter instead of id (number). During testing was found that using id_str is much more reliable than just id. [24] 5.3 Gather stream The marketing user did the gather from both networks two times. It shows that the application is able to add just the NEW items of social media interaction during the second gather request. 64
CHAPTER 5 - Testing 5.3.1 Gather from Facebook user wall Prerequisite for this scenario: User is authenticated against Facebook. Facebook wall post (published text: 01 Testovací příspěvek, který platí pouze jeden den) was not commented or liked. Facebook wall post (published text: 02 Testovací příspěvek diplomové práce umístěný sociální sítě na profil Petr Vůjtěch. Odpovědi budou zaznamenány do MS Dynamics CRM. Řekněte, jaké je dnes u Vás počasí?) was commented and liked as followed: 4 users added 1 comment 1 user added 2 comments 2 users (they also added comment) added Like Web Application gathered Likes and Comments 1 user added 1 Like and 1 comment Web Application gathered Likes and Comments Marketing user ran task Gather from Facebook. RESULT: This scenario was successfully accomplished. NOTES: The DB didn t store any duplicate of Facebook user. All Likes, comments and Facebook users were successfully stored into DB and into MS Dynamics CRM. The interaction with the post with short time interval for monitoring the campaign (1 day) was not gathered because the date was expired. During second gather command just new (1 Like and 1 comment) interactions were gathered. The gather was made also for the Facebook Page post. 5.3.2 Gather from Facebook Page wall Prerequisite for this scenario: User is authenticated against Facebook. Facebook Page wall post was commented and liked as followed: 1 user added 1 Like and 1 comment The authorized user made comment Web Application gathered Likes and Comments 1 user added 2 comment Web Application gathered Likes and Comments Marketing user ran task Gather from Facebook. RESULT: This scenario was successfully accomplished. NOTES: The DB didn t store any duplicate of Facebook user. All Likes, comments and Facebook users were successfully stored into DB and into MS Dynamics 65
CHAPTER 5 - Testing CRM. During second gather command just new (1 Like and 2 comments) interactions were gathered. The gather was made also for the Facebook user wall post. 5.3.3 Gather from Twitter Prerequisite for this scenario: User is authenticated against Twitter. The twitter tweet was retweeted as followed. 2 users retweeted Web Application gathered Likes and Comments 1 user retweeted Web Application gathered Likes and Comments Marketing user ran task Gather from Twitter. RESULT: This scenario was successfully accomplished. NOTES: All retweets were successfully stored into DB and into MS Dynamics CRM. During second gather command just new (1 retweet) interaction was gathered. 66
CHAPTER 6 - Key issues and interests 6 Key issues and interests This chapter describes various issues that are relevant for this thesis and require extra paragraph for explanation. 6.1 Research and relevant information Social networks are widely integrated into software applications. There is no problem to find information about technical aspects of the integration. But the information is usually useless because it is incorrect and it is not relevant any more. The social network interfaces change through time and the changes are important. The developers have to monitor the changes in API, permissions to keep their programs working. Facebook used REST API, but now the Graph API is preferred in the development. Twitter is more consistent in terms of API changes. Working with relevant information sources was quite big issue for me when working on the thesis project. 6.2 Microsoft Dynamics CRM integration development Initially I was trying to develop a built-in module inside MS Dynamics CRM. The project was moving from customization of CRM to sophisticated.net platform Silverlight with CRM Web Services. Advanced customization -> Plug-in development -> Silverlight application I spent long time when I was trying to implement Silverlight solution. The progress was slow and insufficient. Therefore I came up with solution that is independent on MS Dynamics CRM. That was the web application implemented in PHP. The integration issue was solved by reengineering in cooperation with Zenithies group. 6.2.1 First solutions Add the Facebook user profile page into the contact entity form was successfully implemented. Some cross-scripting issues occurred. The core was proper customization of the form and work with web resources. 67
CHAPTER 6 - Key issues and interests Figure 41: Iframe in MS Dynamics CRM contact entity 6.2.2 Sitemap customization Originally I tried to create internal control panel for social networks management. For that reason the sitemap had to be edited. Microsoft Pinpoit server provides Microsoft Dynamics CRM SiteMap Editor. [25] 6.2.3 Silverlight Silverlight solution seemed to be good choice for MS Dynamics CRM interaction. The interaction towards social networks was not covered in the documentation and the solution would be very complicated. After several attempts to work with complex application platform Silverlight I decided to choose to PHP language that is more suitable for interaction with social networks. 68
CHAPTER 6 - Key issues and interests 6.2.4 Cooperation with WBI Aleš Novotný When dealing with Silverlight I got contact to WBI company from Pavel Náplava. I was in contact with Aleš Novotný who suggested following solution for the integration issue. The application is implemented as Silverlight application. When publishing to social network the activity and marketing campaign are created. For gathering responses the workflow has to be set up. Workflow would regularly query the social network if there are any new responses. 6.2.5 Cooperation with Zenithies Zbyněk Pavelek When searching for information about PHP connection to MS Dynamics CRM I found the Zenithies website. This group offered: Import leads from PHP site form directly into Microsoft Dynamics CRM 4.0 PHP site data import/export to/from Microsoft Dynamics CRM 4.0 Zenithies offer commercial package that enables PHP script to interact with MS Dynamics CRM. The package contains: Source code + certificate (license) for one CRM connection Assistance with the primary settings Personalized use case demo Code is easily extendable for other CRM entities I expected that Zenithies is a US company but I was nicely surprised when I found out that the contact person Zbynek Pavelek is from Valasske Mezirici in Czech Republic. We started quite intensive email communication. The communication was forwarded also to his colleagues in Australia. We agreed on free non-commercial mini-solution for purposes of my project. After 2 weeks of communication the final working code was delivered. 6.3 Changes in analysis of twitter interaction In the analysis Twitter favorites and replies were considered as equivalents to Facebook likes and comments. But Twitter REST API doesn t provide such data. Twitter can count how many times the tweet was marked as favorite, but REST API cannot get who marked the tweet as favorite. This feature is not reachable through twitter but it is reachable in two websites: automated funniest tweet finder Favrd and Favstar. The way of implementing such websites was discussed on several internet forums and the guessed solution stands on matches done in internal database. The number of users using these tweet finders is high and therefore such information can be provided. [26] 69
CHAPTER 6 - Key issues and interests The analysis of this project worked with tweets favorites and tweet replies. In the implementation, only retweets were covered in the final solution. 6.4 Gathering personal data from social networks The amount data that is available through api is managed by permissions. In fact the social networks users have to be aware of the fact that their personal data can be scanned by their friends or by applications that their friends use. For machine gather purposes the email, mobile phone number and addresses are not available for Facebook user friends. Thanks for that because otherwise the number of spams and misused phone numbers would increase a lot. Originally I expected that email and phone contact information would be great contribution for the CRM, but it is not available. The login security is ensured by the OAuth protocol, where the delicate login information is not send through GET or POST requests, but it is entered on the site of the service provider. Claimed access is clearly displayed to the user. 6.5 Gathering only newly added responses The gather scripts have to identify which post responses are newly added from last gather action. For this purpose the database is necessary. The disadvantage of the application is its performance. The gather scripts need few second to be completed. The interaction between application and social network is not simple. To gather Facebook post comments several steps have to be done: 1. SQL query to identify relevant post from the DB 2. FQL query to get all user ids that commented the post 3. FQL query to get user data 4. If statement that eliminates comments of the logged user 5. SQL query that verifies if the comment has already been stored in DB 6. curl call to store info to CRM 7. SQL query to insert user data into DB 8. SQL query to insert comment data into DB 6.6 Performance optimization Suggested optimization for gather stream is to change the order of steps mention in previous paragraph. Step 3. FQL query to get user data should be moved behind step 5. We can gather user data when we are sure that the comment needs to be stored into CRM and into the database. When comparing steps 4 and 5, step5 is more often realized than step 70
CHAPTER 6 - Key issues and interests 4. If we repetitively gather responses we gather not actual comments several times. Therefore it is better to switch the order of these steps. The changed order here: 1. SQL query to identify relevant post from the DB 2. FQL query to get all user ids that commented the post 3. SQL query that verifies if the comment has already been stored in DB 4. If statement that eliminates comments of the logged user 5. FQL query to get user data 6.7 Further usage of gathered campaign responses The Campaign response can be managed widely in the CRM. For example it can be closed, converted or added to queue. Following screenshots describe the usage clearly. The response can be processed differently based on internal directions and individual purposes. Figure 42: Campaign response actions Figure 43: Convert campaign response 71
CHAPTER 6 - Key issues and interests 6.8 Marketing responses from the same user If the Facebook user enters two different comments that are gathered by the application CRM has two responses from the same user. That may cause duplicity records when converting marketing response to contact. Duplicity data can be detected by For duplicity check there is an automated function in MS Dynamics CRM where duplicate detection rule can be set. [27] 72
CHAPTER 7 - Conclusion 7 Conclusion 7.1 The thesis summarization The functional analysis part was covered widely and I hope I have clearly presented all possibilities of social network integration. Tables describe the usage of social networks according to various CRM entities. Current commercial solutions for MS Dynamics CRM were presented. Based on the analysis the focus of the thesis was put on external social CRM used for marketing purposes. Subsequent technical analysis summarizes all necessary technical information and resources. Facebook and Twitter connectivity principles are cleared in this chapter. The programming application interfaces are presented together with libraries that support them. The principles are quite similar for both networks. Authentication process is explained. Microsoft Dynamics CRM connectivity and solution development is also introduced. Further the API for the web application is specified. The software project is clarified by the UML model that is also part of the technical analysis. The requirement model defines the scope of the application. The use case model reflects the user point of view. Component diagram defines components and their relationships. Class model defines the database structure. Screen model defines the user interface. Both functional and technical analyses provided sufficient background for implementing the application. In the implementation chapter the core concepts of coding are discussed and presented. The database connection is specified. The code providing the integration is presented from perspective of all important components (MS Dynamics CRM, Facebook, Twitter). The new web application was tested for its functionality. First iteration revealed some imperfections. They were fixed and second iteration of testing was successful. Next chapter (Key issues and interests) emphasize important and interesting issues that appeared when working on the thesis. This chapter has summarizing and explicative purpose and may answer some readers arising questions. 7.2 Meeting the assignment and goals The object of the diploma thesis was to analyze, implement and test new software component that enables integration of social networks into Microsoft Dynamics CRM. All important parts were fulfilled. The outputs from the analytic part were used as inputs for the implementation part. Testing results were satisfactory. 73
CHAPTER 7 - Conclusion 7.3 Project contributions The contribution of the thesis is mainly in delivering original unique solution. The solution has potential to become a part/core/background of commercial product that might be used by companies for their marketing activities on social networks. I find this thesis valuable information source. Lot of information available on internet about social networks PHP connection is not relevant. In this thesis the working solution is delivered. The topic of posting to MS Dynamics CRM using PHP is also solved by this thesis. Even though social network usage in information systems is widely discussed topic but I haven t seen any summarizing paper that would cover and describe this topic as a complex system. All articles usually deal with some small part of the wide issue covered in this thesis. The thesis provides complex view on the topic especially in the Functional analysis chapter. 7.4 Personal satisfaction I am really glad that I have completed this project. I worked on the topic that I am interested in. I find it very dynamic and I can feel that I closely follow one of actual trends. I gained good knowledge about social networks and their integration. I can use the knowledge for website development or other business opportunity. I gained also good knowledge about MS Dynamics CRM. It is very complex system that needs lot of customizations. I had to learn how the CRM works, I know how to use it and how to customize it. The progress of the thesis was quite demanding. I had to deal with new large CRM system MS Dynamics CRM. I had to study principles and technical aspects of several social networks. The study area was quite large. Than I had to put everything together and make working software component. 7.5 Future upgrades of the application I have several ideas how the application could be improved. The gather script could be launched by some CRON server job. The performance of the application could be optimized. Performance suggestion was discussed in chapter Key issues and interests. 74
CHAPTER 7 - Conclusion 7.5.1 Gather relevant responses from social networks I was thinking how to identify responses that are worth to be gathered. From the business point of view I guess that the responses might have low rate of utility. LIKE doesn t mean BUY The application could gather more valuable responses when using some artificial intelligence concepts, heuristics or decision systems. From the large amount of responses could be gathered responses that tend to be converted in a business opportunity. Such topic could be offered as another thesis or any scaling up project. 75
REFERENCES References [1] Social network [online]. 2011 [2011-11-04]. Available from: http://en.wikipedia.org/wiki/social_network [2] How many users do the major social networks have? [online]. 2011 [2011-11-04]. Available from: http://techcocktail.com/users-major-social-networks-2011-10#.t6lq_og9upv [3] 10 reasons for social networking [online]. 2009 [2011-11-04]. Available from: http://blog.b-i.com/2009/08/30/10-reasons-for-social-networking/ [4] Create a user dashboard [online]. 2011 [2011-11-10]. Available from: http://help.crm4.dynamics.com/help/default.aspx?area=%2fworkplace%2fhome_d ashboards.aspx&user_lcid=1033&ver=5.0.9688.1561 [5] Vibe Social Networking for Microsoft Dynamics CRM [online]. 2011 [2011-11- 04]. Available from: http://pinpoint.microsoft.com/en-us/applications/vibe-socialnetworking-for-microsoft-dynamics-crm-4295028209 [6] Parrot - Social CRM for Microsoft Dynamics CRM [online]. 2011 [2011-11-04]. Available from: http://pinpoint.microsoft.com/en-us/applications/parrot-socialcrm-for-microsoft-dynamics-crm-12884912469 [7] InsideView blog [online]. 2011 [2011-11-04]. Available from: http://blog.insideview.com/2008/09/ [8] Developer Blog [online]. 2011 [2011-11-15]. Available from: http://developers.facebook.com/blog/post/616/ [9] Introducing JSON [online]. 2011 [2011-12-03]. Available from: http://www.json.org/ [10] Facebook Graph API [online]. 2011 [2011-12-04]. Available from: http://www.9lessons.info/2011/03/facebook-graph-api-to-post-status.html [11] Facebook Query Language (FQL) [online]. 2012 [2012-04-06]. Available from: http://developers.facebook.com/docs/reference/fql/ [12] Exploring the Twitter API [online]. 2012 [2012-04-17]. Available from: https://dev.twitter.com/console [13] OAuth - nový protokol pro autentizaci k vašemu API [online]. 2008 [2011-12-11]. Available from: http://zdrojak.root.cz/clanky/oauth-novy-protokol-proautentizaci-k-vasemu-api/ [14] Introduction to Solutions [online]. 2012 [2012-02-08]. Available from: http://msdn.microsoft.com/en-us/library/gg334576.aspx 77
REFERENCES [15] Using the CrmDiscoveryService Web Service: CRM Online [online]. 2012 [2012-02-10]. Available from: http://msdn.microsoft.com/en-us/library/cc151011.aspx [16] Silverlight [online]. 2012 [2012-02-13]. Available from: http://www.silverlight.net/ [17] CrmService Entities [online]. 2012 [2012-02-13]. Available from: http://msdn.microsoft.com/en-us/library/bb887790.aspx [18] campaign.name Property [online]. 2012 [2012-04-23]. Available from: http://msdn.microsoft.com/en-us/library/cc151931.aspx [19] campaignresponse.subject Property [online]. 2012 [2012-04-23]. Available from: http://msdn.microsoft.com/en-us/library/cc151979.aspx [20] Facebook Increases Maximum Status Update Length To 63,206 Characters [online]. 2011 [2012-04-24]. Available from: http://reface.me/news/maximumcharacters-facebook-status-update/ [21] Platform Updates [online]. 2012 [2012-04-23]. Available from: http://developers.facebook.com/blog/post/2011/01/14/platform-updates--newuser-object-fields--edge-remove-event-and-more/ [22] Permissions Reference [online]. 2012 [2012-04-28]. Available from: http://developers.facebook.com/docs/authentication/permissions/ [23] abraham / twitteroauth [online]. 2012 [2012-02-19]. Available from: https://github.com/abraham/twitteroauth [24] Twitter IDs, JSON and Snowflake [online]. 2012 [2012-02-30]. Available from: https://dev.twitter.com/docs/twitter-ids-json-and-snowflake [25] Microsoft Dynamics CRM SiteMap Editor [online]. 2012 [2012-02-14]. Available from: http://pinpoint.microsoft.com/en-us/applications/microsoft-dynamics-crmsitemap-editor-12884928049 [26] How To: See When Your Tweets Are Favorited, by RSS [online]. 2012 [2012-03- 06]. Available from: http://www.readwriteweb.com/archives/how_to_see_when_your_tweets_are_favo rited_by_rss.php [27] Detect Duplicate Data in Microsoft Dynamics CRM [online]. 2012 [2012-05-05]. Available from: http://msdn.microsoft.com/en-us/library/gg309427.aspx [28] WOLENIK, Marc J., Damian SINAY a Rajya Vardhan BHAIYA. Microsoft Dynamics CRM 2011 Unleashed [ebook]. 2011 [2012-02-03]. Available: http://books.google.cz/books?id=sdukutpqfdac&dq=ms+dynamics+crm&hl=cs &source=gbs_navlinks_s 78
APPENDIX Appendix A. Customization of MS Dynamics CRM A.1. Status code Appendix Figure 1: Statuscode settings Appendix Figure 2: Launched value 79
APPENDIX A.2. Type of campaign Figure 44: New type of Campaign: Social Media 80
APPENDIX A.3. Views Appendix Figure 3: Set default view for Campaigns Appendix Figure 4: Configure view 81
APPENDIX A.4. Response code Appendix Figure 5: Retweet Response Code Facebook LIKE, Facebook Comment, Twitter 82
APPENDIX A.5. Chanel of campaign response Appendix Figure 6: Channel Facebook, Twitter 83
APPENDIX B. Create database script -- phpmyadmin SQL Dump -- version 3.4.7 -- http://www.phpmyadmin.net -- -- Počítač: 127.0.0.1 -- Vygenerováno: Pon 07. kvě 2012, 03:16 -- Verze MySQL: 5.5.16 -- Verze PHP: 5.3.12 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Databáze: `unterkunftkarlsbadde2` -- -- -------------------------------------------------------- -- -- Struktura tabulky `facebook_comments` -- CREATE TABLE IF NOT EXISTS `facebook_comments` ( `FK_user` bigint(20) NOT NULL, `FK_post` bigint(20) NOT NULL, `id_comment` varchar(100) COLLATE utf8_czech_ci NOT NULL, `text_of_comment` text COLLATE utf8_czech_ci NOT NULL, `reported_to_crm` tinyint(1) NOT NULL, `crm_id` text COLLATE utf8_czech_ci NOT NULL, PRIMARY KEY (`id_comment`), KEY `FK_post` (`FK_post`), KEY `FK_user` (`FK_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -------------------------------------------------------- -- 84
APPENDIX -- Struktura tabulky `facebook_likes` -- CREATE TABLE IF NOT EXISTS `facebook_likes` ( `FK_post` bigint(20) NOT NULL, `FK_user` bigint(20) NOT NULL, `reported_to_crm` tinyint(1) NOT NULL, `crm_id` text COLLATE utf8_czech_ci NOT NULL, PRIMARY KEY (`FK_post`,`FK_user`), KEY `FK_post` (`FK_post`), KEY `FK_user` (`FK_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -------------------------------------------------------- -- -- Struktura tabulky `facebook_users` -- CREATE TABLE IF NOT EXISTS `facebook_users` ( `id_user` bigint(20) NOT NULL, `name` text COLLATE utf8_czech_ci NOT NULL, `first_name` text COLLATE utf8_czech_ci NOT NULL, `last_name` text COLLATE utf8_czech_ci NOT NULL, `website` text COLLATE utf8_czech_ci NOT NULL, PRIMARY KEY (`id_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -------------------------------------------------------- -- -- Struktura tabulky `posts` -- CREATE TABLE IF NOT EXISTS `posts` ( `system_id` int(11) NOT NULL AUTO_INCREMENT, `publish_stream` text COLLATE utf8_czech_ci NOT NULL, `publish_time` int(11) NOT NULL, `publish_dynamics` tinyint(1) NOT NULL, `publish_facebook` tinyint(1) NOT NULL, `publish_twitter` tinyint(1) NOT NULL, `id_dynamics` text COLLATE utf8_czech_ci NOT NULL, `id_facebook` bigint(20) NOT NULL, `id_twitter` bigint(20) NOT NULL, `publisher_id_facebook` bigint(20) NOT NULL, `date_created` date NOT NULL, `date_expire` date NOT NULL, PRIMARY KEY (`system_id`), KEY `id_facebook` (`id_facebook`), KEY `id_twitter` (`id_twitter`) 85
APPENDIX ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=94 ; -- -------------------------------------------------------- -- -- Struktura tabulky `setup` -- CREATE TABLE IF NOT EXISTS `setup` ( `network_name` text COLLATE utf8_czech_ci NOT NULL, `network_id` text COLLATE utf8_czech_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -------------------------------------------------------- -- -- Struktura tabulky `twitter_retweets` -- CREATE TABLE IF NOT EXISTS `twitter_retweets` ( `FK_user` bigint(20) NOT NULL, `FK_post` bigint(20) NOT NULL, `id_retweet` varchar(100) COLLATE utf8_czech_ci NOT NULL, `text_of_retweet` text COLLATE utf8_czech_ci NOT NULL, `reported_to_crm` tinyint(1) NOT NULL, `crm_id` text COLLATE utf8_czech_ci NOT NULL, PRIMARY KEY (`id_retweet`), KEY `FK_user` (`FK_user`), KEY `FK_post` (`FK_post`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -------------------------------------------------------- -- -- Struktura tabulky `twitter_users` -- CREATE TABLE IF NOT EXISTS `twitter_users` ( `id_user` bigint(20) NOT NULL, `name` text COLLATE utf8_czech_ci NOT NULL, `website` text COLLATE utf8_czech_ci NOT NULL, PRIMARY KEY (`id_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci; -- -- Omezení pro exportované tabulky -- -- 86
APPENDIX -- Omezení pro tabulku `facebook_comments` -- ALTER TABLE `facebook_comments` ADD CONSTRAINT `facebook_comments_ibfk_1` FOREIGN KEY (`FK_user`) REFERENCES `facebook_users` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `facebook_comments_ibfk_2` FOREIGN KEY (`FK_post`) REFERENCES `posts` (`id_facebook`); -- -- Omezení pro tabulku `facebook_likes` -- ALTER TABLE `facebook_likes` ADD CONSTRAINT `facebook_likes_ibfk_4` FOREIGN KEY (`FK_user`) REFERENCES `facebook_users` (`id_user`), ADD CONSTRAINT `facebook_likes_ibfk_5` FOREIGN KEY (`FK_post`) REFERENCES `posts` (`id_facebook`); -- -- Omezení pro tabulku `twitter_retweets` -- ALTER TABLE `twitter_retweets` ADD CONSTRAINT `twitter_retweets_ibfk_3` FOREIGN KEY (`FK_user`) REFERENCES `twitter_users` (`id_user`), ADD CONSTRAINT `twitter_retweets_ibfk_2` FOREIGN KEY (`FK_post`) REFERENCES `posts` (`id_twitter`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS * /; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 87
APPENDIX C. Testing screenshots C.1. Publish stream Appendix Figure 7: Launch marketing campaign 88
APPENDIX Appendix Figure 8: Facebook user wall Appendix Figure 9: Facebook page wall 89
APPENDIX Appendix Figure 10: Twitter user tweets Appendix Figure 11: MS Dynamics CRM - Marketing Campaigns 90
APPENDIX C.2. Social media interaction (likes, comments, retweets) Appendix Figure 12: Facebook user wall post interaction (first gather) Appendix Figure 13: Facebook user wall post interaction (second gather) 91
APPENDIX Appendix Figure 14: Facebook page wall post interaction (first gather) Appendix Figure 15: Facebook page wall post interaction (second gather) 92
APPENDIX Appendix Figure 16: Twitter user tweet interaction (first gather) Appendix Figure 17: Twitter user tweet interaction (second gather) 93
C.3. Gathered responses Appendix Figure 18: MS Dynamics CRM Responses for post 02 (first gather)
Appendix Figure 19: MS Dynamics CRM Responses for post 03 (second gather)
Appendix Figure 20: MS Dynamics CRM Responses for text 03 (first gather)
Appendix Figure 21: MS Dynamics CRM Responses for text 02 (second gather)
C.4. Database records system_id publish_stream 01 Testovací příspěvek, který platí pouze jeden 85 den (do 4.5.2012) 02 Testovací příspěvek diplomové práce umístěný sociální sítě na profil Petr Vůjtěch. Odpovědi 87 budou zaznamenány do MS Dynamics CRM. Řekněte, jaké je dnes u Vás počasí? 03 Testovací příspěvek diplomové práce umístěný sociální sítě na profil společnosti Microsoft 88 Dynamics CRM connector. Řekněte, co budete dělat o víkendu? publish_file publish_time publish_dynamics publish_facebook publish_twitter 1 1 1 1 30 1 1 1 30 1 1 0 id_dynamics id_facebook id_twitter publisher_id_facebook date_created date_expire a730195e-9495-e111-b70a-1cc1de6d3b11 3395558882694 198244014682669057 1081368285 2012-05-04 2012-05-05 cdbf8442-9595-e111-b308-18a905732a1b 3395579123200 198245618580328448 1081368285 2012-05-04 2012-06-03 a918315a-9595-e111-b308-18a905732a1b 212647955518669 0 177630909020374 2012-05-04 2012-06-03 Appendix Table 1: DB table posts
FK_user FK_post id_comment text_of_comment reported_to_crm crm_id Patek: Kalba, Sobota: kalba, Nedele: 5b110d88-f195-e111-1567232638 212647955518669 212647955518669_755029 1 doufam ze zadna kalba, Pondeli: kalba :) b308-18a905732a1b 1567232638 3395579123200 3395579123200_3687115 V Praze je slunecno a teplo bez mraku 1 605a5972-f195-e111- b308-18a905732a1b 1663178979 3395579123200 na Zélandu máme krásný podzim, denní e6b2fb79-f195-e111-3395579123200_3687163 1 teplota 18 stupňů, jasno. b70a-1cc1de6d3b11 1436511625 3395579123200 ranní jízda tramvají přes Palackého most je 9b1b967c-f195-e111-3395579123200_3687208 zkurveně pomalá, přemýšlím, že příště jdu 1 b308-18a905732a1b ze Zborovské pěšky 1567232638 3395579123200 Pokazdy, kdyz pujdes pesky ty svine 9c1b967c-f195-e111-3395579123200_3687288 1 tramvaje pojedou rychle :) b308-18a905732a1b 1480127616 3395579123200 3395579123200_3687292 Jasno CRM Jasno!! :) 1 9d1b967c-f195-e111- b308-18a905732a1b 1426359656 3395579123200 3395579123200_3687397 Appendix Table 2: DB table facebook_comments (first gather) Tady probihaji zatezove testy Dynamics CRM.. :) 1 26570c85-f195-e111- b70a-1cc1de6d3b11
FK_user FK_post id_comment text_of_comment reported_to_crm crm_id Patek: Kalba, Sobota: kalba, Nedele: 5b110d88-f195-e111-1567232638 212647955518669 212647955518669_755029 1 doufam ze zadna kalba, Pondeli: kalba :) b308-18a905732a1b 1592979661 212647955518669 212647955518669_764505 合 理 的 貢 獻 1 41db54ff-ba97-e111- b308-18a905732a1b 1592979661 212647955518669 212647955518669_764529 abc 1 42db54ff-ba97-e111- b308-18a905732a1b 1567232638 3395579123200 3395579123200_3687115 V Praze je slunecno a teplo bez mraku 1 605a5972-f195-e111- b308-18a905732a1b 1663178979 3395579123200 na Zélandu máme krásný podzim, denní e6b2fb79-f195-e111-3395579123200_3687163 1 teplota 18 stupňů, jasno. b70a-1cc1de6d3b11 1436511625 3395579123200 ranní jízda tramvají přes Palackého most je 9b1b967c-f195-e111-3395579123200_3687208 zkurveně pomalá, přemýšlím, že příště jdu 1 b308-18a905732a1b ze Zborovské pěšky 1567232638 3395579123200 Pokazdy, kdyz pujdes pesky ty svine 9c1b967c-f195-e111-3395579123200_3687288 1 tramvaje pojedou rychle :) b308-18a905732a1b 1480127616 3395579123200 3395579123200_3687292 Jasno CRM Jasno!! :) 1 9d1b967c-f195-e111- b308-18a905732a1b 1426359656 3395579123200 Tady probihaji zatezove testy Dynamics 26570c85-f195-e111-3395579123200_3687397 1 CRM.. :) b70a-1cc1de6d3b11 1592979661 3395579123200 3395579123200_3698094 mysql vezme i 合 理 的 貢 獻 neboj 1 5d42c3f7-ba97-e111- b308-18a905732a1b Appendix Table 3: DB table facebook_comments (second gather)
FK_post FK_user reported_to_crm crm_id 3395579123200 1436511625 1 e6cc8071-f195-e111-b70a-1cc1de6d3b11 3395579123200 1567232638 1 5f5a5972-f195-e111-b308-18a905732a1b 212647955518669 1567232638 1 5a110d88-f195-e111-b308-18a905732a1b Appendix Table 4: DB table facebook_likes (first gather) FK_post FK_user reported_to_crm crm_id 3395579123200 1436511625 1 e6cc8071-f195-e111-b70a-1cc1de6d3b11 3395579123200 1567232638 1 5f5a5972-f195-e111-b308-18a905732a1b 3395579123200 1592979661 1 03dbe0ef-ba97-e111-b70a-1cc1de6d3b11 212647955518669 1567232638 1 5a110d88-f195-e111-b308-18a905732a1b 212647955518669 1592979661 1 836503fe-bb97-e111-b70a-1cc1de6d3b11 Appendix Table 5: DB table facebook_likes (second gather)
id_user name first_name last_name website 1426359656 Jan Hořejší Jan Hořejší 1436511625 Jirka Menšík Jirka Menšík 1480127616 Karel Sniper Žák Karel Žák webovky.sniperweb.cz 1567232638 Tomas Turek Tomas Turek 1663178979 Markéta Wágnerová Markéta Wágnerová Appendix Table 6: DB table facebook_users (first gather) id_user name first_name last_name website 1426359656 Jan Hořejší Jan Hořejší 1436511625 Jirka Menšík Jirka Menšík 1480127616 Karel Sniper Žák Karel Žák webovky.sniperweb.cz 1567232638 Tomas Turek Tomas Turek 1592979661 Martin Drobný Martin Drobný http://www.drobas.info 1663178979 Markéta Wágnerová Markéta Wágnerová Appendix Table 7: DB table facebook_users (second gather)
FK_user FK_post id_retweet text_of_retweet reported_to_crm crm_id RT @jasemja: 02 Testovací příspěvek diplomové práce umístěný sociální sítě na c887e661-f195-e111-16708350 198245618580328448 198296274368331777 1 profil Petr Vůjtěch. Odpovědi budou b308-18a905732a1b zaznamenány do MS Dyna RT @jasemja: 02 Testovací příspěvek diplomové práce umístěný sociální sítě na c787e661-f195-e111-567356451 198245618580328448 198387796581416960 1 profil Petr Vůjtěch. Odpovědi budou b308-18a905732a1b zaznamenány do MS Dyna Appendix Table 8: DB table twitter_retweets (first gather) FK_user FK_post id_retweet text_of_retweet reported_to_crm crm_id RT @jasemja: 02 Testovací příspěvek c887e661-f195- diplomové práce umístěný sociální sítě na 16708350 198245618580328448 198296274368331777 1 e111-b308- profil Petr Vůjtěch. Odpovědi budou 18a905732a1b zaznamenány do MS Dyna RT @jasemja: 02 Testovací příspěvek c787e661-f195- diplomové práce umístěný sociální sítě na 567356451 198245618580328448 198387796581416960 1 e111-b308- profil Petr Vůjtěch. Odpovědi budou 18a905732a1b zaznamenány do MS Dyna RT @jasemja: 02 Testovací příspěvek 63152106-bb97- diplomové práce umístěný sociální sítě na 246227096 198245618580328448 199235200125898752 1 e111-b70aprofil Petr Vůjtěch. Odpovědi budou 1cc1de6d3b11 zaznamenány do MS Dyna Appendix Table 9: DB table twitter_retweets (second gather)
id_user name website 16708350 mmister http://mmister.com 567356451 Hamr Antonin Appendix Table 10: DB table twitter_users (first gather) id_user name website 16708350 mmister http://mmister.com 246227096 VUJO s.r.o. http://www.vujo.cz/ 567356451 Hamr Antonin Appendix Table 11: DB table twitter_users (second gather)
APPENDIX D. Content of attached CD - files - database DB create script - ms_dynamics_crm_solution exported customized solution from CRM -uml UML model - src application source code - text thesis report files 105