Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyudmila Balakireva committed Aug 17, 2012
1 parent f7c189f commit 89c83f7
Show file tree
Hide file tree
Showing 368 changed files with 2,126 additions and 1,671 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -19,10 +19,10 @@
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<!-- <organization>
<name>Los Alamos National Security, LLC, Research Library Proto Team </name>
<url>http://library.lanl.gov/</url>
</organization>
</organization> -->
<mailingLists>
<mailingList>
<name>SiteStory Archive Discussion List</name>
Expand Down
287 changes: 287 additions & 0 deletions pom.xml~
@@ -0,0 +1,287 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gov.lanl.archive</groupId>
<version>1.0</version>
<artifactId>sitestory-projects</artifactId>
<packaging>pom</packaging>
<name>SiteStory Web Archive</name>
<description>Open source implementation of the SiteStory Web Archive</description>
<modules>
<module>sitestory-core</module>
<module>sitestory-webapp</module>
<module>tg-redirector</module>
</modules>
<licenses>
<license>
<name>BSD open source software license</name>
<url>LICENSE.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>Los Alamos National Security, LLC, Research Library Proto Team </name>
<url>http://library.lanl.gov/</url>
</organization>
<mailingLists>
<mailingList>
<name>SiteStory Archive Discussion List</name>
<subscribe>
http://groups.google.com/d/forum/sitestory
</subscribe>
<archive>
http://groups.google.com/forum/#!forum/sitestory
</archive>
</mailingList>
</mailingLists>

<developers>
<developer>
<name>Lyudmila Balakireva</name>
<id>ludab</id>
<email>ludab at lanl dot gov</email>
<organization>LANL RL Proto Team </organization>
<url>http://library.lanl.gov/</url>
<timezone>-7</timezone>
</developer>
</developers>
<scm>
<connection>scm:git:https:@github.com:mementoweb/twa.git</connection>
<url>https://github.com/mementoweb/twa</url>
<developerConnection>scm:git:https@github.com:mementoweb/twa.git</developerConnection>
</scm>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<code>javadoc:aggregate</code>
<code>javadoc:test-aggregate</code>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.1</version>
<reportSets>
<reportSet>
<reports>
<!--<report>dependencies</report>-->
<report>project-team</report>
<report>mailing-list</report>
<!--<report>cim</report>-->
<!--<report>issue-tracking</report>-->
<report>license</report>
<!--<report>scm</report>-->
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<distributionManagement>
<!-- <site>
<id> website</id>
<url>file:///megalodon.lanl.gov/home/web/htdocs/TWA/</url>
</site> -->
<repository>
<id>gh-pages</id>
<url>file:///home/ludab/workspace/twa_pages/repository/</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>apache</id>
<name>apache</name>
<url>http://people.apache.org/repo/m2-ibiblio-rsync-repository/</url>
</repository>
</repositories>
<properties>
<!-- <cassandra.basedir>/usr/local/cassandra</cassandra.basedir> -->
<!-- <cages.basedir>/home/ludab/archive_lib</cages.basedir> -->
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>gov.lanl.archive</groupId>
<artifactId>sitestore-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>gov.lanl.archive</groupId>
<artifactId>sitestore</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>


<build>
<plugins>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.5</version>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>site-deploy</phase>
<configuration>
<path>${project.version}</path>
<merge>true</merge>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>target/dep</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin> -->
<!-- Setup the build for JAVA 1.6 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
<debug>true</debug>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>gov.lanl.archive.webapp.ClientTest</mainClass>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.1</version>
<configuration>
<chmod>true</chmod>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-docbook-simple</artifactId>
<version>1.3</version>
</dependency>
<!-- <dependency>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.14</version>
</dependency>
-->
</dependencies>
</plugin>
<!-- <plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.13</version><configuration><xincludeSupported>true</xincludeSupported>
<highlightSource>1</highlightSource>
<foCustomization>${project.basedir}/src/docbkx/styles/pdf/custom.xsl
</foCustomization>
</configuration>
<dependencies>
<dependency>
<groupId>org.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.sf.xslthl</groupId>
<artifactId>xslthl</artifactId>
<version>2.0.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.sf.offo</groupId>
<artifactId>fop-hyph</artifactId>
<version>1.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>generate-html</goal>
<goal>generate-pdf</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<!-- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>download-licenses</id>
<goals>
<goal>download-licenses</goal>
</goals>
</execution>
</executions>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>always</forkMode>
<additionalClasspathElements>
</additionalClasspathElements>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expand Up @@ -919,6 +919,7 @@ public String getLast(String url) {
return lastdate;
}
}


}

Expand Down Expand Up @@ -1012,14 +1013,23 @@ public Memento getMemento(String url,Date date) {
String fdate = getFirst(url);

String ldate = getLast(url);
// System.out.println("first date:"+StringtoDate(fdate));
// System.out.println("last date:"+StringtoDate(ldate));

// log.finest("last:"+StringtoDate(ldate));

//log.finest("first:"+StringtoDate(fdate));
if (fdate==null) {
System.out.println("first date null");
m.setStatuscode(404);
return m;
}

if (ldate==null) {
System.out.println("first date:"+StringtoDate(fdate));
//m.setStatuscode(404);
//return m;
ldate = fdate;
}
if (fdate.equals(ldate)) {
//then just one record and this is memento so
//need just get records from dbrecord
Expand All @@ -1031,16 +1041,7 @@ public Memento getMemento(String url,Date date) {
}

Long datereq = date.getTime();
long l = Long.parseLong(ldate);
if (datereq.longValue()>l ) {
log.finest("outside last");
//out of range so you do not need to look for memento
//make momento the lastdate ;
setMemento( m, ldate, url, fdate,ldate);
addHeaders(m,null);
//may be I can find prev (before last).
return m;
}

long f = Long.parseLong(fdate);
if (datereq.longValue() < f ) {
log.finest("outside first");
Expand All @@ -1051,6 +1052,17 @@ public Memento getMemento(String url,Date date) {
//may be I can find next (after last).
return m;
}
long l = Long.parseLong(ldate);
if (datereq.longValue()>l ) {
log.finest("outside last");
//out of range so you do not need to look for memento
//make momento the lastdate ;
setMemento( m, ldate, url, fdate,ldate);
addHeaders(m,null);
//may be I can find prev (before last).
return m;
}

DatabaseEntry key = new DatabaseEntry(("1|"+url).getBytes("UTF-8"));
String datakey =url+"|"+ Long.toString( date.getTime());
DatabaseEntry data = new DatabaseEntry(datakey.getBytes("UTF-8"));
Expand Down

0 comments on commit 89c83f7

Please sign in to comment.