Skip to content

Commit

Permalink
Scorecard web app #156
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaBurek committed Sep 11, 2023
1 parent 596a776 commit 5998ad2
Show file tree
Hide file tree
Showing 35 changed files with 489 additions and 159 deletions.
2 changes: 1 addition & 1 deletion bin/mv_scorecard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CLASSPATH=$CLASSPATH:$MV_HOME/lib/juli-6.0.53.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/slf4j-api-1.7.5.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/slf4j-log4j12-1.7.5.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/guava-14.0.1.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/j2html-1.4.0.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/j2html-1.6.0.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/jackson-core-2.12.0.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/jackson-databind-2.12.0.jar
CLASSPATH=$CLASSPATH:$MV_HOME/lib/commons-lang3-3.11.jar
Expand Down
14 changes: 7 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<pathelement location="${lib}/javax.servlet-api-4.0.1.jar"/>
<pathelement location="${lib}/commons-fileupload-1.4.jar"/>
<pathelement location="${lib}/commons-io-2.8.0.jar"/>
<pathelement location="${lib}/j2html-1.4.0.jar"/>
<pathelement location="${lib}/j2html-1.6.0.jar"/>
<pathelement location="${lib}/jackson-core-2.12.0.jar"/>
<pathelement location="${lib}/jackson-databind-2.12.0.jar"/>
<pathelement location="${lib}/commons-lang3-3.11.jar"/>
Expand All @@ -148,7 +148,7 @@
<pathelement location="${lib}/junit-4.11.jar"/>
<pathelement location="${lib}/hamcrest-core-1.3.jar"/>
<pathelement location="${lib}/mockito-all-1.9.5.jar"/>
<pathelement location="${lib}/j2html-1.4.0.jar"/>
<pathelement location="${lib}/j2html-1.6.0.jar"/>
<pathelement location="${lib}/jackson-core-2.12.0.jar"/>
<pathelement location="${lib}/jackson-databind-2.12.0.jar"/>
<pathelement location="${lib}/commons-lang3-3.11.jar"/>
Expand All @@ -168,7 +168,7 @@
<pathelement location="${lib}/javax.servlet-api-4.0.1.jar"/>
<pathelement location="${lib}/commons-fileupload-1.4.jar"/>
<pathelement location="${lib}/commons-io-2.8.0.jar"/>
<pathelement location="${lib}/j2html-1.4.0.jar"/>
<pathelement location="${lib}/j2html-1.6.0.jar"/>
<pathelement location="${lib}/jackson-core-2.12.0.jar"/>
<pathelement location="${lib}/jackson-databind-2.12.0.jar"/>
<pathelement location="${lib}/commons-lang3-3.11.jar"/>
Expand All @@ -192,7 +192,7 @@
<pathelement location="${lib}/junit-4.11.jar"/>
<pathelement location="${lib}/hamcrest-core-1.3.jar"/>
<pathelement location="${lib}/mockito-all-1.9.5.jar"/>
<pathelement location="${lib}/j2html-1.4.0.jar"/>
<pathelement location="${lib}/j2html-1.6.0.jar"/>
<pathelement location="${lib}/jackson-core-2.12.0.jar"/>
<pathelement location="${lib}/jackson-databind-2.12.0.jar"/>
<pathelement location="${lib}/commons-lang3-3.11.jar"/>
Expand All @@ -212,7 +212,7 @@
<pathelement location="${lib}/javax.servlet-api-4.0.1.jar"/>
<pathelement location="${lib}/commons-fileupload-1.4.jar"/>
<pathelement location="${lib}/commons-io-2.8.0.jar"/>
<pathelement location="${lib}/j2html-1.4.0.jar"/>
<pathelement location="${lib}/j2html-1.6.0.jar"/>
<pathelement location="${lib}/jackson-core-2.12.0.jar"/>
<pathelement location="${lib}/jackson-databind-2.12.0.jar"/>
<pathelement location="${lib}/commons-lang3-3.11.jar"/>
Expand All @@ -236,7 +236,7 @@
<pathelement location="${lib}/junit-4.11.jar"/>
<pathelement location="${lib}/hamcrest-core-1.3.jar"/>
<pathelement location="${lib}/mockito-all-1.9.5.jar"/>
<pathelement location="${lib}/j2html-1.4.0.jar"/>
<pathelement location="${lib}/j2html-1.6.0.jar"/>
<pathelement location="${lib}/jackson-core-2.12.0.jar"/>
<pathelement location="${lib}/jackson-databind-2.12.0.jar"/>
<pathelement location="${lib}/commons-lang3-3.11.jar"/>
Expand Down Expand Up @@ -319,7 +319,7 @@
</copy>
<delete file="${build}/MANIFEST.MF"/>
<manifest file="${build}/MANIFEST.MF">
<attribute name="Specification-Version" value="5.1.0"/>
<attribute name="Specification-Version" value="6.0.0-beta1-dev"/>
</manifest>

