Académique Documents
Professionnel Documents
Culture Documents
Table of Contents
1. Introduction ............................................................................................................................................... 3 1.1 Purpose ............................................................................................................................................... 3 1.2 Document Structure ............................................................................................................................ 3 2. System Context ......................................................................................................................................... 4 2.1 General Context .................................................................................................................................. 4 2.2 Data Flow Diagram ............................................................................................................................ 5 2.3 Data Description ................................................................................................................................. 7 2.4 Relationships ...................................................................................................................................... 8 3. Hardware, Software & Network Specification ......................................................................................... 9 3.1 Hardware ............................................................................................................................................ 9 3.2 Software .............................................................................................................................................. 9 3.3 Network .............................................................................................................................................. 9 4. Module Decomposition ............................................................................................................................. 9 4.1 System Modules ................................................................................................................................. 9 4.2 Module Dependency Diagram .......................................................................................................... 11 4.3 Data Organization ............................................................................................................................. 11 4.4 Data Flow Diagrams ......................................................................................................................... 12 4.4.1 UploadFile ................................................................................................................................. 12 4.4.2 Search Forum ............................................................................................................................ 13 4.4.3 Create Forum Topic .................................................................................................................. 14 4.4.4 Review Document ..................................................................................................................... 15 4.4.5 Comment on Blog Post ............................................................................................................. 16 4.4.6 Blog Post ................................................................................................................................... 17 4.5 Process Decomposition..................................................................................................................... 17 4.5.1 Create an Account ..................................................................................................................... 17 4.5.2 Upload a File to the Document table ......................................................................................... 18 4.5.3 Make a Text file from a Text box.............................................................................................. 18 5. System Design Description ..................................................................................................................... 18 5.1 Coding Scheme ................................................................................................................................. 18 5.2 Input and Output Interfaces ............................................................................................................. 21 5.3 Security Strategy............................................................................................................................... 22 6. Appendix ................................................................................................................................................. 23 6.1 Abbreviations.................................................................................................................................... 23 6.2 Data Dictionary................................................................................................................................. 23
1. Introduction
1.1 Purpose
This document will provide an overview of the iTouch Community Education Portal. It will discuss how the four major design areas of architecture, components, data, and interfaces will be implemented in this system. All of the systems functions will be identified and described and a discussion of how they interact will be provided. This document will also establish the specifications for the hardware, software, and network that are necessary for system support. The main goal of this document is to assist in the implementation of the system by providing a detailed view of the different components that are involved.
2. System Context
2.1 General Context
The following diagram (Figure 2.1) illustrates what each system tier will consist of. The Client tier contains the dynamic HTML pages that will provide the interface which allows users to navigate through the website. This tier will also interact with the Web tier as it contains some php code. The Web tier contains the php code that will assist with login and document display functions. The php code will be nested inside of the HTML and will provide a connection to the database as well as the functions necessary to build queries, execute them, and receive the result. The Business tier contains the plugins used by the system, phpBB for the Programmers Forum and WordPress for the general blog. Both the phpBB and WordPress plugins maintain their own databases and code for accessing their respective databases. The EIS tier contains the database needed to hold the data that is used by the system. The database contains several tables to store information about users, documents, and reviews. This information will be obtained by creating queries and executing them with the php code contained in the Web tier. The Client tier would then be responsible for displaying the information obtained by the query.
All documents uploaded by programmers All documents associated with the user Programmer Documents
My Documents Page
Document Table
Blog Page
Post ID
WordPress Database
User Navigates User Navigates
User Navigates
Educators Page Educators Page Log In Page Log In Page User selects a school subject User Name and Password User Navigates Desired Resource Page (Math, Art, etc) Topics within Forum Programmers Programmers Forum Forum
User Navigates
Create Account Page Subject, resource type, grade level Topic ID User Information All documents that match the query
User Table
phpBB Database
Figure 2.2 Data Flow Diagram
Data requirements specified by Client: Blog, Forum, Documents, Account, Document Reviews
Database Concept Model Entities: Account Documents Reviews Relationships: Each Document has multiple reviews Each Doc has a user Each user has multiple docs
Performance Issues Create Physical Data Technology Issues Physical Data Model Tables: Account Programmer Docs Educator Docs Doc Reviews Keys: Account: Username Programmer Docs: Document ID Educator Docs: Document ID Doc Reviews: Review ID
Business Data
2.4 Relationships
The following Entity-Relationship Diagram (Figure 2.4) shows the overall data structure that will support the website. There are three tables that serve different purposes, but they are all interrelated. The User table stores information about users and facilitates the login process. Users can upload multiple documents and also post multiple reviews. The Document table stores information about documents that have been uploaded by users. A document can be uploaded by only one user, but a document can have multiple reviews associated with it. The Review table stores information about reviews that users have posted. A review is associated with one, and only one, document and one user.
3.2 Software
In order to make changes to the websites code, developers need to have access to Bluehost (www.bluehost.com) and know the username and password in order to log in. Two plugins, phpBB and WordPress, are used by this system. The files for each have been uploaded to the Bluehost account and incorporated into the system. Developers are able to modify the themes for each by logging into each account as an administrator.
3.3 Network
An internet connection is required to access the website and make changes to the code. A 5MB cable connection is sufficient to load the website pages in an acceptable amount of time (one second). Bluehost provides the optimal performance network that the website will run on.
4. Module Decomposition
4.1 System Modules
Logon(): Users can log into their account so that they can view the documents that they have uploaded and upload documents. Users also must login to view the Educators Resources page and Programmers Forum and Programmer Documents. Users do not need to login to use the blog and make blog posts. createAccount(): Anyone can go onto the create account page and create an account. The user will enter a username, password, e-mail and what type of account (Educator, Programmer) they wish to sign up for. The user also must read the terms of use policy and click the checkbox that guarantees that the user will follow the terms of use. uploadDocument(): When a user logs on to their account they will be able to upload documents. When uploading the document the user must select whether it is for programmers or educators. Then they must select a keyword that represents what the document is about. Educators have more advanced options such as grade level, subject and category. When the user clicks to add the document, it is first added to the Bluehost server. Then the document URL is added to a database table that contains the document URL, the category, the subject, grade level and the user that uploaded the document. deleteDocument(): A user logged into their account has the ability to delete any document that they have previously uploaded to the document database. The user will go to the My
Documents page and select the documents they wish to delete by clicking the checkbox to the left of the document. Then the User will click to delete the document. searchProgrammerDoc(): Programmers can log into their account and go to the programmer documents page. They then will be able to search documents on any keyword they wish to search for. searchEducatorDoc(): Educators can log into their account and go to the Educators Resources page then search on subject, category and grade level. They also can search for a keyword on the document. writeTxtBox(): When a user is logged in to their account and go to upload a document page. If they do not have a document but wish to share their ideas and code then they can write their ideas in a text box. This function will automatically develop a .txt file containing the ideas of the user and post that under that as a document under the categories that the user specifies. postReview(): Users that are logged in can view documents. After viewing documents, users can post reviews on the documents that they viewed. When a user downloads a document a review document field will pop up which will allow the user to review this document. The review will contain a star rating and a comment field. blogPost(): Blog posts are done by anyone who views the website. They would click on the blog link. There is no educator or programmer account required. Blogs are run by Wordpress which is hosted on the server. There is no functionality within the html forumPost(): Forum posts are done by programmers only. When a programmer logs into their account they will click on the programmers forum. This will take them to a forum. The forum is operated by phpBB and is hosted on the bluehost server. There is no functionality within html to make the actual post.
10
HomePage
Not Logged In
Login
Create Account
Blog Post
Programmer Account
Blog Post
Educator Account
Programmer Forum
Upload Document
Post Review
Remove Document
Our design for the module dependency diagram helps to show how the functionality and modules of this web application work together (see Figure 4.2). Coming off of the homepage there are technically two tiers. A user can either be logged in or not logged in. Off of logging in there is an option to create account which then in return logs the user in once the account is created. The non-logged in users may only access the WordPress blog. They do not have access to any other functionality than the blog. The login tier then leads to two more tiers. A user can either be logged in as a programmer or an educator. The diagram displays that both accounts have access to four of the modules. Either account type can upload, remove and review documents. They both may also access the blog. For a user registered as a programmer, he/she will be able to access two modules that no one else can access. These two modules are the Programmer Documents database and the programmer forum. Users registered as an educator account have one module that they can access that no other account type can. Educator accounts have access to an educators resource page where they can view and search for resources that are specified for educators. This design is better than other designs because it shows the relationship of each account type and what modules that each account type is able to access and work with.
All of the files and data necessary for this application are stored on one location, the Bluehost server under the sub-domain, Polack. Within this sub-domain there will be a mySQL database that operates in the backend of this client-server model web application. Within this database there will be four tables. One table will consist of all of the information required to create an account. The second table will consist of all of the documents that have been uploaded by user accounts that are registered as programmers. The third table will hold the documents that have been uploaded by educators. The final table will hold the information of the reviews made by users on all documents that have been uploaded. This Bluehost server also hosts a Wordpress blog. This blog is used for anyone who visits the website to post anything they want on the blog such as app Ideas or ask questions. There will also be a private forum that is hosted on this server that will allow accounts registered as programmers to view this forum and post code and comments and ask any questions they might have dealing with application development.
uploadDoc(Name,URL,User,Category,Subject,Topic, grade,Keyword)
Document Database
Figure 4.4.1
12
Login
Login(username,password)
Account Database
User clicks search button and page passes query with key words to search the Forum Database Loads the page to display results along With the results from the search
Forums Database
Figure 4.4.2
13
Login(username,password)
Accounts Database
Loads page with Forum Topic ID, Forum Topic, replies to topic, and number of replies.
Forum Database
Figure 4.4.3
14
Document Database
Figure 4.4.4
15
Blog Database
Homepage Navigate to Wordpress Blog Blog
Blog Post
Figure 4.4.5
16
Homepage
Blog
Blog Database
Blog Post
Figure 4.4.6
17
4.5.2 Upload a File to the Document table Provide an HTML form with a file and 2 text input types Include a submit input type in the form also The form redirects to a php page Connect to the database Get username from $_SESSION (store as $username) Get userID by querying on username (store as $userID) Get the title by using $_POST and store as variable ($title) Get the description by using $_POST and store as variable ($desc) Assign a filename variable by using $_FILES[file][username] Assign $target as $filename Move the uploaded file by using the php function move_uploaded_file($_FILES['file']['tmp_name'], $target); Construct a query to insert the file into the Document table ($query = "INSERT INTO $table (documentID, title, description, filename, userID) VALUES (NULL, $title, '$desc', '$target', $userID)"; Execute the query by using the php function $result = mysqli_query($db, $query) or die("Error 1 Querying Database");
4.5.3 Make a Text file from a Text box If (input is equal to null){ No input was put in. Reload page with text box for user to put in input. } else { Get string from variable input. Get string from variable nameOfDocument. Create text file named nameOfDocument. Write string from input into text file. Call uploadDocument() to move document into document database. } Load page to confirm document was created.
<tr>Column 1, Row 1</tr> <tr>Column 2, Row 1</tr> </td> <td> <tr>Column 1, Row 2</tr> <tr>Column 2, Row 2</tr> </td> </table> 3. File Documentation Guidelines: 1. Banner style documentation at the top of the file (for html) consisting of: <!--Project Name: Project Name--> <!--Author: Authors Name--> <!--Coauthors: Other Authors--> <!--Language: HTML--> <!--Purpose: The purpose of the file.--> <!--Description: Describes the functions of the file.--> <!--Date Created: Date File was created.--> <!--Date Modified: Date file was most recently modified.--> 2. Banner style documentation at the top of the file (for php) consisting of: <?php /*Project Name: Project Name Author: Authors Name Coauthors: Other Authors Language: PHP Purpose: The purpose of the file. Description: Describes the functions of the file. Date Created: Date File was created. Date Modified: Date file was most recently modified.*/ ?> 3. CSS Documentation and Structure: <style type="text/css"> /*Declaration for: body of page.*/ body{ background-color:#b0c4de; /*Property: background-color Value: :#b0c4de */ } </style> 4. PHP Documentation should consist of comments explaining Comparison statements, Functions, and While-loops. Example for Comparison Statements: <?php /*Checks to see if the Session variable for user_name is set to Null or not set.*/ if(isset($_SESSION['user_name'])) { /*Displays the Logout Link if there is a user logged in.*/ 19
echo "<a href=\"Index.php?page=logout.php\"><font size=\"2\" color=\"white\"><b>Logout</b></font></a>"; } else { /*Displays the Login link and the new User link if there is not a user logged in.*/ echo "<a href=\"IndexLogin.php\"><font size=\"2\" color=\"white\"><b>Login</b></font></a>"; echo "<font size=\"2\" color=\"white\">|</font>"; echo "<a href=\"IndexAddUser.php\"><font size=\"2\" color=\"white\"><b>New User</b></font></a>"; } ?> Example for functions: <?php /** Name: writeName * Description: Prints out the name stored in the variable $name. * Parameter: $name * Return Type: N/A */ function writeName($name){ echo $name . is my name.<br/>; } ?> Example for While-Loops: <?php $bush_price = 5; /* Bush price variable which holds the price per item.*/ $counter = 10; /* Counter variable which holds the quanity.*/ echo "<table border=\"1\" align=\"center\">"; echo "<tr><th>Quantity</th>"; echo "<th>Price</th></tr>"; /* While loop that keeps looping until counter is less than or equal to 100.*/ while ( $counter <= 100 ) { echo "<tr><td>"; echo $counter; /*Displays the value counter holds which is the quantity.*/ echo "</td><td>"; echo $brush_price * $counter; /*Multiplies the value of bush_price by the value of counter to get the price per quantity.*/ echo "</td></tr>"; $counter = $counter + 10; /*Increments counter by 10.*/ } echo "</table>"; ?> 20
21
Programmers will also be able to post news and respond to questions on their applications via the Blog section of the website (shown in Figure 5 below, after Figure 4). The blog is run via a Word Press installation on BlueHost. All information related to users or documents is stored in a MySQL database also on BlueHost. All connections for the interface will be done through a combination of hyperlinks and MySQL queries executed by the system.
Figure 3 This shows the documents within a category of the Educators Resources.
Figure 4 This shows the forum that the programmers will use to discuss issues and questions on the website.
Figure 5 This shows the main blog page the iTouch Education Community Portal.
6. Appendix
6.1 Abbreviations
phpBB: PHP Bulletin Board
23