Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
daveneiman committed Nov 6, 2018
2 parents 462d2df + be61291 commit c2a18de
Show file tree
Hide file tree
Showing 62 changed files with 362 additions and 516 deletions.
39 changes: 27 additions & 12 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" path="lib/httpclient-4.5.2.jar"/>
<classpathentry kind="lib" path="lib/httpclient-cache-4.5.2.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.4.4.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.5.2.jar"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="lib/servlet-api-2.5.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/fits"/>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/fits"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/target/
/*.log
# Mac OS X system file
.DS_Store

/bin
/dist/
/test.log
8 changes: 7 additions & 1 deletion .project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>FITSservlet_GitHub</name>
<name>FITSservlet</name>
<comment></comment>
<projects>
</projects>
Expand All @@ -25,8 +25,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
Expand Down
5 changes: 5 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
2 changes: 2 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
11 changes: 7 additions & 4 deletions .settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="FITSservlet_GitHub">
<wb-module deploy-name="fits-service-1.2.0-SNAPSHOT">
<wb-resource deploy-path="/WEB-INF/web.xml" source-path="/src/main/webapp/WEB-INF/web.xml"/>
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/test"/>
<property name="context-root" value="FITSservlet_GitHub"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<property name="java-output-path" value="/FITSservlet_GitHub/bin"/>
<property name="context-root" value="fits-service"/>
</wb-module>
</project-modules>
2 changes: 2 additions & 0 deletions .settings/org.eclipse.wst.validation.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#FITS Service
# FITS Service
The FITS Service is a project that allows [FITS](http://fitstool.org) to be deployed as a service on either Tomcat or JBoss. The project has been built with Java 8.
(It has been tested on Tomcat 7, Tomcat 8, and minimally tested on JBoss 7.1.)

Expand Down Expand Up @@ -33,7 +33,10 @@ Examining a file and returning corresponding metadata containing both FITS outpu
* GET: (using a browser) `http://yourserver.yourdomain.com:<port>/fits/examine?file=path/to/file`
* POST: (using curl) `curl -k -F datafile=@path/to/file http://yourserver.yourdomain.com:<port>/fits/examine` ('datafile' is the required form parameter that points to the uploaded file.)
* POST: (using a browser) `http://yourserver.yourdomain.com:<port>/fits/index.html` (Select the file to upload then click the 'Upload' button.)

##### a. Optional parameter
The metadata that is returned contains "standard output" for the given content type within the `<metadata>` element by default. In order to disable this, the URL for both GET and POST requires an additional request parameter
of `includeStandardOutput=false`. For example:
`http://yourserver.yourdomain.com:<port>/fits/examine?includeStandardOutput=false&file=path/to/file`
#### 2. /version
Obtaining the version of FITS being used to examine input files returned in plain text format. (GET request only)
<br>Examples:
Expand All @@ -50,17 +53,17 @@ See <a href="#test-client">below</a> for a Java test client example.
## <a name="tomcat"></a>Deploying to Tomcat 7 and Tomcat 8
### Add Entries to catalina.properties
It’s necessary to add the location of the FITS home directory to the file `$CATALINA_BASE/conf/catalina.properties` then add the location of the FITS lib folder JAR files. (See example below.)
<br>1. Add the fits.home” environment variable.
<br>2. Add all “fits.home”/lib/ JAR files to the shared class loader classpath with a wildcard ‘*’ and the `${fits.home}` property substitution.
**Note: Do NOT add any JAR files that are contained in any of the FITS lib/ subdirectories to this classpath entry. They are added programmatically at runtime by the application.**
<br>3. (optional) Rather than using the default log4j.properties file located within the WAR file here: /WebContent/WEB-INF/ (which logs to a file within the Tomcat directory structure) it's possible to set up logging to point to an external log4j.properties file. Add a "log4j.configuration" property to catalina.properties pointing to this file. It can be either a full path or have the `file:` protocol at the beginning of the entry. This is managed by the class `edu.harvard.hul.ois.fits.service.listeners.LoggingConfigurator.java`.
<br>4. (optional) There are default configuration values for uploaded file located within the WAR file here: /WebContent/WEB-INF/fits-service.properties -- it's possible to set up these values externally. Add the property `FITS_SERVICE_PROPS` to catalina.properties pointing to a customized version of this file. Example:
`FITS_SERVICE_PROPS=/path/to/fits-service.properties`
<br>1. Add the `fits.home` property which points to the base of the FITS installation. Example: `fits.home=/path/to/fits-1.3.0`
<br>2. Add the FITS JAR files folder to the existing `shared.loader` classpath property using the `${fits.home}` property substitution. Example: `shared.loader=${fits.home}/lib/*.jar`
**Notes: 1) This property MUST follow the `fits.home` property. 2) Do NOT add any of the JAR files that are contained in any of the FITS lib/ subdirectories to this classpath entry. They are added programmatically at runtime by the application.**
<br>3. (optional) Rather than using the default log4j.properties file located within the WAR file here: `/src/main/resource/` (which logs to a file within the Tomcat directory structure) it's possible to set up logging to point to an external log4j.properties file. Add a "log4j.configuration" property to `catalina.properties` pointing to this file. It can be either a full path or have the `file:` protocol at the beginning of the entry. This is managed by the class `edu.harvard.hul.ois.fits.service.listeners.LoggingConfigurator.java`.
<br>4. (optional) There are default configuration values for uploaded file located within the WAR file here: `/src/main/resource/fits-service.properties` -- it's possible to set up these values externally. Add the property `FITS_SERVICE_PROPS` to catalina.properties pointing to a customized version of this file.
Example: `FITS_SERVICE_PROPS=/path/to/fits-service.properties`
#### catalina.properties example
Add the following to the bottom of the file:
- `fits.home=path/to/fits/home` (note: no final slash in path)
- `shared.loader=${fits.home}/lib/*.jar`
- `log4j.configuration=/path/to/log4j.properties` or `log4j.configuration=file:/path/to/log4j.properties` (optional -- to override using the default log4j.properties in the WEB-INF directory of the WAR file.)
- `log4j.configuration=/path/to/log4j.properties` or `log4j.configuration=file:/path/to/log4j.properties` (optional -- to override using the default log4j.properties in the WEB-INF/classes directory of the WAR file.)

#### Additional Information:
**Class loading:** Within the WAR file’s META-INF directory is a Tomcat-specific file, context.xml. This file indicates to the Tomcat server to modify the Tomcat default class loader scheme for this application. The result is that, rather than load the WAR’s classes and JAR files first, classes on Tomcat’s shared classpath will be loaded first. This is critical given the nature of the custom class loaders used in FITS. (This file will be ignored if deploying to JBoss.)
Expand Down
1 change: 0 additions & 1 deletion WebContent/META-INF/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion WebContent/WEB-INF/.gitignore

This file was deleted.

Binary file removed WebContent/WEB-INF/lib/commons-cli-1.1.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/commons-codec-1.6.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/commons-fileupload-1.3.1.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/commons-io-2.4.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/commons-lang-2.6.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/commons-logging-1.2.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/commons-pool2-2.4.1.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/jaxen-core.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/jaxen-jdom.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/jdom.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/log4j-1.2.17.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/saxon9-dom.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/saxon9-jdom.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/saxon9.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/serializer.jar
Binary file not shown.
10 changes: 0 additions & 10 deletions build.properties

This file was deleted.

Loading

0 comments on commit c2a18de

Please sign in to comment.