Skip to content

Commit

Permalink
个性化recommender all code
Browse files Browse the repository at this point in the history
  • Loading branch information
zjnxyz committed Jan 25, 2013
0 parents commit 996be2d
Show file tree
Hide file tree
Showing 117 changed files with 5,685 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="melibrary.com.genuitec.eclipse.j2eedt.core.MYECLIPSE_JAVAEE_6_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>
13 changes: 13 additions & 0 deletions .mymetadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-module
type="WEB"
name="MovieSite3"
id="myeclipse.1339168206675"
context-root="/MovieSite3"
j2ee-spec="6.0"
archive="MovieSite3.war">
<attributes>
<attribute name="webrootdir" value="WebRoot" />
</attributes>
</project-module>

58 changes: 58 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MovieSite3</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>
12 changes: 12 additions & 0 deletions .settings/.jsdtscope
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
8 changes: 8 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Fri Jun 08 23:10:08 CST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
10 changes: 10 additions & 0 deletions .settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="MovieSite3">
<wb-resource deploy-path="/" source-path="/WebRoot"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/test"/>
<property name="context-root" value="/MovieSite3"/>
<property name="java-output-path" value="/MovieSite3/WebRoot/WEB-INF/classes"/>
</wb-module>
</project-modules>
7 changes: 7 additions & 0 deletions .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
1 change: 1 addition & 0 deletions .settings/org.eclipse.wst.jsdt.ui.superType.container
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
1 change: 1 addition & 0 deletions .settings/org.eclipse.wst.jsdt.ui.superType.name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Window
3 changes: 3 additions & 0 deletions WebRoot/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

Binary file added WebRoot/WEB-INF/classes/zjn/dao/MovieDao.class
Binary file not shown.
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/dao/PrefileDao.class
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/dao/RatingDao.class
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/dao/UserDao.class
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/init/DataTest.class
Binary file not shown.
40 changes: 40 additions & 0 deletions WebRoot/WEB-INF/classes/zjn/init/tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
CREATE TABLE movies (
id INTEGER NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
type varchar(100) default NULL,
PRIMARY KEY (id)
);

CREATE TABLE users (
id INTEGER NOT NULL AUTO_INCREMENT,
name varchar(50) NOT NULL,
sex varchar(4) default NULL,
hobby varchar(100) default NULL,
PRIMARY KEY (id)
);

CREATE TABLE prefile (
movieID INTEGER NOT NULL AUTO_INCREMENT,
sex varchar(4) default NULL,
PRIMARY KEY (movieID)
);

CREATE TABLE movie_preferences (
userID INTEGER NOT NULL,
movieID INTEGER NOT NULL,
preference INTEGER NOT NULL DEFAULT 0,
FOREIGN KEY (userID) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (movieID) REFERENCES movies(id) ON DELETE CASCADE
);

CREATE TABLE movie_similarity (
movieID1 INTEGER NOT NULL,
movieID2 INTEGER NOT NULL,
similarity DOUBLE NOT NULL DEFAULT 0,
FOREIGN KEY (movieID1) REFERENCES movies(id) ON DELETE CASCADE,
FOREIGN KEY (movieID2) REFERENCES movies(id) ON DELETE CASCADE
);

CREATE INDEX movie_preferences_index1 ON movie_preferences ( userID , movieID );
CREATE INDEX movie_preferences_index2 ON movie_preferences ( userID );
CREATE INDEX movie_preferences_index3 ON movie_preferences ( movieID );
Binary file added WebRoot/WEB-INF/classes/zjn/model/Movie.class
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/model/MovieList.class
Binary file not shown.
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/model/Prefile.class
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/model/Rating.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/model/User.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/util/DBUtil.class
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/util/FactoryBean.class
Binary file not shown.
Binary file not shown.
Binary file added WebRoot/WEB-INF/classes/zjn/util/StringUtil.class
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions WebRoot/WEB-INF/classes/zjn/util/db.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
driver=org.gjt.mm.mysql.Driver
url=jdbc\:mysql\://127.0.0.1/moviedb
userName=root
pwd=root
140 changes: 140 additions & 0 deletions WebRoot/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/movie</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<servlet>
<servlet-name>axis</servlet-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>UserLoginServlet</servlet-name>
<servlet-class>zjn.servlet.UserLoginServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>MovieServlet</servlet-name>
<servlet-class>zjn.servlet.MovieServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>MovieRecommenderServlet</servlet-name>
<servlet-class>zjn.servlet.MovieRecommenderServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>UserRegisterServlet</servlet-name>
<servlet-class>zjn.servlet.UserRegisterServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>AnonymousRecommenderServlet</servlet-name>
<servlet-class>zjn.servlet.AnonymousRecommenderServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>MovieShowServlet</servlet-name>
<servlet-class>zjn.servlet.MovieShowServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>SimilarItemsRecommenderServlet</servlet-name>
<servlet-class>zjn.servlet.SimilarItemsRecommenderServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>MovieRatingServlet</servlet-name>
<servlet-class>zjn.servlet.MovieRatingServlet</servlet-class>
</servlet>






<filter>
<filter-name>characterFilter</filter-name>
<filter-class>zjn.util.CharacterFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<servlet-mapping>
<servlet-name>axis</servlet-name>
<url-pattern>*.jws</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>UserLoginServlet</servlet-name>
<url-pattern>/UserLoginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MovieServlet</servlet-name>
<url-pattern>/MovieServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MovieRecommenderServlet</servlet-name>
<url-pattern>/MovieRecommenderServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>UserRegisterServlet</servlet-name>
<url-pattern>/UserRegisterServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AnonymousRecommenderServlet</servlet-name>
<url-pattern>/AnonymousRecommenderServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MovieShowServlet</servlet-name>
<url-pattern>/MovieShowServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimilarItemsRecommenderServlet</servlet-name>
<url-pattern>/SimilarItemsRecommenderServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MovieRatingServlet</servlet-name>
<url-pattern>/MovieRatingServlet</url-pattern>
</servlet-mapping>


<!-- The rest of the config is adapted from Axis's default web app -->

<session-config>
<session-timeout>5</session-timeout>
</session-config>

<!-- currently the W3C havent settled on a media type for WSDL;
http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
for now we go with the basic 'it's XML' response -->
<mime-mapping>
<extension>wsdl</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xsd</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>


</web-app>
Binary file added WebRoot/images/dashed.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WebRoot/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 996be2d

Please sign in to comment.