1. People Aggregator Web 2.0 platform
Rapid Web 2.0 application development
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-1-
2. People Aggregator Web 2.0 platform ................................................................................. 1
1. Overview ..................................................................................................................... 3
2. Key Features ............................................................................................................... 3
3. Licensing ..................................................................................................................... 4
4. Technical Overview .................................................................................................... 4
5. Architecture................................................................................................................. 5
6. Code Layout ................................................................................................................ 6
Appendix 1 .......................................................................................................................... 7
Appendix 2 .......................................................................................................................... 8
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-2-
3. 1. Overview
People Aggregator ™ (also referred to as PA™) is a platform for rapidly developing web
2.0 applications of a varied nature. The platform is well suited for developing social
networking applications, personal publishing (blogs etc), group collaboration, community
building etc. The platform, built using LAMP technology, allows developers to focus on
the business logic specific to their application without having to worry about developing
standard features like user profiles, blogs, message boards, relationships (friends),
personal media publishing, groups and communities. The system is object oriented and
provides a well defined API for accessing the base functionality and build further upon it.
2. Key Features
User profiles
• User registration
• Customizable user profile fields
• Public/Private pages
• Access control (“show my date of birth only to my immediate friends”)
Relationships
• Establish relationships
• Named relationships
• Find shortest paths
• List friends of a user
Messaging
• Private messages to other users
• Folders
Message boards
• Hierarchical categories
• Threaded discussions
Invites
• Mechanism for inviting users into system using email invites
• Track status of invites
User Generated Content
• Blogs
• Images
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-3-
4. • Audio
• Video
Groups
• Create groups
• Public, private groups
Media Storage
• Allow users to create image, audio and video albums
Tags
• Everything can be tagged
o Users
o Groups
o User generated content
Comments
• Post comments to content
Search
• Database backed text search
Content routing
• Route user content to wordpress, blogspot, movabletype blogs
Theme system
• Template based themeing system
3. Licensing
The People Aggregator ™ platform is available under various licensing models. Please
contact Marc Canter (marc@broadbandmechanics.com) for further detail.
4. Technical Overview
Object Oriented API
People Aggregator™ exposes functionality using a well documented object oriented API
which allows for modular and extensible code.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-4-
5. Clean separation of UI and business logic
The core API is completely UI agnostic and is completely devoid of any HTML/CSS
elements. This ensures that the platform is flexible enough to cater to wide variety of web
applications.
Themable
The system is themable using template files. This allows web designers to work
independently. System supports multiple themes and the complete look and feel of the
application can be controlled using themes.
Exception Handling and Logging
Using exceptions ensures that error handling code can remain separate from the business
logic. Logging is built into the system to allow for easy debugging of code.
5. Architecture
People Aggregator™ architecture is motivated by following design principles:
1. Clear and complete separation of UI from business logic
2. Easy extensibility of various user generated content types (blogs, reviews, events
etc)
3. Easy extensibility of content collections (e.g. Groups, User albums)
4. Everything should be taggable
With these goals in mind, the core of the platform contains four base classes:
1. User This class provides functionality for creating users in the system
2. Content This abstract class serves as the base class for various types of user
generated content that can be created. For example, the BlogPost extends the
Content class for providing blogging functionality.
3. ContentCollection This abstract class serves as the base class for various types of
content collections. For example, the Group class extends the content collection
class.
4. Tag This class allows for creating and associating tags with users, content and
content collections
Database calls are routed through a database abstraction layer. People Aggregator ™
supports sharing database tables across multiple web applications. This is useful in
scenarios where different web applications need to share data (say user profiles).
The user interface code lies in a separate folder and does NEVER access the database
directly. User interface interacts with the APIs to access the business logic. This is crucial
in keeping clean 3 tier architecture.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-5-
6. 6. Code Layout
The code is laid out in the following manner
api/
• Contains the platform API (User, Content, Tags etc)
db/
• Contains the database abstraction layer and database scripts
docs/
• Contains API documentation
ext/
• Contains various classes that extend the Content and ContentCollection
classes (BlogPost, Groups etc)
web/
• Contains the PHP files that contain UI logic for the application. These PHP
files generate the actual UI using the theme template files that reside in the
“Themes” folder within the web folder
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-6-
7. Appendix 1
System requirements
The People Aggregator Platform has been tested on the following system configuration
Apache 1.3 or higher
MySQL 4.1.12 or higher
PHP 5.0.4 or higher
Hardware configuration will vary for different applications and usage scenarios. We are
currently doing performance testing of the platform and results will be provided soon.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-7-
8. Appendix 2
Sample class documentation for “Content” class
Class: Content
Description:
Content class represents and manages the contents of the system ie Blogs, Events,
Reviews, Images, Video and Audio. It is the parent class of all contents types.
Exceptions:
➢ DB_CONNECTION_FAILED - If Failed to establish connection with
database.
➢ DB_QUERY_FAILED - If Query does not execute successfully.
Protected Properties:
$db - database handle.
Public Properties:
$content_id - int ID for micro-content.
$author_id - int User who created this micro-content.
$type - int type of micro-content e.g, BlogPost/Event/Review.
$parent_collection_id = -1 - int ID of Containing Collection for micro-content.
$title - string title of micro-content.
$excerpt - string content body excerpt or introductory text.
$body - string content body text.
$allow_comments - boolean Whether comments are allowed on this
micro-content.
$is_active = 1 - boolean Whether content is deleted or not.
$created - unix-timestamp content creation date/time.
$changed - unix-timestamp content modification date/time.
$tags - array holds the tags associations for contents.
Protected Methods:
➢ load($content_id)
– Loads micro-content data from content,contentcollection,tags tables.
EXCEPTIONS:
- CONTENT_NOT_FOUND (If Content does not exist).
INPUTS:
- Content id.
➢ save()
– Saves object to database.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-8-
9. EXCEPTIONS:
- CONTENT_HAS_BEEN_DELETED (If content exist but
deleted).
➢ delete()
- deletes an object from database.
Public Methods:
➢ construct()
- Creates a database connection instances.
➢ destruct()
- Destroys a database connection instances upon deletion on object.
➢ add_trackbacks($content_id,
$trackback_url,
$title,
$excerpt)
– adds trackbacks to content object.
EXCEPTIONS:
- CONTENT_NOT_FOUND (If Content does not exist).
INPUTS:
- Content id.
- Trackback url.
- Title of content.
- Excerpt of content.
OUTPUT:
- TRUE or FALSE.
➢ send_trackback($trackback_url)
- sends trackbacks to content object.
INPUTS:
- Trackback url.
➢ send_ping()
- sends pings for content object.
➢ get_trackbacks_for_content($content_id)
- loads all the trackbacks of a content id.
INPUTS:
- Content ID.
OUTPUT:
- Trackbacks of a particular content.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
-9-
10. ➢ get_content_feed_for_user($user_id = 0,
$no_of_items = 10)
- It gives the rss feed of contents for a given user and no of items.
INPUTS:
– User ID.
– Number of contents.
OUTPUT:
- RSS feeds.
➢ get_feed_for_content($content_ids)
- It gives the rss feed given content id array.
INPUTS:
– Array of Content IDs.
OUTPUT:
- RSS feeds.
➢ get_user_content ($user_id)
- returns content_ids for a user_id.
INPUTS:
- User ID.
OUTPUT:
- Array of content ids of a user.
➢ check_access ($user_id)
– It checks the user access on a content.
EXCEPTIONS:
- USER_ACCESS_DENIED (If user does not have
permission to access this content.).
INPUTS:
- User ID.
OUTPUT:
– TRUE or FALSE.
➢ load_content ($content_id,
$user_id)
– loads a micro-content, transparently deciding its type.
EXCEPTIONS:
- USER_ACCESS_DENIED (If user does not have
permission to access this content).
- CONTENT_NOT_FOUND (If Content does not exist).
INPUTS:
– Content ID.
– User ID.
OUTPUT:
- Content details like title, author etc.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
- 10 -
11. ➢ load_content_id_array ($user_id = 0,
$count = 5,
$order_by = 'changed DESC')
- loads array of content-id in decreasing order of their addition.
INPUTS:
– User ID.
– Number of contents.
– Sort Order.
OUTPUT:
– Array of content ids and few details like author, title,
created etc..
➢ delete_by_id($content_id)
- deletes an object from database.
INPUTS:
- Content ID.
➢ delete_all_content_of_user($user_id)
- deletes all content related with a user_id.
INPUTS:
- User ID.
➢ search_content($search_string_array)
- Search contents based on search string.
INPUTS:
- Search String.
OUTPUT:
- Array of content ids.
Database Design:
Table: 'contents'
Fields:
Field name Type Length Key Index Use
content_id integer 11 Primary yes For uniquely identifying contents.
author_id integer 11 yes Id of Author.
type integer 2 Type of Content.
title varchar 255 Title of content.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
- 11 -
12. Field name Type Length Key Index Use
is_active tinyint 1 Flag indicating deleted contents.
body longtext body of content.
allow_com tinyint Flag indicating comments are
ments 1 allowed on this micro-content.
created integer 11 Timestamp of content created.
changed integer 11 Timestamp of content modified.
trackbacks text 1024 trackback urls.
SQL:
CREATE TABLE `contents` (
`content_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`type` int(2) NOT NULL default '0',
`title` varchar(255) NOT NULL default '',
`is_active` tinyint(1) NOT NULL default '0',
`body` longtext,
`allow_comments` tinyint(1) NOT NULL default '0',
`created` int(11) NOT NULL default '0',
`changed` int(11) NOT NULL default '0',
`trackbacks` text(1024) default NULL,
PRIMARY KEY (`content_id`)
);
Table: 'content_types'
Fields:
Field name Type Length Key Index Use
type_id integer 2 primary yes For uniquely identifying folders.
name varchar 50 name of content_type.
description text description of content_type.
SQL:
CREATE TABLE `content_types` (
`type_id` int(2) NOT NULL default '0',
`name` varchar(50) NOT NULL default '',
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
- 12 -
13. `description` text NOT NULL,
PRIMARY KEY (`type_id`)
);
Table: 'trackback_contents'
Fields:
Field name Type Length Key Index Use
index integer primary yes For uniquely identifying fid and
11 mid.
trackback text 1024 trackback urls.
content_id integer 11 Content id.
title varchar 255 Title of content.
excerpt text 1024 excerpt of content.
SQL:
CREATE TABLE `trackback_contents` (
`index` int(11) NOT NULL auto_increment,
`track_back` text(1024) NOT NULL default '',
`cid` int(11) NOT NULL default '0',
`title` varchar(255) NOT NULL default '',
`excerpt` text(1024) NOT NULL default '',
PRIMARY KEY (`index`)
);
Child Classes:
– Audio
– BlogPost
– Event
– Image
– Review
– Video
External Libraries Used:
None.
All material and intellectual property contained herein is owned by Broadband
Mechanics Inc. This is confidential material provided under non-disclosure agreement.
- 13 -