User:Pwong
From CSWiki
[edit] Week 1 - January 4, 2008
Class introduction and students personal introductions. I have the intention on building a Digital Asset Management (DAM) using PHP or Java for the class. Project Fedora was a suggestion from Dr. Abbott to look into.
[edit] Week 2 - January 11, 2008
Currently interested in implementing a system alert application to notify users of over heating computer servers. Looking to implement Intelligent Platform Management Interface (IPMI) for Linux servers. IPMI is a open standard for machine health monitoring and control (including remote access), implemented by many hardware vendors. I am thinking of implementing an email or some sort of paging application that will capture IPMI monitoring information and notify some users about servers downtime, critical disk space usage and critical temperatures.
Digital Asset Management Introduction
- How to manage / store digital assets?
- How to search one asset within large collections?
- How to deliver the asset?
- How to create multiple formats of the asset from one original format?
- How to collaborate with other users?
- How to preserve the assets?
Digital Asset Management (DAM)
- Software application to manage, store and distribute digital assets such as photographs, videos and music.
- It is also referred as a protocol to download, rename, backup, rating, grouping, archive, optimize, maintain, thinning and exporting files.
- Types of DAM:
- Brand asset management systems
- Library asset management systems
- Production asset management systems
- Digital supply chain services
Business Usage
- Collaboration and Management of:
- Advertising and marketing collateral
- Multimedia press Kits
- Multimedia sales Kits
- Multimedia general Marketing
- Multimedia training Materials
- Corporate presentations
- Video on demand (VOD)
- Rich Media libraries
Commercial DAM Software Products
- ActiveMedia (ClearStory Systems)
- ADAM (Adam Software)
- Artesia DAM
- Documentum
- Media Beacon R3volution
- Expression Media (Microsoft)
- Adobe Lightroom
- And many more...
Fedora
- Open Source software with tools to manage and deliver digital contents
- Java based with its own collection set of APIs
- Digital Objects within a repository architecture
- Controlled management
- Metadata
- Inter-Object relationship
- Web Services (Dynamic Content Delivery and Management/Access API)
- Version Control and Collaboration
- Preservation of assets
Fedora Digital Object Model
Dublin Core Metadata
- Consists of 15 metadata elements:
- Title
- Creator
- Subject
- Description
- Publisher
- Contributor
- Date
- Type
- Format
- Identifier
- Source
- Language
- Relation
- Coverage
- Rights
Fedora Digital Object Model cont.
<digitalObject PID="uniqueID">
<!-- there are a set of core object properties -->
<objectProperties>
<property/>
<property/>
...
</objectProperties>
<!-- there can be zero or more datastreams -->
<datastream>
<datastreamVersion/>
<datastreamVersion/>
...
</datastream>
<!-- there can be zero or more disseminators -->
<disseminator>
<disseminatorVersion/>
<disseminatorVersion/>
...
</disseminator>
</digitalObject>
Representations mapped to datastreams
Disseminations via service operations
Relationship among objects
- Metadata in Resource Description Format (RDF) XML syntax
- Indexing of the relationship metadata in special database
- Query interface to extract relationship information (Web service in Fedora API)
Available Services Module
- Generic Search Service
- OAI Provider Service
- Directory Ingest Service
- SIP Creator
The Future of Fedora
- Preservation Monitoring
- Preservation Integrity
- Fedora Workflow
- Event Notification Service
[edit] Week 3 - January 18, 2008
"""Apache Tomcat 6 Installation""" Downloaded Tomcat 6 source code from http://tomcat.apache.org
- Extracted apache-tomcat-6.0.14.tar.gz into /opt directory
tar zxvf apache-tomcat-6.0.14.tar.gz
- Then created a symbolic to point to apache-tomcat-6.0.14
ln -s apache-tomcat-6.0.14 tomcat6
- Make sure that JAVA_HOME environment variable is set
#echo $JAVA_HOME
/usr/lib/jvm/java-6-sun/
- Downloaded Fedora and installed Fedora from .jar installer file. Just select the desired configuration setting during the installation (eg: port number, username, password, database to use etc...). I chose a custom installation. Fedora comes with Tomcat 5.5 but I configured it to have it use Tomcat 6. It will use the built-in McKoi SQL Database 1.0.3. I did not install Fedora with SSL because it is just for testing on my local machine but certainly will use SSL if it gets to an open server accessible from the web.
#java -jar fedora-2.2.1-installer.jar
***********************
Fedora Installation
***********************
To install Fedora, please answer the following questions.
Enter CANCEL at any time to abort the installation.
Detailed installation instructions are available at:
http://www.fedora.info/download/
Installation type
-----------------
The 'quick' install is designed to get you up and running with Fedora
as quickly and easily as possible. It will install Tomcat and an
embedded version of the McKoi database. SSL support and XACML policy
enforcement will be disabled.
For more options, including the choice of hostname, ports, security,
and databases, select 'custom'.
To install only the Fedora client software, enter 'client'.
Options : quick, custom, client
Enter a value ==> custom
Fedora home directory
---------------------
This is the base directory for Fedora scripts, configuration files, etc.
Enter the full path where you want to install these files.
Enter a value [default is /opt/Fedora-2.2.1] ==>
WARNING: /opt/Fedora-2.2.1 is not empty.
WARNING: Overwrite? (yes or no) [default is no] ==> n
Fedora administrator password
-----------------------------
Enter the password to use for the Fedora administrator (fedoraAdmin) account.
(code cut off)
- Setting Fedora required environment variables into startup script .bashrc
# vi /root/.bashrc
FEDORA_HOME=/opt/Fedora-2.2.1
export FEDORA_HOME
CATALINA_HOME=/opt/tomcat6
export CATALINA_HOME
PATH=$PATH:/opt/Fedora-2.2.1/server/bin:/opt/Fedora-2.2.1/client/bin:/$JAVA_HOME
- Start Tomcat web server
#/opt/tomcat6/bin/startup.sh
Using CATALINA_BASE: /opt/tomcat6
Using CATALINA_HOME: /opt/tomcat6
Using CATALINA_TMPDIR: /opt/tomcat6/temp
Using JRE_HOME: /usr/lib/jvm/java-6-sun/
- Installed (Ingest) demo Fedora objects into repository
# fedora-ingest-demos localhost 8080 fedoraAdmin [password] http
Starting Fedora DemoIngester...
Ingesting Demonstration Objects...
SUCCESS: All 33 objects were ingested.
A detailed log is at /opt/Fedora-2.2.1/client/logs/ingest-from-dir-1200632612336.xml
SUCCESS: All 9 objects were ingested.
A detailed log is at /opt/Fedora-2.2.1/client/logs/ingest-from-dir-1200632623135.xml
Finished.
- Objects can also be ingested and managed from the Fedora GUI client
#fedora-admin.sh
- Access the demo object profile from the repository from a web browser
http://{hostname}:{port}/fedora/get/{objectPID}
[edit] Week 4 - January 25, 2008
Fez PHP front end for Fedora
As part of its eScholarship testbed (http://www.library.uq.edu.au/escholarship) for the Australian Partnership for Sustainable Repositories project (http://www.apsr.edu.au/), staff at the University of Queensland Library are developing software for a flexible, digital repository and workflow management system. The digital repository software is PHP- and MySQL-based and works as a frontend and administration tool using Fedora. Designed around Fedora 2, it uses RELS-EXT to describe relationships between objects for communities, collections, and records. Records will have associated datastreams which may be documents such as PDFs. Records can belong to both collections and communities. All records will also be associated with a controlled subject thesaurus. The software will also be able to handle multiple metadata schema, i.e. Dublin Core, EAD and so on.
The digital repository can handle different content models which can be customised through the web-based administration interface. A conference paper, for instance, could have multiple datastreams - one for the actual document, e.g. the PDF of the paper, one for the Dublin Core data, one for preservation metadata, one for provenance, one with conference-specific data such as location, date and so on. New content models can be added at any stage. Each object type is governed by XSDs that map those XSDs against HTML inputs, static variables or dynamic variables and search keys. The create, edit and view forms, searches and the consequent XML objects are controlled dynamically by these mappings.
Linux installation requirements for Fez:
- Apache2
- PostgreSQL 8.2
- pgadmin3 (GUI DB access tool)
- MySQL Server 5
- Imagemagick
- Graphviz
- Xpdf
- msttcorefonts
- vim-full
- PHP5
After installation of all the requirements: Setup PostgreSQL admin user password:
su - postgres
psql postgres postgres
postgres=# ALTER USER postgres WITH PASSWORD '*password*';
Create fedoraAdmin user for postgreSQL and create Fedora postgre DB:
postgres=# CREATE ROLE "fedoraAdmin" LOGIN PASSWORD 'fedoraAdmin';
postgres=# CREATE DATABASE "fedora22" WITH ENCODING='UTF8' OWNER="fedoraAdmin";
postgres=# \q
[edit] Week 5 - February 1, 2008
ImageMagick
ImageMagick is a powerful set of open source image manipulation utilities. It can read, write and manipulate images in many image formats. It can resize, rotate, sharpen, color reduce or add any other special effect to your images. ImageMagick can also be run from the command line which means ImageMagick can be used from scripts. You can also use the functionality of ImageMagick from APIs of the following language:
G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick (Java), L-Magick (Lisp), NMagick (Neko/haXe), MagickNet (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK).
ImageMagick Features
- Format conversion: convert an image from one format to another (e.g. PNG to JPEG)
- Transform: resize, rotate, crop, flip or trim an image
- Transparency: render portions of an image invisible
- Draw: add shapes or text to an image
- Decorate: add a border or frame to an image
- Special effects: blur, sharpen, threshold, or tint an image
- Animation: create a GIF animation sequence from a group of images
- Text & comments: insert descriptive or artistic text in an image
- Image identification: describe the format and properties of an image
- Composite: overlap one image over another
- Montage: juxtapose image thumbnails on an image canvas
- Motion picture support: read and write the common image formats used in digital film work
- Image calculator: apply a mathematical expression to an image or image channels
- High dynamic-range images: accurately represent the wide range of intensity levels found in real scenes ranging from the brightest direct sunlight to the deepest darkest shadows
- Large image support: read, process, or write mega- and giga-pixel image sizes
- Threads of execution support: ImageMagick is thread safe and many internal algorithms are already threaded to take advantage of speed-ups offered by the dual and quad-core processor technologies
Script functions
1. Parse the query string 2. Convert the query string to an ImageMagick command string 3. Run ImageMagick on the image 4. Send the modified image to the browser.
[edit] Week 6 - February 8, 2008
PHP and MySQL
I had coded a basic authentication page using PHP and MySQL to get a better understanding of how to use PHP. I am planning to develop a website where users can store different kind of media and be able to modify the media files on the fly instead of having to use 3rd party desktop applications. I understand that there may be similar websites that provides similar service but I would like to consolidate those services and possible innovate additional useful ones. I am thinking of building a web application that can compare to Fedora repository capabilities.
PHP Authentication Page
<?php
session_start();
$db = mysql_connect('localhost','root','letmein') or die("Couldn't connect to the database @ localhost.");
mysql_select_db('dam_users') or die("Coudn't select the database dam_users");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Digital Asset Management</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
// Process login
if (isset($_POST['username'])) {
// Check credentials
//if ($_POST['username'] == 'foxmulder' and
// $_POST['password'] == 'trustno1') {
$userId = $_POST['username'];
$userPass = $_POST['password'];
$sql = "SELECT userId
FROM dam_users
WHERE userId = '$userId'
AND userPass = '$userPass'";
$result = mysql_query($sql)
or die('Query failed. ' . mysql_error());
if (mysql_num_rows($result) == 1) {
//the user id and password match,
//set the session
$_SESSION['authorized'] = TRUE;
}
}
// Process logout
if (isset($_REQUEST['logout'])) {
unset($_SESSION['authorized']);
}
// Check login
if (isset($_SESSION['authorized'])) {
// Display secure information
?>
<h1>Administration Options</h1>
<ul>
<li><a href="news.php">News items</a></li>
<li><a href="images.php">Images Section</a></li>
<li><a href="video.php">Video Section</a></li>
<li><a href="music.php">Music Section</a></li>
<li><a href="webcam.php">Webcam Section</a></li>
<li><a href="chat.php">Chat Section</a></li>
<li><a href="upload.php">Upload Media</a></li>
<li><a href="search.php">Media Search</a></li>
<li><a href="blog.php">Blog Section</a></li>
</ul>
<p><a href="<?php echo $_SERVER['PHP_SELF']; ?>?logout=1">Log
Out</a></p>
<?php
} else {
// Display login form
?>
<h1>Please log in for access</h1>
<div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<label>User name:
<input type="text" name="username" /></label><br />
<label>Password:
<input type="password" name="password" /></label><br />
<input type="submit" value="Log In" />
</form>
</div>
<?php
}
?>
</body>
</html>
?>
[edit] Week 7 - February 15, 2008
I am still thinking of a good selling point for my project to make it stand out from other similar available product. In the meantime, I have worked with PHP and MySQL to add upload.php and download.php to upload and download media files to and from MySQL database.
<html>
<head>
<TITLE>Upload File to MySQL DB</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.box {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
border: 1px solid #000000;
}
-->
</style>
</head>
<body>
<?
if (isset($_POST['upload']) && $_FILES['userfile']['size'] > 0)
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}
include 'library/config.php';
include 'library/opendb.php';
$query = "INSERT INTO upload (name, size, type, content ) ".
"VALUES ('$fileName', '$fileSize', '$fileType', '$content')";
mysql_query($query) or die('Error, query failed');
include 'library/closedb.php';
echo "<br>File $fileName uploaded<br>";
}
?>
<form action="" method="post" enctype="multipart/form-data" name="uploadform">
<table width="350" border="0" cellpadding="1" cellspacing="1" class="box">
<TR>
<TD width="246"><input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<input name="userfile" type="file" id="userfile">
</TD>
<TD width="80"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></TD>
</TR>
</table>
<a href="login.php">Home</a>
</form>
</body>
</html>
Codes to upload media files into MySQL
[edit] Week 8 - February 22, 2008
A good selling point to my project would be to implement mobile device accessibility. I own a Blackberry cellphone device which doesn't have the capability to upload and download pictures from web applications like Picasa and Flickr. I found a website called itookthisonmyphone.com which comes with a Blackberry application to be loaded on the mobile device to view and upload pictures to that website. Suns has a
<?php
if (isset($_GET['id']))
{
include 'library/config.php';
include 'library/opendb.php';
$id = $_GET['id'];
$query = "SELECT name, type, size, content FROM upload WHERE id = '$id'";
$result = mysql_query($query) or die('Error, query failed');
list($name, $type, $size, $content) = mysql_fetch_array($result);
header("Content-Disposition: attachment; filename=$name");
header("Content-length: $size");
header("Content-type: $type");
echo $content;
include 'library/closedb.php';
exit;
}
?>
<html>
<head>
<TITLE>Download file from MySQL DB</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include 'library/config.php';
include 'library/opendb.php';
$query = "SELECT id, name FROM upload";
$result = mysql_query($query) or die('Error, query failed');
if (mysql_num_rows($result) == 0)
{
echo "Database is empty <br>";
}
else
{
while(list($id, $name) = mysql_fetch_array($result))
{
?>
<a href="download.php?id=<?=$id;?>"><?=$name;?></a> <br>
<?php
}
}
include 'library/closedb.php';
?>
</body>
</html>
download.php codes
[edit] Week 9 - February 29, 2008
[edit] Week 10 - March 7, 2008
[edit] Week 11 - March 14, 2008
[edit] Brief project description
A web/mobile phone application that allows users to upload, access and edit media files such as pictures, videos and music files. A search feature will be implemented to allow quick or detailed search of media files based on metadata. Mobile device (mainly Blackberry) access integration will be implemented for users to be able to upload, view and download their media files. Additional useful features to this application may be implemented to provide better user experience.
[edit] Anticipated users
Users who have large collections of picture, music or video files will be able to gather all their media files into this application. Access to this application will be from any computers (PC, MAC or Linux) users with an internet connection. Users who use their mobile cellular phone built-in camera, video recorder or sound recorder and wish to upload their captured media files on the fly. Users with mobile device that have an internet connection and a built-in web browser and wish to access/view their media files while away from a computer. Users who are interested to share their media collections with other application users or users who chose to set their media collection private for personal use only.
[edit] Main conceptual (i.e., user-level) objects
The primary objects are picture, music and video media files. The mobile device application that will allow users to access and upload media files.
[edit] Primary conceptual (i.e., user-level) operations
The anticipated application will be able to provide users with an account to access their personal media files. A registration web page will allow users to register with an account to access the web application. Once logged in, the user will be able to search through their own media files collection or through media collections that were made available to the web application community. When a query to the specified search is found, the web application displays the results and the user can either view the pictures, stream the videos or stream the sound files. From another web page, the user can choose to upload pictures, music or video files from media type specific forms. The user will have the option to make a final decision on the file format they wish to upload such as file size, dimensions of pictures, re-sampling of sound or video file, etc... The review web page will allow the users to view and stream the uploaded media files and can choose to download them to their computers. From the same web page, the users can also choose to make their media files available for other application users to view and comment.
Users can use the built-in web browser of their mobile device to access the web application and download a mobile phone application and install it onto their devices. The mobile application will be able to access the web application to upload captured picture, music video files to their respective web accounts. From the mobile device web browser, the users can also access their files and chose to download them to their mobile phone.
[edit] Why I am interested in this project
I personally have collections of media files that I would like to be able to access from any computers when I'm not at home. I own a USB flash drive but there is a limitation of how much it can store. I sometimes, want to send photos, videos and music to friends and family but emailing files to them can be inconvenient if the file is too large, or if the file is not immediately on hand. I own a mobile phone and wish to fully utilize its built-in camera and web access capability. While not in front of a computer, I'd like to be able to upload and share my captured media files or review my collections.
[edit] Status
I've introduced myself to PHP web scripting language and created a simple login form to access additional web pages to upload and download picture files. I've used MySql database to build a database to store pictures and additional information about the pictures (eg: file size, file format and file name). I've started to look into ZK project [1] which is an Ajax platform to build web and mobile application.
I'm acknowledging the fact that the requirements that I set for this project are ambitious and may not come to fruition in time to deliver the project. The main requirements that I'd like to complete is the mobile device access application to be able to interact with the web application. Since it is a project that I can see myself using as a tool, I believe that I will keep working on it beyond cs 491b.



