Move modules to attic
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1811949 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webloader/README.txt b/webloader/README.txt
deleted file mode 100644
index 442ef0d..0000000
--- a/webloader/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-----------------------
-Sling Webloader sample
-----------------------
-This sample consists of two separate bundles: a "service" bundle, written in
-java, implements the content loading, and the "ui" bundle implements a scripted
-front-end to that service.
-
-More details in the bundle's source code folders, under this folder.
diff --git a/webloader/service/LICENSE b/webloader/service/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/webloader/service/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/webloader/service/NOTICE b/webloader/service/NOTICE
deleted file mode 100644
index 17a76f3..0000000
--- a/webloader/service/NOTICE
+++ /dev/null
@@ -1,9 +0,0 @@
-Apache Sling Webloader Sample Service
-Copyright 2008-2009 The Apache Software Foundation
-
-Apache Sling is based on source code originally developed
-by Day Software (http://www.day.com/).
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/webloader/service/README.md b/webloader/service/README.md
deleted file mode 100644
index 4cdeb3c..0000000
--- a/webloader/service/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Apache Sling Samples Webloader Service
-
-This module is part of the [Apache Sling](https://sling.apache.org) project.
-
-
-Sling Webloader sample - OSGi service
----------------------------------------
-This is the service component of the Webloader sample, this bundle provides
-a service according to the org.apache.sling.samples.webloader.Webloader
-interface.
-
-The sibling "webloader.ui" bundle provides an example user interface.
-
-Running the demo
-================
-
-For details on running this demo, see the Webloader UI component README.txt
diff --git a/webloader/service/pom.xml b/webloader/service/pom.xml
deleted file mode 100644
index e3df6bf..0000000
--- a/webloader/service/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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.
--->
-<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/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>26</version>
- <relativePath/>
- </parent>
-
- <groupId>org.apache.sling.samples</groupId>
- <artifactId>org.apache.sling.samples.webloader.service</artifactId>
- <packaging>bundle</packaging>
- <version>2.0.3-SNAPSHOT</version>
-
- <name>Apache Sling Samples Webloader Service</name>
- <description>
- Sample OSGi service that retrieves documents from the Web using a Google
- search, and stores them into the repository.
- </description>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/samples/webloader/service</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/samples/webloader/service</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/samples/webloader/service</url>
- </scm>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.sling.samples.webloader;version=${project.version}
- </Export-Package>
- <Private-Package>
- org.apache.sling.samples.webloader.internal
- </Private-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <excludePackageNames>
- org.apache.sling.samples.webloader.internal
- </excludePackageNames>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.api</artifactId>
- <version>2.0.8</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.jcr.api</artifactId>
- <version>2.0.6</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.jcr</groupId>
- <artifactId>jcr</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.mime</artifactId>
- <version>2.0.2-incubator</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr.annotations</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/webloader/service/src/main/java/org/apache/sling/samples/webloader/Webloader.java b/webloader/service/src/main/java/org/apache/sling/samples/webloader/Webloader.java
deleted file mode 100644
index df69584..0000000
--- a/webloader/service/src/main/java/org/apache/sling/samples/webloader/Webloader.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.sling.samples.webloader;
-
-/** Gets documents from the Web via a Google query, and stores them into the
- * repository. The service interface is designed to be easy to use from Sling
- * scripts.
- */
-public interface Webloader {
- /** Create a new job that loads documents in the repository, and start
- * it immediately
- * @return the job ID
- * @param webQuery used to Google for documents to retrieve
- * @param storagePath documents are stored under this path in the repository
- * @param fileExtensions comma-separated list of extensions , each one
- * is passed in turn to Google as a "filetype:" search option
- * @param maxDocsToRetrieve up to this many documents are stored
- * @param maxDocSizeInKb documents over this size are ignored, to speed up the process
- */
- String createJob(String webQuery, String storagePath,
- String fileExtensions, int maxDocsToRetrieve, int maxDocSizeInKb);
-
- /** Get the status of a job given its ID
- * @return null if the job doesn't exist
- */
- WebloaderJobStatus getJobStatus(String jobId);
-}
diff --git a/webloader/service/src/main/java/org/apache/sling/samples/webloader/WebloaderException.java b/webloader/service/src/main/java/org/apache/sling/samples/webloader/WebloaderException.java
deleted file mode 100644
index 4a44d47..0000000
--- a/webloader/service/src/main/java/org/apache/sling/samples/webloader/WebloaderException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.sling.samples.webloader;
-
-import org.apache.sling.api.SlingException;
-
-/** Webloader-specific exception */
-@SuppressWarnings("serial")
-public class WebloaderException extends SlingException {
- public WebloaderException(String reason) {
- super(reason);
- }
-
- public WebloaderException(String reason, Throwable cause) {
- super(reason, cause);
- }
-}
diff --git a/webloader/service/src/main/java/org/apache/sling/samples/webloader/WebloaderJobStatus.java b/webloader/service/src/main/java/org/apache/sling/samples/webloader/WebloaderJobStatus.java
deleted file mode 100644
index ca8dbbf..0000000
--- a/webloader/service/src/main/java/org/apache/sling/samples/webloader/WebloaderJobStatus.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.sling.samples.webloader;
-
-/** Provides status information about a Webloader job */
-public interface WebloaderJobStatus {
-
- /** Is this job still running? */
- boolean isRunning();
-
- /** @return the error cause if the job aborted */
- Throwable getError();
-
- /** Get the "main" status info, like "loading document foo.pdf"... */
- String getStatusInfo();
-
- /** Get status details, like "19234 bytes loaded" */
- String getStatusDetails();
-
- /** How many documents loaded by this job already? */
- int getNumberOfDocumentsLoaded();
-}
diff --git a/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/ProgressInputStream.java b/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/ProgressInputStream.java
deleted file mode 100644
index d90291f..0000000
--- a/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/ProgressInputStream.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.sling.samples.webloader.internal;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/** InputStream that calls reportProgress during each read() call */
-public class ProgressInputStream extends FilterInputStream {
-
- private final int length;
-
- public ProgressInputStream(InputStream in, int length) {
- super(in);
- this.length = length;
- }
-
- public int read() throws IOException {
- int r = super.read();
- reportProgress(r, length);
- return r;
- }
-
- public int read(byte b[]) throws IOException {
- int r = super.read(b);
- reportProgress(r, length);
- return r;
- }
-
- public int read(byte b[], int off, int len) throws IOException {
- int r = super.read(b, off, len);
- reportProgress(r, length);
- return r;
- }
-
- protected void reportProgress(int bytesRead, int totalBytesToRead) {
- }
-}
diff --git a/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java b/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java
deleted file mode 100644
index 9f60218..0000000
--- a/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebLoaderImpl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.sling.samples.webloader.internal;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.commons.mime.MimeTypeService;
-import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.samples.webloader.Webloader;
-import org.apache.sling.samples.webloader.WebloaderJobStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Webloader implementation, manages WebloaderJobs
- *
- */
-@Component(immediate=true)
-@Service
-@Property(name="service.description", value="Sling Webloader service")
-public class WebLoaderImpl implements Webloader {
-
- private static final Logger log = LoggerFactory.getLogger(WebLoaderImpl.class);
-
- private final Map<String, WebloaderJob> jobs = new HashMap<String, WebloaderJob>();
-
- @Reference
- private SlingRepository repository;
-
- @Reference
- private MimeTypeService mimeTypeService;
-
- /** @inheritDoc */
- public String createJob(String webQuery, String storagePath, String
- fileExtensions, int maxDocsToRetrieve, int maxDocSizeInKb) {
- deleteFinishedJobs();
- final WebloaderJob j = new WebloaderJob(repository, mimeTypeService,
- webQuery, storagePath, fileExtensions, maxDocsToRetrieve, maxDocSizeInKb);
- synchronized (jobs) {
- jobs.put(j.getJobId(), j);
- }
- log.info("Created job {}", j);
- return j.getJobId();
- }
-
- /** @inheritDoc */
- public WebloaderJobStatus getJobStatus(String jobId) {
- return jobs.get(jobId);
- }
-
- /** Remove finished jobs from our list of jobs */
- protected void deleteFinishedJobs() {
- final List<WebloaderJob> toDelete = new LinkedList<WebloaderJob>();
- for(WebloaderJob j : jobs.values()) {
- if(!j.isRunning()) {
- toDelete.add(j);
- }
- }
-
- synchronized (jobs) {
- for(WebloaderJob j : toDelete) {
- jobs.remove(j.getJobId());
- }
- }
- }
-
-}
diff --git a/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebloaderJob.java b/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebloaderJob.java
deleted file mode 100644
index aad90da..0000000
--- a/webloader/service/src/main/java/org/apache/sling/samples/webloader/internal/WebloaderJob.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * 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.sling.samples.webloader.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jcr.Item;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.HTMLDocument;
-import javax.swing.text.html.HTMLEditorKit;
-
-import org.apache.sling.commons.mime.MimeTypeService;
-import org.apache.sling.samples.webloader.WebloaderException;
-import org.apache.sling.samples.webloader.WebloaderJobStatus;
-import org.apache.sling.jcr.api.SlingRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/** A Webloader job, manages retrieval of documents from the web and storage
- * in the Sling repository. This code is based on the "populate.jsp" example
- * of the jackrabbit-webapp module.
- */
-class WebloaderJob extends Thread implements WebloaderJobStatus {
- private Throwable error;
- private int numDocsLoaded;
- private final int maxDocsToRetrieve;
- private final int maxDocSize;
- private String statusInfo = "initialized";
- private String statusDetails = "";
- private boolean running = true;
- private final String jobId;
- private final String webQuery;
- private String storagePath;
- private final SlingRepository repository;
- private final MimeTypeService mimeTypeService;
- private Session session;
- private Node storageRoot;
- private static int idCounter;
- private final String [] filetypes;
-
- public static final String [] DEFAULT_FILETYPES = { "pdf", "rtf", "ppt", "doc", "xls" };
- public static final int URL_RETRIEVE_TIMEOUT_SECONDS = 10;
-
- private static final Logger log = LoggerFactory.getLogger(WebloaderJob.class);
-
- @SuppressWarnings("serial")
- static class DocTooBigException extends IOException {
- DocTooBigException(URL url, int size) {
- super("Document at URL " + url + " too big (" + size + " bytes), will be ignored");
- }
- }
-
- WebloaderJob(SlingRepository repository, MimeTypeService mimeTypeService,
- String webQuery, String storagePath, String fileExtensions, int maxDocsToRetrieve, int maxDocSize) {
- synchronized (WebloaderJob.class) {
- jobId = String.valueOf(idCounter++);
- }
-
- this.repository = repository;
- this.mimeTypeService = mimeTypeService;
- this.webQuery = webQuery;
- this.storagePath = storagePath;
- this.maxDocsToRetrieve = maxDocsToRetrieve;
- this.maxDocSize = maxDocSize;
-
- final String [] ft = fileExtensions == null ? null : fileExtensions.split(",");
- if(ft!=null && ft.length > 0) {
- filetypes = new String[ft.length];
- for(int i=0; i < ft.length; i++) {
- filetypes[i] = ft[i].trim().toLowerCase();
- }
- } else {
- filetypes = DEFAULT_FILETYPES;
- }
-
- if(mimeTypeService == null) {
- throw new WebloaderException("Missing MimeTypeService");
- }
- if(repository == null) {
- throw new WebloaderException("Missing Repository");
- }
-
- setDaemon(true);
- start();
- }
-
- @Override
- public String toString() {
- final StringBuffer sb = new StringBuffer();
- for(String str : filetypes) {
- if(sb.length() > 0) {
- sb.append(",");
- }
- sb.append(str);
- }
-
- return getClass().getSimpleName() + ", webQuery=" + webQuery
- + ", storagePath=" + storagePath
- + ", fileTypes=" + sb.toString()
- + ", maxDocsToRetrieve=" + maxDocsToRetrieve
- + ", maxDocSize=" + maxDocSize
- ;
- }
-
- @Override
- public void run() {
- log.debug("Job thread starting: {}", this);
-
- // TODO should use a session provided by client, but can we use it
- // safely for our async job?
- session = null;
-
- if(storagePath.charAt(0) == '/') {
- storagePath = storagePath.substring(1);
- }
- final String absStoragePath = "/" + storagePath;
-
- try {
- session = repository.loginAdministrative(null);
- if(session.itemExists(absStoragePath)) {
- final Item i = session.getItem(absStoragePath);
- if(i.isNode()) {
- storageRoot = (Node)i;
- } else {
- throw new WebloaderException("Item at " + storagePath + " is not a Node");
- }
- } else {
- // TODO deep-create hierarchy if needed
- storageRoot = session.getRootNode().addNode(storagePath);
- session.save();
- }
-
- int offset = 0;
- for(String type : filetypes) {
- final URL[] urls = getDocumentUrlsFromGoogle(type, offset);
- for(URL url : urls) {
- try {
- getAndStoreDocument(url);
- session.save();
- numDocsLoaded++;
- if(numDocsLoaded >= maxDocsToRetrieve) {
- break;
- }
- } catch(DocTooBigException dtb) {
- log.info(dtb.getMessage());
- } catch(Exception e) {
- log.warn("Exception while retrieving url " + url, e);
- } finally {
- session.refresh(false);
- }
- }
- offset += 10;
-
- if(numDocsLoaded >= maxDocsToRetrieve) {
- break;
- }
- }
-
- statusInfo = "All done.";
-
- } catch(Exception e) {
- error = e;
- log.warn("Exception in WebloaderJob.run()", e);
- statusInfo = "Exception while running job: " + e;
-
- } finally {
- if(session != null) {
- session.logout();
- }
- statusDetails = "";
- running = false;
- }
-
- if(numDocsLoaded >= maxDocsToRetrieve) {
- log.info("Stopped after retrieving maximum number of documents ({})", maxDocsToRetrieve);
- }
-
- log.info("Job thread ends: {}, {} documents loaded", this, numDocsLoaded);
- }
-
- private URL [] getDocumentUrlsFromGoogle(String currentFiletype, int start) throws IOException, BadLocationException {
- final List urls = new ArrayList();
- String query = webQuery + " filetype:" + currentFiletype;
- final URL google = new URL("http://www.google.com/search?q=" +
- URLEncoder.encode(query, "UTF-8") + "&start=" + start);
- log.debug("Querying {}", google.toString());
- statusInfo = "Querying " + google.toString();
- statusDetails = "";
- URLConnection con = google.openConnection();
- con.setRequestProperty("User-Agent", "");
- InputStream in = con.getInputStream();
- try {
- HTMLEditorKit kit = new HTMLEditorKit();
- HTMLDocument doc = new HTMLDocument();
- doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
- kit.read(new InputStreamReader(in, "UTF-8"), doc, 0);
- HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
- while (it.isValid()) {
- if(it.getAttributes() != null) {
- String href = (String) it.getAttributes().getAttribute(HTML.Attribute.HREF);
- if (href != null && href.endsWith("." + currentFiletype)) {
- URL url = new URL(new URL("http", "www.google.com", "dummy"), href);
- if (url.getHost().indexOf("google") == -1) {
- log.debug("Got document URL from google: {}", url);
- statusDetails = "Got URL " + url;
- urls.add(url);
- }
- }
- }
- it.next();
- }
- } finally {
- in.close();
- }
- return (URL[]) urls.toArray(new URL[urls.size()]);
-
- }
-
- private void getAndStoreDocument(URL currentURL) throws RepositoryException, IOException {
-
- statusInfo = "Retrieving document " + currentURL;
- statusDetails = "";
-
- // build JCR path for storing document, based on its URL
- String path = currentURL.getPath();
- if (path.startsWith("/")) {
- path = path.substring(1);
- }
- final String host = currentURL.getHost();
- final List folderNames = new ArrayList();
- folderNames.addAll(Arrays.asList(host.split("\\.")));
- Collections.reverse(folderNames);
- folderNames.addAll(Arrays.asList(path.split("/", 0)));
- final String filename = URLDecoder.decode((String) folderNames.remove(folderNames.size() - 1), "UTF-8").replaceAll(":", "_");
- Node node = storageRoot;
- for (Iterator fn = folderNames.iterator(); fn.hasNext(); ) {
- String name = URLDecoder.decode((String) fn.next(), "UTF-8");
- name = name.replaceAll(":", "_");
- if (name.length() == 0) {
- continue;
- }
- if (!node.hasNode(name)) {
- node.addNode(name, "nt:folder");
- }
- node = node.getNode(name);
- }
-
- log.debug("Retrieving document {}, will be stored at {}", currentURL, node.getPath() + "/" + filename);
-
- if (!node.hasNode(filename)) {
- Node file = node.addNode(filename, "nt:file");
- final Node resource = file.addNode("jcr:content", "nt:resource");
- getAndStoreContent(currentURL, resource, filename);
- }
-
- }
-
- private void getAndStoreContent(URL currentURL, Node resource, String filename)
- throws RepositoryException, IOException {
- statusInfo = "Retrieving content from " + currentURL;
- statusDetails = "";
-
- final URLConnection con = currentURL.openConnection();
- con.setReadTimeout(URL_RETRIEVE_TIMEOUT_SECONDS * 1000);
- InputStream in = con.getInputStream();
- try {
- // Read with a ProgressInputStream, so that our status is updated while
- // downloading
- int length = con.getContentLength();
- if (length != -1) {
- if(length > maxDocSize * 1024) {
- throw new DocTooBigException(currentURL, length);
- }
- in = new ProgressInputStream(in, length) {
- int nextReport = 0;
- protected void reportProgress(int bytesRead, int totalBytesToRead) {
- if(bytesRead > nextReport) {
- nextReport += 1024;
- statusDetails = "Downloaded " + bytesRead + " bytes out of " + totalBytesToRead;
- }
- }
- };
- }
-
- resource.setProperty("jcr:data", in);
- final String mimeType = mimeTypeService.getMimeType(filename);
- resource.setProperty("jcr:mimeType", mimeType);
- final Calendar lastModified = Calendar.getInstance();
- lastModified.setTimeInMillis(con.getLastModified());
- resource.setProperty("jcr:lastModified", lastModified);
- } finally {
- if(in != null) {
- in.close();
- }
- }
- }
-
- String getJobId() {
- return jobId;
- }
-
- /** {@inheritDoc} */
- public Throwable getError() {
- return error;
- }
-
- /** {@inheritDoc} */
- public int getNumberOfDocumentsLoaded() {
- return numDocsLoaded;
- }
-
- /** {@inheritDoc} */
- public String getStatusInfo() {
- return statusInfo;
- }
-
- /** {@inheritDoc} */
- public String getStatusDetails() {
- return statusDetails;
- }
-
- /** {@inheritDoc} */
- public boolean isRunning() {
- return running;
- }
-
-}
diff --git a/webloader/service/src/main/resources/META-INF/LICENSE b/webloader/service/src/main/resources/META-INF/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/webloader/service/src/main/resources/META-INF/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/webloader/service/src/main/resources/META-INF/NOTICE b/webloader/service/src/main/resources/META-INF/NOTICE
deleted file mode 100644
index 17a76f3..0000000
--- a/webloader/service/src/main/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,9 +0,0 @@
-Apache Sling Webloader Sample Service
-Copyright 2008-2009 The Apache Software Foundation
-
-Apache Sling is based on source code originally developed
-by Day Software (http://www.day.com/).
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/webloader/ui/LICENSE b/webloader/ui/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/webloader/ui/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/webloader/ui/NOTICE b/webloader/ui/NOTICE
deleted file mode 100644
index 947a64d..0000000
--- a/webloader/ui/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Sling Webloader Sample Service UI
-Copyright 2008-2009 The Apache Software Foundation
-
-Apache Sling is based on source code originally developed
-by Day Software (http://www.day.com/).
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/webloader/ui/README.md b/webloader/ui/README.md
deleted file mode 100644
index ec298a5..0000000
--- a/webloader/ui/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# Apache Sling Samples Webloader User Interface
-
-This module is part of the [Apache Sling](https://sling.apache.org) project.
-
-## Sling Webloader sample - user interface
-
-This bundle provides a sample web user interface for the Webloader Service,
-which id provided by the sibling "webloader.service" bundle.
-
-The demo bundles can be deployed through Maven using the following commands:
-
-Deploy the Webloader Service bundle running the following command in
-the samples/webloader/service directory:
- mvn install -P autoInstallBundle
-then deploy the Webloader UI bundle by running the following command in
-the samples/webloader/ui directory:
- mvn install -P autoInstallBundle
-
-When deployed, the webloader can be accessed by navigating to:
- http://localhost:8080/bin/sling/webloader.html
-This should display the "Sling Webloader" page, that gives access to
-the Webloader service.
diff --git a/webloader/ui/pom.xml b/webloader/ui/pom.xml
deleted file mode 100644
index ad9c914..0000000
--- a/webloader/ui/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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.
--->
-<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/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>26</version>
- <relativePath/>
- </parent>
-
- <groupId>org.apache.sling.samples</groupId>
- <artifactId>org.apache.sling.samples.webloader.ui</artifactId>
- <packaging>bundle</packaging>
- <version>2.0.3-SNAPSHOT</version>
-
- <name>Apache Sling Samples Webloader User Interface</name>
- <description>
- Simple user interface for the Sling Webloader service.
- </description>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/samples/webloader/ui</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/samples/webloader/ui</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/samples/webloader/ui</url>
- </scm>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Sling-Initial-Content>
- initial-content
- </Sling-Initial-Content>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <!-- No javadocs -->
- <excludePackageNames>
- org.apache.sling
- </excludePackageNames>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr.annotations</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/webloader/ui/src/main/resources/META-INF/LICENSE b/webloader/ui/src/main/resources/META-INF/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/webloader/ui/src/main/resources/META-INF/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/webloader/ui/src/main/resources/META-INF/NOTICE b/webloader/ui/src/main/resources/META-INF/NOTICE
deleted file mode 100644
index 947a64d..0000000
--- a/webloader/ui/src/main/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Sling Webloader Sample Service UI
-Copyright 2008-2009 The Apache Software Foundation
-
-Apache Sling is based on source code originally developed
-by Day Software (http://www.day.com/).
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/webloader/ui/src/main/resources/initial-content/apps/sling/webloader/POST.esp b/webloader/ui/src/main/resources/initial-content/apps/sling/webloader/POST.esp
deleted file mode 100644
index 49e3f16..0000000
--- a/webloader/ui/src/main/resources/initial-content/apps/sling/webloader/POST.esp
+++ /dev/null
@@ -1,61 +0,0 @@
-<%
-/*
- * 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.
- */
-%>
-
-<% /*
- Webloader POST processing: create a new job and redirect to its status page
-*/ %>
-
-<%
- var loader = sling.getService(Packages.org.apache.sling.samples.webloader.Webloader);
-
- var webQuery = request.getParameter("webQuery");
- var storagePath = request.getParameter("storagePath");
- var maxDocsToRetrieve = request.getParameter("maxDocsToRetrieve");
- var maxDocSize = request.getParameter("maxDocSize");
- var fileTypes = request.getParameter("fileTypes");
-
- if(!webQuery) {
- response.sendError(400, "required parameter missing: webQuery");
- }
- if(!storagePath) {
- storagePath = "/webloader";
- }
- if(!maxDocsToRetrieve) {
- maxDocsToRetrieve = 25;
- }
- if(!maxDocSize) {
- maxDocSize = 512;
- }
-
- var jobId = loader.createJob(webQuery, storagePath, fileTypes, maxDocsToRetrieve, maxDocSize);
-
- var statusPath =
- request.getContextPath()
- + request.getRequestPathInfo().getResourcePath()
- + "." + jobId + ".html"
- ;
-
- var status = loader.getJobStatus(jobId);
-
- if(status==null) {
- response.sendError(500, "Webloader status not available (or not anymore) for job " + jobId);
- }
-
- response.sendRedirect(statusPath);
-%>
diff --git a/webloader/ui/src/main/resources/initial-content/apps/sling/webloader/html.esp b/webloader/ui/src/main/resources/initial-content/apps/sling/webloader/html.esp
deleted file mode 100644
index caf5079..0000000
--- a/webloader/ui/src/main/resources/initial-content/apps/sling/webloader/html.esp
+++ /dev/null
@@ -1,156 +0,0 @@
-<%
-/*
- * 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.
- */
-%>
-
-<% /*
- Webloader GET request processing
- Display a form to create new jobs, or, if a selector is given, display
- the status of that job
-*/ %>
-
-<%
- // get job ID from selectors, for example webloader.5.html displays status of job 5
- var jobId = null;
- var selectors = request.getRequestPathInfo().getSelectors();
- if(selectors.length > 0) {
- jobId = selectors[0];
- }
-
- var loader = sling.getService(Packages.org.apache.sling.samples.webloader.Webloader);
- var status = loader.getJobStatus(jobId);
- var running = status!=null && status.isRunning();
-%>
-
-<%
-function showForm() {
- %>
- <hr/>
- <h2>Create a new webloader job</h2>
- <form method="POST">
- <table>
- <tr>
- <td>
- Web query to use to select documents:
- </td>
- <td>
- <input type="text" name="webQuery" size="60" value="drums"/>
- </td>
- </tr>
- <tr>
- <td>
- Storage path for retrieved documents:
- </td>
- <td>
- <input type="text" name="storagePath" size="60" value="/webloader"/>
- </td>
- </tr>
- <tr>
- <td>
- Maximum number of documents to retrieve:
- </td>
- <td>
- <input type="text" name="maxDocsToRetrieve" value="25"/>
- </td>
- </tr>
- <tr>
- <td>
- Maximum size of a single document in kilobytes:
- </td>
- <td>
- <input type="text" name="maxDocSize" value="512"/>
- </td>
- </tr>
- <tr>
- <td>
- Comma-separated list of file types to consider (empty=default):
- </td>
- <td>
- <input type="text" name="fileTypes" size="60" value="pdf, rtf, ppt, doc, xls"/>
- </td>
- </tr>
- </table>
- <input type="submit"/>
- </form>
- <%
-}
-%>
-
-<%
-function showStatus() {
- if(status==null) {
- response.sendError(404, "Webloader status not available (or not anymore) for job " + jobId);
- }
- var statusString = status.isRunning() ? "running" : "done";
- %>
- <hr/>
- <h2>Webloader job <%= jobId + " " + statusString %></h2>
-
- <p>
- Job info: <b><%= status %></b>.
- </p>
- <p>
- <b><%= status.statusInfo %></b>
- ,
- <em><%= status.statusDetails %></em>
- </p>
- <p>
- <b><%= status.numberOfDocumentsLoaded %></b> documents have been loaded.
- </p>
- <%
-}
-%>
-
-<%
- var autoRefresh = status!=null && status.isRunning();
-%>
-
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="/sling/res/ui/admin.css">
- <% if(autoRefresh) { %>
- <meta http-equiv="refresh" content="1"/>
- <% } %>
- </head>
- <body>
- <div id="main">
- <h1>Sling Webloader</h1>
-
- <% if(autoRefresh) { %>
- <p>
- This page <b>reloads itself</b> automatically every second, while the webloader job is running.
- </p>
- <% } %>
-
- <p>
- This example application retrieves documents from the Web using
- a Google query, and loads them in the repository. It is based on the
- the Jackrabbit <em>populate.jsp</em> example, ported to Sling.
- </p>
-
- <%
- if(status!=null) {
- showStatus();
- }
-
- if(!running) {
- showForm();
- }
- %>
- </div>
- </body>
-</html>
diff --git a/webloader/ui/src/main/resources/initial-content/bin.json b/webloader/ui/src/main/resources/initial-content/bin.json
deleted file mode 100644
index a8fa0cc..0000000
--- a/webloader/ui/src/main/resources/initial-content/bin.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "jcr:primaryType" : "sling:Folder",
- "sling" : {
- "jcr:primaryType" : "sling:Folder",
- "webloader" : {
- "jcr:primaryType" : "nt:unstructured",
- "sling:resourceType" : "sling/webloader"
- }
- }
-}
\ No newline at end of file