Title: Web and Database Programming: Database Content Management
1Web and Database ProgrammingDatabase Content
Management
- David Goldfeder
- Web and Database Specialist
- Mechanical and Industrial Engineering
2Objectives
- To understand what constitutes a database driven
web site. - To understand the requirements of such a web
site. - To analyze the preparatory steps necessary in
designing such a site. - To discuss different content management
techniques available to site administrators. - To analyze database driven content management.
3What is a database driven site?
- Definition a database driven site is one where
some or all of the content of the site is stored
within a database for retrieval when requested by
the client. - Requirements
- Web server
- Server-side programming language
- Database
1.1 (4)
4Normal Site Operation
- Client requests a page.
- Server locates page.
- Server processes server-side script.
- Server returns requested page to client.
- Page is displayed to client.
1.2 (4)
5Database Driven Site Operation
- Client requests a page.
- Server locates page.
- Server requests content from database.
- Database returns content to server.
- Server processes content.
- Server processes server-side script.
- Server returns requested page to client.
- Page is displayed to the client.
1.3 (4)
6Database Driven Site Operation
1.4 (4)
7Requirements
- Web Server
- Server Side Programming Language
- Database Technology
2.1 (4)
8Requirements Server Side Programming Language
- Language choice should be driven by the
preference of the programmers. - Only real requirement is the ability of the
language to communicate with the chosen database
technologies. - Some communication can be performed via Open
Database Connection Protocols (ODBC) - Other languages provide optimized libraries (i.e.
PHP with the mysql and mysqli extensions).
2.2 (4)
9Requirements Database
- Like the programming language, database
technology decisions are driven by the preference
of the programmers. - Database should be compliant with SQL standards
and provide the ability to set foreign keys
within a table (a.k.a. relationships). - Stored procedures, triggers, views, etc. are
nice, but not necessarily required for a site
with lower throughput.
2.3 (4)
10Requirements Database
- Necessity of a separate data server determined by
demand. There are arguments on both sides of
this issue - Data server can be made more secure than a web
server, thus protecting the data. - Database becomes more scalable on its own machine
and receives a greater portion of processing
power. - Transmission time between machines can impact
response to client on pages with a large amount
of queries. - Two machines to maintain rather than one.
- Cost becomes a factor when purchasing more than
one server-quality machine.
2.4 (4)
11Database Driven Site Design
- Database drives the content, not the layout.
- Consider where the database hooks will be
necessary during design process. - Ability to use programmatic server includes
becomes helpful in separating content sections - Decide early the amount of database content that
will be used to display that page.
3.1 (8)
12Distributed Content Management
- Definition a system which allows the content
experts to create the data (content) for each
page while the programmers focus on the display
of these data. - Databases can provide the repository for the data
that the experts create. - How do the experts put the data in the database?
- How do the programmers retrieve said data for
display?
3.2 (8)
13Paradigm Shift
- In a database driven content management system,
there is only one file per type of layout. - For example, if you have a splash page and a
content page, you might only need two files to
run the whole site. - This does not include the administrative tools
that are written to allow content experts access
to the databases.
3.3 (8)
14Layout Type Splash Page
3.4 (8)
15Layout Type Content Page
3.5 (8)
16Layout Type Content Page
3.6 (8)
17Layout Type Content Page
3.7 (8)
18Design Concerns
- Dont do safe design just because the
programming is complex. Let the programmer make
it happen. - In other words, design first, then program.
Otherwise, programming concerns could trump
layout/interface design. - Programming concerns are only concerns for
programmers. - Layout and interface directly influence the way
people work and access your site. Theyre job
should be easy, the programmer can drink more
coffee!
3.8 (8)
19Content Management Techniques
- Apply dynamic template onto static pages
- Include static content into dynamic template
(a.k.a. Fusebox) - XML/XSL
- Database Content Repository
- Each of these can be a distributed content
management system. The distributed part is
determined by who controls the content, not the
technique used to manage that content.
4.1 (5)
201. Apply dynamic template
- One of the most common management techniques.
- Allows anyone to create the static pages and then
the programmers to apply the necessary look and
feel to them. - Example Dreamweaver templates
4.2 (5)
212. Include static content
- This technique is often called Fusebox.
- Essentially, there is one page, called the box
which controls the layout. - Then, any files which are displayed in that
layout are included into the box. These are the
fuses. - Truly separates content and display by putting
them in different files. - Content experts can create fuses while the
programmers worry about the box.
4.3 (5)
223. XML/XSL
- Similar to Fusebox would be to make the XSL
transformation the box and the XML files the
fuses. - XML can be created from many applications,
including MS Office. - Software can help a person make well-defined XML
files.
4.4 (5)
234. Database Content Repository
- But, why do you need so many files?
- If you have a box into which you can plug fuses,
put the fuses in the database. - Often requires very few files for the public
site. - However, the content management files for
getting the content in to the database make up
the lions share of the system. - Dynamic form builders can come in handy for
making new content on the fly. - More likely, however, the programmers will
probably be creating a number of web forms which
handle different types of content.
4.5 (5)
24DB Content Repository Needs
- Depend on the layout and content of your site.
- Most common database needs are
- Page table this can be as simple as the page
title and an identifier (page_id) - Menu table using the page_id, look up the
necessary menu information - Content table textual and graphical content on
a page maintaining the page_id relationship with
the other two tables.
25How does the Content Expert interact with the
Database?
- Answer web forms.
- Programmer can create an authenticated system
where content experts can access the existing
page information and change it as necessary
365/24/7. - Downside this does impose a certain amount of
conformity between pages. Any page that upsets
the status-quo (i.e. calendars, contact pages,
etc.) usually needs its own form. - Upside content experts never need to touch
software like Dreamweaver, they just use a web
browser.
26 How Many Web Forms?
- Depends on the number of different page types.
Some common forms are - List of links
- Paragraphs with headers
- News articles
- Events and/or event calendars
27But what about the HTML?
- If content experts enter their data into web
forms, how do these data end up as a web page? - Answer server side programming and form
validation. - Form validation for each type of content form
creates the necessary HTML and then saves it in
the database.
28But what about the HTML?
- Content experts could enter HTML directly into
the web form. - This creates the possibility of a site
vulnerability called a Cross Site Scripting (XSS)
attack. - Someone would have to break into the
authenticated system to perform the attack. - Somewhat defeats the purpose of the management
tool, which was to remove HTML concerns from the
content experts in the first place.
29Example Nano-CEMMS
- http//dev.nano-cemms.uiuc.edu/
30What if
- the content expert needs a list, or a link, or
an image, or an - If youre allowing HTML and the experts know what
to do, this can solve the problem. - More likely, though, this isnt a viable solution.
31What if
- Client side solution
- JavaScript can often be leveraged to provide the
ability to enter lists and links so that expert
doesnt have to worry about the HTML involved. - Example
- Downsides
- can only add information to the end of the
content. - if HTML is blocked in form processes (to protect
against bad markup) then you need a different
markup (like BBCode) to control your display. - Not WYSIWYG
- Could use pop-up interface windows to provide
similar functionality, to solve many of these
downsides, as long as the visitor allows you to
pop a window, of course
32What happens when theweb form isnt enough?
- If possible, make a new web form. Some problems
can be solved by making a new tool for the
content experts. - Could allow a WYSIWYG editor via Java or perhaps
even Flash. - Example Editize
- Problem with these is that they could be slow and
require a plug-in which may not be available. - Many, Editize included, can accept copy/paste
from Word and other applications, however.
33Do database content management solutions it
really help?
- How does all this back-end processing help save
time for the programmers? - Depends on the environment
- A site with a team of dedicated programmers and
content experts may have available workers to
avoid this type of system. - A smaller site without a dedicated web programmer
cant always wait for one to be available.
Content has to go online as soon as possible.
34(No Transcript)