Professional Documents
Culture Documents
By:
Faculty of Engineering
Carleton University
April 7, 2010
Abstract
topic. The website will save our clients the time required to publish and
owners will get better exposure by entering the social media space.
business.
Page | 2
Acknowledgements
had help and guidance in two areas. The first was the technical and
step of the way helping us see the next steps needed to be taken in
helped us pinpoint the business need for our project and proper
business plan writing. We owe our final results to the great guidance of
Page | 3
Table of Contents
Abstract............................................................................................................ 2
Acknowledgements .....................................................................................3
Table of Contents.............................................................................................4
........................................................................................................................ 6
List of Figures...................................................................................................7
Introduction .....................................................................................................9
Problem ........................................................................................................ 9
Solution ......................................................................................................10
Engineering Professionalism........................................................................11
Project Management...................................................................................11
Individual Contributions...............................................................................13
Project Contributions................................................................................13
Report Contributions................................................................................14
1.Overview .................................................................................................... 15
Website ...................................................................................................... 15
Analytics .....................................................................................................20
Background ...................................................................................................20
Authentication..........................................................................................26
Facebook Integration...................................................................................29
Facebook API............................................................................................32
Requirements ...............................................................................................32
2.Design......................................................................................................... 38
Website ...................................................................................................... 38
Configurations Section.............................................................................40
Code-behind.............................................................................................49
Datastore Interface.....................................................................................53
Datastore.....................................................................................................54
Implementation .............................................................................................56
Twitter Implementation............................................................................56
Facebook Implementation........................................................................60
Conversations..........................................................................................62
Email ..........................................................................................................64
Mobile Client................................................................................................66
Posting content...........................................................................................68
Testing ..........................................................................................................69
Page | 5
Business Achievements .................................................................................70
Conclusion ....................................................................................................72
References ....................................................................................................74
Page | 6
List of Figures
Figure 21 Twitter accounts can be added by clicking on the Twitter icon in the
Admin Tools....................................................................................................57
Page | 7
Figure 24 The full content of the post on SynapSync.....................................60
Page | 8
Introduction
Cheryl Schramm and spanned over the period of September 16th 2009
Market Trends
brand and manage to get a sense of how they should align their
Problem
their use of social media. The results showed that 63% of small
Page | 9
businesses are currently not employing any means of Social Media
a new one appears and becomes popular they have to learn how to
Solution
topic.
Page | 10
The Engineering Project
Due to the software nature of our project we did not face the
regular health and safety hazards that most projects due. We did
refreshed.
Engineering Professionalism
the Settings page or Control Panel was authorized to do so. For both
Project Management
Due to the large scale project we took on as our fourth year project
files needed for our individual task. This not only helped us in the
consistency of our code, but also in rolling back code. When certain
Page | 12
Google App Engine. Google Sites also allowed us to store our
Google Docs. The tool saved us a lot of time by acting a central hub
Individual Contributions
Project Contributions
Contributor: Contributions:
Filip Mares Web Design
DataStore design
URL shortening
manipulation
Competition Work
Apurva Saini Sessions and Authentication
Facebook Implementation
Twitter Implementation
Page | 13
Report Contributions
Contributor: Contributions:
Filip Mares Abstract
Introduction
Engineering Project
Overview
Design(website, datastore)
Business Achievements
Conclusion
Apurva Saini Background
Requirements
and Authentication)
Testing
Page | 14
1. Overview
Website
through a page called the Control Panel. The website allows for
On this page the company employee enters the title and content for
file. The employee can either ‘Save’ the post for publishing it at a
Page | 15
Our clients will be provided with a personalized profile page
the website visitor can subscribe to email updates from the small
business.
vary in format and require the user to learn both social network
protocols. Our site helps users to converse with social network users
sidebar, our users can reply to the comments and engage social
network users.
Email Newsletters
and social networks our users can send their updates to email
This is a great opportunity for the small business owner to reach its
communication method.
Page | 17
Mobile Devices
is displayed in Figure 3.
Page | 18
Figure 3 Android Mobile Client
Page | 19
Analytics
All the above service allow for our clients to get greater exposure
the ability to see the number of unique visitors that view each
Background
Google App Engine, and Microsoft Windows Azure. The Google App
Page | 20
Engine is the platform that SynapSync makes use of and it is the
support, URL Fetch API for communicating with other internet hosts
(via HTTP requests), and many more [3]. An overview of all the key
the ability to share it with the world [3]. This not only saves time for
some of the useful App Engine services can be found later in this
section.
The supported languages by App Engine are Python and Java. Both
that web applications can run smoothly without having to deal with
Page | 21
Figure 5 Overview of Google App Engine Services [4]
This section provides details of how and why SynapSync makes use
Database Design
in order for him or her to be able to log into the website at a later
Page | 22
offered by App Engine is known as BigTable, which is a high
application = webapp.WSGIApplication('/profile.html',
HTML document.
Page | 24
Figure 6 webapp framework
Twitter Integration
OAuth protocol, which allows users to share all their content stored
time.
Page | 25
Authentication
Page | 26
Through the OAuth protocol, the user is first prompted with
along with other OAuth fields. The request token has an expiry
Page | 27
Figure 7 Twitter Account Authentication
Page | 28
and thus, authentication is not required. Once authorization has
Twitter API
update status, etc [7]. Any application can make successful calls
Facebook Integration
Page | 29
Authorization and Authentication
Figure 8.
Even after following these steps, the application still does not
Page | 31
Facebook API
Requirements
The requirements for the SynapSync system were broken down into
through our 4th year Software Engineering course. All the functional
requirements are defined in the use case diagram below and entail
non-functional requirements.
Page | 32
The non-functional requirements of SynapSync are not reflected in the
are explained in the Design section of the report. The following use
Page | 33
Page | 34
SynapSync System
Mobile Access
Company Profile
Subscribe to
Email
Mobile Client
Contact
Company
Synapsync DataStore
Access
Company Profile
Company Follower
Login
Logout
Publish
Company Representative Content
Reply to
Comment
Facebook Twitter
Edit Company
Info
Company Administrator
Add
Facebook Social Network API
Account
Facebook Twitter
The scenario for the use case ‘Publish Content’ is shown below. Some
Page | 35
Publish Content
content>
RFS <Post Branching Action
Content>
ELSE
RFS Basic Step #
Page | 36
Flow 3 1) The system gets the name of the company from
SynapSync DataStore
2) The system stores the content to SynapSync DataStore
3) Company Representative is redirected to the Control
Panel
ENDIF
Postcondit Post is stored into SynapSync DataStore but NOT published, and
any notifications
Page | 37
2. Design
Website
Page | 38
The SynapSync website is comprised of a number of webpages.
page, control panel and settings page. Some of the pages are
visible to anonymous users who visit the site and others are
the web front end are composed of the WebHandlers package, the
Page | 39
Configurations Section
Page | 40
When creating a web application on Google App Engine there
our case when any URL from our application is requested the
Page | 41
Figure 13 app.yaml contents
Page | 42
The User Interface Section
written if more than one HTML page require the same formatting.
throughout the site and edit it once to change the layout of our
design.
Page | 44
Figure 15 Error reporting
'{{ }}'. The tag contained within the double swirly brackets is
the user and 'info' which is the formatted version of the company
through the 'posts' list with standard Python right in line with
Page | 45
HTML. The 'block' containers refer to their respective sections of
Page | 46
the Master Page highlighted in figure 13.
Page | 47
Figure 16 profiles.html source code
Page | 48
Code-behind
As mention in the Background section 4.2.2, SynapSync uses App
Page | 49
Figure 17 Request Handlers
Page | 50
retrieved from the datastore. A Python dictionary is essentially a
a webpage is requested.
To access the Settings page and the Control Panel page, the
session.
creted for their user id. If there was another session active on the
the user in session. Since a session instance knows of the user that
is logged in, the Session class is directly associated with the User
Page | 51
Figure 18 User entities and session
designed a number of classes which interact with both the view and
into multiple control classes for the various entities in the model. As
DataStoreUserInterface, DataStoreCompaniesInterface,
Contained within these classes are getters and setters for our
Page | 53
Figure 19 Datastore Interface Controllers
Datastore
Google App Engine uses the Big Table model for database design as
Google ensures better performance results when using the Big Table
model on Google App Engine. While the Big Table model does
Figure 18. To relate the tables together when retrieving data stored
find the user information for a company we linked the entries with
Page | 54
an identifier. We used the dbProfileName entry as the identifier.
Page | 55
Implementation
Social Networks
Twitter Implementation
Page | 56
Figure 21 Twitter accounts can be added by clicking on the Twitter icon in the
Admin Tools
token, and gets the Twitter username through the REST API. This
token, the Twitter username, and the name of the company have
Page | 57
accounts under the company name are retrieved from the
datastore.
When the user navigates to the Home page or the Control Panel,
listed on the right column (Figure 1). Every time this page is
website itself.
Page | 58
Figure 23 New post shown on Twitter
Page | 59
Figure 24 The full content of the post on SynapSync
Facebook Implementation
Admin Tools section on the Settings page. There they click on the
Facebook icon seen in Figure 21. Doing so will prompt the user
user's stream.
key is stored into the datastore along with the name of the
they can update the Facebook account with a new status. All that
Page | 61
is required to invoke the API methods are the permanent session
'Utilities' package which also holds the Session class that is used
Conversations
SynapSync takes advantage of the social network interactions
Page | 62
comment by the Company Follower was retrieved by SynapSync
comment Facebook
Twitter and Facebook are both very similar. This makes SynapSync
Hi5 will be a similar process. The sequence diagram will then have
Email
Google App Engine offers a number of APIs that simplify the
Page | 65
Mobile Client
SynapSync server.
Page | 66
Mobile Access Company Profile
<<boundary >>
Mobile Handler
Company Follower
Create ()
Android
onCreate ()
getCompanyUpdates ()
get ()
Create ()
<<control >>
DataStorePostsInterface
getPosts ()
Query ()
formatPost ()
Page | 67
Posting content
and Facebook). Upon posting the update, the post is sent to email
Page | 68
Figure 32 Publishing Content
Testing
Although unit test classes were not created, unit testing was still
algorithm was isolated and executed. By doing so, the resulting values
values.
In the event that the system would encounter errors and if verifications
debugging tool which prints out traces of the runtime stack. This
proper corrections were then made. The Eclipse IDE was used to
develop the application, and this IDE also provides a debugging tool
that offers the ability to step-through the code and note the changes
occurring at runtime.
Business Achievements
Page | 70
upon graduation. To validate the product and its need, we developed a
the market and get feedback on it. We did this by entering a number of
entrepreneurial competitions.
challenged on the application of our software and the need for it. This
was due to little market research into the matter. We received 4th place
points.
acquisition, financial forecast and pricing. This was more in-depth than
business market and statistics on the use of social media. This proved
to be very well done as our team advanced to the finals where Filip
Mares presented the company, product and business plan. Our team
Page | 71
faced tough competition with most competitors coming from the Sprott
which can help us tailor our business plan. We are currently still in the
Conclusion
We have used some of the most cutting edge technologies on the web
including the Twitter oAuth protocol, Google App Engine and the
Android 2.1 SDK. Dealing with all these new technologies we have
area was discussed in detail in section 6.2. We had to develop our own
solution rather than using the Google built authentication system. This
it.
Page | 72
We however did make a good decision developing on the Google App
application and not worry about setting up a server. Tying into the
reduce our development time and we can see how in the real world
documentation and source code. This allowed for few collisions in the
however went against our initial concern of running a lean project with
Page | 73
References
[1] G. MacMillan, "Dell sales via Twitter leap more than 100% to $6.5m,"
http://www.brandrepublic.com/News/972507/Dell-sales-via-Twitter-leap-100-
65m/.
1023_3-10374886-93.html.
[3] Google, “What is Google App Engine?”, Google Code, [Online], 2010. [6
http://code.google.com/appengine/docs/whatisgoogleappengine.html
consulting.com/blog/tag/ec2/
[5] Google, “Datastore Python API Overview”, Google Code, [Online], 2010.
http://code.google.com/appengine/docs/python/datastore/overview.html
[6] Google, “webapp Overview”, Google Code, [Online], 2010. [6 April 2010].
Available:
http://code.google.com/appengine/docs/python/tools/webapp/overview.html
Page | 74
[7] Twitter, “Twitter API Documentation”, Twitter, [Online], 02 April 2010. [6
http://wiki.developers.facebook.com/index.php/API
[9] tav, “tweetapp”, github Social Coding, [Online], 21 May 2009. [6 April
2010].
Available: http://github.com/tav/tweetapp
http://github.com/sciyoshi/pyfacebook
http://basecamphq.com/?
source=37signals+home&__utma=1.1640256451.1270595573.1270595573.
1270595573.1&__utmb=1.4.10.1270595573&__utmc=1&__utmx=-
&__utmz=1.1270595573.1.1.utmcsr=%28direct%29|utmccn=%28direct%29|
utmcmd=%28none%29&__utmv=-&__utmk=258283658
Page | 75
Page | 76
Appendix A – Use Case Actor Descriptions
Actor Descriptions
Company Follower
Company Representative
Company Administrator
Mobile Client
Page | 77
SynapSync DataStore
Page | 78
Appendix B – Use Case Descriptions
Page | 79
Access Control Panel – Company Representative visits the home
about the company such as name, address, postal code, etc. on the
settings page.
Page | 80
Appendix C – Use Case Scenarios
Contact Company
Basic Flow
Steps Action
1 Company Follower chooses to send 'Email'
2 Company Follower types email body into the textbox and chooses
to 'Send'
3 The system gets the email of the Company Administrator from
SynapSync DataStore
The system processes the email and sends email to the Company
4
Administrator
SynapSync redirects Company Follower to the Company Profile
5
page
Postcondit Company Administrator has received the email and Company
Page | 81
Login
of SynapSync
Primary Actor Company Representative, SynapSync DataStore
Generalizatio None
Basic Flow
Steps Action
1 Company Representative types in his or her username and
Page | 82
Brief Company Representative posts content to SynapSync
Actors
Dependency None
Generalizatio None
Page | 83
Basic Flow <Post Content>
Steps Action
1 Company Representative uploads an image
2 Company Representative types content into the title and the body
3 IF Company Representative chooses to 'Post', THEN the system
SynapSync
The system sends an announcement to all subscribers through
5
email about the post
The system retrieves all of the added social network accounts from
6
SynapSync DataStore
The system publishes the post to all Social Network accounts as a
7
status update through Social Network API
8 Company Representative is redirected to the Control Panel
Postcondit Post is displayed on the company profile page on SynapSync and
ion: all added social network accounts of the company, and Company
notifications
Page | 84
Specific Alternative Flow:
RFS <Post Branching Action
<Basic flow
step 3>
ELSE
RFS Basic Step #
1) The system gets the name of the company from
Flow 3
SynapSync DataStore
2) The system stores the content to SynapSync DataStore
3) Company Representative is redirected to the Control
Panel
ENDIF
Postcondit Post is stored into SynapSync DataStore, and Company
notifications
Page | 85
Reply to Comment
SynapSync
Precondition Company Representative is Logged in and has
Representative
The system retrieves the social network account to which Company
3
Follower made a comment on
IF the account is on Facebook, THEN the reply is published to the
4
stream on which Company Follower commented on Facebook
5 Company Representative is redirected to the Control Panel
Postcondit The reply is published onto the company's status update stream
where the comment was made on Facebook, and Company
ion:
Representative is redirected to the Control Panel without any
notifications
Page | 86
Specific Alternative Flow:
RFS <Reply to Branching Action
#
1) The reply is published to Company Follower's
Control Panel
ENDIF
Postcondition: The reply is published onto Company Follower's twitter
Page | 87
Appendix D – Class Diagrams
EmailProcessor Diagram
EmailProcessor
<<boundary >>
<< boundary >>
CPanel Handl er
Contact Handl er
+get () +get ()
+post () +post ()
Page | 88
Appendix E – Sequence Diagrams
Login Process
Login
<<boundary
>> <<entity>> <<boundary>>
MainHandler Users ControlPanelHandler
Company Representative
Get()
Post()
Create()
DataStoreUserInterface
loginUser()
Query()
checkPass()
Query()
opt
Get() If checkPass == ‘false’
[Else]
Create()
Session
appendUser()
Get()
Page | 89
Load Control Panel
<<boundary>> <<boundary>>
CPanelHandler MainHandler
Company Representative
Get()
[else]
Create() <<control>>
DataStoreCompaniesInterface
getCompanyProfileName
()
Create()
<<control>>
:DataStoreSocialInterface
getTwitterAccounts
()
getFacebookAccounts
()
Create()
:Facebook
__call__(‘Stream.get’)
Create()
<<control>>
StringFormatter
getCompanyProfileName
()
Create()
<<control>>
DataStorePostsInterface
getSavedPosts()
render.doRender(‘controlpanel.html’)
Page | 90
Load Settings
Load Settings
getCompanyProfileName
()
getEmail( )
Create() <<control>>
DataStoreCompaniesInterface
getCompanyInfo
()
Query()
Create() <<control>>
DataStoreUserInterface
getUserInfo()
Query()
isAdmin()
Query()
opt
Is Admin Create()
<<control>>
DataStoreSocialInterface
getTwitterAccounts
()
Quey()
getFacebookAccounts
()
Query()
Change Settings
Page | 91
Access Company Profile
Company Follower
Get()
Create() <<control>>
DataStorePostsInterface
getPosts()
Query()
getCompanyInfo()
Query()
getCompanyName
()
Query()
Create() <<control>>
StringFormatter
formatCompanyInfo
()
formatPost()
Post()
Create()
<<control>>
DataStoreCompaniesInterface
addEmailSubscriber
()
Put()
Get()
Page | 92