Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-2159 Ensure that all WebApp files are copied into generated artifacts for 1.X Webapp

Lewis John McGibbney28d9fdab0dac
diff --git a/CHANGES.txt b/CHANGES.txt
index 3427c3439..b0fa00823 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,8 @@ Nutch Change Log
Nutch 1.11 Release 25/10/2015 (dd/mm/yyyy)
Release Report: http://s.apache.org/nutch11
+* NUTCH-2159 Ensure that all WebApp files are copied into generated artifacts for 1.X Webapp (lewismc)
+
* NUTCH-2154 Nutch REST API (DB) suffering NullPointerException (Aron Ahmadia, Sujen Shah via mattmann)
* NUTCH-2150 Add protocolstats utility (Michael Joyce via mattmann)
diff --git a/build.xml b/build.xml
index 857702bc0..70743e7c2 100644
--- a/build.xml
+++ b/build.xml
@@ -104,7 +104,12 @@
deprecation="${javac.deprecation}">
<compilerarg value="-Xlint:-path"/>
<classpath refid="classpath"/>
- </javac>
+ </javac>
+ <copy todir="${build.classes}">
+ <fileset dir="${src.dir}" includes="**/*.html" />
+ <fileset dir="${src.dir}" includes="**/*.css" />
+ <fileset dir="${src.dir}" includes="**/*.properties" />
+ </copy>
</target>
<target name="compile-plugins" depends="init, resolve-default" description="--> compile plugins only">
diff --git a/src/java/org/apache/nutch/tools/CommonCrawlDataDumper.java b/src/java/org/apache/nutch/tools/CommonCrawlDataDumper.java
index 4663bfe13..87d1db80e 100644
--- a/src/java/org/apache/nutch/tools/CommonCrawlDataDumper.java
+++ b/src/java/org/apache/nutch/tools/CommonCrawlDataDumper.java
@@ -330,7 +330,7 @@ public class CommonCrawlDataDumper extends Configured implements Tool {
reverseKey = reverseUrl(url);
config.setReverseKeyValue(
- reverseKey.replace("/", "_") + "_" + DigestUtils.shaHex(url)
+ reverseKey.replace("/", "_") + "_" + DigestUtils.sha1Hex(url)
+ "_" + timestamp);
}
diff --git a/src/java/org/apache/nutch/util/DumpFileUtil.java b/src/java/org/apache/nutch/util/DumpFileUtil.java
index c2287663b..9ed3e75a3 100644
--- a/src/java/org/apache/nutch/util/DumpFileUtil.java
+++ b/src/java/org/apache/nutch/util/DumpFileUtil.java
@@ -89,7 +89,7 @@ public class DumpFileUtil {
}
public static String createFileNameFromUrl(String basePath, String reverseKey, String urlString, String epochScrapeTime, String fileExtension, boolean makeDir) {
- String fullDirPath = basePath + File.separator + reverseKey + File.separator + DigestUtils.shaHex(urlString);
+ String fullDirPath = basePath + File.separator + reverseKey + File.separator + DigestUtils.sha1Hex(urlString);
if (makeDir) {
try {
diff --git a/src/java/org/apache/nutch/webui/pages/AbstractBasePage.java b/src/java/org/apache/nutch/webui/pages/AbstractBasePage.java
index 22b851ce0..5611d7404 100644
--- a/src/java/org/apache/nutch/webui/pages/AbstractBasePage.java
+++ b/src/java/org/apache/nutch/webui/pages/AbstractBasePage.java
@@ -57,6 +57,11 @@ import de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarDropDownBut
import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconType;
public abstract class AbstractBasePage<T> extends GenericWebPage<T> {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@SpringBean
private NutchService service;
@@ -105,6 +110,11 @@ public abstract class AbstractBasePage<T> extends GenericWebPage<T> {
protected Component addUserMenu() {
DropDownButton userMenu = new NavbarDropDownButton(Model.of("Username")) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Override
protected List<AbstractLink> newSubMenuButtons(final String buttonMarkupId) {
List<AbstractLink> subMenu = Lists.newArrayList();
@@ -125,6 +135,11 @@ public abstract class AbstractBasePage<T> extends GenericWebPage<T> {
IModel<String> instanceName = PropertyModel.of(currentInstance, "name");
DropDownButton instancesMenu = new NavbarDropDownButton(instanceName) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Override
protected List<AbstractLink> newSubMenuButtons(String buttonMarkupId) {
List<NutchInstance> instances = instanceService.getInstances();
@@ -132,6 +147,11 @@ public abstract class AbstractBasePage<T> extends GenericWebPage<T> {
for (NutchInstance instance : instances) {
subMenu.add(new Link<NutchInstance>(buttonMarkupId, Model
.of(instance)) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Override
public void onClick() {
currentInstance.setObject(getModelObject());
@@ -159,6 +179,11 @@ public abstract class AbstractBasePage<T> extends GenericWebPage<T> {
private class InstanceModel extends LoadableDetachableModel<NutchInstance> {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Override
public void setObject(NutchInstance instance) {
super.setObject(instance);
diff --git a/src/java/org/apache/nutch/webui/pages/DashboardPage.java b/src/java/org/apache/nutch/webui/pages/DashboardPage.java
index e370d6e20..50586b9ed 100644
--- a/src/java/org/apache/nutch/webui/pages/DashboardPage.java
+++ b/src/java/org/apache/nutch/webui/pages/DashboardPage.java
@@ -29,6 +29,11 @@ import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.util.time.Duration;
public class DashboardPage extends AbstractBasePage<Object> {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@SpringBean
private NutchService nutchService;
@@ -41,10 +46,14 @@ public class DashboardPage extends AbstractBasePage<Object> {
panel.add(new Label("jobsRunning", new JobsModel()));
add(panel);
add(new BookmarkablePageLink<Void>("viewInstances", InstancesPage.class));
-
}
private class JobsModel extends LoadableDetachableModel<Integer> {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
@Override
protected Integer load() {
NutchInstance currentInstance = getCurrentInstance();
diff --git a/src/java/org/apache/nutch/webui/pages/instances/InstancesPage.java b/src/java/org/apache/nutch/webui/pages/instances/InstancesPage.java
index 10db153da..62b780641 100644
--- a/src/java/org/apache/nutch/webui/pages/instances/InstancesPage.java
+++ b/src/java/org/apache/nutch/webui/pages/instances/InstancesPage.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.nutch.webui.pages.instances;
import static de.agilecoders.wicket.core.markup.html.bootstrap.block.LabelType.Danger;
diff --git a/src/java/org/apache/nutch/webui/pages/menu/VerticalMenu.java b/src/java/org/apache/nutch/webui/pages/menu/VerticalMenu.java
index 9783d47eb..bcdaa4dc5 100644
--- a/src/java/org/apache/nutch/webui/pages/menu/VerticalMenu.java
+++ b/src/java/org/apache/nutch/webui/pages/menu/VerticalMenu.java
@@ -22,7 +22,6 @@ public class VerticalMenu extends Navbar {
public VerticalMenu(String componentId) {
super(componentId);
- // TODO Auto-generated constructor stub
}
}