<jar jarfile="${dist}/lib/metviewer.jar" basedir="${build}" manifest="${build}/MANIFEST.MF">
Expand Down
95 changes: 95 additions & 0 deletions buildScorecardWeb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<project name="scorecard" default="dist" basedir=".">

<description>Scorecard Viewer build file</description>

<!-- set global properties for this build -->
<property name="src" location="java/edu/ucar/metviewer/scorecard/web"/>
<property name="lib" location="lib"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="src.webapp.dir" location="webapp_scorecard"/>


<!-- Initialize the build tree -->
<target name="init">

<delete dir="${build}"/>
<mkdir dir="${build}"/>

<delete dir="${dist}"/>
<mkdir dir="${dist}"/>
</target>


<path id="classpath">
<pathelement location="${lib}/javax.servlet-api-4.0.1.jar"/>
<pathelement location="${lib}/jackson-core-2.12.0.jar"/>
<pathelement location="${lib}/jackson-databind-2.12.0.jar"/>
<pathelement location="${lib}/jackson-annotations-2.12.0.jar"/>
</path>


<!-- Compile the java code from ${src} into ${build} -->
<target name="compile" depends="init" description="compile the source">
<!-- Compile the project java files -->
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<include name="**/*.java"/>
<classpath refid="classpath"/>
</javac>
</target>

<!-- Create the distribution directory -->
<target name="dist" depends="compile"
description="generate the distribution">
<!-- Create the dist lib folder and put the jared class files there -->
<mkdir dir="${dist}/lib"/>

<manifest file="${build}/MANIFEST.MF">
<attribute name="Specification-Version" value="5.1.0"/>
</manifest>

<jar jarfile="${dist}/lib/scorecard.jar" basedir="${build}" manifest="${build}/MANIFEST.MF">
</jar>
</target>


<!-- Build the web application folder -->
<target name="webapp" depends="dist"
description="build the web application bundle">
<!-- Copy the webapp contents to the dist folder -->
<delete dir="${dist}/scorecard"/>
<copy todir="${dist}/scorecard">
<fileset dir="webapp_scorecard"></fileset>
</copy>

<copy todir="${dist}/scorecard/WEB-INF/lib"
file="${dist}/lib/scorecard.jar"/>
<copy todir="${dist}/scorecard/WEB-INF/lib"
file="${lib}/jackson-databind-2.12.0.jar"/>
<copy todir="${dist}/scorecard/WEB-INF/lib"
file="${lib}/jackson-core-2.12.0.jar"/>
<copy todir="${dist}/scorecard/WEB-INF/lib"
file="${lib}/jackson-annotations-2.12.0.jar"/>


</target>


<!-- Delete the ${build} and ${dist} directory trees -->
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>


<target name="war" depends="webapp" description="Create web archive">
<war destfile="${dist}/scorecard.war"
needxmlfile="false"
basedir="${dist}/scorecard"
manifest="${build}/MANIFEST.MF"
>
</war>
</target>

</project>

2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ RUN pip install cartopy \
&& pip install lxml==4.9.1 \
&& pip install matplotlib==3.5.2 \
&& pip install netcdf4==1.6.2 \
&& pip install numpy==1.22.0 \
&& pip install numpy==1.24.2 \
&& pip install pytest==7.1.2 \
&& pip install metpy==1.3.1 \
&& pip install pyyaml==6.0 \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile_for_Singularity
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ RUN pip install cartopy \
&& pip install lxml==4.9.1 \
&& pip install matplotlib==3.5.2 \
&& pip install netcdf4==1.6.2 \
&& pip install numpy==1.22.0 \
&& pip install numpy==1.24.2 \
&& pip install pytest==7.1.2 \
&& pip install metpy==1.3.1 \
&& pip install pyyaml==6.0 \
Expand Down
2 changes: 1 addition & 1 deletion docs/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.0
6.0.0-beta1-dev
11 changes: 10 additions & 1 deletion java/edu/ucar/metviewer/MVUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -2860,7 +2864,7 @@ public static String[][] getDiffSeriesArr(String diffSeriesTemplate) {
return result.toArray(new String[0][]);
}

public static synchronized void createYamlFile(final String fileName, final Map<String, Object> info) throws IOException {
public static synchronized void createYamlFile(final String fileName, final Map<String, Object> info) throws IOException, InvalidPathException {
DumperOptions options = new DumperOptions();
//options.setDefaultScalarStyle(DumperOptions.ScalarStyle.SINGLE_QUOTED);
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
Expand All @@ -2869,6 +2873,11 @@ public static synchronized void createYamlFile(final String fileName, final Map<
Yaml yaml = new Yaml(options);
try (FileWriter writer = new FileWriter(fileName)) {
yaml.dump(sortedMap, writer);
}catch (FileNotFoundException e){
Files.createDirectories(Paths.get(fileName).getParent());
try (FileWriter writer = new FileWriter(fileName)) {
yaml.dump(sortedMap, writer);
}
}
}
public static boolean isEtbJob(MVPlotJob job){
Expand Down
Loading

0 comments on commit 5998ad2

Please sign in to comment.