Final Report PDF
Final Report PDF
Final Report PDF
On
“Online Art Gallery” At
Wepanther global limited
We panther
Department of IT & CA
JECRC UNIVERSITY, JAIPUR
Signature of student
Name of student
Student reg no.
It is certified that the above statement made by the student is correct to the best
of our knowledge
Signature
Mr. Rahul dangi
1|Page
ACKNOWLEDGEMENT
2|Page
Online Art Gallery
TABLE OF CONTENTS
1. INTRODUCTION
2.1. MODULES
3. PROJECT DICTIONARY
5. MAIN INDEX
.......................................................................
1 INTRODUCTION
1.1 PROJECT BACKGROUND
2.2.3 Security
3 SYSTEM DESIGN
3.1 THE OVERALL STRUCTURE OF THE SYSTEM
5 SYSTEM TEST
5|Page
ABSTRACT
Category:
HTML CSS -Web Application.
Objective:
• User Registration
• Art Exhibition
• Artist Directory
• Contact Us
6|Page
ADMIN Modules:
1. Admin Login module.
2. Admin Order Management module.
3. Add Artist information module.
4. Add System user module.
5. Artist Login module.
6. Customer Login Module.
7. Customer Payment Module.
8. Advanced Search module.
HARDWARE REQUIREMENTS:
Processor : Any Processor above 500 MHz.
Ram : 128Mb.
Hard Disk : 10 Gb.
Compact Disk : 650 Mb.
Input device : Standard Keyboard and Mouse.
Output device : High Resolution Monitor.
7|Page
1. INTRODUCTION
Online Art Gallery is an online application, which is used to display and sell art
works of artist irrespective of their nationality, gender and other narrow
consideration, through auction. Artist can register online for being a member in
the art gallery and each artist can upload the digital copy of their art work under
the respective categories. They can host their art work either for auction or for
fixed price. The artist is liable to pay a fraction of the price of each art work to
the web site to find the running fund for site. Art lovers have to go to the art
exhibition to collect their favorite arts or painting. But now-a-days they are not
getting enough time to go to the galleries and collect the arts and paintings.
Existing System:
Customer can also register online and they can browse art works that are
arranged in different categories scientifically. Each Customer can create their
own gallery to see his favorite art works with out much difficult. And each user
has the right to purchase an art work using the integrated payment gateway and
participate in auction by submitting their bids. Qualified bidder should remit the
amount using payment gateway and after each valid payment the art work will
be shipped within some days.
Proposed System:
ONLINE ART GALLERY is a application software and it is very helpful
for the art lovers and others who wants to know the addresses where this kind of
arts will we sold.This application helps the end-users to search their arts and
paintings and they can place order for the selected pieces. The end-user can also
get the information about the art exhibition and the respective address, so, that
they can visit to those exhibitions.
Art Gallery brings you an opportunity to view online art exhibitions at our
Online Art Gallery we bring you details of all art exhibitions held in the past and
the forthcoming show. The Online Art Gallery is updated daily, so the user can
view and buy the latest collection of contemporary art online from any where in
the world. You can view and buy the latest Indian contemporary art collection
available at their exhibitions and also at their online gallery.
2. System Analysis
8|Page
After analyzing the requirements of the task to be performed, the next step
is to analyze the problem and understand its context. The first activity in the phase is
studying the existing system and other is to understand the requirements and domain of the
new system. Both the activities are equally important, but the first activity serves as a basis
of giving the functional specifications and then successful design of the proposed system.
Understanding the properties and requirements of a new system is more difficult and
requires creative thinking and understanding of existing running system is also difficult,
improper understanding of present system can lead diversion from solution.
• Requirement
• Analysis
• System design
• Implementation
• Testing
• Maintenance
9|Page
Fig: 2.1 Analysis Model
Problem Definition
Existing System:
Customer can also register online and they can browse art works that are
arranged in different categories scientifically. Each Customer can create their
own gallery to see his favorite art works with out much difficult. And each user
has the right to purchase an art work using the integrated payment gateway and
participate in auction by submitting their bids. Qualified bidder should remit the
amount using payment gateway and after each valid payment the art work will
be shipped within some days.
Proposed System:
ONLINE ART GALLERY is a application software and it is very helpful
for the art lovers and others who wants to know the addresses where this kind of
arts will we sold.This application helps the end-users to search their arts and
paintings and they can place order for the selected pieces. The end-user can also
get the information about the art exhibition and the respective address, so, that
they can visit to those exhibitions.
Art Gallery brings you an opportunity to view online art exhibitions at our
Online Art Gallery we bring you details of all art exhibitions held in the past and
the forthcoming show. The Online Art Gallery is updated daily, so the user can
view and buy the latest collection of contemporary art online from any where in
10 | P a g e
the world. You can view and buy the latest Indian contemporary art collection
available at their exhibitions and also at their online gallery.
11 | P a g e
The purpose of the SRS is to reduce the communication gap between the clients and
the developers. SRS is the medium though which the client and user needs are accurately
specified.
It forms the basis of software development. A good SRS should satisfy all the parties
involved in the system.
HARDWARE AND SOFTWARE SPECIFICATIONS
SOFTWARE REQUIREMENTS:
Operating System : Windows 10,11.
Language : Javascript
Technologies : Html , CSS
Data Bases : Microsoft Sql Server
IDE : Visual Studio
HARDWARE REQUIREMENTS:
Processor : Any Processor above 500 MHz.
Ram : 128Mb.
Hard Disk : 10 Gb.
Compact Disk : 650 Mb.
Input device : Standard Keyboard and Mouse.
Output device : High Resolution Monitor.
12 | P a g e
Microsoft.NET Framework
The .NET Framework is a new computing platform that simplifies application development
in the highly distributed environment of the Internet. The .NET Framework is designed to
fulfill the following objectives:
The .NET Framework has two main components: the common language runtime and the
.NET Framework class library. The common language runtime is the foundation of the .NET
Framework. You can think of the runtime as an agent that manages code at execution time,
providing core services such as memory management, thread management, and remoting,
while also enforcing strict type safety and other forms of code accuracy that ensure security
and robustness. In fact, the concept of code management is a fundamental principle of the
runtime. Code that targets the runtime is known as managed code, while code that does not
target the runtime is known as unmanaged code. The class library, the other main component
of the .NET Framework, is a comprehensive, object-oriented collection of reusable types
that you can use to develop applications ranging from traditional commandline or graphical
user interface (GUI) applications to applications based on the latest innovations provided by
ASP.NET, such as Web Forms and XML Web services.
The .NET Framework can be hosted by unmanaged components that load the common
language runtime into their processes and initiate the execution of managed code, thereby
creating a software environment that can exploit both managed and unmanaged features.
The .NET Framework not only provides several runtime hosts, but also supports the
development of thirdparty runtime hosts.
For example, ASP.NET hosts the runtime to provide a scalable, server-side environment for
managed code. ASP.NET works directly with the runtime to enable Web Forms applications
and XML Web services, both of which are discussed later in this topic.
13 | P a g e
Internet Explorer is an example of an unmanaged application that hosts the runtime (in the
form of a MIME type extension). Using Internet Explorer to host the runtime enables you to
embed managed components or Windows Forms controls in HTML documents. Hosting the
runtime in this way makes managed mobile code (similar to Microsoft® ActiveX® controls)
possible, but with significant improvements that only managed code can offer, such as semi-
trusted execution and secure isolated file storage.
The following illustration shows the relationship of the common language runtime and the
class library to your applications and to the overall system. The illustration also shows how
managed code operates within a larger architecture.
With regards to security, managed components are awarded varying degrees of trust,
depending on a number of factors that include their origin (such as the Internet, enterprise
network, or local computer). This means that a managed component might or might not be
able to perform file-access operations, registry-access operations, or other sensitive
functions, even if it is being used in the same active application.
The runtime enforces code access security. For example, users can trust that an executable
embedded in a Web page can play an animation on screen or sing a song, but cannot access
their personal data, file system, or network. The security features of the runtime thus enable
legitimate Internet-deployed software to be exceptionally feature rich.
The runtime also enforces code robustness by implementing a strict typeand code-
verification infrastructure called the common type system (CTS). The CTS ensures that all
managed code is self-describing. The various Microsoft and third-party language compilers
Generate managed code that conforms to the CTS. This means that managed code can
consume other managed types and instances, while strictly enforcing type fidelity and type
safety.
In addition, the managed environment of the runtime eliminates many common software
issues. For example, the runtime automatically handles object layout and manages
references to objects, releasing them when they are no longer being used. This automatic
memory management resolves the two most common application errors, memory leaks and
invalid memory references.
14 | P a g e
The runtime also accelerates developer productivity. For example, programmers can write
applications in their development language of choice, yet take full advantage of the runtime,
the class library, and components written in other languages by other developers. Any
compiler vendor who chooses to target the runtime can do so. Language compilers that target
the .NET Framework make the features of the .NET Framework available to existing code
written in that language, greatly easing the migration process for existing applications.
While the runtime is designed for the software of the future, it also supports software of
today and yesterday. Interoperability between managed and unmanaged code enables
developers to continue to use necessary COM components and DLLs.
The runtime is designed to enhance performance. Although the common language runtime
provides many standard runtime services, managed code is never interpreted. A feature
called just-in-time (JIT) compiling enables all managed code to run in the native machine
language of the system on which it is executing. Meanwhile, the memory manager removes
the possibilities of fragmented memory and increases memory locality-of-reference to
further increase performance.
For example, the .NET Framework collection classes implement a set of interfaces that you
can use to develop your own collection classes. Your collection classes will blend seamlessly
with the classes in the .NET Framework.
As you would expect from an object-oriented class library, the .NET Framework types
enable you to accomplish a range of common programming tasks, including tasks such as
string management, data collection, database connectivity, and file access. In addition to
these common tasks, the class library includes types that support a variety of specialized
15 | P a g e
development scenarios. For example, you can use the .NET Framework to develop the
following types of applications and services:
• Console applications.
• Scripted or hosted applications.
• Windows GUI applications (Windows Forms).
• ASP.NET applications.
• XML Web services.
• Windows services.
For example, the Windows Forms classes are a comprehensive set of reusable types that
vastly simplify Windows GUI development. If you write an ASP.NET Web Form
application, you can use the Web Forms classes.
Another kind of client application is the traditional ActiveX control (now replaced by the
managed Windows Forms control) deployed over the Internet as a Web page. This
application is much like other client applications: it is executed natively, has access to local
resources, and includes graphical elements.
In the past, developers created such applications using C/C++ in conjunction with the
Microsoft Foundation Classes (MFC) or with a rapid application development (RAD)
environment such as Microsoft® Visual Basic®. The .NET Framework incorporates aspects
of these existing products into a single, consistent development environment that drastically
simplifies the development of client applications.
The Windows Forms classes contained in the .NET Framework are designed to be used for
GUI development. You can easily create command windows, buttons, menus, toolbars, and
other screen elements with the flexibility necessary to accommodate shifting business needs.
16 | P a g e
For example, the .NET Framework provides simple properties to adjust visual attributes
associated with forms. In some cases the underlying operating system does not support
changing these attributes directly, and in these cases the .NET Framework automatically
recreates the forms. This is one of many ways in which the .NET Framework integrates the
developer interface, making coding simpler and more consistent.
Unlike ActiveX controls, Windows Forms controls have semi-trusted access to a user's
computer. This means that binary or natively executing code can access some of the
resources on the user's system (such as GUI elements and limited file access) without being
able to access or compromise other resources. Because of code access security, many
applications that once needed to be installed on a user's system can now be safely deployed
through the Web. Your applications can implement the features of a local application while
being deployed like a Web page.
The .NET Framework is a managed type-safe environment for application development and
execution. The .NET Framework manages all aspects of your program’s execution. It
allocates memory for the storage of data and instructions, grants or denies the appropriate
permissions to your application, initiates and manages application execution, and manages
the reallocation of memory from resources that are no longer needed. The .NET Framework
consists of two main components: the common language runtime and the .NET Framework
class library.
The common language runtime can be thought of as the environment that manages code
execution. It provides core services, such as code compilation, memory allocation, thread
management, and garbage collection. Through the common type system (CTS), it enforces
strict type-safety and ensures that code is executed in a safe environment by also enforcing
code access security.
The .NET Framework class library provides a collection of useful and reusable types that
are designed to integrate with the common language runtime. The types provided by the
.NET Framework are object-oriented and fully extensible, and they allow you to seamlessly
integrate your applications with the .NET Framework. Languages and the .NET Framework
The .NET Framework is designed for cross-language compatibility, which means, simply,
that .NET components can interact with each other no matter what supported language they
were written in originally. So, an application written in Microsoft Visual Basic .NET might
reference a dynamic-link library (DLL) file written in Microsoft Visual C#, which in turn
might access a resource written in managed Microsoft Visual C++ or any other .NET
17 | P a g e
language. This language interoperability extends to full object-oriented inheritance. A
Visual Basic .NET class might be derived from a C# class, for example, or vice versa.
The CTS ensures type compatibility between .NET components. Because .NET applications
are converted to IL prior to deployment and execution, all primitive data types are
represented as .NET types. Thus, a Visual Basic Integer and a C# int are both represented in
IL code as a System.Int32. Because both languages use a common type system, it is possible
to transfer data between components and avoid time-consuming conversions or hard-tofind
errors.
Visual Studio .NET ships with languages such as Visual Basic .NET, Visual C#, and Visual
C++ with managed extensions, as well as the JScript scripting language. You can also write
managed code for the .NET Framework in other languages. Third-party tools and compilers
exist for Fortran, Cobol, Perl, and a host of other languages. All of these languages share the
same cross-language compatibility and inheritability. Thus, you can write code for the .NET
Framework in the language of your choice, and it will be able to interact with code written
for the .NET Framework in any other language.
To understand how the common language runtime manages code execution, you must
examine the structure of a .NET application. The primary unit of a .NET application is the
assembly. An assembly is a self-describing collection of code, resources, and metadata. The
assembly manifest contains information about what is contained within the assembly. The
assembly manifest provides:
18 | P a g e
• A list of code access security instructions, including permissions required by the
assembly and permissions to be denied the assembly
Each assembly has one and only one assembly manifest, and it contains all the description
information for the assembly. However, the assembly manifest can be contained in its own
file or within one of the assembly’s modules.
An assembly contains one or more modules. A module contains the code that makes up your
application or library, and it contains metadata that describes that code. When you compile
a project into an assembly, your code is converted from high-level code to IL. Because all
managed code is first converted to IL code, applications written in different languages can
easily interact. For example, one developer might write an application in Visual C# that
accesses a DLL in Visual Basic .NET. Both resources will be converted to IL modules before
being executed, thus avoiding any languageincompatibility issues.
Each module also contains a number of types. Types are templates that describe a set of data
encapsulation and functionality. There are two kinds of types: reference types (classes) and
value types (structures). These types are discussed in greater detail in Lesson 2 of this
chapter. Each type is described to the common language runtime in the assembly manifest.
A type can contain fields, properties, and methods, each of which should be related to a
common functionality. For example, you might have a class that represents a bank account.
It contains fields, properties, and methods related to the functions needed to implement a
bank account. A field represents storage of a particular type of data. One field might store
the name of an account holder, for example. Properties are similar to fields, but properties
usually provide some kind of validation when data is set or retrieved. You might have a
property that represents an account balance. When an attempt is made to change the value,
the property can check to see if the attempted change is greater than a predetermined limit.
If the value is greater than the limit, the property does not allow the change. Methods
represent behavior, such as actions taken on data stored within the class or changes to the
user interface. Continuing with the bank account example, you might have a Transfer
method that transfers a balance from a checking account to a savings account, or an Alert
method that warns users when their balances fall below a predetermined level.
When you compile a .NET application, it is not compiled to binary machine code; rather, it
is converted to IL. This is the form that your deployed application takes—one or more
assemblies consisting of executable files and DLL files in IL form. At least one of these
assemblies will contain an executable file that has been designated as the entry point for the
application.
19 | P a g e
When execution of your program begins, the first assembly is loaded into memory. At this
point, the common language runtime examines the assembly manifest and determines the
requirements to run the program. It examines security permissions requested by the
assembly and compares them with the system’s security policy. If the system’s security
policy does not allow the requested permissions, the application will not run. If the
application passes the system’s security policy, the common language runtime executes the
code. It creates a process for the application to run in and begins application execution.
When execution starts, the first bit of code that needs to be executed is loaded into memory
and compiled into native binary code from IL by the common language runtime’s Just-In-
Time (JIT) compiler. Once compiled, the code is executed and stored in memory as native
code. Thus, each portion of code is compiled only once when an application executes.
Whenever program execution branches to code that has not yet run, the JIT compiler
compiles it ahead of execution and stores it in memory as binary code. This way, application
performance is maximized because only the parts of a program that are executed are
compiled.
The .NET base class library is a collection of object-oriented types and interfaces that
provide object models and services for many of the complex programming tasks you
will face. Most of the types presented by the .NET base class library are fully
extensible, allowing you to build types that incorporate your own functionality into
your managed code.
The .NET Framework base class library contains the base classes that provide many of the
services and objects you need when writing your applications. The class library is organized
into namespaces. A namespace is a logical grouping of types that perform related functions.
For example, the System.Windows.Forms namespace contains all the types that make up
Windows forms and the controls used in those forms.
Namespaces are logical groupings of related classes. The namespaces in the .NET base class
library are organized hierarchically. The root of the .NET Framework is the System
namespace. Other namespaces can be accessed with the period operator. A typical
namespace construction appears as follows:
System
System.Data
System.Data.SQLClient
The first example refers to the System namespace. The second refers to the
System.Data namespace. The third example refers to the System.Data.SQLClient namespace.
Table 1.1 introduces some of the more commonly used .NET base class namespaces.
20 | P a g e
Table 1-1. Representative .NET Namespaces
Namespace Description
This namespace is the root for many of the low-level types required by
the .NET Framework. It is the root for
System primitive data types as well, and it is the root for all the other namespaces in the
.NET base class library.
System.Collections This namespace contains classes that represent a variety Table 1-1.
Representative .NET Namespaces
Namespace Description
21 | P a g e
This namespace is home to common mathematics
System.Math functions such as extracting roots and
trigonometry.
System.Reflection This namespace provides support for obtaining
information and dynamic creation of types at
runtime. implementation of multithreaded applications.
The namespace names are self-descriptive by design. Straightforward names make the .NET
Framework easy to use and allow you to rapidly familiarize yourself with its contents.
Types in the .NET Framework come in two varieties: value types and reference types. The
primary difference between value types and reference types has to do with the way variable
data is accessed. To understand this difference, a little background on memory dynamics is
required.
Application data memory is divided into two primary components, the stack and the heap.
The stack is an area of memory reserved by the application to run the program. The stack is
analogous to a stack of dinner plates. Plates are placed on the stack one on top of another.
When a plate is removed from the stack, it is always the last one to have been placed on top
that is removed first. So it is with program variables. When a function is called, all the
variables used by the function are pushed onto the stack. If that function calls additional
functions, it pushes additional variables onto the stack. When the most recently called
function terminates, all of its variables go out of scope (meaning that they are no longer
available to the application) and are popped off the stack. Memory consumed by those
variables is then freed up, and program execution continues.
The heap, on the other hand, is a separate area of memory reserved for the creation of
reusable objects. The common language runtime manages allocation of heap memory for
objects and controls the reclamation of memory from unused objects through garbage
collection.
22 | P a g e
All the data associated with a value type is allocated on the stack. When a variable of a value
type goes out of scope, it is destroyed and its memory is reclaimed. A variable of a reference
type, on the other hand, exists in two memory locations. The actual object data is allocated
on the heap. A variable containing a pointer to that object is allocated on the stack. When
that variable is called by a function, it returns the memory address for the object to which it
refers. When that variable goes out of scope, the object reference is destroyed but the object
itself is not. If any other references to that object exist, the object remains intact. If the object
is left without any references, it is subject to garbage collection. (See Lesson 6 of this
chapter.)
Examples of value types include primitives, such as Integer (int), Boolean (bool), Char
(char), and so on, as well as user-defined types such as Structure (struct) and Enumeration
(enum). Classes represent the majority of reference types. Other reference types include the
interface, delegate, and array types. Classes and structures are discussed in Lesson 3 of this
chapter, and other reference and value types are discussed in Chapter 3.
When you begin writing an application, you automatically begin with a reference to the
.NET Framework base class library. You reference it so that your application is aware of the
base class library and is able to create instances of the types represented by it. Value Types
int myInteger;
This line tells the runtime to allocate the appropriate amount of memory to hold an integer
variable. Although this line creates the variable, it does not assign a value to it. You can
assign a value using the assignment operator, as follows:
myInteger = 42;
You can also choose to assign a value to a variable upon creation, as shown in this example:
Reference Types
Creating an instance of a type is a two-step process. The first step is to declare the variable
as that type, which allocates the appropriate amount of memory for that variable but does
not actually create the object. The following syntax declares an object:
System.Windows.Forms.Form myForm;
23 | P a g e
This line tells the runtime to set aside enough memory to hold a Form variable and assigns
it the name myForm, but it does not actually create the Form object in memory. The second
step, called instantiation, actually creates the object. An example of instantiation follows:
This line makes a call to the constructor method of the type System.Windows.Forms.Form
by way of the New (new) keyword. The constructor is a special method that is invoked only
at the beginning of an object’s lifetime. It contains any code that must be executed for the
object to work (assigning values to properties, for example). If any parameters were required
by the constructor, they would be contained within the parentheses at the end of the line.
The following example shows declaration and instantiation of a hypothetical Widget class
that requires a string as a parameter in the constructor.
Widget myWidget;
myWidget = new Widget("This string is required by the constructor");
If desired, you can also combine both declaration and instantiation into a single statement.
By declaring and instantiating an object in the same line, you reserve the memory for the
object and immediately create the object that resides in that memory. Although there was a
significant performance penalty for this shortcut in previous versions of Visual Basic, Visual
Basic .NET and Visual C# are optimized to allow this behavior without any performance
loss. The following example shows the one-step declaration and instantiation of a new Form:
Both value types and reference types must be initialized before use. For class and structure
fields in Visual Basic .NET, types are initialized with default values on declaration. Numeric
value types (such as integer) and floatingpoint types are assigned zero; Boolean variables
are assigned False; and reference types are assigned to a null reference.
In C#, variables of a reference type have a default value of null. It is recommended that you
do not rely on the default value. These variables should not be used until they have been
initialized.
A variable that represents a value type contains all the data represented by that type. A
variable that represents a reference type contains a reference to a particular object. This
distinction is important. Consider the following example:
int x, y; x = 15; y = x;
x = 30;
// What is the value of y?
24 | P a g e
In this example, two integer variables named x and y are created. X is assigned a value of
15, and then y is assigned the value of x. Next the value of x is changed to 30, and the
question is posed: what is the value of y? The answer to this question might seem obvious,
and it is y = 15 because x and y are two separate variables and have no effect on each other
when changed. When the line y = x is encountered, the value of x is copied to the value of
y, and there is no further connection between the two variables.
This situation changes, however, in the case of reference types. Let’s reconsider the previous
example using a reference type (Form) instead of a value type.
What value does y.Text return? This time, the answer is less obvious. Because
System.Windows.Forms.Form is a reference type, the variable x does not actually contain a
Form; rather, it points to an instance of a Form. When the line y = x is encountered, the
runtime copies the reference from variable x to y. Thus, the variables x and y now point to
the same instance of Form. Because these two variables refer to the same instance of the
object, they will return the same values for properties of that object. Thus, y.Text returns
“This is Form 2”.
Up to this point of the chapter, if you wanted to access a type in the .NET Framework base
class library, you had to use the full name of the type, including every namespace to which
it belonged. For example:
System.Windows.Forms.Form
This is called the fully-qualified name, meaning it refers both to the class and to the
namespace in which it can be found. You can make your development environment “aware”
of various namespaces by using the Imports (Visual Basic .NET) or using (Visual C#)
statement. This technique allows you to refer to a type using only its generic name and to
omit the qualifying namespaces. Thus, you could refer to
System.Windows.Forms.Form as simply Form. In Visual Basic .NET, the Imports statement
must be placed at the top of the code window, preceding any other statement (except Option).
In Visual C#, the using statement must occur before any other namespace element, such as
a class or struct. This example demonstrates use of this statement:
using System.Windows.Forms;
25 | P a g e
When two types of the same name exist in more than one imported namespace, you must
use the fully qualified name to avoid a naming conflict. Thus, if you are using
MyNameSpaceOne and MyNameSpaceTwo, and each contains a Widget class, you would
have to refer to MyNameSpaceOne.Widget or MyNameSpaceTwo.Widget to ensure the
correct result.
In C#, you can resolve namespace conflicts such as these by creating an alias. An alias allows
you to choose one name to refer to another class. You create an alias using the using
keyword, as shown below:
After implementing an alias, you can use it in code to represent the aliased class. For
example:
You cannot create aliases for types in this manner in Visual Basic .NET.
You might want to use class libraries not contained by the .NET Framework, such as libraries
developed by third-party vendors or libraries you developed. To access these external
libraries, you must create a reference.
3. Choose the appropriate tab for the library you want to reference. .NETlibraries are
available on the .NET tab. Legacy COM libraries appear on the COM tab, and local
Visual Studio projects appear on the Projects tab.
4. Locate the library you want to reference, and double-click it to add itto the Selected
components box. Click OK to confirm the choice of that reference.
26 | P a g e
Programming in the .NET Framework environment is done with objects. Objects are
programmatic constructs that represent packages of related data and functionality. Objects
are self-contained and expose specific functionality to the rest of the application
environment without detailing the inner workings of the object itself. Objects are created
from a template called a class. The .NET base class library provides a set of classes from
which you can create objects in your applications. You also can use the Microsoft Visual
Studio programming environment to create your own classes. This lesson introduces you to
the concepts associated with objectoriented programming.
An object is a programmatic construct that represents something. In the real world, objects
are cars, bicycles, laptop computers, and so on. Each of these items exposes specific
functionality and has specific properties. In your application, an object might be a form, a
control such as a button, a database connection, or any of a number of other constructs. Each
object is a complete functional unit, and contains all of the data and exposes all of the
functionality required to fulfill its purpose. The ability of programmatic objects to represent
real-world objects is called abstraction.
Classes can be thought of as blueprints for objects: they define all of the members of an
object, define the behavior of an object, and set initial values for data when appropriate.
When a class is instantiated, an in-memory instance of that class is created. This instance is
called an object. To review, a class is instantiated using the New (new) keyword as follows:
When an instance of a class is created, a copy of the instance data defined by that class is
created in memory and assigned to the reference variable. Individual instances of a class are
independent of one another and represent separate programmatic constructs. There is
generally no limit to how many copies of a single class can be instantiated at any time. To
use a real-world analogy, if a car is an object, the plans for the car are the class. The plans
can be used to make any number of cars, and changes to a single car do not, for the most
part, affect any other cars.
Objects are composed of members. Members are properties, fields, methods, and events, and
they represent the data and functionality that comprise the object. Fields and properties
represent data members of an object. Methods are actions the object can perform, and events
are notifications an object receives from or sends to other objects when activity happens in
the application.
27 | P a g e
To continue with the real-world example of a car, consider that a Car object has fields and
properties, such as Color, Make, Model, Age, GasLevel, and so on. These are the data that
describe the state of the object. A Car object might also expose several methods, such as
Accelerate, ShiftGears, or Turn. The methods represent behaviors the object can execute.
And events represent notifications. For example, a Car object might receive an
EngineOverheating event from its Engine object, or it might raise a Crash event when
interacting with a Tree object.
Object Models
Simple objects might consist of only a few properties, methods, and perhaps an event or two.
More complex objects might require numerous properties and methods and possibly even
subordinate objects. Objects can contain and expose other objects as members. For example,
the TextBox control exposes a Font property, which consists of a Font object. Similarly,
every instance of the Form class contains and exposes a Controls collection that comprises
all of the controls contained by the form. The object model defines the hierarchy of contained
objects that form the structure of an object.
Encapsulation
Objects should only interact with other objects through their public methods and properties.
Thus, objects should contain all of the data they require, as well as all of the functionality
that works with that data. The internal data of an object should never be exposed in the
interface; thus, fields rarely should be Public (public).
Returning to the Car example. If a Car object interacts with a Driver object, the Car interface
might consist of a GoForward method, a GoBackward method, and a Stop method. This is
28 | P a g e
all the information that the Driver needs to interact with the Car. The Car might contain an
Engine object, for example, but the Driver doesn’t need to know about the Engine object—
all the Driver cares about is that the methods can be called and that they return the
appropriate values. Thus, if one Engine object is exchanged for another, it makes no
difference to the Driver as long as the interface continues to function correctly.
Polymorphism
Interface Polymorphism
An interface is a contract for behavior. Essentially, it defines the members a class should
implement, but states nothing at all about the details of that implementation. An object can
implement many different interfaces, and many diverse classes can implement the same
interface. All objects implementing the same interface are capable of interacting with other
objects through that interface. For example, the Car object in the previous examples might
implement the IDrivable interface (by convention, interfaces usually begin with I), which
specifies the GoForward, GoBackward, and Halt methods. Other classes, such as Truck,
Forklift, or Boat might implement this interface and thus are able to interact with the Driver
object. The Driver object is unaware of which interface implementation it is interacting with;
it is only aware of the interface itself.
Inheritance Polymorphism
Inheritance allows you to incorporate the functionality of a previously defined class into a
new class and implement different members as needed. A class that inherits another class is
said to derive from that class, or to inherit from that class. A class can directly inherit from
only one class, which is called the base class. The new class has the same members as the
base class, and additional members can be added as needed. Additionally, the
implementation of base members can be changed in the new class by overriding the base
class implementation. Inherited classes retain all the characteristics of the base class and can
interact with other objects as though they were instances of the base class. For example, if
the Car class is the base class, a derived class might be Sport scar. The Sport scar class might
29 | P a g e
be the base class for another derived class, the ConvertibleSportsCar. Each newly derived
class might implement additional members, but the functionality defined in the original Car
class is retained.
4. PROJECT DICTIONARY
4.1. DATAFLOW DIAGRAMS
Data flow diagram is used to decrease analysis the movement of data through a system
store of data in the system. Data flow diagrams are the central tool basing on which
components are developed.The transformation of data from input to output, through process
may be describe logically and independently of physically components associated with the
system. They are called logical data flow diagrams. In contrast physical data flow diagrams
show the actual implementation and movement of data between people, Department, and
work station.
The data flow diagram show functional composition of the system. The first level of
conceptual level in context diagram is flowed by the description of input and output for each
of entities the next level of dfd is level 0, which shows the main functions in the system.
Level 0 is followed by the description of the main functions. The main function further
broken into functions and sub functions.
Along with the improvement of people's life quality in China, tourism has become more
and more popular, and it has become one of the major entertainments for people
spending their leisure time. Both domestic tourism and outbound tourism has become
increasingly common in recent years. According to statistics of the China National
Tourism Administration, about 4.12 billion people went on domestic travel or outbound
travel in 2015 [1]. With the rapid development of the tourism, the numberof people
who use photos to record the beautiful moments in their life is also increasing, and
many people have become very fond of photography [2].
Internet is rapidly developing and people's lives are constantly changed by it. The
30 | P a g e
Internet not only allows people to get the information they want easily, but also builds
a strong social network. Through the structure of social network platforms and hubs,
people can quickly and easily communicate with others, share their life moments, and
so on.
Nowadays, many photography enthusiasts expect to have a platform to share high-
quality photos with friends and manage their online storage photos more efficiently and
conveniently. Photography enthusiasts are also keen to participate in photography
competitions to get encourage from others and find their own shortcomings. However,
most of the online photography competition websites mainly focus on their own
competitions, which have a lot of limitations. This kind of website has quite a big
difficulty to meet various needs of photography enthusiasts at different levels of
expertise, and the number of systems containing both photo sharing and general
photography competition management are quite a few in China.
At the same time, with the development of technology and photographers’ higher
demand for photo resolution, the system needs a more efficient way to manage storage
space. Therefore, it is imminent to design a web-based photo sharing and photography
competition management system for photography enthusiasts, which hasmore efficient
storage space management.
31 | P a g e
1.2 Research status at China and abroad
Most of photo sharing or photography competition platforms appeared around the early
2000, and have become increasingly popular in recent years.
Flickr and Imgur are well-known international photo-sharing websites. Flickr has
social contact and photo management functions, allowing users to easily share photos
with their friends, interact with other users, and effectively manage uploaded resources.
Imgur is more inclined to resource storage and image search platform. So uploaded
images can be searched and viewed by other users, and the system will record the
viewing number of these images, and push images, which have a large click numbers,
to the website’s homepage. WPO (World Photography Organization), World Press
Photo and POYi (Photos of the Year International) are internationally famous
photography competition websites, but they are mostly established for their own
competitions.
In China, most famous photo-sharing websites belong to the kinds of forum
website, resource website or community website, such as POCO and Fengniao. Both
are community photo-sharing websites with forum and photo viewing functions. Their
users can post text to communicate with other users, upload photos to a unified photo
library for sharing, and simply manage uploaded photos. Global Photography and
Photo Inter are prestigious photography competition websites in China. They both have
photo viewing and photography competition management functions, so users can
upload photos to a unified photo library and view them online, or participate in the
designated competitions after payment. At present, there are relatively few platforms
containing both photo sharing and photography competition management functions.
The aim of our project is to build a system for photographers with excellent photo
sharing, photo management and photography competition managementfunctions. Also,
a good storage space management subsystem is to be built for efficient resource use
and system expansion, which will be incorporated into the system.
32 | P a g e
recording and enjoying excellent moments with photos has become more and more
popular. Therefore, a large number of photography enthusiasts appeared. Photography
enthusiasts are eager to communicate, share high-quality photos with others, and
participate in photography competition to find out their own shortcomings or get
approval from others. However, the platforms, which contain both photo sharing and
photography competition management, are relatively few at present. So the system is
developed to meet these needs, which not only allows people to upload and share high-
quality photos more easily, but also narrows the distance among photographers and
photography enthusiast by interaction on the system, allowing enthusiasts to learnfrom
each other. This system also allows all photography enthusiasts to participate in, and
get more evaluation, encouragement and support from other people.
A good photo sharing and photography competition management system must be
intuitive, convenient and easy to use. Users with different backgrounds can use its
functions efficiently. At the same time, a better solution is needed to make the storage
space management subsystem more efficient, stable and expansible, because of the
storage of large number of high-quality photos and a lot of potential users. The project
aims to develop a photo sharing and photography competition management system for
photographic enthusiasts by using J2EE, MVC and other related technologies. We
also realized the system's easy using, security, efficiently and expansibility. At the same
time, the realization of the system not only has great potential value of commerce, but
also promotes spread and development of photography.
33 | P a g e
3. The overall design of the system was carried out. The system was divided into
two subsystems: photo sharing and photography competition management. The
former subsystem consists of 5 parts, which are the Personal Homepage, Photo
Management module, Album Management module, Collection Management
module, and User and Authorization Management module. The latter consists of
6 modules, which are User and Authorization Management module, Competition
Management module, Review module, Contribution module, Display of
Competition module, and Display of Competition Results module.
4. All modules were designed in detail in their functions and processing logic, and
the sequence charts for them were drawn, also giving detailed processing steps.
5. The database’s design was accomplished, and E-R charts and database tables
were given. We used a tree structure in the data classification. The tree structure
can build good relationship and structure among resources and records in the
database [3].
6. A unique storage space management module was proposed and designed, it not
only provides efficient and flexible management of storage on the server, but can
also fulfill efficient file synchronization and file transmission.
7. The UI of the system was designed and implemented. Each module of the
system was coded and debugged by using Java and MyEclipse, and then system
integration and testing are carried out.
34 | P a g e
of each module is described. Then, the processing logic and steps of each module is
given by using sequence diagrams. Later on, the user management mechanism,
directory tree and storage space management subsystem are described. Finally,
database design of the system is described, and detail information of database tables
and E-R charts are given.
Chapter 4 is the realization of the system, which describes the details of realization
of each module. User interface screenshots and part codes are given.
Chapter 5 describes the test of the system. Test cases and test results are given.
Chapter 6 summarizes the work done in this paper, and describes future work,
including possible improvement and extension of this system.
35 | P a g e
Chapter 2 System Requirement Analysis
First of all, requirements of this system are analyzed. After investigation and analysis
of related websites at China and abroad, we confirm that the system should consist of
two subsystems: the photo sharing subsystem and the photography competition
management subsystem, which play different roles, but are closed related with each
other.
The photo sharing subsystem should provide a variety of functions for users to share
photos easily and flexibly, allowing them to upload photos, to manage the uploaded
photos, and to share photos with other users. It should also provide a variety of
operations to easily create and manage their own albums.
Based on this analysis, we determine that the subsystem contains five parts:
Personal Homepage, Photo Management, Album Management, Collection
Management, and User and Authorization Management.
1. Personal Homepage
The Personal Homepage is the “Home” of a user, for others to visit over Internet. When
visitor visit a user's homepage, the page will automatically show the user’s personal
information, representative photos, selected album and user customize, which also
functions as a guide for browsing all his photos and information. Visitors can also
comment on his photos and albums.
2. Photo Management
Users can upload, delete, move and copy photos. When uploading photos, they need
fill in metadata of the photos and can later modify the metadata. The purpose of the
metadata is to provide for better sharing and searching of the photos, through key words,
for example. At the same time, the user can also choose specified photos to participate
in the ongoing photography competitions.
36 | P a g e
3. Album Management
Album Management allows users to create and manage album, the operations include
37 | P a g e
creating, deleting, removing and modifying albums. It also allows users to manage
photos inside an album.
4. Collection Management
When viewing other people's photos or albums, a user can add his interested objects
into a collection for future access. He can manage his collection using the functions
provided by Collection Management. Operations should include: adding collection
items, deleting collection items and viewing collection items.
5. User and Authorization Management
As an important part of the system, User and Authorization Management manages users
information and access permission, which is jointly shared by the photo sharing
subsystem and the photography competition management subsystem. It provides users
with the functions of registration, login and logout. It also allows users to modify his
password and personal information, which mainly contains name, gender, avatar,
contact information.
1. Competition Management
The Competition Management has two kinds of functions: competition management
and photo management. The super administrator is responsible for managing all
competitions. Operations include: creating, modifying, deleting and other operations.
The competition administrator can only be responsible for a specific competition. He
can delete photos and block an account when the user uploads inappropriate photos
(such as a reactionary or pornographic photo).
When super administrator establishes a new competition, he should set the
38 | P a g e
competition name, start date, end date, reviewer and competition administrator.
Users can find the competitions they have taken part in through the Competition
Management, and check the photos they have submitted.
2. Review
Competition reviewers can select, evaluate and reward photos.
3. Contribution
User can submit photos to ongoing photography competitions by uploading a photo
and fill in description.
4. Display of Competition
The users and visitors can view all the photos of all competitions. While viewing, users
also can set different sorting orders for display, and give like’s (similar to the like’s in
facebook.com) to their favorite photos
5. Display of Competition Result
Display of Competition Result is used to display rewarded photos and relevant
competition information for users and visitors. They also can click “like” buttons for
them.
6. User and Authorization Management
User and Authorization Management module is jointly shared by photo sharing
subsystem and photography competition management subsystem. See Section 2.1.1 for
more details.
2.2.1 Feasibility
Due to the diversified background of different users and the overall goal to make the
system simple and user-friendly, the system’s interface is designed to be concise and
clear. We use JavaScript and a tree structure to achieve a visual directory tree in user
interface page. In this way users can easily achieve the selecting of path, and this
improves system usability and operational efficiency [5].
39 | P a g e
2.2.2 Scalability and maintainability
The MVC framework is used in order to make the system have good scalability and
maintainability, which makes the system’s view layer, logical business layer and data
manipulation layer to be independent of each other, and also makes it easy to do future
development and system maintenance [6].
2.2.3 Security
In order to guarantee the security and integrity of the whole system, it is necessary to
verify the user's access level and login status again while logged-in users trying to
modify important information (such as password) or logged-in administrators trying
to execute high-privilege operations. This kind of examination can avoid malicious
operations and provide Anti-Leech.
It is easy to waste the storage space if it is not effectively managed, because the system
mainly stores large-sized high quality photos, and uploading and deleting operations
can happen very often. Besides, if the client and the server frequently interact with large
amounts of data, a lot of bandwidth will be consumed, resulting in slower respond,
worse user experience and maybe other problems. Therefore, we will use AJAX to
refresh only part of the page elements, instead of all the elements. It can improve the
response speed and user experience, and reduce the burden on the server [7]. We will
also incorporate a specific storage space management subsystem to optimize
synchronization and transmission process for files, and to make management of the
server resources more efficient.
40 | P a g e
module is shown in Figure 2.1, in which functions of each role are shown. They are:
41 | P a g e
1. Visitors can register an account.
2. Registered users can log in to the system and log out of the system.
3. Registered users can change or retrieve their own password.
4. Registered users can update their personal information, including the avatar,
cover, basic information and contact information.
Figure 2.1 Use case diagram of User and Authorization Management module
The Personal Homepage, as one of the most important parts of the system, mainly aims
to provide photo sharing and photo displaying for users. Only registered users have
personal homepages. Visitors can visit any user’s personal homepage and browse his
photos, albums and collections without registering or logging in. However, in addition
to browsing photos, the visitors have no authority to perform any other operations.
The use case diagram of Personal Homepage is shown in Figure 2.2. Thefunctions
of each role are as follows:
1. Registered users and visitors can visit and browse any users’ personal
homepage.
42 | P a g e
2. Registered users and visitors can also browse any users’ resources (photos,
albums and collections).
3. Registered users and visitors can jump to other users’ personal homepage by
searching their nickname.
4. Only registered users can perform collect, follow and comment on other users’
resources.
The Photo Management module is mainly used to manage users' photo resources. The
use case analysis diagram for this module is shown in Figure 2.3, the functions of
each role are as follows:
1. Registered users can upload photos into the system, by selecting the source files
and inputting information, which describes the photos. Each photo is regarded as
resource in the system.
2. Registered users can manage the photos. The operations that can be performed
include: moving photos, copying photos, deleting photos and modifying photo
information.
3. Registered users can also setting the sort mode for photos displaying, including
sorting by upload time, sorting by modified time, sorting by the
43 | P a g e
number of likes and sorting by the number of views
4. Registered users can take part in competitions after select uploaded photo and
select specific competition.
The Album Management module contains not only all operations and management
functions of the album resources, but also the majority operations of the photo
resources. The use case analysis diagram of the Album Management module is shown
in Figure 2.4, the functions of each role are as follows:
1. Registered users can create a new album.
2. Registered users can edit the album, including moving the album, copying the
album, deleting the album and updating the album information.
3. Registered users can also set the sorting method for albums, including sorting
by created time, sorting by modified time, sorting by the number of likes and
sorting by the number of views.
44 | P a g e
Figure 2.4 Use case diagram of Album Management module
Similar to the previous two modules, this module contains operations andmanagement
functions of the collections. The use case analysis diagram of the Collection
Management module is shown in Figure 2.5, in which functions of each role are as
follows:
1. Registered users can add their favorite photos or albums into a collection.
2. Registered users can delete collected items from their own collection.
3. Registered users can view their own collection items by clicking the target in
the collection management page.
45 | P a g e
2.3.6 Use case analysis of Competition Management module
The Competition Management module, which is also an important part of the system,
mainly manages affairs related to photography competitions. The administrators
manage competitions through this module, and a normal user checks his participated
competitions through this module too. The use case diagram of the Competition
Management module is shown in Figure 2.6, in which functions of each role are as
follows:
1. Registered users can check their participated competitions through this module,
including competition information and contributions (uploaded photos).
2. The super administrator can create and delete competitions.
3. The super administrator can update the competition information, including the
name, date, reviewer, and competition administrator.
4. Both the super administrator and the competition administrator can delete
photos and lock users. The super administrator can delete photos from all
competitions, but the competition administrator can only delete photos included in
the competitions under his control.
46 | P a g e
2.3.7 Use case analysis for Contribution module
Registered users can submit photos for competition through this module. The functions
of this module include viewing the competition information and contribution, which is
done by uploading photos and providing information about the photos. The use case
diagram of the Contribution module is shown in the top part of Figure 2.7, in which
functions of each role are as follows:
1. Registered users can view the detail information of ongoing competitions.
2. After viewing, the user can choose a specific competition to contribute,
including upload the photos and give detail description.
With the Review module, the reviewers can review photos and set awards, change
awards and lock competition results. The use case diagram for the Review module is
shown in the lower part of Figure 2.7, in which functions of each role are as follows:
1. The reviewer can review the photos, assess the level and set awards.
2. The reviewer can change the results of the assessment.
3. The reviewer can also lock the results of assessment. After locked, the result
cannot be changed again.
Figure 2.7 Use case diagrams of Contribution module and Review module
47 | P a g e
2.3.9 Use case analysis of Display of Competition module
The Display of Competition module is used to show all photos that have participated
in each competition. All the registered users and visitors can browse the photos. The
use case diagram of the module is shown in Figure 2.8, in which functions of each role
are as follows:
1. Registered users and visitors can view all competition lists and select one
competition.
2. Registered users and visitors can browse all the photos in the competition.
3. Registered users and visitors can give their favorite photos like’s.
4. Registered users and visitors can set different sorting orders to display all
photos, such as sorting by uploaded time, sorting by number of likes, and sorting
by number of views.
48 | P a g e
which functions of each role are as follows:
1. Registered users and visitors can view the winning photos, including checking
the list of finished competitions and selecting one competition to view.
2. Visitors and registered users can browse their favorite photos and give them
like’s.
49 | P a g e
Chapter 3 System Design
50 | P a g e
View layer: view layer is mainly used to provide users with visualized operations, to
facilitate interactions between users and the system. A good view layer should contain
51 | P a g e
only the user visualization interface and the data of user operation, it should avoid
containing business logic operation of the system and operation on the database [11].
Control layer: as the core of the MVC structure, control layer is mainly used to
receive data from the view layer, to perform business logic operation and to call the
functions of model layer. When the view layer sends a request to the control layer, the
web application service normally filters and match the requested URL with the
controller (xml configuration file), then sends it to the specified Servlet for relevant
logic processing, and finally the control layer and the model layer interact with each
other [12].
Model layer: model layer is mainly used for the data operation, such as CRUD
(create, retrieve, update and delete) operation. In this system, we also import DAO (data
access object) Entity, encapsulation of the database, and data objects oriented operation,
to make the model layer to be loose coupling and manageable [13].
52 | P a g e
Figure 3.2 Division of system modules
The functions of each module are designed, which are described below.
1. User and Authorization Management module
This module aims to manage users and authorizations, whose functions include:
registering account, logging into the system, logging out of the system, modifying
user information, changing password, retrieving the password and authorization
verifying.
(1) Registering account
Visitors can input relevant information in the registration page, and become a user
after submit and verify. After successful registration, it will automatically login and
jump to the user's personal homepage.
(2) Logging into the system
Registered users can log into the system by providing the user name and password.
After the system verify that both of them are correct, it will automatically jump to the
user's homepage.
(3) Logging out of the system
(4) Logged-in users can log out at any time, and return to the login page to protect the Logging into
the system user account security.
53 | P a g e
(5) Modifying user information
Registered users can modify and update their personal information at any time,
including name, gender, birthday, avatar, self-introduction, contact information and so
on.
(6) Changing password
Registered users can change their password through this module. They will be
asked to enter the current password and the new password to set. If the current password
is verified to be correct, the new password will be set into the system, replacing the old
one.
(7) Retrieving the password
In case a registered user lost his password, he can retrieve his password through
Email. What he needs to do is to input his username on the login page, and click on the
“Forgot Password” link, after that the system will automatically send an email to the
user and help him reset his password.
(8) Authorization verifying
When a user (including administrator) accesses some common modules or
attempts to perform a high-privilege operation, the system will automatically verify
current user’s authority to determine whether the operation is allowed or restricted. If
allowed, the system will jump to corresponding webpage, otherwise, warning
information is displayed.
2. Personal Homepage
As a core module in the photo sharing subsystem, Personal Homepage’s main function
is to show the user's own avatars, personal information, representative photos and
selected albums. This homepage contains 5 parts: personal information display,
personal representative photo display, personal selected album display, user customize
and user operation.
(1) Personal information display
This function will automatically count the number of photos, the number of albums
and the number of collections of the user, showing them in the personal homepage. It
also displays the basic information of the user, including: name and labels.
(2) Personal representative photo display
This part displays the user’s representative photos, which are the photos with the
highest click rate and the photos selected by the user from all his photos. All users can
54 | P a g e
click on the photos for detailed viewing.
(3) Personal selected album display
This part displays the user’s selected albums, which are the albums with the
highest click rate and the albums selected by the user from all his albums. All users can
click on any album for detailed viewing.
(4) User customize
This part displays the user customize, including: avatars and background picture.
(5) User operation
Users can comment, collect and like other users’ photos and albums, and also can
follow other users.
3. Photo Management module
This module is mainly used to manage the user's photos, with operations including:
uploading photos, participating in competitions, moving photos, copying photos,
deleting photos, modifying photo information and sort setting.
(1) Uploading photos
Users can select photos in their local storage and upload and save them onto the
server side. After uploading, they can view and manipulate these photos on a web page
with a visualized directory tree.
(2) Moving photos
Users can move photos from one subdirectory to another subdirectory. This
operation is similar to Copying, except that it deletes photos copied.
(3) Copying photos
Users can copy photos from one subdirectory (called the source) to another
subdirectory (called the target).
(4) Deleting photos
Users can delete the specified photo to repair the user's operation errors, such as:
error uploading, redundant uploading and so on.
(5) Participating in competitions
Users can select photos uploaded to the system to participate in competitions.
While doing so, he needs to choose specific competitions on the competition list.
(6) Modifying photo information
Users can modify relevant information of their own photos, including: name,
category and so on.
(7) Sort setting
55 | P a g e
Sorting orders can be set by users, including sorting by upload time, sorting by
number of likes, sorting by modifying time and sorting by number of views.
4. Album Management module
This module is mainly used to operate on albums and photos, including creating albums,
moving albums, copying albums, deleting albums, modifying album information and
sort settings in addition to the same functions as the Photo Management module.
(1) Creating albums
Users can create albums to store photos and albums, which has greatly enriched
the photo and album folder structure, and made the photo and album resource
management more reasonable. When creating an album, you need to input information
about the album's name, category and so on.
(2) Moving albums
Users can move the album from one subdirectory to another subdirectory.
(3) Copying albums
Similarly, the specified album can be selected, and then the copy object of the
album is created in the current subdirectory.
(4) Deleting albums
Users can delete the specified album or delete photos in a batch way.
(5) Modifying album information
Users can modify relevant information of their own albums, including: name,
category and so on.
(6) Sort settings
Different sorting orders can be used for album display, including sorting by
uploaded time, sorting by number of likes, sorting by modified time and sorting by
number of views.
5. Collection Management module
The Collection Management module provides functions related to user collections,
including: adding collection, viewing collection, and deleting collection.
(1) Adding collection
When users are viewing photos or albums of other users, they can use this function
to add resources(photo or album) into his collection. The system will draw the
associated information from the database and insert into the collection list.
(2) Viewing collection
56 | P a g e
After collection, users can directly click on the collection items, which will
directly jump to the target photo or album display page.
(3) Deleting collection
When a user is no longer interested in some items of resource, he can simply
remove them by deleting the items from the collection.
6. Competition Management module
The super administrators are responsible for managing competitions. Operations that
can be performed include creating a new competition, modifying competition
information, deleting the competition. As to normal users, they can only use this module
to view the competitions they have participated in.
(1) Creating a new competition
The super administrators can create a new photography competition with this
function, during which he must input the relevant information about the competition,
such as the name, the dates of the competition, and assign administrators and reviewers
for the competition.
(2) Modifying the competition information
The super administrators can modify the information of each competition,
including the name, start date, end date, reviewers and administrators of the
competition.
(3) Deleting competitions
The super administrators can also delete any competitions.
(4) Viewing the competitions participated in
When a user accesses this module, he is allowed to view his contributed photos
and the associated competitions he has participated in.
(5) Deleting the photo
The super administrators and his designated competition administrator can delete
inappropriate works (such as reactionary works, pornographic works, etc.) for aspecific
competition.
(6) Locking the user
The super administrators and the competition administrators can also lock the user
who uploaded inappropriate works and prohibit him from continued uploading.
7. Contribution module
Users can contribute through this model. Operations include: viewing competitions and
contributing.
57 | P a g e
(1) Viewing competitions
Users can view all the information and photos of all the ongoing competitions.
(2) Contribution
Users can choose competitions and upload their own photos to participate in.
8. Review module
Through this module, a reviewer can review all the works in the competition and give
his evaluation results, including: setting levels of awards, changing awards level later
on and locking review result when competition administrator believes no changes will
be made in the future.
(1) Setting levels of awards
The reviewers can enter the review results into the system through this function.
(2) Changing awards level
The reviewers can change the levels of awards that they have already evaluated
to be.
(3) Locking review result
When the review function of a competition is locked, the reviewer can no longer
change review results and related information.
9. Display of Competition module
The module is mainly used for showing all photos in the competition. The operations
all users can perform are: viewing photos, giving photos like’s, browsing photos and
setting sorting order.
(1) Viewing all photos
Both the visitors and the registered users can view all photos. They first select one
competition from the competition lists, and enter into the webpage of the corresponding
competition to view all the photos in the competition.
(2) Giving photos like’s
Registered users and visitors can give their favorite photos like’s.
(3) Browsing photos
All the photos are shown in thumbnails in the showing webpages. Users can
browse the photos by clicking on the thumbnail.
(4) Setting sort order
This function is prepared for the uses to set the sorting order for displaying photos.
The orders allowed include sorting by uploaded time, sorting by the numberof likes
and sorting by number of views.
58 | P a g e
10. Display of Competition result module
The function of this module is to implement the showing of competition results.
Operations provided include: viewing winning photos, giving photos like’s and
browsing photos.
(1) Viewing winning photos
Users can view competition results by viewing the list of completed competitions
and then selecting the competition they want to view.
(2) Giving photos like’s
Registered user and visitors can click on the link below the winning photos to
give their favorite photos like’s.
(3) Browsing photos
Registered users and visitors can browse photos by clicking the target thumbnail
photos.
The User and Authorization Management module is a basic module of both the photo
sharing and the photography competition management subsystem.
In this module, the registration function is used for visitors to apply for user
accounts. After a visitor registers successfully or logs in with the correct user name and
password, the system will change the user's status and the operation authority directly.
At the same time, page’s automatically redirect function can be achieved according to
the current user’s authorization. After logging in, the user can modify the personal
information, change password, change customize settings and logged out. Therefore,
the login function is the core function of this module. The sequencediagram when a
59 | P a g e
user logs in is shown in Figure 3.3.
60 | P a g e
Figure 3.3 The sequence diagram when a user logging in
The Personal Homepage mainly aims to show the user's personal information and their
resources. Figure 3.4 shows the sequence diagram of displaying a user’s representative
photos
61 | P a g e
Figure 3.4 Sequence diagram of displaying a user’s representative photos
Users can enter the photo management page and upload their own photos for sharing.
After successfully uploading, Users can perform a variety of operations on their photos.
The sequence diagram of uploading photos is shown in Figure 3.5.
62 | P a g e
Figure 3.5 The sequence diagram of uploading photos
Similar to the Photo Management module, the Album Management module is mainly
used for the management of album resources. Through the functions of Album
Management module, users can create new albums, move albums, delete albums,
modify album information, set sorting order and so on, which makes the user's storage
63 | P a g e
and folder structure more efficient and intuitive. The sequence diagram of moving
album is shown in Figure 3.6.
64 | P a g e
3.3.5 Collection management module
This module provides the main functions related to competition management. Through
these functions, users and administrators can perform different operations relate to
competitions. The sequence diagram of creating competition is shown in Figure 3.8.
66 | P a g e
competition information in the database, and returns saving results.
7. Finally, the page will jump to corresponding pages according to the returned
results.
This flow use AJAX to transmit data asynchronously and use JavaScript to
visualize the options of the reviewers. It is convenient for the administrator to select
reviewers since there are only a fewer reviewers in general. And this also improves
the system’s security (only the reviewers existent in the system can be selected) and
prevents the system from Hotlink attack or potential errors. But this may become
inconvenience when the reviewers need to be increased. Hence we need to add a
retrieving mechanism for quick finding of reviews in the future.
The Contribution module provides the relevant functions for participate in competitions
and contributions. The sequence diagram of competition contribution is shown in
Figure 3.9.
67 | P a g e
corresponding competition information, and then asynchronously returns to the
JavaScript.
4. JavaScript uses the relevant information to show the competition list.
5. The user chooses the competition to participate in.
6. The management page sends the relevant request information to the
ContributeServlet for processing.
7. The ContributeServlet calls the competition relation data access object for the
insert database operation, and return the results of the operation.
There are two ways for users to contribute. This flow describes the way to
contribute by through photo or album management page. Section 4.2.6 describes the
way to contribute by through competition page.
The Review module is used to review all users' photos, by which the reviewer can
review the winning works in the competition, and modify review results. However,
after reviewer lock the results, the review results can no longer be changed. The
sequence diagram of review is shown in Figure 3.10.
68 | P a g e
In this flow, step 2 and step 3 can be constantly repeated until all this competition’s
photos have been reviewed. And the reviewing can be interrupted or continued at any
time (unless the completion’s review function has been locked by administrator). But
currently there is no visible marker or sign showing the specific photos already
reviewed which may cause some confusion to the reviewer. Therefore, I will solve this
problem in my future work.
Display of competition module allows the user to view all photos and related information
for all photography competitions, and sort or give likes to these photos. Since the display
function of this module is similar to the individual representative shown in 3.3.2, the
function of sorting according to given conditions is described here. The detailed
sequence diagram is shown in Figure 3.11.
69 | P a g e
When the sever intend to return the sorted page to the client, the specific JSP will
extract URLs from the obtained collection of picture instance objects, and use their
URLs to build the HTML code.
The Display of Competition Result module is designed to allow the user to view the
winning works of the photo competition and to give their favorite photos like’s. The
sequence diagram of display of competition result is shown in Figure 3.12.
70 | P a g e
During repeating step 4, the Servlet will user different parameters (for different
awards) to get all wining photo’s instances, and then the specific JSP will use these
instance’s URLs to build the HTML code for the client page.
The access control mechanism for this system adopts the resource privilege mode
based on system roles and system functions in table 3.1. Each page is regarded as a
separate resource. When different roles access certain resources, the system needs to
check weather the users have the privileges to access relevant pages and use relevant
functions. The setting of resource privilege prevents non-administrator users from
violating the privilege, and avoids the behavior that may damage the system [14].
The objectives of this access control mechanism:
1. After the user logs in, the system queries the user’s role information, and saves
related information in the session for later usage. When the user attempts to
execute a high-privilege operation, the system will check the user’s role
information saved in the session, avoiding frequent access to database.
2. When the user accesses specific pages and perform operations on the
71 | P a g e
resources, the system will query the user's role information to determine whether
the resources belong to this user, and whether the user has the relevant privilege
to operate. If he does not meet the conditions, he will be returned to the previous
page with a warning given. This processing can ensure the safety of system
operations.
3. Some pages are shared by different roles, and will display different modules
and content based on the current user's role and privilege. The competition
management module is an example. This scheme will achieve highly role-oriented
and flexible page functions.
In this system, many operations involve management of photos and album folders. If
the original data rows are directly stored in the tables of the database, the correlation
among them will be poor, which is not conducive to achieve efficient operation and
management of data, and users cannot perform intuitive and convenient operation on
their own resources, which also easily leads to waste of system resources and inefficient
use of the database.
In order to improve the efficiency of the system and realize the directory tree
resource management, we introduce tree structure in the database. Every object
(including photos, albums, collections) is regarded as a tree node. At the same time, the
ID information of the parent node is added to this tree node’s information. Then the tree
structure among objects is established through corresponding node ID information, and
achieved the directory tree resource management. It highly improves the efficiency of
searching data, and the flexibility of data storage [15]. After that, we can use tree node
information in record to find their father node and child node conveniently.
The tree node records need to include the following metadata:
1. Tree node ID: used to uniquely identify a tree node records
2. Association ID: the unique ID of the object associated with the tree node.
3. Association type: the type of object associated with the tree node (photos,
albums, collections, etc.).
4. Father node ID: the unique ID of this tree node’s father node.
5. User ID: the unique ID of the user who own this node.
6. Layers: the number of layers in which the tree node is located.
72 | P a g e
Through the user ID, the tree node ID and the father node ID, the system can retrieve
the tree structure of the specified user from the database. And the combination of
association ID and association type can point to a specific object corresponding to the
node. The use of the number of layers can greatly improve the efficiency of query to
avoid unnecessary operations.
For example, to find the father object of the current album folder, only 3 steps are
needed:
1. To query the database and take out tree node records binding to the album
folder through the current album folder ID and object type (album).
2. To get the corresponding father node record through the father node ID saved
in the tree node record.
3. To extract the father object of the current album file through association ID
and association type in the father node record.
73 | P a g e
algorithm in the Unix-like system, which is usually used for data backup, file
synchronization between remote hosts, and network disk data update process. Rsync
algorithm can distinguish different parts of two files by operation, and then only
transmit different parts, which is the most important feature of the algorithm [16].
The main flow of the algorithm is as follows:
(1) The receiver calculates the checksum.
The receiver first divides its file into equal size blocks, and then calculates the
rolling checksum and MD5 checksum for each block, then submit the results to the
sender.
The rolling checksum used in rsync is based on the Adler-32 checksum invented
by Mark Adler, which is a 32-bit weak checksum [17]. While the MD5 checksum is a
widely used 128-bit strong checksum [18].
The reason for using the two checksums in this algorithm is that although MD5
is used to check whether the two file blocks are the same with the low probability of
collision, but its operation speed is lower because of the limitations of computer
hardware and processing speed. Therefore, it is necessary to have a faster rolling
checksum with a slightly lower accuracy rate, but sufficient to determine whether the
two blocks are different. Beyond that, the MD5 checksum used between the same
rolling checksum blocks to ensure that the two blocks are exactly the same. After
checking and comparing two checksums, it is found that the difference between the two
blocks is almost negligible, with the probability of 1/2 ^ (128 + 32) [19].
(2) The sender calculates and compares the checksum
The sender also divides the files into different blocks with the same size as the
receiver, and then quickly computes the rolling checksum of each block. If the
checksum of the block is not the same as that of any block of the receiver, it means that
the block has different content between two sides. If the rolling checksum is the same,
the sender will calculate the MD5 checksum and compare it with the receiver’s MD5
checksum, determine whether they are identical [20].
It is important to note that the file block movement on the sender side is scrolling
rather than jumping at a fixed value. If the content of the current block differs from
the content of any block on the receiver, the block will move back by 1 byte instead of
the size of the entire block before calculating the checksum. Only when the block is
exactly the same as a block on the receiver will it move back by the size of the entire
block. Specific rolling process can refer to Figure 3.13.
74 | P a g e
Figure 3.13 Scrolling diagram of the rsync algorithm
75 | P a g e
corresponding information of each layer. For example, the full path of a resource is
[Service]/[VirtualDisk]/[ResourceType]/[Block]/[FileName]. The detailed storage
structure is shown in Figure 3.14.
(1) Service layer: service layer refers to server or storage device, and it is usually
hardware with operating systems. The service layer can make the system resources
stored in different servers or storage devices, to achieve resource scalability and
distributed storage [21].
(2) Virtual disk layer: virtual disk usually is the root directory file or diskpartition
of the system. And a single service layer object can have multiple virtualdisk layer
objects at the same time.
(3) Resource type layer: the resource type layer is mainly used to divide the
resource type, in order to facilitate the administrator's browsing and management.
(4) Block layer: the block layer is established based on the resource type layer.
Each resource type has multiple block objects corresponding to its own type. At the
same time, each block limited the maximum storage resources.
(5) Resource files: stored resource files.
76 | P a g e
After analyzing the logical relationship between the system demands and the
system, we draw the demands on data, and set up data tables to meet the demand. We
have designed the E-R relationship among data tables, which are shown in Figure 3.15.
1. User table
User table mainly stores the user's basic information, including: user name,
password, mailbox, user privilege level, user lock status and other fields, as shown in
Table A.1 in Appendix A. It is the major table of the database and the whole system.
2. Picture table
Picture table is used to store relevant picture information and the relationship
between albums and users, containing 13 fields: photo ID, album ID, user ID,
competition ID, photo name, upload time and total number of browse, and so on, which
are shown in Table A.2 in Appendix A. Each picture has a corresponding recordin this
table.
3. Picture resource table
The picture resource table mainly records information of the picture resource,
which contains the following fields: picture resource ID, associated picture ID,
associated space resource ID and URL, as show in Table A.3 in Appendix A. This table
records the relationship between pictures and resources. It also allows different
77 | P a g e
picture table records link to a same space resource record, which can avoid large amount
of repetition storage and save the storage space of the system. But it also makes the
resource deleting more complicated.
4. Album table
The album table is used to record basic information about the album and the
relation among users, containing 12 fields, such as album ID, album name, user ID,
album class, as shown in Table A.4 in Appendix A.
5. Collection table
Similar to the picture table and the album table, the collection table records the
user's collection information and related logical relationship, including: collection ID,
custom collection name, collected user ID, collecting user ID, and so on, which are
shown in Table A.5 in Appendix A. Combine SourceID field and Type field can define
a specific resource (e.g. a picture or an album)
6. Comment table
The table mainly stores the user's comment and content, containing following
fields: the comment ID, user ID, resource type of the commented object, and ID of the
resource corresponding to the commented object. Regardless of whether the object
being commented is a photo or an album, you can find the relevant data by looking up
the photo table or the album table, as long as you know the relevant SourceID and the
type. The specific structure of the table is shown in Table A.6 in Appendix A.
7. Competition table
Information related to the photography competition is stored in this table,
containing competition ID, competition name, sponsor ID, start date, end date,
published result date, reviewer ID, and review lock status, where reviewer ID refers to
ID information of multiple reviewers with the Varchar data type, as shown in Table
A.7 in Appendix A.
8. Competition relationship table
This table records the logical relationship among the user, the user's photo, and the
photography competition, and the winning results of the corresponding photo,
containing competition relationship ID, competition ID, user ID, picture ID, and result,
as shown in Table A.8 in Appendix A. The reason for not setting a foreign key in this
table is to prevent from disturbing when the administrator deletes the competition or
when the user deletes the photo, which can avoid the photos on the other module from
being displayed normally.
78 | P a g e
9. Tree node table
This table is mainly used to store information about the directory tree structure,
which is one of the most important tables in the database, containing: tree node ID,
node resource type, father node ID, and user ID. The detailed structure of the table is
shown in Table A.9 in Appendix A.
10. Space resource table
This table is mainly used for storing data for the space management subsystem.
Using data in the space resource table and the space block table, you can determine the
unique resource and information about its storage path. The space resource table
contains: resource ID, block ID, original name of resource, resource size, and created
time, as shown in Table A.10 in Appendix A for details.
11.Block table
This table records partial information about the location where the resource is
stored, including the block ID, VDisk, storage status, and remaining storage space. The
detailed structure is shown in Table A.11 in Appendix A.
79 | P a g e
Chapter 4 Implementation of the System
Based on demand analysis and system design of the system in the first two chapters,
we fulfilled the implementation of this photo sharing and photography competition
management system, which is described in this chapter. The implementation of each
module is described by giving corresponding user interface screenshots, procedures and
part of code line (See Appendix B: Part of System Codes).
The directory tree resource interface enables users to perform simple and intuitive
operations on managed resources of the system [24], which is used in the Photo
Management module, the Album Management module, the Collection Management
module and Contribution functions.
When the user does nothing, the directory tree interface displays only three
defaulted system folders: the photo folder, the album and the collection folder, as shown
in Figure 4.1 (a). When the user clicks on any one of the folders, the directory tree
interface will be expanded to show its subfolders. If the clicked folder does not contain
subfolders, the folder will be highlighted, as shown in Figure 4.1 (b) below.
80 | P a g e
Figure 4.1(a) The unexpanded directory tree Figure 4.1(b) The expanded directory tree
The main processing flow when a user accesses the directory tree resource management
interface is as follows:
1. When a logged-in user accesses a page that contains a directory tree, the client
sends a request to the server together with the information about the user
2. After the server receives the request and the user data, it submits them to the
GetTreeServlet for processing.
3.The GetTreeServlet calls getTreeByUserName method to access the database,
gets the user’s tree node collection, which is simplified after got, then only the
relevant information is extracted, such as node ID, name, type, etc., and then
passes it to the corresponding JSP.
4. The JSP extracts the relationship among each node from the received data (the
system default photo, album and collection folder as the base), and then constructs
the corresponding HTML code, and finally returns it to the client page.
5. The client page re-uses JavaScript and CSS to display directory tree.
This processing flow mainly describes the initialization of directory tree resource
management interface. But there is a foreseeable problem: some parts of the expanded
directory tree may be lost while refreshing, due to the non-real time data transmissions.
Also, how to save the current status of expanded directory tree before
81 | P a g e
sending request is an important part of this module. Therefore, I have introduced a
variable to save the expanded status of all folder nodes in the directory tree while
transmitting with service. Some background codes for accessing the directory tree
resource management interface are shown in Appendix B.1.
Storage space management subsystem is mainly used when normal users uploadphotos
and administrators perform storage management or database backup. Because this part
involves system security and key module confidentiality, only the operations when
users upload photos are described below.
The main processing flow of the storage space management subsystem when users
upload photos is as follows:
1.The upload function module calls the createResourceEntityAndURL method of
the storage space management subsystem to apply for allocation of the storage
space.
2. Using createResourceEntityAndURL method and getBlockAuto method, the
distributed block instance is obtained.
3.With getBlockAuto method, all block information stored in the database is
obtained, and then a non–full photo type resources block is picked and returned.
4. With the createResourceEntityAndURL method, the system configuration, the
block instance and URL are allocated to the photo resource, and the relevant
information is stored into the space resource table. The ResID (unique
identification ID) of the record in the space resource table is obtained. And then
the URL address and ResID are returned.
5. Finally, the uploading function module stores the photo to the specified URL
and saves the photo’s UserID, AlbID, ResID and other related data to the
corresponding database table.
This procedure describes the most important part of the resource management
module of storage space management subsystem. Before uploading, the system needs
to find a non-full block for saving the uploaded resource, and the selected block are
only allowed to save the same type resources as the uploaded one. For example, while
uploading photos, the system must find a non-full photo block. After that, the system
will extract the block’s information from database (including Service field and
VirtualDisk field), and combine them to get a complete URL. Then save the resource
82 | P a g e
to the specific URL and save relevant information in database. Otherwise, if there is
not non-full block, the system will automatically generate a new empty block, and save
block’s information in space resource table. Part of the codes for the storage
management subsystem is shown in Appendix B.2.
83 | P a g e
Figure 4.2 Account Management drop-down menu
The login interface is shown in Figure 4.3, which provides not only the registration
function, but also the password retrieving function. Visitors can click on the “Create a
new account” link below to apply for becoming registered users.
The main process of the module’s processing when a user logs in is as follows:
1. When the server receives the login request and related information submitted
by the client page, it uses URL mapping of the controller to filter URL, and
transfers them to the LoginServlet for processing.
2. The Servlet calls the doLogin method and submits the received data to it for
84 | P a g e
processing.
3. doLogin method checks the user's request and information. If there is an error,
it will return wrong message and jump to login page. If there is no error, it will
call loginByUserEmail method to verify the user name and password.
4. loginByUserEmail method first calls userDAO to retrieve the database to
determine whether the user name (email) exists. If it does not exist, it returns false,
and if it exists, it will continue to do the password verification. If the authentication
succeeds, it returns true and saves the login status of the current user in the cookie.
If the authentication fails, it returns false.
5. The doLogin method then evaluates the return value of loginByUserEmail. If
it is true, it will return the user name and ID information to the client and jump to
the user’s personal homepage, and if it is false, it will return an error prompt and
jump back to the login page.
During logging in, the User and Authorization Management module firstly needs
to check the request and input information, this can reduce the redundant access of
database and avoid malicious attack. Then it will verify password by compare input
data with database records. After successful login, the system will automatically save
current user’s login status for future authorization. And the login status also can protect
the system for Hotlinking and exceeding authorized access. The main code when the
user logs in is shown in Appendix B.3.
When the user attempts to change his password, he needs to enter the correct
current password and the new password twice. The operation page for modifying the
password is shown in Figure 4.4.
85 | P a g e
The main process of the module’s processing when a user changes his password is as
follows:
1. When the server receives the change password request and information
submitted by the client page, it uses URL mapping of the controller to filter URL,
and transfer them to the ChangePasswordServlet for processing.
2. The Servlet calls the updateUserPassword method and submits the received
data to it for processing.
3. updateUserPassword uses getCurrentUser method to obtain the current login
user instance, and then passes the relevant data to the changePassword method for
validation.
4. changePassword method firstly determines whether two new passwords are the
same. If not, it will interrupt and return false;; if yes, it will continue to verify the
user's old password. If the password does not match that in the database, it will
interrupt and return false. When both the two previous judgments are true, the
method will encrypt the new password, and call the user DAO update method to
update the data in the database.
5. Finally, the updateUserPassword method returns corresponding results to the
client based on the returned boolean value.
Although the client page have already verify whether the two new passwords are
the same by using JavaScript before sending request, but it is still necessary for the
server side to check it again to prevent malicious attack. And the password saved in
database has already been encrypted, so if the server wants to verify or change
password, the input data must be encrypted by the same way before verify or update.
Part of codes to change the password is shown in Appendix B.4.
One of the core demands of the photo sharing and photography competition
management system is to share photos with others. The functions of this module is to
show the user's personal information and photos, and to allow others to access, view
the photos and communicate with him.
This module’s interface is the user's personal homepage. The left part of the page
shows his personal information, including the name, the number of likes obtained, the
number of followers, the total number of photos, the total number of albums and so on.
Under the user's personal information, you can also search for other users and jump to
86 | P a g e
their personal homepages. At the right of this page, there are the owner's representative
works and selected albums. The representative works is a set of photos that is selected
by the owner by moving them into a special folder or are selected by the system which
are of the top three photos in the rank of descending order of click numbers. The
selected albums are chosen in a similar way. The representative works also have a
rotation function. The layout of the personal homepage is shown in Figure4.5.
The main steps for obtaining the user’s representative works are as follows:
1. When the client attempts to access the user's personal homepage, it sends
relevant requests and data to the server. The server-side backstage then submits
the requests and data to the HomepageServlet for processing according to the URL
mapping rules.
2. The Servlet calls showUserhome function, and uses incoming parameters and
getUserByUserName method for query the database to get the user's User class
instance.
3. showUserhome calls getSysTreeNodeByNodeNameAndUserID,
getAbumByTreeNodeID and getPhotosByAbumIDAndSortByViews to access
87 | P a g e
the database. Through the TreeNode table, the Album table, and the relationship
among data in the Photos table, The method obtains the user’s representative work
folder, and take outs the list of objects containing up to 3 photos in the rank of
descending order of click numbers.
4. Then the method determines the size of the list. If the photo number is less than
three, it uses getPhotoByUserIDAndSortByViews to take out the lack part, and
mergers the new list and the previous list.
5. Finally returns the list of representative photos.
The automatically generation of representative works may cause some
comprehension difficulties. Therefore I would like to explain the major parts of this
procedure (step 3 and 4). While obtaining the user’s representative works, the system
firstly will extra three photos with the highest click numbers from current user’s
representative work folder. If the photos in current user’s representative work folder
are less then three (e.g. only have two photos), then the system will extract the highest
click number photos for all the rest folders for supplement (e.g. find one from all the
rest folders for supplement). Part of the codes to obtain the main representative works
of the user is shown in Appendix B.5.
Users can also comment on the photos while browsing them. The comment
interface is shown in Figure 4.6.
88 | P a g e
The main process of the module’s processing when a user comment photos is as
follows:
1. After the user completes comments in the photo enlarge page and clicks submit,
the client sends a request and related information to the server-side designated
Servlet for processing.
2. CommentServlet calls postComment function to obtain the current logged-on
user’s instance object, create a new Comment instance object and store relevant
information submitted by the client page in it. At the same time it calls
setCreateTime method to save the time of the comment operation, and then calls
comment DAO to insert the relevant data into database table.
3. Finally, the method returns the Comment instance to servlet and JSP, so that the
newly published comments are displayed on the new page.
The process of user comment photos is quite simple, and the key point of this
process is to create an instance for the comment operation and it’s contents, then
persistent it into database. The core codes when commenting are as shown in
Appendix B.6.
This module realizes user operation and management of photo resources. It is closely
related to the Album Management module and the Collection Management module, as
the basis for their implementation.
In the photo management page, the user can do operations on the photos through
directory tree on the left side and operation buttons on the upper right side, including:
uploading photos, editing information, moving, copying, deleting and participating in
competitions. The user can also click on the photos on the right to enlarge them. The
photo management page is shown in Figure 4.7.
89 | P a g e
Figure 4.7 The photo management page
When the user tries to operate on the photos, he needs to click the "Select "
button on the left side of the button bar, and the page will display the hidden check
box, so that the user can select the desired photos. Then the user can perform the 6
operations described above. In the following, only the moving function is described,
and the function interface for moving photos is shown in Figure 4.8.
90 | P a g e
Figure 4.8 The user interface for moving photos
91 | P a g e
moved photo is changed to that of the target album, and the database information
is updated.
6. Finally, the MoveItemServlet will send new data back to the JS function, which
will use the data to modify page elements, with the deleted photos no longer
shown.
In this procedure, the system updates database three times in step 5, including:
updates PicNum (the total numbers of photos) of the target album’s data in Album table,
updates the PicNum of the current album’s data in Album table and updates the AlbID
(the ID of the album containing this photo) of the moved photo’s data in Picture table.
If one of three updates fails, it may cause some big mistake or bugs, because the other
two updates may still successfully finished. Therefore, I have combined these three
operations in a method, and if any update fails, the system will make roll back the other
two executed updates. Part of the codes for moving photos is shown in Appendix B.7.
92 | P a g e
Figure 4.9 The user interface for modifying albums
93 | P a g e
4.2.5 Implementation of Collection Management module
The main steps of the module’s processing when a user deletes collection items are as
follows:
1. When a user deletes a collection item, the client page will send a request to the
server. The server submits the request and data to the DeleteItemServlet for
processing.
2. The DeleteItemServlet calls removeCollection method to delete the specified
collection item and related data.
3. The method uses sourceID, sourceType and UserID to extract the
corresponding Collection instance object.
4. The method deletes the data in the database, and modifies the user's total
94 | P a g e
number of collection items.
5. The method returns the results of the operation, and uses AJAX asynchronous
transfer technology to modify the elements of the collection page, and no longer
shows the collection item deleted.
The same as discussed in 4.2.3, the delete of collection data and the update of
current user’s total number of collection items also need to be combined for potential
roll back when some error happens. Part of the codes for deleting collections is shown
in Appendix B.9.
The Competition Management module mainly provides users and administrators with
photography competition-related functions. The super administrator can create a new
competition or modify/delete an existing competition through this module. And
ordinary users can view their participated competitions and contributed photos by using
this module. The competition management page is shown in Figure 4.11.
When a super administrator clicks the “Create Competition” button in the upper left
95 | P a g e
of the competition management page shown in Figure 4.11, the creating competition
page will be jumped to, which is shown in Figure 4.12.
The main steps of the module’s processing when a super administrator creates a new
competition is as follows:
1. The super administrator sends a request of creating competition to the server
after filling in the related information.
2. The server submits the request and the relevant data to the
CreateCompetitionServlet for processing according to URL mapping in the
controller.
3. The CreateCompetitionServlet calls newCompetition method to create a new
competition.
4. The method checks whether the current login user has the privilege to create a
new competition. If yes, the relevant information is stored into a new Competition
instance object, and the insert function of competition DAO iscalled to save the
instance object into the database.
5. Results are returned, and the interface jumps to the competition management
page.
Before the client page sends creating competition request, it will use JavaScript
and AJAX to visualize the sponsor and reviewer’s list respectively (after click “select”),
and also will use JavaScript to check weather the input information is corresponding to
the required format. Part of the codes for creating competitions is
96 | P a g e
shown is Appendix B.10.
By using this module, users can contribute photos in two ways. (1) select the photo they
want to submit in the photo or album management page, and then click on the
“Contribute” button, followed by selecting the competition to contribute to. (2) select
one specified competition in the competition page, then upload photos and provide
relevant information for the photos to the contribution. Figure 4.13 shows the
contribution page of the photography competition management subsystem.
The main steps of the module’s processing when a user contributes to a competition is
as follows:
1. When a user confirms his contribution photo, the page will calls Node.js to
process the uploaded photo, and sends a request to the server side.
2. The server sends the request and related data to the ContributeServlet for
processing according to the URL mapping saved in the controller.
3. The ContributeServlet calls uploadPhoto method for incoming data
processing.
4. The uploadPhoto method requests the storage space management subsystem to
assign storage space, URL and the corresponding space resource ID.
5. The method uploads the photo resource to the target address based on the
returned URL.
97 | P a g e
6. At the same time, the method saves the relevant photo information and
competition relationship information to the database table.
7. Finally, the contribution page will show the contribution results to the user.
In this procedure, the user must input the relevant information of uploading photo.
Otherwise, the server will deny the uploading request. Part of the codes for contributing
is shown in Appendix B.11.
The Review module is only available for reviewers. After a reviewer accesses this
module and selects a specific competition, the user interface will automatically jump to
the review page. Then reviewer can click on the drop-down box below the photo to
review and select award. The function interface for reviewing is shown in Figure 4.14.
98 | P a g e
attributes in the instances and update the database with the results.
4. Finally, the results of these operations are fed back to the reviewer.
Once the reviewer select an award from the drop-down box, the reviewing
request will be send to the server, and the reviewer dose not need to click any “submit”
or “confirm” buttons. After that, the server will return the operation result to the client
page, and showing the result by popup window. This way of processing is convenient
for plenty of review operations, but is also may cause some out of sync problems
between the client page and the server database when the network is poor or
interrupted. Part of the codes for reviewing is shown in Appendix B.12.
The functions of the Display of Competition module can be fulfilled by the support of
the exhibition page. When a user accesses the exhibition page and selects a specific
competition for displaying, all the thumbnails of the photos for that competition will be
displayed. The user can browse the photos or give like’s by clinking on the “View” or
the “Like” hotlinks below the thumbnails. The user can also select the sorting methods
through the drop-down selection button. The exhibition page for a specific competition
is shown in Figure
99 | P a g e
The main steps of the module’s processing when a user sets sorting by the upload time
on the exhibition page is as follows:
1. When a user selects arrange by upload time, the client page will send a request
and relevant data to the server, and the server will send it to the GetPicturesServlet
for processing.
2. The servlet calls the sortPhoto method for incoming data processing.
3. The sortPhoto method passes the passed in parameters in to the key-value pair.
4. It calls the getPhotosByCompetitionID method to retrieve the data sorted in
descending order of the upload time in the database and save the data in a
collection of Photo object.
5. The results will be transmitted to the JSP, and JSP modifies HTML page
elements based on the relevant information, and returns the new page back to the
client.
100 | P a g e
In these processing steps, only the specific photos of current page will be obtained
and displayed. For example, the first page will only request the first 15 photos ordered
by upload time, and the second page will request photos ordered by upload time from
16th-30th. This can significantly improve the efficiency of data transmission between
server and client pages and reduce the redundant query for database. Part of the codes
for arranging by upload time is shown in Appendix B.13.
This module mainly has three functions: to show the winning works, browsing photos
or giving photo likes through the “View” and “Like” link below. The awards page of
this module is shown in Figure 4.16.
The main steps of the module’s processing when a user gives a photo like’s is as
follows:
1. When a user gives his favorite award-winning photo like’s, the client page will
use JavaScript functions and AJAX technology to send a request and related data
to the server.
2. The server submits the request to the LikeServlet for processing.
3.The LikeServlet calls the updateLikeNum method to change relevant
information of the target photo, which is saved in the database, and then the
number of the photo’s likes is increased by one.
4. The LikeServlet returns results to the JavaScript function through
asynchronous AJAX, and then JavaScript function refreshes the number of likes
based on the returned results.
There is one thing that can be improved in the future work. For now, all the visitors
can give their favorite photo Likes, and they can like the same photo multiple times. It
will be more reasonable if one user can give at most only one Like to each photo. Part
of the codes of giving a photo like’s is shown in Appendix B.14.
101 | P a g e
5 System test
102 | P a g e
Table 5.1 Test cases and results of the User and Authorization Management module
Table 5.2 Test cases and results of the Personal Homepage module
Table 5.4 Test cases and results of the Album Management module
104 | P a g e
5. Test of the Collection Management module
Table 5.5 describes the test cases and related conclusions of the Collection Management
module.
Table 5.5 Test cases and results of the Collection Management module
Table 5.6 Test cases and results of the Competition Management module
105 | P a g e
Table 5.7 Test cases and results of the Contribution module
Table 5.9 Test cases and results of the Display of Competition module
106 | P a g e
The count of giving
Function of giving
Give like to photos Give like to photos likes is increased by
likes is working well
one
107 | P a g e
10. Test of the Display of Competition Result module
Table 5.10 describes the test cases and the results for the Display of Competition
Result module.
Table 5.10 Test cases and the results of the Display of Competition Result module
108 | P a g e
6 Conclusion and Future Work
6.1 Conclusion
This paper describes the design and implementation of the J2EE-based photo sharing
and photography competition management system. This system provides a user-
friendly platform that highly meets the needs of photography enthusiasts and the current
market. During the design and development of this system, we have completed the
following work:
1. An in-depth investigation is conducted through communication with
shutterbugs. And according to the investigation results, system requirements are
analyzed by using UML and object-oriented methods, and the relevant use case
diagrams are drawn.
2. The overall structure of the system is designed. The system is divided into two
subsystems: the photo sharing subsystem and the photography competition
management subsystem. The former consists of 5 modules: the Personal Homepage,
the Photo Management, the Album Management, the Collection Management, and the
User and Authorization Management. The latter consists of 6 modules: the User and
Authorization Management, the Competition Management, the Review, the
Contribution, the Display of Competition and the Display of Competition Result.
3. The detailed design is performed for each module, and the processing sequence
diagram of each module is drawn, the processing steps of each module is also given.
4. The database design is fulfilled. The E-R chart and database tables are given.
We have adopted a tree structure in the classification of resources, so that the resources
and records in the database have a good relationship and structure.
5. A unique storage space management mechanism is proposed and incorporated
into the system, which provides efficient and flexible storage management for resources
on the server, and makes the file synchronization and transmission more efficient.
6.The UI of the system and each module are designed and implemented. Finally,
the whole system is programed and tested, and bugs are removed based on the test.
109 | P a g e
6.2 The direction of further work
Although the design and implementation of the system have been finished, it is far from
perfect, and there exists improvements that can make the system works better. For
example, the webpages are not pleasing enough to the eye, and the correlation among
multiple subsystems is not strong. Tables and structures of the database can also be
further optimized. Besides, the system has not been optimized for performance in large
workload, such as the response time, the maximum number of concurrent users, and
etc. I believe there exists a large development space in the future.
110 | P a g e
References
[1] Lu, Qian. “In 2015, China's domestic tourism exceeded 4 billion, and the tourism
industry contributed over 10% of GDP.” The State Council The People’s Republic
of China, 4 Jan. 2016. 10 Feb. 2016.
<http://www.gov.cn/xinwen/2016-01/04/content_5030593.htm>
[2] Tan, Jie Ni. “The Study on the Photography behavior of tourist.” Diss. Chongqing
Normal University, 2011.
[3] Hong-tao, D. E. N. G. "Research on Processing Method of Tree Structure
Information in Relational Database [J]." Journal of Jianghan University (Natural
Sciences) 2 (2010): 016.
[4] Chung, Lawrence, et al. Non-functional requirements in software engineering.
Vol. 5. Springer Science & Business Media, 2012.
[5] Tilkov, Stefan, and Steve Vinoski. "Node. js: Using JavaScript to build
high-performance network programs." IEEE Internet Computing 14.6 (2010):
80-83.
[6] Juan, T. I. A. N., and X. U. Zhao. "Analysis & Consideration of MVC Design
Model Based on J2EE [J]." Computer and Modernization 10 (2010): 015.
[7] Yang, Jin Cheng, L. Qiang, and Y. E. Han-Minb. "Realization of Web Treeview
Component Based on Ajax." Journal of Shanghai University of Electric
Power 26.2 (2010): 205-209.
[8] Sun, Chang Ai, et al. "Object-Oriented Requirements Analysis Based on UML."
Acta Aeronautica ET Astronautica Sinica 24.1 (2003): 75-78.
[9] Alur, Deepak, et al. Core J2EE Patterns (Core Design Series): Best Practices and
Design Strategies. Sun Microsystems, Inc., 2003.
[10] Lu, Rongxing, et al. "Study and implementation of MVC design pattern on J2EE
platform." Application Research of Computers 20.3 (2003): 144-146.
[11] Fei, W. A. N. G. "Rationalize the View Tier of MVC." Science Technology and
Engineering 22 (2009): 067.
[12] WU, Chenqing, and Zhenhua RONG. "Implementing Web Application Using
JSP/Servlet Technology [J]." Computer Engineering 1 (2001): 066.
111 | P a g e
[13] Shilin, Xiao Aihua Wang. "A COMMON WAY IMPLEMENTS DATA ACCESS
OBJECT PATTERN FOR J2EE APPLICATION [J]." Computer Applications
and Software 9 (2005): 051.
[14] Gong, Fu Qiang. “Development and Application of User Authority Management
System Based on RBAC.” Diss. Northwestern Poly-Technical University, 2007.
[15] Ramakrishnan, Raghu, and Johannes Gehrke. Database management systems.
McGraw Hill, 2000.
[16] Tridgell, Andrew, and Paul Mackerras. "The rsync algorithm." (1996).
[17] Wikipedia contributors. "Rolling hash." Wikipedia, The Free Encyclopedia.
Wikipedia, The Free Encyclopedia, 4 Mar. 2016. Web. 17 Aug. 2016.
<https://en.wikipedia.org/wiki/Rolling_hash>
[18] Wikipedia contributors. "MD5." Wikipedia, The Free Encyclopedia. Wikipedia,
The Free Encyclopedia, 19 Mar. 2016. Web. 21 Aug. 2016.
<https://en.wikipedia.org/wiki/MD5>
[19] Tang, Xiao-Di, et al. "Design and implementation of remote file synchronization
system based on difference." Computer Engineering and Design 31.20 (2010):
4389-4392.
[20] Hao,Cheng. “The Core Algorithm of Rsync”. CoolShell. 17 May. 2012. 13 Feb.
2016.
< http://coolshell.cn/articles/7425.html >
[21] Sun, Jie. “Design and Implementation of Distributed Storage and Management of
Spatial Data” Diss. Jilin University, 2015
[22] XU, Chang-sheng, Chao DAI, and Li XIE. "Research of rapid development of
web application [J]." Computer Engineering and Design 12 (2004): 037.
[23] Freeman, Eric, et al. Head First Design Patterns: A Brain-Friendly Guide. "
O'Reilly Media, Inc.", 2004.
[24] ZHANG, Yu-fang, Xiang-qian Hu, and Zhong-yang Xiong. "Building treeview
with recursive algorithm in JSP [J]." Computer Engineering and Design 1 (2005):
014.
[25] Myers, Glenford J., Corey Sandler, and Tom Badgett. The art of software testing.
John Wiley & Sons, 2011.
[26] SHANG, Dong-juan, et al. "A Study of Test Cases and Reuse in Software Testing
[J]." Computer Technology and Development 1 (2006): 021.
112 | P a g e
Appendix A: Database Tables
113 | P a g e
Total number of
ViewNum INT Not Null
browse
LikeNum Total number of likes INT Not Null
114 | P a g e
Field Description Data type Remarks
ColID Collection ID INT Primary Key
Custom collection
ColName VARCHAR Not Null
name
SrcUserID Collected user ID INT Not Null
DesUserID Collecting user ID INT Foreign Key
SourceID Collected object ID INT Not Null
Collected object
Type VARCHAR Not Null
type
Create Collected time DATETIME Not Null
Description Description VARCHAR
115 | P a g e
Locked Review lock status TINYINT Not Null
116 | P a g e
Table A.10 Space resource table
117 | P a g e
CONCLUSION
ONLINE ART GALLERY is a application software and it is very helpful
for the art lovers and others who wants to know the addresses where this kind of
arts will we sold.
This application helps the end-users to search their arts and paintings and
they can place order for the selected pieces. The enduser can also get the
information about the art exhibition and the respective address, so, that they can
visit to those exhibitions.
Art Gallery brings you an opportunity to view online art exhibitions at our
Online Art Gallery we bring you details of all art exhibitions held in the past and
the forthcoming show. The Online Art Gallery is updated daily, so the user can
view and buy the latest collection of contemporary art online from any where in
the world.
• This project “Online Art Gallery ” gives sopes for the further
enhancement.
• The product can enter any user requirement.
• The application is currently stand alone and can be extended for the web.
• This gives a very good knowledge about webapp
BIBLIOGRAPHY
118 | P a g e