Courses/CS 491ab/Winter 2008/Aditya jamwal
From CSWiki
Hi this is Aditya and Iam interested into web development and computer networks
Contents |
[edit] Week 1 - January 4, 2008
This was the first clas for cs491 had an overview of what we are supposed to be doing in this quater.
Tried to gather information on the project that I am thinking right now to build. My project will be java based application that would use the JDBC and My sql to gather and retrieve the information for the election campaigners.
It would have a gui that looks like a form and the user could update the voter information or retrieve specific information from the database.
[edit] Week 2 - January 11, 2008
For this week and week ahead Fedora is the focus of my research. These are some of the major features and details of Fedora
Fedora is content management software that runs as a web service within an Apache Tomcat web server. Fedora provides the tools and interfaces for creation, ingest, management, and dissemination of content stored within a repository. There are a number of features that distinguish Fedora:
1. It supports the creation and management of digital content objects (from this point on called digital objects) that can aggregate data from multiple sources. For example, a digital object might be a set of tiff images that are the individual page images of a scanned document. The data sources may be either locally managed within the Fedora software or sourced from another URL accessible network server. The data sources may be content or metadata. You may think of these digital objects as advanced digital documents, especially in light of the feature described next.
2. It supports the association of web services with the digital objects. These services typically consume the data packaged within the digital object to produce dynamic disseminations from the digital object. For example, the digital object described above with multiple tiff page images may be associated with a service that OCRs the images that are components of the digital object and disseminates an html version of the pages. The services may be either local to the machine of the respective Fedora server or sourced another network accessible server that is addressable via a URL. In this manner, Fedora acts as a mediation layer that coordinates local and distributed data and web services within a uniform framework. This is illustrated in Figure 1.
3. It provides uniform access web-based interface to these digital objects, through REST requests and more powerful SOAP-based methods. This interface consists of a set of built-in methods to access characteristics common to all digital objects such as key metadata and internal structure. These include a method to introspect on an object to reveal the set of methods that constitute the extended behavior of that object. For example, a client could use these built-in methods to “learn” about the capability of the digital object described above to dynamically disseminate an html page from a set of tiff images. The benefits of these are two-fold:
a. Clients accessing Fedora digital objects can rely on uniform access regardless of the nature of the object.
b. The disseminations available from an object are independent of the internal structure of the object. For example, the client interface of the example above in which html is disseminated from a set of source tiff pages could remain constant regardless of whether the underlying object contained tiff images, jpeg, pdf, or even simple static html. This gives the content developer great freedom to modify a repository’s internals without disrupting the client and user views of the content.
4. It presents a uniform and powerful SOAP-based management interface. All internal operations of the repository such as object creation and management are available through this API, providing the hooks for integrating Fedora into a variety of environments. These makes Fedora useful as the foundation for advanced content management applications
5. It includes a comprehensive versioning framework that tracks the evolution of objects and provides access to earlier versions.
6. It includes a basic relationship framework for representing the links among digital objects.
[edit] Week 3 - January 18, 2008
Fedora Installation
Install Prerequisites Required:
Java SE Development Kit (JDK) 5.0.
Whether installing a binary or source distribution, JDK 5.0 is required. The JDK should be installed on the machine you intend to use as the Fedora server. The JDK is available from http://java.sun.com/.
Optional: Database
The Fedora server is backed in part by a relational database. To simplify installation, the Fedora installer includes and can configure an embedded instance of the McKoi SQL Database 1.0.3. Fedora also supports MySQL, Oracle 9 and PostgreSQL. If the included McKoi database will not be used, another database server must be installed, configured and running before proceeding with the installation. To configure Fedora to use another database, please see the Database section below for further instructions.
The latest version of the software can always be found at
http://www.fedora-commons.org/developers/index.php
'Prepare Environment Variables
The following environment variables must be correctly defined:
JAVA_HOME This should point to the base directory of your Java installation. On Windows systems, this might be C:\java. For UNIX derivatives, this might be something like /usr/local/java-1.5.0-sun
FEDORA_HOME This is the directory where Fedora will be installed, for example, C:\fedora or /usr/local/fedora. PATH This must include the Java and Fedora bin directories. For UNIX derivatives, this will be $FEDORA_HOME/server/bin, $FEDORA_HOME/client/bin and usually $JAVA_HOME/bin. For Windows, this will be %FEDORA_HOME%\server\bin, %FEDORA_HOME%\client\bin and usually %JAVA_HOME%\bin.
If you will be building from source, Ant should also also be on your path.
JAVA_OPTS If Fedora is configured to use SSL, JAVA_OPTS must include the javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword properties. See the SSL section below for more information.
CATALINA_HOME If Fedora is configured to use Tomcat, CATALINA_HOME must be set before starting Fedora. If using the quick install option, CATALINA_HOME should be set to $FEDORA_HOME/tomcat (or %FEDORA_HOME%\tomcat in Windows).
To start the installer, change to the directory where you downloaded the installer and at a command prompt, enter:
java -jar fedora-3.0b1-installer.jar The Fedora Installer provides three installation options: quick, custom, and client.
Running the Fedora Server %FEDORA_HOME%\tomcat\bin\startup.bat
DATABASE
MySQL
Please note that the MySQL JDBC driver provided by the installer requires MySQL v3.23.x or higher.
The MySQL commands listed below can be run within the mysql program, which may be invoked as follows: mysql -u root -p
Create the database. For example, to create a database named fedora30,
Enter:
CREATE DATABASE fedora30;
Set username, password and permissions for the database.
For example, to set the permissions for user fedoraAdmin with password fedoraAdmin on database fedora30,
Enter:
GRANT ALL ON fedora30.* TO fedoraAdmin@localhost IDENTIFIED BY 'fedoraAdmin';
GRANT ALL ON fedora30.* to fedoraAdmin@'%' IDENTIFIED BY 'fedoraAdmin';
Access Fedora
Access the Fedora repository by running the Fedora Administrator interface, fedora-admin, which is located in the FEDORA_HOME/client directory (you can start this program from the command line if you have configured your environment variables properly). Upon starting up the administrator interface you will be presented with the login screen . This document assumes that you have not changed any of the configuration defaults for your Fedora server so the Password you enter should be fedoraAdmin.
[edit] Week 4 - January 25, 2008
Using Fedora to produce dynamic content
The examples described so far demonstrate the basic content aggregation features of Fedora. As mentioned already, the power of Fedora lies in its ability to associate the data in a digital object with web services to produce dynamic disseminations. Some examples of this capability are as follows:
• Rather than packaging multiple formats of a document as in Example 1, it is possible to have a digital object with one datastream in a source format (e.g. TeX) and then associate a service with the digital object to transform the source format into multiple output formats (e.g. pdf and html). An obvious advantage of this is that any changes to the source format propagate out to the derived formats. Furthermore, less content is stored and/or duplicated in the repository.
• Rather than packing multiple metadata XML-based metadata formats in a digital object, it is possible to package a single base metadata format in a digital object (for example, fully qualified Dublin Core) and use that base format as the basis of metadata crosswalks. To do this, one could associate an XSLT engine (e.g. saxon) service with the digital object that processes the base format with a transform XSL document (packaged as a datastream in another digital object) to derive one or more additional formats.
1. Client: Clients make requests for content disseminations through the Fedora Access service APIs (i.e., API-A-LITE and API-A). The uniform interface includes operations for discovering and accessing all disseminations that are available for a particular digital object. A digital object can have both static and dynamic disseminations, which is described below.
2. Fedora APIs: The Fedora repository service is exposed via a uniform set of APIs. Fedora’s API-A and API-A-Lite provide operations (methods) for accessing digital object content. While default mode of accessing digital object directly delivers the datastreams (i.e., repository returns a bitstream for a datastream un-transformed), the CMA enables defining any number of custom services for accessing datastream content. These custom services are produced when the Fedora repository service calls another Web service to transform datastream content. Such transformations can be thought of “virtual” views of digital object content, since these views are created dynamically at runtime.
3. Web Services: These are Web-accessible programs that are invoked by HTTP to produce disseminations of digital object content. Note that the Fedora repository itself is a Web service to access the default services of digital objects. Also, Fedora can interact with other Web service to product custom access services that transform digital object content on-the-fly. In this tutorial we will describe how Fedora interacts simple REST-based services to product such custom services. Custom services are produced when the Fedora repository service itself makes outbound service calls to other Web services using simple REST-based requests. We will not discuss Fedora interacting with SOAP-based web services here.
4. Storage: Digital objects are stored in the Fedora repository service. Datastreams are constituent parts of digital objects – essentially the content streams. Fedora interacts with low-level storage to access digital objects to fulfull client requests for access to content. Datastreams capture the raw content. As shown in the previous examples, datastreams can be directly disseminated via the Fedora Access service. Also, datastreams can serve as input to another custom services that are produced on-the-fly when the Fedora repository service calls upon another Web service at runtime (using a raw datastream as input).
The process of creating digital objects with dynamic content disseminations involves creating linkages between these layers. During this process you will create and employ the following:
• Behavior Definition (or BDef): A digital object that is a template for client-side services, defining a set of abstract operations (methods) and their client-side arguments. Association of a BDefwith a digital object augments the basic behavior of the object with the operations defined in the BDef template. A BDef may be associated with more than one digital object, thereby augmenting all of them with the same operations.
• Behavior Mechanism (or BMech): A digital object that registers within Fedora the capability of web service(s) to perform the operations defined by a specific BDef. This registration includes defining service binding metadata encoded in the Web Service Description Language (WSDL) and also a data profile of the BMech. The data profile defines the types of inputs that are considered compatible with the service. In particular it declares the MIME types that are needed by the respective web service to perform its task. Multiple BMechs may be registered for an individual BDef, thereby exposing a generic client-side interface (defined by the BDef) over multiple data and web service foundations (defined by the BMechs).
• Content Model (or CModel): A digital object that in addition to being used to store information that will allow you to validate whether a data object constitutes a valid object corresponding to that content model. The Content Model is also an important piece for doing disseminations in the Content Model Architecture. A Data Object will indicate which Content model they represent via a special RELS-EXT relationship. The Content Model indicates which BDef (or BDefs) it is associated with (also with a special RELS-EXT relationship).
These three kinds of special Fedora objects are stored in Fedora repositories. The set of all BDefs represents a “registry” of all the kinds of abstract services supported by the Fedora repository. The set of all BMechs represents a “registry” of all the concrete service bindings for the abstract service definitions supported by the Fedora repository. The set of all CModels represent a “registry” of the different user-defined types of data objects that exist in that Fedora repository.
At the end of the day, other digital objects make references to BDefs, BMechs and CModels as the way of providing extended access points for digital objects (i.e., dynamic content disseminations). This is done by adding special relationships between the objects that are stored in the RELS-EXT datastreams of those objects.
[edit] Week 5 - February 1, 2008
Datastreams are versioned whenever modifications are made via API-M
At ingest, each datastream MUST have following attributes:
- ID (required) a unique identifier for the datastream within this object. User can provide it,
or if not provided, the system will assign one.
- STATE (Required) The datastream state can be Active (A), Inactive (I), or Deleted (D)
- CONTROL_GROUP (required) indicates the kind of datastream, either Externally Referenced Content (E),
Redirected Content (R), Managed Content (M) or Inline XML (X)
- MIME (required per version) user-assigned MIME type of the bytestream referred to by the
contentLocation URL
And at ingest, it may have these optional attributes:
- LABEL (optional per version) user-assigned descriptive label for the datastream
- ALT_IDS (optional per version) user-assigned set of alternative identifiers for the datastream, with the identifiers separated by spaces
- FORMAT_URI (optional per version) user-assigned URI used to identify the media type of the bytestream referred to by the contentLocation URL (more specific than MIME type)
- SIZE (optional per version) size of the bytestream referred to by the contentLocation. User can provide it, or Fedora can be configured to calculate it.
The system will assign these attributes (they should not be put in the ingest file): - VERSIONABLE (system-assigned) a true/false indication as to whether the datastream should be versioned by the Fedora repository service. In Fedora 2.0, all datastreams are set to VERSIONABLE="true". In a future release, selective datastream versioning will be enabled and this attribute can then be user-assigned.
- CREATED (system-assigned per version) creation date for the datastream version, to the millisecond *******************************************************************************************************************************************
DATASTREAM (E):
This datastream demonstrates "Externally Referenced Content" (see attribute CONTROL_GROUP=E).
The contentLocation element points to content on a external web server (meaning the content is not under the
custodianship of the Fedora repository). When repository access requests are made for this datastream, the
content bytestream will be mediated by the Fedora repository service, meaning that Fedora will get the content
and return it to the client. The client will not be aware of the true URL of the content. Notice that the datastream
*******************************************************************************************************************************************
-->
- <foxml:datastream CONTROL_GROUP="E" ID="IMAGE" STATE="A" VERSIONABLE="true"> - <foxml:datastreamVersion ID="IMAGE.0" MIMETYPE="image/x-mrsid-image" LABEL="Image of Pavilion III, University of Virginia" CREATED="2004-12-10T00:21:58.000Z">
<foxml:contentLocation REF="http://iris.lib.virginia.edu/mrsid/mrsid_images/iva/archerp01.sid" TYPE="URL" /> </foxml:datastreamVersion> </foxml:datastream>
- - <foxml:datastream CONTROL_GROUP="R" ID="DRAWING-BEST" STATE="A" VERSIONABLE="true"> - <foxml:datastreamVersion ID="DRAWING-BEST.0" MIMETYPE="image/jpeg" LABEL="Architectural Drawing Pavilion III (veryhigh res)" CREATED="2004-12-10T00:21:58.000Z">
<foxml:contentLocation REF="http://icarus.lib.virginia.edu/images/iva/archerd05high.jpg" TYPE="URL" /> </foxml:datastreamVersion> </foxml:datastream>
- - <foxml:datastream CONTROL_GROUP="M" ID="DRAWING-BETTER" STATE="A" VERSIONABLE="true"> - <foxml:datastreamVersion ID="DRAWING-BETTER.0" MIMETYPE="image/jpeg" LABEL="Architectural Drawing Pavilion III (med res)" CREATED="2004-12-10T00:21:58.000Z">
<foxml:contentLocation REF="http://icarus.lib.virginia.edu/images/iva/archerd05medium1.jpg" TYPE="URL" />
-
</foxml:datastreamVersion> </foxml:datastream>
- - <foxml:datastream CONTROL_GROUP="M" ID="DRAWING-ICON" STATE="A" VERSIONABLE="true"> - <foxml:datastreamVersion ID="DRAWING-ICON.0" MIMETYPE="image/jpeg" LABEL="Architectural Drawing Pavilion III" CREATED="2004-12-10T00:21:58.000Z">
<foxml:contentLocation REF="http://icarus.lib.virginia.edu/images/iva/archerd05small.jpg" TYPE="URL" /> </foxml:datastreamVersion>
- <foxml:datastreamVersion ID="DRAWING-ICON.1" MIMETYPE="image/jpeg" LABEL="Architectural Drawing Pavilion III (thumbnail icon)" ALT_IDS="doi:10.1234/123" CREATED="2005-01-20T22:46:07.428Z">
<foxml:contentLocation REF="http://icarus.lib.virginia.edu/images/iva/archerd05small.jpg" TYPE="URL" /> </foxml:datastreamVersion> </foxml:datastream>
- - <foxml:datastream ID="UVATECH" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> - <foxml:datastreamVersion ID="UVATECH.0" MIMETYPE="text/xml" FORMAT_URI="info:fedora/format:xml:uvalibadmin" LABEL="UVA Technical Metadata Record" SIZE="556" CREATED="2004-12-10T00:21:58.000Z"> - <foxml:xmlContent> - <uvalibadmin:admin xmlns:uvalibadmin="http://virginia.lib.edu/uvalibadmin:tech"> - <uvalibadmin:technical>
<uvalibadmin:format>image/jpeg</uvalibadmin:format> <uvalibadmin:compression>LZW</uvalibadmin:compression> <uvalibadmin:bitDepth BITS="" /> <uvalibadmin:colorSpace /> <uvalibadmin:colorProfile CPLOCAT="" CPFILE="" /> <uvalibadmin:resolution>600</uvalibadmin:resolution> </uvalibadmin:technical> </uvalibadmin:admin> </foxml:xmlContent> </foxml:datastreamVersion> </foxml:datastream>
-
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list>
</web-app>
Index.jsp
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <logic:redirect forward="welcome"/>
<%--
Redirect default requests to Welcome global ActionForward. By using a redirect, the user-agent will change address to match the path of our Welcome ActionForward.
--%>
Struts-config.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
</form-beans>
<global-exceptions> </global-exceptions>
<global-forwards>
<forward
name="welcome"
path="/Welcome.do"/>
</global-forwards>
<action-mappings>
<action
path="/Welcome"
forward="/pages/Welcome.jsp"/>
</action-mappings>
<message-resources parameter="MessageResources" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/org/apache/struts/validator/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>
[edit] Week 10 - March 7, 2008
[edit] Final
[edit] Brief project description
This is project that would be implementing the struts frame work in the background which has the MVC architecture.The framework provides its own web Controller component and integrates with other technologies to provide the Model and the View.For the Model, the framework can interact with standard data access technologies, like JDBC and EJB, as well as most any third-party packages, like Hibernate, iBATIS, or Object Relational Bridge. For the View, the framework works well with JavaServer Pages, including JSTL and JSF, as well as Velocity Templates, XSLT, and other presentation systems.
Why is struts important ?
If you need to write a very simple application, with a handful of pages, then you might consider a "Model 1" solution that uses only server pages. But, if you are writing a more complicated application, with dozens of pages, that need to be maintained over time, then Struts can help.It also provides the dynamicity where the developer does not have to write a new java class for every form he or she has ,the controller component could route the request to appropriate java class.
The struts implementation would be a website that would be jobs website where the user would find the jobs and can apply for the jobs.
Goal:
Demonstrate the power of the struts for the MVC architecture.
[edit] Anticipated users
Though my project is not going to be a professional website but the anticipated users would be ...
Users who are looking for the jobs , students looking for internships .
Users who are into website development or people who are doing research on the MVC architecture and want developed live examples working on struts.
[edit] Main conceptual (i.e., user-level) objects
The user will have to fill the form for the job application.Website would have the form beans which would be the user objects that would fetch all the data from the forms
[edit] Primary conceptual (i.e., user-level) operations
The primary operation the user will do is to simply specify the data for their resume. Based on the validation of this data we could maintain the database and email the users back with the jobs that match their resume profile.
[edit] Why I am interested in this project
I want to implement the Power of MVC .I want to extend what ever I have learned in cs320 and utilise the power of jsp,java beans and servlets in more efficient manner
[edit] Status
I currently have the knowledge of MVC as I am working on it with struts.My main aim would be have the database at the back end.

