Server Side Technologies

Mobile Application Design and Development [./]
Spring 2010 — INFO 152 (CCN 42504)

Erik Wilde, UC Berkeley School of Information
2010-03-08

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents Erik Wilde: Server Side Technologies

Contents

Erik Wilde: Server Side Technologies

(2) Abstract

Navigating the mobile landscape means that depending on the targeted mobile devices, it might be impossible to rely on sophisticated client-side support for Web technologies. In such a case, it is necessary to move the functionality to the server-side, so that mobile applications can be used by simpler clients as well. In this lecture, we look at the concepts that can be utilized on the server side, standalone web servers, general programming frameworks, and Content Management Systems (CMS).



Erik Wilde: Server Side Technologies

(3) Mobile Applications

  1. Local application only
    • games and navigation and personal productivity applications
    • more and more of those local applications have online features as well
  2. Server-side application only
    • functionality and data is entirely implemented and exposed server-side
    • most Web-based applications qualify
    • RIAs (Flash/Silverlight/HTML5) are supporting more local functionality
  3. Mix of local and server-side functionality
    • local capabilities compensate for disconnects and slow transfer rates
    • server-side capabilities compensate for limited devices and risk of data loss
    • well-designed switching between both modes is useful but not easy
    • good developer support for this type is in its infancy


Web Server

Outline (Web Server)

  1. Web Server [6]
  2. Server Side Programming [4]
  3. Content Management System (CMS) [9]
Web Server Erik Wilde: Server Side Technologies

(5) Computing Cycles



Web Server Erik Wilde: Server Side Technologies

(6) HTTP and File Systems



Web Server Erik Wilde: Server Side Technologies

(7) Serving Content from Files

wcms-fs-only.png

Web Server Erik Wilde: Server Side Technologies

(8) Serving Content from Files with SSI

wcms-fs-ssi.png

Web Server Erik Wilde: Server Side Technologies

(9) Server-Side Includes (SSI)



Web Server Erik Wilde: Server Side Technologies

(10) Common Gateway Interface (CGI)

http://radblast-aa.wunderground.com/cgi-bin/radar/WUNIDS_map?station=MUX&brand=wui&num=6&delay=15&type=N0R&frame=0&scale=0.498&noclutter=0&t=1165711666&lat=37.86912155&lon=-122.26962280&label=Berkeley%2C+CA&showstorms=0&map.x=400&map.y=240&centerx=470&centery=334&transx=70&transy=94&showlabels=1&severe=0&rainsnow=1&lightning=0

Server Side Programming

Outline (Server Side Programming)

  1. Web Server [6]
  2. Server Side Programming [4]
  3. Content Management System (CMS) [9]
Server Side Programming Erik Wilde: Server Side Technologies

(12) From Processing to Programming



Server Side Programming Erik Wilde: Server Side Technologies

(13) PHP Hello World

<!DOCTYPE html>
<html>
 <head>
  <title>PHP Hello World</title>
 </head>
 <body>
  <h1>PHP Hello World</h1>
   <p><?php echo "Hello World."; ?></p>
   <ul>
    <?php
     foreach (getallheaders() as $name => $value) {
      echo "<li>$name: $value</li>";
     }
    ?>
   </ul>
 </body>
</html>


Server Side Programming Erik Wilde: Server Side Technologies

(14) Minimal Server-Side Feed Reader

<?php
 require_once('simplepie.inc');
 $feed = new Simplepie($_GET['feed']);
 $feed->handle_content_type();
?>
<!DOCTYPE html>
<html>
 <head>
  <title><?php echo $feed->get_title(); ?></title>
 </head>
 <body>
  <h1>
   <a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a>
  </h1>
  <ol>
   <?php foreach ($feed->get_items() as $item): ?>
    <li>
     <p>
      <a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a>:
      <?php echo $item->get_description(); ?>
      [ <?php echo $item->get_date('g:i a, F j, Y'); ?> ]
     </p>
    </li>
   <?php endforeach; ?>
  </ol>
 </body>
</html>


Server Side Programming Erik Wilde: Server Side Technologies

(15) Adding jQuery

<?php
 require_once('simplepie.inc');
 $feed = new Simplepie($_GET['feed']);
 $feed->handle_content_type();
?>
<!DOCTYPE html>
<html>
 <head>
  <title><?php echo $feed->get_title(); ?></title>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript">
   $(document).ready(function() {
    $('li div.content').hide();
    $('li').toggle(function() {
     $(this).find('div.summary').hide("slow");
     $(this).find('div.content').show("slow");
    }, function() {
     $(this).find('div.summary').show("slow");
     $(this).find('div.content').hide("slow");});});
  </script>
 </head>
 <body>
  <h1>
   <a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a>
  </h1>
  <ol>
   <?php foreach ($feed->get_items() as $item): ?>
    <li>
     <p>
      <a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a>
      [ <?php echo $item->get_date('g:i a, F j, Y'); ?> ]
     </p>
     <div class="summary"><?php echo $item->get_description(); ?></div>
     <div class="content"><?php echo $item->get_content(); ?></div>
    </li>
   <?php endforeach; ?>
  </ol>
 </body>
</html>


Content Management System (CMS)Content on the Web

Outline (Content Management System (CMS))

  1. Web Server [6]
  2. Server Side Programming [4]
  3. Content Management System (CMS) [9]
Content Management System (CMS) Erik Wilde: Server Side Technologies

(17) Content and Structure



Content Management System (CMS) Erik Wilde: Server Side Technologies

(18) CMS Evolution

  1. Web servers reading from files
  2. Web servers implementing primitive content management (SSI)
  3. Scripting languages implementing better management
  4. Management code getting hooked up to databases
  5. Better handling of client-specific behavior
  6. Databases getting more diverse (RDB, XML, RDF)


Content Management System (CMS) Erik Wilde: Server Side Technologies

(19) The Rise of the CMS



Content Management System (CMS) Erik Wilde: Server Side Technologies

(20) File Systems are Databases



Content Management System (CMS) Erik Wilde: Server Side Technologies

(21) Tables (Relational Model)



Content Management System (CMS) Erik Wilde: Server Side Technologies

(22) ER Model

Wikipedia: Entity-Relationship Model

Content Management System (CMS) Erik Wilde: Server Side Technologies

(23) Ordered Trees (XML)



Content Management System (CMS) Erik Wilde: Server Side Technologies

(24) XML Content

The term Mixed content in XML refers to elements which have text content mixed with elements [http://www.w3.org/TR/xml/#sec-mixed-content]. What these elements do depends on the elements smiley.gif, but the important point is that they are on the same level as the text nodes of the mixed content.

XML tree for mixed content

Content Management System (CMS) Erik Wilde: Server Side Technologies

(25) Directed Graphs (RDF)



2010-03-08 Mobile Application Design and Development [./]
Spring 2010 — INFO 152 (CCN 42504)