Merge branch 'omaha_14.4.1' of ssh://www.awips2omaha.com:29418/AWIPS2_baseline into master_14.4.1
Former-commit-id: c08dc1a7d558fba175460ef8255fc3b7b1db5c71
This commit is contained in:
commit
adc24b15b6
66 changed files with 2541 additions and 1396 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
|
@ -21,8 +21,23 @@
|
|||
<!DOCTYPE project [
|
||||
<!ENTITY substitute-targets SYSTEM "substitute.xml">
|
||||
]>
|
||||
|
||||
<project name="RCMPackageBuilder" default="deploy" basedir=".">
|
||||
<!--
|
||||
<property file="${basedir}/../../edexOsgi/build.edex/edex/common.properties" />
|
||||
|
||||
<condition property="ant.lib.dir" value="${basedir}/../../edexOsgi/build.edex/lib/ant/" else="${basedir}/../build.edex/lib/ant/">
|
||||
<available file="${basedir}/../../edexOsgi/build.edex/lib/ant/ant-contrib-1.0b3.jar" />
|
||||
</condition>
|
||||
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${ant.lib.dir}/ant-contrib-1.0b3.jar" />
|
||||
|
||||
<path id="ant.classpath">
|
||||
<fileset dir="${ant.lib.dir}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<!--
|
||||
This build script expects the following projects to exist at the same
|
||||
level as this project's folder. com.raytheon.rcm.lib
|
||||
com.raytheon.rcm.server com.raytheon.rcm.server.mq
|
||||
|
@ -31,175 +46,226 @@
|
|||
-->
|
||||
&substitute-targets;
|
||||
|
||||
|
||||
<description>
|
||||
Builds a deployment of the RCM for packaging
|
||||
</description>
|
||||
|
||||
<!-- set global properties for this build -->
|
||||
<property environment="user" />
|
||||
|
||||
<property name="src" location="src" />
|
||||
<property name="build" location="build" />
|
||||
<property name="deploy.dir" location="Deploy" />
|
||||
<!-- set global properties for this build -->
|
||||
<property environment="user" />
|
||||
|
||||
<property name="props.dir" location="${basedir}/properties" />
|
||||
<property file="${props.dir}/build-local.properties" />
|
||||
<property name="src" location="src" />
|
||||
<property name="build" location="build" />
|
||||
<property name="deploy.dir" location="Deploy" />
|
||||
|
||||
<available file="${basedir}/tmp" property="tmp.ready" />
|
||||
<property name="props.dir" location="${basedir}/properties" />
|
||||
<property file="${props.dir}/build-local.properties" />
|
||||
|
||||
<condition property="pde.not.ready">
|
||||
<and>
|
||||
<isset property="pde.build" />
|
||||
<not>
|
||||
<isset property="tmp.ready" />
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<available file="${basedir}/tmp" property="tmp.ready" />
|
||||
|
||||
<condition property="cots.dir" value="${basedir}/.." else="${basedir}/../../cots">
|
||||
<available file="${basedir}/../org.springframework" />
|
||||
</condition>
|
||||
<condition property="pde.not.ready">
|
||||
<and>
|
||||
<isset property="pde.build" />
|
||||
<not>
|
||||
<isset property="tmp.ready" />
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
<condition property="edexsrc.dir" value="${basedir}/.." else="${basedir}/../../edexOsgi">
|
||||
<available file="${basedir}/../com.raytheon.uf.common.util" />
|
||||
</condition>
|
||||
<condition property="top.dir" value="${basedir}/.." else="${basedir}/../../..">
|
||||
<available file="${basedir}/../build.edex/lib/ant/ant-contrib-1.0b3.jar" />
|
||||
</condition>
|
||||
|
||||
<!-- Set default EDEX install location for copy filter -->
|
||||
<property name="def.edex.install.dir" value="/awips" />
|
||||
<condition property="edex.home" value="$EdexBaseDir" else="${def.edex.install.dir}">
|
||||
<isset property="installer"/>
|
||||
</condition>
|
||||
<condition property="core_foss_lib.dir" value="${basedir}/.." else="${top.dir}/${core-foss.repo}/lib">
|
||||
<available file="${basedir}/../build.edex/lib/ant/ant-contrib-1.0b3.jar" />
|
||||
</condition>
|
||||
|
||||
<!-- Create clean deployment -->
|
||||
<target name="deploy">
|
||||
<echo message="----------------------------------------------------------------"/>
|
||||
<echo message=" deploying RCM to ${deploy.dir}"/>
|
||||
<echo message=" PDE Build = ${pde.build}"/>
|
||||
<echo message="----------------------------------------------------------------"/>
|
||||
<antcall target="un.deploy" />
|
||||
<antcall target="re.deploy" />
|
||||
<antcall target="config.deploy" />
|
||||
</target>
|
||||
<condition property="a2_foss_lib.dir" value="${basedir}/.." else="${top.dir}/${awips2-foss.repo}/lib">
|
||||
<available file="${basedir}/../build.edex/lib/ant/ant-contrib-1.0b3.jar" />
|
||||
</condition>
|
||||
|
||||
<!--
|
||||
<condition property="core_common.dir" value="${basedir}/.." else="${top.dir}/${core.repo}/common/">
|
||||
<available file="${basedir}/../build.edex/lib/ant/ant-contrib-1.0b3.jar" />
|
||||
</condition>
|
||||
|
||||
<!-- Only check for directories on development workstation-->
|
||||
<if>
|
||||
<equals arg1="${top.dir}" arg2="${basedir}/../../.." />
|
||||
<then>
|
||||
<property name="tab" value=" " />
|
||||
<echo level="info" message=" " />
|
||||
<echo level="info" message="Deploy checks the following directories for source:" />
|
||||
<echo level="info" message=" " />
|
||||
<for list="${core.repositories}" param="repository.directory">
|
||||
<sequential>
|
||||
<echo level="info" message="${tab}@{repository.directory}" />
|
||||
<if>
|
||||
<not>
|
||||
<available file="${top.dir}/@{repository.directory}" type="dir" />
|
||||
</not>
|
||||
<then>
|
||||
<echo level="error" message="${tab}@{repository.directory} does not exist!" />
|
||||
<property name="missingDir" value="true" />
|
||||
</then>
|
||||
</if>
|
||||
</sequential>
|
||||
</for>
|
||||
<if>
|
||||
<isset property="missingDir" />
|
||||
<then>
|
||||
<echo level="error" message=" " />
|
||||
<echo level="error" message="Edit core.repositories=${core.repositories} in common.properties, rename source directories or create a symlink!" />
|
||||
<echo level="error" message=" " />
|
||||
<fail message="Unable to locate source directories." />
|
||||
</then>
|
||||
</if>
|
||||
<echo level="info" message=" " />
|
||||
</then>
|
||||
</if>
|
||||
|
||||
|
||||
<property name="edexsrc.dir" value="${basedir}/../../edexOsgi"/>
|
||||
|
||||
<!-- Set default EDEX install location for copy filter -->
|
||||
<property name="def.edex.install.dir" value="/awips" />
|
||||
<condition property="edex.home" value="$EdexBaseDir" else="${def.edex.install.dir}">
|
||||
<isset property="installer"/>
|
||||
</condition>
|
||||
|
||||
<!-- Create clean deployment -->
|
||||
<target name="deploy">
|
||||
<echo message="----------------------------------------------------------------"/>
|
||||
<echo message=" deploying RCM to ${deploy.dir}"/>
|
||||
<echo message=" PDE Build = ${pde.build}"/>
|
||||
<echo message="----------------------------------------------------------------"/>
|
||||
<antcall target="un.deploy" />
|
||||
<antcall target="re.deploy" />
|
||||
<antcall target="config.deploy" />
|
||||
</target>
|
||||
|
||||
<!--
|
||||
Deploy on top of existing deployment. Old files not removed nor is the
|
||||
configuration file changed.
|
||||
-->
|
||||
<target name="re.deploy">
|
||||
<mkdir dir="${deploy.dir}" />
|
||||
<mkdir dir="${deploy.dir}/bin" />
|
||||
<mkdir dir="${deploy.dir}/lib" />
|
||||
<mkdir dir="${deploy.dir}/data" />
|
||||
<!-- copy with filter -->
|
||||
<copy todir="${deploy.dir}" verbose="false">
|
||||
<filterset refid="installer.filter.set" />
|
||||
<fileset dir="bits">
|
||||
<include name="bin/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<chmod perm="a-w,a+x">
|
||||
<fileset dir="${deploy.dir}/bin">
|
||||
<include name="*" />
|
||||
</fileset>
|
||||
</chmod>
|
||||
|
||||
<!--
|
||||
<target name="re.deploy">
|
||||
|
||||
<mkdir dir="${deploy.dir}" />
|
||||
<mkdir dir="${deploy.dir}/bin" />
|
||||
<mkdir dir="${deploy.dir}/lib" />
|
||||
<mkdir dir="${deploy.dir}/data" />
|
||||
<!-- copy with filter -->
|
||||
<copy todir="${deploy.dir}" verbose="false">
|
||||
<filterset refid="installer.filter.set" />
|
||||
<fileset dir="bits">
|
||||
<include name="bin/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<chmod perm="a-w,a+x">
|
||||
<fileset dir="${deploy.dir}/bin">
|
||||
<include name="*" />
|
||||
</fileset>
|
||||
</chmod>
|
||||
|
||||
<!--
|
||||
Not all of these files should be made executable. Need to know all
|
||||
executable names... or all non-executables...
|
||||
-->
|
||||
<copy todir="${deploy.dir}/bin" verbose="false">
|
||||
<fileset dir="../com.raytheon.rcm.tools/src">
|
||||
<include name="*.py" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<chmod perm="a+x">
|
||||
<fileset dir="${deploy.dir}/bin">
|
||||
<include name="*.py" />
|
||||
<exclude name="stomp.py" />
|
||||
</fileset>
|
||||
</chmod>
|
||||
<chmod perm="a-w">
|
||||
<fileset dir="${deploy.dir}/bin">
|
||||
<include name="*.py" />
|
||||
</fileset>
|
||||
</chmod>
|
||||
<copy todir="${deploy.dir}/bin" verbose="false">
|
||||
<fileset dir="../com.raytheon.rcm.tools/src">
|
||||
<include name="*.py" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<chmod perm="a+x">
|
||||
<fileset dir="${deploy.dir}/bin">
|
||||
<include name="*.py" />
|
||||
<exclude name="stomp.py" />
|
||||
</fileset>
|
||||
</chmod>
|
||||
<chmod perm="a-w">
|
||||
<fileset dir="${deploy.dir}/bin">
|
||||
<include name="*.py" />
|
||||
</fileset>
|
||||
</chmod>
|
||||
|
||||
<copy todir="${deploy.dir}/lib" flatten="true">
|
||||
<fileset dir="${cots.dir}/org.apache.activemq" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/org.apache.qpid" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/org.slf4j" includes="**/*.jar">
|
||||
<include name="**/jcl-over-slf4j*.jar" />
|
||||
<include name="**/jul-to-slf4j*.jar" />
|
||||
<include name="**/slf4j-api*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${cots.dir}/org.apache.commons.beanutils" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/org.apache.commons.codec" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/org.apache.commons.collections" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/org.apache.commons.lang" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/ch.qos.logback" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/javax.jms" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/org.springframework">
|
||||
<include name="**/*spring*beans*.jar" />
|
||||
<include name="**/*spring*context*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${cots.dir}/org.itadaki.bzip2" includes="**/*.jar" />
|
||||
<fileset dir="${cots.dir}/org.quartz" includes="**/*.jar" />
|
||||
</copy>
|
||||
<copy todir="${deploy.dir}/lib" flatten="true">
|
||||
<fileset dir="${core_foss_lib.dir}/org.apache.activemq" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/org.apache.qpid" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/org.slf4j" includes="**/*.jar">
|
||||
<include name="**/jcl-over-slf4j*.jar" />
|
||||
<include name="**/jul-to-slf4j*.jar" />
|
||||
<include name="**/slf4j-api*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${core_foss_lib.dir}/org.apache.commons.beanutils" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/org.apache.commons.codec" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/org.apache.commons.collections" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/org.apache.commons.lang" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/ch.qos.logback" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/javax.jms" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/org.springframework">
|
||||
<include name="**/*spring*beans*.jar" />
|
||||
<include name="**/*spring*context*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${a2_foss_lib.dir}/org.itadaki.bzip2" includes="**/*.jar" />
|
||||
<fileset dir="${core_foss_lib.dir}/org.quartz" includes="**/*.jar" />
|
||||
</copy>
|
||||
|
||||
<delete dir="bin" />
|
||||
<mkdir dir="bin" />
|
||||
<antcall target="local.jar" />
|
||||
<antcall target="pde.jar" />
|
||||
<jar destfile="${deploy.dir}/lib/radarserver-mq.jar" basedir="bin" />
|
||||
<delete dir="bin" />
|
||||
</target>
|
||||
<delete dir="bin" />
|
||||
<mkdir dir="bin" />
|
||||
<antcall target="local.jar" />
|
||||
<antcall target="pde.jar" />
|
||||
<jar destfile="${deploy.dir}/lib/radarserver-mq.jar" basedir="bin" />
|
||||
<delete dir="bin" />
|
||||
</target>
|
||||
|
||||
<target name="local.jar" if="pde.build">
|
||||
<copy toDir="bin">
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.lib/@dot"
|
||||
<target name="local.jar" if="pde.build">
|
||||
<copy toDir="bin">
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.lib/@dot"
|
||||
includes="**/*.class" />
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.lib/@dot"
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.lib/@dot"
|
||||
includes="**/*.txt" />
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.server/@dot"
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.server/@dot"
|
||||
includes="**/*.class" />
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.server.mq/@dot"
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.server.mq/@dot"
|
||||
includes="**/*.class" />
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.server.mq/@dot"
|
||||
<fileset dir="tmp/plugins/com.raytheon.rcm.server.mq/@dot"
|
||||
includes="**/*.txt" />
|
||||
<fileset dir="tmp/plugins/com.raytheon.uf.common.util/@dot"
|
||||
<fileset dir="tmp/plugins/com.raytheon.uf.common.util/@dot"
|
||||
includes="**/*.class" />
|
||||
</copy>
|
||||
</target>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="pde.jar" unless="pde.build">
|
||||
<copy todir="bin">
|
||||
<fileset dir="../com.raytheon.rcm.lib/bin" includes="**/*.class" />
|
||||
<fileset dir="../com.raytheon.rcm.lib/bin" includes="**/*.txt" />
|
||||
<fileset dir="../com.raytheon.rcm.server/bin" includes="**/*.class" />
|
||||
<fileset dir="../com.raytheon.rcm.server.mq/bin" includes="**/*.class" />
|
||||
<fileset dir="../com.raytheon.rcm.server.mq/bin" includes="**/*.txt" />
|
||||
<fileset dir="${edexsrc.dir}/com.raytheon.uf.common.util/bin" includes="**/*.class" />
|
||||
</copy>
|
||||
</target>
|
||||
<target name="pde.jar" unless="pde.build">
|
||||
<copy todir="bin">
|
||||
<fileset dir="../com.raytheon.rcm.lib/bin" includes="**/*.class" />
|
||||
<fileset dir="../com.raytheon.rcm.lib/bin" includes="**/*.txt" />
|
||||
<fileset dir="../com.raytheon.rcm.server/bin" includes="**/*.class" />
|
||||
<fileset dir="../com.raytheon.rcm.server.mq/bin" includes="**/*.class" />
|
||||
<fileset dir="../com.raytheon.rcm.server.mq/bin" includes="**/*.txt" />
|
||||
<fileset dir="${core_common.dir}/com.raytheon.uf.common.util/bin" includes="**/*.class" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="config.deploy">
|
||||
<copy todir="${deploy.dir}" verbose="false">
|
||||
<filterset refid="installer.filter.set" />
|
||||
<fileset dir="cfgbits">
|
||||
<include name="**/*" />
|
||||
<exclude name="**/config.xml"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- this is required because config.xml contains an '@' in a url -->
|
||||
<copy todir="${deploy.dir}" verbose="false">
|
||||
<filterset refid="config.xml.filter.set"/>
|
||||
<fileset dir="cfgbits">
|
||||
<include name="**/config.xml"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
<target name="config.deploy">
|
||||
<copy todir="${deploy.dir}" verbose="false">
|
||||
<filterset refid="installer.filter.set" />
|
||||
<fileset dir="cfgbits">
|
||||
<include name="**/*" />
|
||||
<exclude name="**/config.xml"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- this is required because config.xml contains an '@' in a url -->
|
||||
<copy todir="${deploy.dir}" verbose="false">
|
||||
<filterset refid="config.xml.filter.set"/>
|
||||
<fileset dir="cfgbits">
|
||||
<include name="**/config.xml"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="un.deploy">
|
||||
<delete dir="${deploy.dir}"></delete>
|
||||
</target>
|
||||
<target name="un.deploy">
|
||||
<delete dir="${deploy.dir}">
|
||||
</delete>
|
||||
</target>
|
||||
</project>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
# Jul 10, 2014 #3363 bclement logs command used to launch application to console logs
|
||||
# Oct 10, 2014 #3675 njensen Logback now does console logging to ensure correct pid
|
||||
# Oct 13, 2014 #3675 bclement startup shutdown log includes both launching pid and placeholder
|
||||
#
|
||||
# Jan 28, 2015 #4018 randerso Added a productEditor log file to changes in the GFE product editor
|
||||
#
|
||||
|
||||
|
||||
|
@ -218,6 +218,7 @@ curTime=`date +%Y%m%d_%H%M%S`
|
|||
export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_logs.log"
|
||||
export LOGFILE_CONSOLE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_console.log"
|
||||
export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_perf.log"
|
||||
export LOGFILE_PRODUCT_EDITOR="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_productEditor.log"
|
||||
|
||||
# can we write to log directory
|
||||
if [ -w ${LOGDIR} ]; then
|
||||
|
|
|
@ -82,11 +82,11 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Oct.31 2012 1297 skorolev Clean code
|
||||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
|
||||
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
|
||||
* Sep 04, 2014 3220 skorolev
|
||||
* Sep 23, 2014 3356 njensen Remove unnecessary import
|
||||
* Oct 16, 2014 3220 skorolev Corrected fogConfig assignment.
|
||||
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
|
||||
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with fogConfig.
|
||||
* Jan 27, 2015 3220 skorolev Corrected fogConfig assignment.Moved refreshing of table in the UI thread.
|
||||
* Updated configUpdate method and added updateMonitoringArea.
|
||||
* Replaced MonitoringArea with fogConfig.Updated code for better performance.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -104,21 +104,12 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
/** Singleton instance of this class */
|
||||
private static FogMonitor monitor = null;
|
||||
|
||||
/**
|
||||
* This object contains all observation data necessary for the table dialogs
|
||||
* and trending plots [this replaces the objects of ObsData and TableData
|
||||
* below Jan 21, 2010, zhao]
|
||||
*/
|
||||
private ObMultiHrsReports obData;
|
||||
|
||||
/** data holder for FOG **/
|
||||
private ObsData obsData;
|
||||
|
||||
/** data holder for FOG ALG data **/
|
||||
private SortedMap<Date, Map<String, FOG_THREAT>> algorithmData = null;
|
||||
|
||||
private Date dialogTime = null;
|
||||
|
||||
/** list of coordinates for each zone **/
|
||||
private Map<String, Geometry> zoneGeometries = null;
|
||||
|
||||
|
@ -129,7 +120,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
private MonitoringAreaConfigDlg areaDialog = null;
|
||||
|
||||
/** area config manager **/
|
||||
private FSSObsMonitorConfigurationManager fogConfig = null;
|
||||
private static FSSObsMonitorConfigurationManager fogConfig = null;
|
||||
|
||||
/** table data for the station table **/
|
||||
private final TableData stationTableData = new TableData(
|
||||
|
@ -162,7 +153,6 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
initObserver(OBS, this);
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
|
||||
obData.setThresholdMgr(FogThresholdMgr.getInstance());
|
||||
obData.getZoneTableData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -173,14 +163,10 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
public static synchronized FogMonitor getInstance() {
|
||||
if (monitor == null) {
|
||||
monitor = new FogMonitor();
|
||||
// Pre-populate dialog with an observations from DB
|
||||
monitor.createDataStructures();
|
||||
monitor.getAdjAreas();
|
||||
List<String> zones = monitor.fogConfig.getAreaList();
|
||||
monitor.processProductAtStartup(zones);
|
||||
monitor.fireMonitorEvent(monitor);
|
||||
monitor.processProductAtStartup(fogConfig);
|
||||
}
|
||||
|
||||
return monitor;
|
||||
}
|
||||
|
||||
|
@ -204,7 +190,6 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
// [Jan 21, 2010, zhao]
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
|
||||
obData.setThresholdMgr(FogThresholdMgr.getInstance());
|
||||
|
||||
obsData = new ObsData();
|
||||
algorithmData = new TreeMap<Date, Map<String, FOG_THREAT>>();
|
||||
|
||||
|
@ -247,8 +232,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
@Override
|
||||
public void processProductMessage(final AlertMessage filtered) {
|
||||
if (fogPattern.matcher(filtered.dataURI).matches()) {
|
||||
List<String> zones = fogConfig.getAreaList();
|
||||
processURI(filtered.dataURI, filtered, zones);
|
||||
processURI(filtered.dataURI, filtered, fogConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -285,8 +269,9 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
@Override
|
||||
public void configUpdate(IMonitorConfigurationEvent me) {
|
||||
fogConfig = (FSSObsMonitorConfigurationManager) me.getSource();
|
||||
obData.getObHourReports().updateZones(fogConfig);
|
||||
if (zoneDialog != null && !zoneDialog.isDisposed()) {
|
||||
zoneDialog.refreshZoneTableData(obData);
|
||||
obData.updateTableCache();
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
@ -320,6 +305,8 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
@Override
|
||||
protected void process(ObReport result) throws Exception {
|
||||
obData.addReport(result);
|
||||
// update table cache
|
||||
obData.getZoneTableData(result.getRefHour());
|
||||
// Get zones containing station
|
||||
List<String> zones = fogConfig.getAreaByStationId(result
|
||||
.getPlatformId());
|
||||
|
@ -328,10 +315,10 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
AreaContainer ac = getTableData().getArea(zn);
|
||||
if (ac != null) {
|
||||
ac.addReport(result.getObservationTime(), result);
|
||||
fireMonitorEvent(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
fireMonitorEvent(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -351,26 +338,20 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
*/
|
||||
public void launchDialog(String type, Shell shell) {
|
||||
if (type.equals("zone")) {
|
||||
if (zoneDialog == null) {
|
||||
zoneDialog = new FogZoneTableDlg(shell, obData);
|
||||
addMonitorListener(zoneDialog);
|
||||
zoneDialog.addMonitorControlListener(this);
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
zoneDialog = new FogZoneTableDlg(shell, obData);
|
||||
addMonitorListener(zoneDialog);
|
||||
zoneDialog.addMonitorControlListener(this);
|
||||
zoneDialog.open();
|
||||
} else if (type.equals("area")) {
|
||||
if (areaDialog == null) {
|
||||
areaDialog = new FogMonitoringAreaConfigDlg(shell,
|
||||
"Fog Monitor Area Configuration");
|
||||
areaDialog.setCloseCallback(new ICloseCallback() {
|
||||
areaDialog = new FogMonitoringAreaConfigDlg(shell,
|
||||
"Fog Monitor Area Configuration");
|
||||
areaDialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
areaDialog = null;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
areaDialog = null;
|
||||
}
|
||||
});
|
||||
areaDialog.open();
|
||||
}
|
||||
}
|
||||
|
@ -490,21 +471,18 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
*
|
||||
* @param drawTime
|
||||
*/
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.monitor.ObsMonitor#updateDialogTime(java.util.Date)
|
||||
*/
|
||||
@Override
|
||||
public void updateDialogTime(Date dialogTime) {
|
||||
this.dialogTime = dialogTime;
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* The date for the dialog to stay in step with
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Date getDialogDate() {
|
||||
return dialogTime;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -51,7 +51,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
|
||||
* Oct 27, 2014 3667 skorolev Cleaned code.
|
||||
* Nov 21, 2014 3841 skorolev Corrected handleOkBtnSelection.
|
||||
* Dec 11, 2014 3220 skorolev Removed unnecessary code.
|
||||
* Dec 11, 2014 3220 skorolev Removed unnecessary code.
|
||||
* Feb 03, 2015 3841 skorolev Replaced resetParams with resetStatus.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,7 +72,6 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
*/
|
||||
public FogMonitoringAreaConfigDlg(Shell parent, String title) {
|
||||
super(parent, title, AppName.FOG);
|
||||
FogMonitor.getInstance();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -110,7 +110,7 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
* using new monitor area configuration
|
||||
*/
|
||||
fireConfigUpdateEvent();
|
||||
resetParams();
|
||||
resetStatus();
|
||||
} else { // Return back to continue edit.
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
|
|||
* Dec 03, 2012 15216/15639 zhao fixed a bug related to Link-to-Frame
|
||||
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs.
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
|
||||
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
|
||||
*
|
||||
* Jan 27, 2015 3220 skorolev Removed "site".Added check on dispose.Corrected configMgr assignment.
|
||||
* Added table cache update.
|
||||
* Feb 04, 2015 3841 skorolev Corrected notify method for empty table update.
|
||||
* </pre>
|
||||
*
|
||||
* @author ?
|
||||
|
@ -80,6 +80,9 @@ public class FogZoneTableDlg extends ZoneTableDlg {
|
|||
public FogZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
|
||||
super(parent, obData, CommonConfig.AppName.FOG);
|
||||
configMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
|
||||
obData.updateTableCache();
|
||||
zoneTblData = obData.getZoneTableData();
|
||||
zoneTblData.sortData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,12 +149,11 @@ public class FogZoneTableDlg extends ZoneTableDlg {
|
|||
// The algorithm output.
|
||||
|
||||
if (me.getSource() instanceof FogMonitor) {
|
||||
|
||||
FogMonitor fog = (FogMonitor) me.getSource();
|
||||
Date date = fog.getDialogDate();
|
||||
ObMultiHrsReports obData = fog.getObData();
|
||||
Date date = fog.getDialogTime();
|
||||
if (date != null) {
|
||||
Date nominalTime = date;
|
||||
ObMultiHrsReports obData = fog.getObData();
|
||||
if (!isLinkedToFrame()) {
|
||||
nominalTime = obData.getLatestNominalTime();
|
||||
}
|
||||
|
@ -160,33 +162,12 @@ public class FogZoneTableDlg extends ZoneTableDlg {
|
|||
.getAlgorithmData(nominalTime));
|
||||
obData.setFogAlgCellType(fogAlgCellType);
|
||||
this.updateTableDlg(obData.getObHourReports(nominalTime));
|
||||
} else {
|
||||
this.updateZoneTable(obData.getLatestNominalTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Jan 25, 2010, #4281, zhao, Modified to pass an ObMultiHrsReports object
|
||||
* to table dialog
|
||||
*
|
||||
* @Override public void notify(IMonitorEvent me) { if
|
||||
* (zoneTable.isDisposed()) return;
|
||||
*
|
||||
* if (me.getSource() instanceof FogMonitor) { FogMonitor monitor
|
||||
* = (FogMonitor)me.getSource();
|
||||
* this.updateTableDlg(monitor.getObData()); }
|
||||
*
|
||||
* //if (me.getSource() instanceof FogMonitor) { //
|
||||
* IMPORTANT!!!!!! For now we just grab the most recent time from
|
||||
* the OBSTable // When we have the CAVE rendering working we will
|
||||
* grab it from the CaveResource! // Date date = new Date(); //
|
||||
* FogMonitor fog = (FogMonitor)me.getSource(); //
|
||||
* FogDataGenerator fdg = new FogDataGenerator(); // TableData
|
||||
* tZoneTableData = fdg.generateZoneData(fog.getTableData(),
|
||||
* fog.getAlgorithmData(), date); //
|
||||
* updateZoneTable(tZoneTableData, fog.getStationTableData(),
|
||||
* date); //} }
|
||||
*/
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -81,11 +81,9 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Oct 26, 2012 1280 skorolev Clean code and made changes for non-blocking dialog
|
||||
* Oct 30, 2012 1297 skorolev Changed HashMap to Map
|
||||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
|
||||
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
|
||||
* Oct 16, 2014 3220 skorolev Corrected ssAreaConfig assignment.
|
||||
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
|
||||
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with ssAreaConfig.
|
||||
* Jan 27, 2015 3220 skorolev Removed local getMonitorAreaConfig method.Updated configUpdate method and added updateMonitoringArea.
|
||||
* Corrected ssAreaConfig assignment. Moved refreshing of table in the UI thread.
|
||||
* Replaced MonitoringArea with ssAreaConfig.Updated code for better performance.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -109,13 +107,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
private SSMonitoringAreaConfigDlg areaDialog = null;
|
||||
|
||||
/** configuration manager **/
|
||||
private FSSObsMonitorConfigurationManager ssAreaConfig = null;
|
||||
|
||||
/**
|
||||
* This object contains all observation data necessary for the table dialogs
|
||||
* and trending plots
|
||||
*/
|
||||
private ObMultiHrsReports obData;
|
||||
private static FSSObsMonitorConfigurationManager ssAreaConfig = null;
|
||||
|
||||
/** table data for the zone table **/
|
||||
private final TableData zoneTableData = new TableData(
|
||||
|
@ -134,9 +126,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
/** List of SAFESEAS resource listeners **/
|
||||
private final List<ISSResourceListener> safeSeasResources = new ArrayList<ISSResourceListener>();
|
||||
|
||||
/** Time which Zone/County dialog shows. **/
|
||||
private Date dialogTime = null;
|
||||
|
||||
/** list of coordinates for each zone **/
|
||||
private Map<String, Geometry> zoneGeometries = null;
|
||||
|
||||
|
@ -164,7 +153,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
initObserver(OBS, this);
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
|
||||
obData.setThresholdMgr(SSThresholdMgr.getInstance());
|
||||
obData.getZoneTableData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -173,12 +161,9 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
public static synchronized SafeSeasMonitor getInstance() {
|
||||
if (monitor == null) {
|
||||
monitor = new SafeSeasMonitor();
|
||||
// Pre-populate dialog with an observation (METAR) for KOMA
|
||||
monitor.createDataStructures();
|
||||
monitor.getAdjAreas();
|
||||
List<String> zones = monitor.ssAreaConfig.getAreaList();
|
||||
monitor.processProductAtStartup(zones);
|
||||
monitor.fireMonitorEvent(monitor);
|
||||
monitor.processProductAtStartup(ssAreaConfig);
|
||||
}
|
||||
return monitor;
|
||||
}
|
||||
|
@ -213,26 +198,21 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
*/
|
||||
public void launchDialog(String type, Shell shell) {
|
||||
if (type.equals("zone")) {
|
||||
if (zoneDialog == null) {
|
||||
zoneDialog = new SSZoneTableDlg(shell, obData);
|
||||
addMonitorListener(zoneDialog);
|
||||
zoneDialog.addMonitorControlListener(this);
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
zoneDialog = new SSZoneTableDlg(shell, obData);
|
||||
addMonitorListener(zoneDialog);
|
||||
zoneDialog.addMonitorControlListener(this);
|
||||
zoneDialog.open();
|
||||
} else if (type.equals("area")) {
|
||||
if (areaDialog == null) {
|
||||
areaDialog = new SSMonitoringAreaConfigDlg(shell,
|
||||
"SAFESEAS Monitor Area Configuration");
|
||||
areaDialog.setCloseCallback(new ICloseCallback() {
|
||||
areaDialog = new SSMonitoringAreaConfigDlg(shell,
|
||||
"SAFESEAS Monitor Area Configuration");
|
||||
areaDialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
areaDialog = null;
|
||||
}
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
areaDialog = null;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
areaDialog.open();
|
||||
}
|
||||
}
|
||||
|
@ -271,8 +251,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
@Override
|
||||
public void processProductMessage(final AlertMessage filtered) {
|
||||
if (ssPattern.matcher(filtered.dataURI).matches()) {
|
||||
final List<String> zones = ssAreaConfig.getAreaList();
|
||||
processURI(filtered.dataURI, filtered, zones);
|
||||
processURI(filtered.dataURI, filtered, ssAreaConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -328,8 +307,11 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
@Override
|
||||
public void configUpdate(IMonitorConfigurationEvent me) {
|
||||
ssAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource();
|
||||
zoneDialog.refreshZoneTableData(obData);
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
obData.getObHourReports().updateZones(ssAreaConfig);
|
||||
if (zoneDialog != null && !zoneDialog.isDisposed()) {
|
||||
obData.updateTableCache();
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -383,6 +365,8 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
@Override
|
||||
protected void process(ObReport result) throws Exception {
|
||||
obData.addReport(result);
|
||||
// update table cache
|
||||
obData.getZoneTableData(result.getRefHour());
|
||||
fireMonitorEvent(this);
|
||||
}
|
||||
|
||||
|
@ -391,30 +375,18 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
*
|
||||
* @param dialogTime
|
||||
*/
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.monitor.ObsMonitor#updateDialogTime(java.util.Date)
|
||||
*/
|
||||
@Override
|
||||
public void updateDialogTime(Date dialogTime) {
|
||||
this.dialogTime = dialogTime;
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Dialog Time.
|
||||
*
|
||||
* @return dialogTime
|
||||
*/
|
||||
public Date getDialogTime() {
|
||||
return dialogTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the dialogTime
|
||||
*
|
||||
* @param dialogTime
|
||||
*/
|
||||
public void setDialogTime(Date dialogTime) {
|
||||
this.dialogTime = dialogTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds recourse listener
|
||||
*
|
||||
|
@ -460,7 +432,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
*/
|
||||
@Override
|
||||
public ArrayList<Date> getTimeOrderedKeys(IMonitor monitor, String type) {
|
||||
// Not used
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -200,14 +200,6 @@ public class SafeSeasResourceData extends AbstractRequestableResourceData {
|
|||
return fogThreatSS;
|
||||
}
|
||||
|
||||
/** Get the SafeSeasMonitor monitor **/
|
||||
protected SafeSeasMonitor getFogMonitor() {
|
||||
if (monitor == null) {
|
||||
monitor = SafeSeasMonitor.getInstance();
|
||||
}
|
||||
return monitor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return plotSource
|
||||
*/
|
||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Oct 27, 2014 3667 skorolev Cleaned code.
|
||||
* Nov 21, 2014 3841 skorolev Corrected handleOkBtnSelection.
|
||||
* Dec 11, 2014 3220 skorolev Removed unnecessary code.
|
||||
* Feb 03, 2015 3841 skorolev Replaced resetParams with resetStatus.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -72,7 +73,6 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
*/
|
||||
public SSMonitoringAreaConfigDlg(Shell parent, String title) {
|
||||
super(parent, title, AppName.SAFESEAS);
|
||||
SafeSeasMonitor.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -102,7 +102,7 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
}
|
||||
}
|
||||
fireConfigUpdateEvent();
|
||||
resetParams();
|
||||
resetStatus();
|
||||
} else { // Return back to continue edit.
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -54,10 +54,11 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
|
|||
* Dec 30, 2009 3424 zhao use ObMultiHrsReports for obs data archive
|
||||
* Oct 30, 2012 1297 skorolev Changed HashMap to Map
|
||||
* Nov 10, 2012 1297 skorolev Added initiateProdArray
|
||||
* Dec 7, 2012 #1351 skorolev Changes for non-blocking dialogs.
|
||||
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs.
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
|
||||
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
|
||||
* Jan 27, 2015 3220 skorolev Removed "site". Added check on dispose.Corrected configMgr assignment.
|
||||
* Added table cache update.
|
||||
* Feb 04, 2015 3841 skorolev Corrected notify method for empty table update.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -81,6 +82,9 @@ public class SSZoneTableDlg extends ZoneTableDlg {
|
|||
public SSZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
|
||||
super(parent, obData, CommonConfig.AppName.SAFESEAS);
|
||||
configMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
|
||||
obData.updateTableCache();
|
||||
zoneTblData = obData.getZoneTableData();
|
||||
zoneTblData.sortData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,10 +155,10 @@ public class SSZoneTableDlg extends ZoneTableDlg {
|
|||
|
||||
if (me.getSource() instanceof SafeSeasMonitor) {
|
||||
SafeSeasMonitor monitor = (SafeSeasMonitor) me.getSource();
|
||||
ObMultiHrsReports obData = monitor.getObData();
|
||||
Date date = monitor.getDialogTime();
|
||||
if (date != null) {
|
||||
Date nominalTime = date;
|
||||
ObMultiHrsReports obData = monitor.getObData();
|
||||
if (!isLinkedToFrame()) {
|
||||
nominalTime = obData.getLatestNominalTime();
|
||||
}
|
||||
|
@ -163,6 +167,8 @@ public class SSZoneTableDlg extends ZoneTableDlg {
|
|||
obData.setFogAlgCellType(monitor.getAlgCellTypes(fogAlgThreats));
|
||||
this.updateTableDlg(monitor.getObData().getObHourReports(
|
||||
nominalTime));
|
||||
} else {
|
||||
this.updateZoneTable(obData.getLatestNominalTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +286,7 @@ public class SSZoneTableDlg extends ZoneTableDlg {
|
|||
* setZoneSortColumnAndDirection()
|
||||
*/
|
||||
@Override
|
||||
protected void setZoneSortColumnAndDirection() {
|
||||
public void setZoneSortColumnAndDirection() {
|
||||
if (zoneTblData != null) {
|
||||
zoneSortColumn = zoneTblData.getSortColumn();
|
||||
zoneSortDirection = zoneTblData.getSortDirection();
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package com.raytheon.uf.viz.monitor.snow;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -69,10 +68,10 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Nov. 1, 2012 1297 skorolev Changed HashMap to Map and clean code
|
||||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
|
||||
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
|
||||
* Oct 16, 2014 3220 skorolev Corrected snowConfig assignment.
|
||||
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
|
||||
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with snowAreaConfig.
|
||||
* Jan 27, 2015 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
|
||||
* Corrected snowConfig assignment.Corrected snowConfig assignment.
|
||||
* Moved refreshing of table in the UI thread.Replaced MonitoringArea with snowAreaConfig.
|
||||
* Updated code for better performance.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -96,13 +95,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
private SnowMonitoringAreaConfigDlg areaDialog = null;
|
||||
|
||||
/** SNOW configuration manager **/
|
||||
private FSSObsMonitorConfigurationManager snowAreaConfig = null;
|
||||
|
||||
/**
|
||||
* This object contains all observation data necessary for the table dialogs
|
||||
* and trending plots
|
||||
*/
|
||||
private ObMultiHrsReports obData;
|
||||
private static FSSObsMonitorConfigurationManager snowAreaConfig = null;
|
||||
|
||||
/** All SNOW datauri start with this */
|
||||
private final String OBS = "fssobs";
|
||||
|
@ -110,9 +103,6 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
/** regex wild card filter */
|
||||
private final String wildCard = "[\\w\\(\\)-_:.]+";
|
||||
|
||||
/** Time which Zone/County dialog shows. **/
|
||||
private Date dialogTime = null;
|
||||
|
||||
/** Array of snow listeners **/
|
||||
private final List<ISnowResourceListener> snowResources = new ArrayList<ISnowResourceListener>();
|
||||
|
||||
|
@ -131,7 +121,6 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
initObserver(OBS, this);
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);
|
||||
obData.setThresholdMgr(SnowThresholdMgr.getInstance());
|
||||
obData.getZoneTableData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,13 +131,17 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
public static synchronized SnowMonitor getInstance() {
|
||||
if (monitor == null) {
|
||||
monitor = new SnowMonitor();
|
||||
List<String> zones = monitor.snowAreaConfig.getAreaList();
|
||||
monitor.processProductAtStartup(zones);
|
||||
monitor.fireMonitorEvent(monitor);
|
||||
monitor.createDataStructures();
|
||||
monitor.processProductAtStartup(snowAreaConfig);
|
||||
}
|
||||
return monitor;
|
||||
}
|
||||
|
||||
private void createDataStructures() {
|
||||
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);
|
||||
obData.setThresholdMgr(SnowThresholdMgr.getInstance());
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-initialization of monitor.
|
||||
*
|
||||
|
@ -169,26 +162,21 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
*/
|
||||
public void launchDialog(String type, Shell shell) {
|
||||
if (type.equals("zone")) {
|
||||
if (zoneDialog == null) {
|
||||
zoneDialog = new SnowZoneTableDlg(shell, obData);
|
||||
addMonitorListener(zoneDialog);
|
||||
zoneDialog.addMonitorControlListener(this);
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
zoneDialog = new SnowZoneTableDlg(shell, obData);
|
||||
addMonitorListener(zoneDialog);
|
||||
zoneDialog.addMonitorControlListener(this);
|
||||
zoneDialog.open();
|
||||
} else if (type.equals("area")) {
|
||||
if (areaDialog == null) {
|
||||
areaDialog = new SnowMonitoringAreaConfigDlg(shell,
|
||||
"SNOW Monitor Area Configuration");
|
||||
areaDialog.setCloseCallback(new ICloseCallback() {
|
||||
areaDialog = new SnowMonitoringAreaConfigDlg(shell,
|
||||
"SNOW Monitor Area Configuration");
|
||||
areaDialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
areaDialog = null;
|
||||
}
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
areaDialog = null;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
areaDialog.open();
|
||||
}
|
||||
}
|
||||
|
@ -236,21 +224,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
@Override
|
||||
public void processProductMessage(final AlertMessage filtered) {
|
||||
if (snowPattern.matcher(filtered.dataURI).matches()) {
|
||||
List<String> zones = snowAreaConfig.getAreaList();
|
||||
processURI(filtered.dataURI, filtered, zones);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort by Date.
|
||||
*
|
||||
* @author dhladky
|
||||
*
|
||||
*/
|
||||
public class SortByDate implements Comparator<Date> {
|
||||
@Override
|
||||
public int compare(Date o1, Date o2) {
|
||||
return o1.compareTo(o2);
|
||||
processURI(filtered.dataURI, filtered, snowAreaConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,8 +261,9 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
@Override
|
||||
public void configUpdate(IMonitorConfigurationEvent me) {
|
||||
snowAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource();
|
||||
obData.getObHourReports().updateZones(snowAreaConfig);
|
||||
if (zoneDialog != null && !zoneDialog.isDisposed()) {
|
||||
zoneDialog.refreshZoneTableData(obData);
|
||||
obData.updateTableCache();
|
||||
fireMonitorEvent(zoneDialog.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
@ -318,27 +293,10 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
@Override
|
||||
protected void process(ObReport result) throws Exception {
|
||||
obData.addReport(result);
|
||||
obData.getZoneTableData(result.getRefHour());
|
||||
fireMonitorEvent(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Dialog Time.
|
||||
*
|
||||
* @return dialogTime
|
||||
*/
|
||||
public Date getDialogTime() {
|
||||
return dialogTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets dialog time.
|
||||
*
|
||||
* @param dialogTime
|
||||
*/
|
||||
public void setDialogTime(Date dialogTime) {
|
||||
this.dialogTime = dialogTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a listener.
|
||||
*
|
||||
|
@ -359,16 +317,6 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
|
|||
snowResources.remove(isru);
|
||||
}
|
||||
|
||||
/**
|
||||
* SnowResource sets the Drawtime.
|
||||
*
|
||||
* @param dialogTime
|
||||
*/
|
||||
public void updateDialogTime(Date dialogTime) {
|
||||
this.dialogTime = dialogTime;
|
||||
fireMonitorEvent(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close SNOW zone table dialog.
|
||||
*/
|
||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Oct 27, 2014 3667 skorolev Cleaned code.
|
||||
* Nov 21, 2014 3841 skorolev Corrected handleOkBtnSelection.
|
||||
* Dec 11, 2014 3220 skorolev Removed unnecessary code.
|
||||
* Feb 03, 2015 3841 skorolev Replaced resetParams with resetStatus.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,7 +72,6 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
*/
|
||||
public SnowMonitoringAreaConfigDlg(Shell parent, String title) {
|
||||
super(parent, title, AppName.SNOW);
|
||||
SnowMonitor.getInstance();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -111,7 +111,7 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
}
|
||||
}
|
||||
fireConfigUpdateEvent();
|
||||
resetParams();
|
||||
resetStatus();
|
||||
} else { // Return back to continue edit.
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -53,8 +53,9 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
|
|||
* Nov. 8, 2012 1297 skorolev Added initiateProdArray method
|
||||
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
|
||||
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
|
||||
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
|
||||
* Jan 27, 2015 3220 skorolev Removed "site". Added check on dispose.Corrected configMgr assignment.
|
||||
* Added table cache update.
|
||||
* Feb 04, 2015 3841 skorolev Corrected notify method for empty table update.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -76,6 +77,9 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
|
|||
public SnowZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
|
||||
super(parent, obData, CommonConfig.AppName.SNOW);
|
||||
configMgr = FSSObsMonitorConfigurationManager.getSnowObsManager();
|
||||
obData.updateTableCache();
|
||||
zoneTblData = obData.getZoneTableData();
|
||||
zoneTblData.sortData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -144,12 +148,15 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
|
|||
|
||||
if (me.getSource() instanceof SnowMonitor) {
|
||||
SnowMonitor monitor = (SnowMonitor) me.getSource();
|
||||
ObMultiHrsReports obData = monitor.getObData();
|
||||
Date date = monitor.getDialogTime();
|
||||
if (date != null) {
|
||||
if (!isLinkedToFrame()) {
|
||||
date = monitor.getObData().getLatestNominalTime();
|
||||
date = obData.getLatestNominalTime();
|
||||
}
|
||||
this.updateTableDlg(monitor.getObData().getObHourReports(date));
|
||||
this.updateTableDlg(obData.getObHourReports(date));
|
||||
} else {
|
||||
this.updateZoneTable(obData.getLatestNominalTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ package com.raytheon.uf.viz.monitor;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -32,6 +33,7 @@ import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
|
|||
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecordTransform;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.inventory.exception.DataCubeException;
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -42,6 +44,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
||||
import com.raytheon.uf.viz.datacube.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.monitor.data.ObMultiHrsReports;
|
||||
import com.raytheon.uf.viz.monitor.data.ObReport;
|
||||
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
|
||||
import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
|
||||
|
@ -59,8 +62,7 @@ import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
|
|||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
* Feb 04, 2014 2757 skorolev Added filter for removed stations
|
||||
* May 08, 2014 3086 skorolev Added current site definition.
|
||||
* Sep 04, 2014 3220 skorolev Removed cwa and monitorUsefrom vals.
|
||||
* Jan 08, 2015 3220 skorolev Added zones parameter to processURI.
|
||||
* Jan 27, 2015 3220 skorolev Removed cwa and monitorUsefrom vals.Added zones parameter to processURI.Updated code for better performance.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -102,6 +104,15 @@ public abstract class ObsMonitor extends Monitor {
|
|||
/** these are the patterns for the stations **/
|
||||
protected ArrayList<Pattern> stationPatterns = new ArrayList<Pattern>();
|
||||
|
||||
/**
|
||||
* This object contains all observation data necessary for the table dialogs
|
||||
* and trending plots
|
||||
*/
|
||||
protected ObMultiHrsReports obData;
|
||||
|
||||
/** current time of monitor dialog */
|
||||
protected Date dialogTime;
|
||||
|
||||
/** Current CWA **/
|
||||
public static String cwa = LocalizationManager.getInstance().getSite();
|
||||
|
||||
|
@ -186,10 +197,11 @@ public abstract class ObsMonitor extends Monitor {
|
|||
*
|
||||
* @param dataURI
|
||||
* @param filtered
|
||||
* @param zones
|
||||
* @param areaConfig
|
||||
*/
|
||||
public void processURI(String dataURI, AlertMessage filtered,
|
||||
final List<String> zones) {
|
||||
final FSSObsMonitorConfigurationManager areaConfig) {
|
||||
List<String> zones = areaConfig.getAreaList();
|
||||
try {
|
||||
Map<String, RequestConstraint> constraints = RequestConstraint
|
||||
.toConstraintMapping(DataURIUtil.createDataURIMap(dataURI));
|
||||
|
@ -223,51 +235,55 @@ public abstract class ObsMonitor extends Monitor {
|
|||
* @param zones
|
||||
*
|
||||
*/
|
||||
public void processProductAtStartup(List<String> zones) {
|
||||
public void processProductAtStartup(
|
||||
FSSObsMonitorConfigurationManager areaConfig) {
|
||||
|
||||
/**
|
||||
* Assume this number for MaxNumObsTimes is larger enough to cover data
|
||||
* of all observations (at least 24 hours' worth of data) in database
|
||||
* [changed from 10 to 240 on May, 18, 2010 for DR #6015, zhao]
|
||||
*/
|
||||
int MaxNumObsTimes = 240;
|
||||
Map<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
||||
try {
|
||||
vals.put(FSSObsRecord.PLUGIN_NAME_ID, new RequestConstraint(
|
||||
FSSObsRecord.PLUGIN_NAME));
|
||||
List<String> zones = areaConfig.getAreaList();
|
||||
if (!zones.isEmpty()) {
|
||||
/**
|
||||
* Assume this number for MaxNumObsTimes is larger enough to cover
|
||||
* data of all observations (at least 24 hours' worth of data) in
|
||||
* database [changed from 10 to 240 on May, 18, 2010 for DR #6015,
|
||||
* zhao]
|
||||
*/
|
||||
int MaxNumObsTimes = 240;
|
||||
Map<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
||||
try {
|
||||
vals.put(FSSObsRecord.PLUGIN_NAME_ID, new RequestConstraint(
|
||||
FSSObsRecord.PLUGIN_NAME));
|
||||
|
||||
DataTime[] dataTimesAvailable = DataCubeContainer.performTimeQuery(
|
||||
vals, false);
|
||||
DataTime[] selectedTimes = dataTimesAvailable;
|
||||
DataTime[] dataTimesAvailable = DataCubeContainer
|
||||
.performTimeQuery(vals, false);
|
||||
DataTime[] selectedTimes = dataTimesAvailable;
|
||||
|
||||
// Ensure that the latest product is retrieved.
|
||||
// [Modified: retrieve at most MaxNumObsTimes data
|
||||
// points, Feb
|
||||
// 19, 2010, zhao]
|
||||
if (dataTimesAvailable.length > 0) {
|
||||
Arrays.sort(dataTimesAvailable);
|
||||
// at most, MaxNumObsTimes observation times are
|
||||
// considered
|
||||
if (dataTimesAvailable.length > MaxNumObsTimes) {
|
||||
selectedTimes = new DataTime[MaxNumObsTimes];
|
||||
System.arraycopy(dataTimesAvailable,
|
||||
dataTimesAvailable.length - MaxNumObsTimes,
|
||||
selectedTimes, 0, MaxNumObsTimes);
|
||||
}
|
||||
// Ensure that the latest product is retrieved.
|
||||
// [Modified: retrieve at most MaxNumObsTimes data
|
||||
// points, Feb
|
||||
// 19, 2010, zhao]
|
||||
if (dataTimesAvailable.length > 0) {
|
||||
Arrays.sort(dataTimesAvailable);
|
||||
// at most, MaxNumObsTimes observation times are
|
||||
// considered
|
||||
if (dataTimesAvailable.length > MaxNumObsTimes) {
|
||||
selectedTimes = new DataTime[MaxNumObsTimes];
|
||||
System.arraycopy(dataTimesAvailable,
|
||||
dataTimesAvailable.length - MaxNumObsTimes,
|
||||
selectedTimes, 0, MaxNumObsTimes);
|
||||
}
|
||||
|
||||
FSSObsRecord[] obsRecords = requestFSSObs(vals, selectedTimes);
|
||||
for (FSSObsRecord objectToSend : obsRecords) {
|
||||
// Filter removed stations
|
||||
if (!zones.isEmpty()) {
|
||||
ObReport result = GenerateFSSObReport
|
||||
FSSObsRecord[] obsRecords = requestFSSObs(vals,
|
||||
selectedTimes);
|
||||
for (FSSObsRecord objectToSend : obsRecords) {
|
||||
// Filter removed stations
|
||||
final ObReport result = GenerateFSSObReport
|
||||
.generateObReport(objectToSend);
|
||||
processAtStartup(result);
|
||||
}
|
||||
}
|
||||
} catch (DataCubeException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"No data in database at startup.");
|
||||
}
|
||||
} catch (DataCubeException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"No data in database at startup.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,4 +312,35 @@ public abstract class ObsMonitor extends Monitor {
|
|||
constraints);
|
||||
return FSSObsRecordTransform.toFSSObsRecords(pdc);
|
||||
}
|
||||
|
||||
public ObMultiHrsReports getObData() {
|
||||
return obData;
|
||||
}
|
||||
|
||||
public void setObData(ObMultiHrsReports obData) {
|
||||
this.obData = obData;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date for the dialog to stay in step with
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Date getDialogTime() {
|
||||
return dialogTime;
|
||||
}
|
||||
|
||||
public void setDialogTime(Date dialogTime) {
|
||||
this.dialogTime = dialogTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resource sets the Drawtime.
|
||||
*
|
||||
* @param dialogTime
|
||||
*/
|
||||
public void updateDialogTime(Date dialogTime) {
|
||||
this.dialogTime = dialogTime;
|
||||
fireMonitorEvent(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -46,7 +47,7 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
|
|||
* Oct.31, 2012 1297 skorolev Cleaned code.
|
||||
* Sep 04, 2014 3220 skorolev Added updateZones method.
|
||||
* Dec 18, 2014 3841 skorolev Corrected updateZones method.
|
||||
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with areaConfig.
|
||||
* Jan 27, 2015 3220 skorolev Replaced MonitoringArea with areaConfig.Changed updateZones method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -107,22 +108,16 @@ public class ObHourReports {
|
|||
.getAreaByStationId(station);
|
||||
if (zones.size() == 0) {
|
||||
statusHandler
|
||||
.error("Error: station: "
|
||||
.info("Error: station: "
|
||||
+ station
|
||||
+ " is not associated with any zone in the monitoring area");
|
||||
return;
|
||||
}
|
||||
boolean hasZone = false;
|
||||
for (String zone : zones) {
|
||||
if (hourReports.containsKey(zone)) {
|
||||
hasZone = true;
|
||||
hourReports.get(zone).addReport(report);
|
||||
}
|
||||
}
|
||||
if (hasZone == false) {
|
||||
statusHandler
|
||||
.error("Error in addreport() of ObHourReports: unable to add obs report to data archive");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -224,10 +219,12 @@ public class ObHourReports {
|
|||
|
||||
/**
|
||||
* Updates zones in the Hour Reports
|
||||
*
|
||||
* @param configMgr
|
||||
*/
|
||||
public void updateZones() {
|
||||
public void updateZones(FSSObsMonitorConfigurationManager configMgr) {
|
||||
// Updated list of zones
|
||||
List<String> updtZones = thresholdMgr.getAreaConfigMgr().getAreaList();
|
||||
List<String> updtZones = configMgr.getAreaList();
|
||||
// remove zones
|
||||
hourReports.keySet().retainAll(updtZones);
|
||||
// add zones
|
||||
|
|
158
cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/data/ObMultiHrsReports.java
Executable file → Normal file
158
cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/data/ObMultiHrsReports.java
Executable file → Normal file
|
@ -29,6 +29,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
|
@ -53,9 +54,10 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
|
|||
* Dec 24, 2009 3424 zhao added getTrendDataSet() that returns ObTrendDataSet object
|
||||
* Jan 25, 2010 4281, 3888, 3877 wkwock/zhao added getHistTableData method
|
||||
* Oct.31, 2012 1297 skorolev Clean code.
|
||||
* Jan. 29, 2013 15654 zhao add Wind Chill calculation for SNOW
|
||||
* Sep 04, 2014 3220 skorolev Updated getStationTableData method.
|
||||
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with cfgMgr.
|
||||
* Jan.29, 2013 15654 zhao add Wind Chill calculation for SNOW
|
||||
* Jan 27, 2015 3220 skorolev Updated getStationTableData method.Replaced MonitoringArea with cfgMgr.
|
||||
* Added multiHrsTabData - Table data cache.
|
||||
* Feb 04, 2015 3841 skorolev Corrected getEmptyZoneTableData method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -81,9 +83,14 @@ public class ObMultiHrsReports {
|
|||
private CommonConfig.AppName appName;
|
||||
|
||||
/**
|
||||
* key is nominal time, value is ObHourReports object
|
||||
* FSSObs records cache. Key is nominal time, value is ObHourReports object
|
||||
*/
|
||||
private SortedMap<Date, ObHourReports> multiHrsReports;
|
||||
private SortedMap<Date, ObHourReports> multiHrsReports = new TreeMap<Date, ObHourReports>();
|
||||
|
||||
/**
|
||||
* Monitor Table data cache. Key is nominal time, value is TableData
|
||||
*/
|
||||
private ConcurrentHashMap<Date, TableData> multiHrsTabData = new ConcurrentHashMap<Date, TableData>();
|
||||
|
||||
/**
|
||||
* The maximum number of most recent hours within which observation reports
|
||||
|
@ -100,29 +107,10 @@ public class ObMultiHrsReports {
|
|||
*/
|
||||
public ObMultiHrsReports(CommonConfig.AppName appName) {
|
||||
this.appName = appName;
|
||||
multiHrsReports = new TreeMap<Date, ObHourReports>();
|
||||
if (appName.equals(AppName.FOG) || appName.equals(AppName.SAFESEAS)) {
|
||||
initFogAlgCellType();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an array of ObReport objects to the ObMultiHrsReports object (Don't
|
||||
* use! VK)
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
public void addReports(ObReport[] results) {
|
||||
for (ObReport report : results) {
|
||||
/**
|
||||
* DR #8723: if wind speed is zero, wind direction should be N/A,
|
||||
* not 0
|
||||
*/
|
||||
if (report.getWindSpeed() < 0.0001) { // zero wind speed
|
||||
report.setWindDir(ObConst.MISSING);
|
||||
}
|
||||
addReport(report);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,8 +120,6 @@ public class ObMultiHrsReports {
|
|||
* @return returns multiHrsReports
|
||||
*/
|
||||
public void addReport(ObReport report) {
|
||||
// Date nominalTime = TableUtil
|
||||
// .getNominalTime(report.getObservationTime());
|
||||
Date nominalTime = report.getRefHour();
|
||||
/**
|
||||
* DR #8723: if wind speed is zero, wind direction should be N/A, not 0
|
||||
|
@ -160,22 +146,24 @@ public class ObMultiHrsReports {
|
|||
report.setWindChill(calcWindChill(report.getTemperature(),
|
||||
report.getWindSpeed()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (multiHrsReports.containsKey(nominalTime)) {
|
||||
multiHrsReports.get(nominalTime).addReport(report);
|
||||
ObHourReports obHourReports;
|
||||
// new nominal time; create a new ObHourReports object
|
||||
if (multiHrsReports.isEmpty()
|
||||
|| !multiHrsReports.containsKey(nominalTime)) {
|
||||
obHourReports = new ObHourReports(nominalTime, appName,
|
||||
thresholdMgr);
|
||||
} else {
|
||||
// new nominal time; create a new ObHourReports object
|
||||
// the map is full; delete the oldest entry
|
||||
if (multiHrsReports.size() >= maxFrames) {
|
||||
// the map is full; delete the oldest entry
|
||||
multiHrsReports.remove(multiHrsReports.firstKey());
|
||||
}
|
||||
ObHourReports obHourReports = new ObHourReports(nominalTime,
|
||||
appName, thresholdMgr);
|
||||
obHourReports.addReport(report);
|
||||
multiHrsReports.put(nominalTime, obHourReports);
|
||||
// update multiHrsReports with new data
|
||||
obHourReports = multiHrsReports.get(nominalTime);
|
||||
}
|
||||
obHourReports.addReport(report);
|
||||
// update data cache
|
||||
multiHrsReports.put(nominalTime, obHourReports);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,26 +204,31 @@ public class ObMultiHrsReports {
|
|||
/**
|
||||
* Returns a zone TableData object for a caller-specified nominal-time. If
|
||||
* no data available, returns an empty/default zone TableData object (table
|
||||
* cells filled with "N/A").
|
||||
* cells filled with "N/A"). Updates multiHrsTabData table cache.
|
||||
*
|
||||
* @param nominalTime
|
||||
* @return
|
||||
*/
|
||||
public TableData getZoneTableData(Date nominalTime) {
|
||||
TableData tabData = null;
|
||||
if (nominalTime == null || !multiHrsReports.containsKey(nominalTime)) {
|
||||
return getEmptyZoneTableData();
|
||||
}
|
||||
if (appName == AppName.FOG) {
|
||||
return this.getObHourReports(nominalTime).getFogZoneTableData(
|
||||
tabData = this.getObHourReports(nominalTime).getFogZoneTableData(
|
||||
fogAlgCellType);
|
||||
}
|
||||
if (appName == AppName.SAFESEAS) {
|
||||
return this.getObHourReports(nominalTime).getSSZoneTableData(
|
||||
} else if (appName == AppName.SAFESEAS) {
|
||||
tabData = this.getObHourReports(nominalTime).getSSZoneTableData(
|
||||
fogAlgCellType);
|
||||
}
|
||||
|
||||
return this.getObHourReports(nominalTime).getZoneTableData();
|
||||
// return multiHrsReports.get(nominalTime).getZoneTableData();
|
||||
} else {
|
||||
tabData = this.getObHourReports(nominalTime).getZoneTableData();
|
||||
}
|
||||
// update table data cache
|
||||
if (multiHrsTabData.replace(nominalTime, tabData) == null) {
|
||||
multiHrsTabData.put(nominalTime, tabData);
|
||||
}
|
||||
return tabData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,10 +241,19 @@ public class ObMultiHrsReports {
|
|||
.getSystemTime().getTime());
|
||||
ObHourReports hourReports = new ObHourReports(nominalTime, appName,
|
||||
thresholdMgr);
|
||||
TableData tabData = null;
|
||||
if (appName == AppName.FOG) {
|
||||
return hourReports.getFogZoneTableData(fogAlgCellType);
|
||||
tabData = hourReports.getFogZoneTableData(fogAlgCellType);
|
||||
} else {
|
||||
tabData = hourReports.getZoneTableData();
|
||||
}
|
||||
return hourReports.getZoneTableData();
|
||||
// update data cache
|
||||
multiHrsReports.put(nominalTime, hourReports);
|
||||
// update cache with empty table data
|
||||
if (multiHrsTabData.replace(nominalTime, tabData) == null) {
|
||||
multiHrsTabData.put(nominalTime, tabData);
|
||||
}
|
||||
return tabData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -483,7 +485,26 @@ public class ObMultiHrsReports {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets MultiHrsReports
|
||||
* Gets table cache
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ConcurrentHashMap<Date, TableData> getMultiHrsTabData() {
|
||||
return multiHrsTabData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets table cache
|
||||
*
|
||||
* @param multiHrsTabData
|
||||
*/
|
||||
public void setMultiHrsTabData(
|
||||
ConcurrentHashMap<Date, TableData> multiHrsTabData) {
|
||||
this.multiHrsTabData = multiHrsTabData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets data cache
|
||||
*
|
||||
* @return SortedMap object <nominal time, ObHourReports object>
|
||||
*/
|
||||
|
@ -492,27 +513,13 @@ public class ObMultiHrsReports {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets MultiHrsTableData Returns a SortedMap object (key is nominal time,
|
||||
* value is zone TableData object)
|
||||
* Sets data cache
|
||||
*
|
||||
* @return
|
||||
* @param multiHrsReports
|
||||
*/
|
||||
public SortedMap<Date, TableData> getMultiHrsTableData() {
|
||||
SortedMap<Date, TableData> multiHrsTblData = new TreeMap<Date, TableData>();
|
||||
if (appName == AppName.FOG) {
|
||||
for (Date nominalTime : multiHrsReports.keySet()) {
|
||||
multiHrsTblData.put(
|
||||
nominalTime,
|
||||
multiHrsReports.get(nominalTime).getFogZoneTableData(
|
||||
fogAlgCellType));
|
||||
}
|
||||
return multiHrsTblData;
|
||||
}
|
||||
for (Date nominalTime : multiHrsReports.keySet()) {
|
||||
multiHrsTblData.put(nominalTime, multiHrsReports.get(nominalTime)
|
||||
.getZoneTableData());
|
||||
}
|
||||
return multiHrsTblData;
|
||||
public void setMultiHrsReports(
|
||||
SortedMap<Date, ObHourReports> multiHrsReports) {
|
||||
this.multiHrsReports = multiHrsReports;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -549,8 +556,14 @@ public class ObMultiHrsReports {
|
|||
*/
|
||||
public ObHourReports getObHourReports() {
|
||||
if (multiHrsReports.isEmpty()) {
|
||||
return new ObHourReports(TableUtil.getNominalTime(SimulatedTime
|
||||
.getSystemTime().getTime()), appName, thresholdMgr);
|
||||
ObHourReports obHrsReps = new ObHourReports(
|
||||
TableUtil.getNominalTime(SimulatedTime.getSystemTime()
|
||||
.getTime()), appName, thresholdMgr);
|
||||
Date refTm = obHrsReps.getNominalTime();
|
||||
TableData tabData = obHrsReps.getZoneTableData();
|
||||
multiHrsTabData.clear();
|
||||
multiHrsTabData.put(refTm, tabData);
|
||||
return obHrsReps;
|
||||
}
|
||||
return multiHrsReports.get(multiHrsReports.lastKey());
|
||||
}
|
||||
|
@ -635,4 +648,13 @@ public class ObMultiHrsReports {
|
|||
}
|
||||
setFogAlgCellType(fogAlgCellType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates table cache
|
||||
*/
|
||||
public void updateTableCache() {
|
||||
for (Date time : multiHrsReports.keySet()) {
|
||||
getZoneTableData(time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Apr 28, 2014 3086 skorolev Removed local getAreaConfigMgr method.
|
||||
* Nov 10, 2014 3741 skorolev Fixed configXML issue.
|
||||
* Nov 21, 2014 3841 skorolev Content of ID field made an editable.
|
||||
* Feb 03, 2015 3841 skorolev Fixed deleteSelected method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -358,9 +359,14 @@ public class EditNewZoneDlg extends CaveSWTDialog {
|
|||
}
|
||||
String area = zoneList.getItem(zoneList.getSelectionIndex());
|
||||
zoneList.remove(zoneList.getSelectionIndex());
|
||||
idTF.setText("");
|
||||
latTF.setText("");
|
||||
lonTF.setText("");
|
||||
zoneList.select(0);
|
||||
if (zoneList.getItemCount() != 0) {
|
||||
handleZoneSelection();
|
||||
} else {
|
||||
idTF.setText("");
|
||||
latTF.setText("");
|
||||
lonTF.setText("");
|
||||
}
|
||||
if (macDlg.getMaZones().contains(area)) {
|
||||
macDlg.getMaZones().remove(area);
|
||||
macDlg.configMgr.removeArea(area);
|
||||
|
|
|
@ -80,6 +80,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Nov 12, 2014 3650 skorolev Added confirmation box for unsaved changes in the dialog.
|
||||
* Nov 21, 2014 3841 skorolev Added formIsValid method.
|
||||
* Dec 18, 2014 3841 skorolev Corrected addZoneStn method.
|
||||
* Feb 03, 2015 3841 skorolev Fixed saving problem for distance and time.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1336,18 +1337,11 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
|||
populateMaRegionalList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset configuration parameters.
|
||||
*/
|
||||
protected void resetParams() {
|
||||
getValues();
|
||||
resetStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saving configuration parameters.
|
||||
*/
|
||||
protected void saveConfigs() {
|
||||
getValues();
|
||||
configMgr.saveConfigXml();
|
||||
configMgr.saveAdjacentAreaConfigXml();
|
||||
}
|
||||
|
|
37
cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/ui/dialogs/ZoneTableDlg.java
Normal file → Executable file
37
cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/ui/dialogs/ZoneTableDlg.java
Normal file → Executable file
|
@ -94,9 +94,8 @@ import com.vividsolutions.jts.io.ParseException;
|
|||
* Nov.11, 2012 1297 skorolev new abstract initiateProdArray()
|
||||
* May 13, 2014 3133 njensen Updated getting ObsHistType from configMgr
|
||||
* May 15, 2014 3086 skorolev Replaced MonitorConfigurationManager with FSSObsMonitorConfigurationManager.
|
||||
* Sep 15, 2014 3220 skorolev Added refreshZoneTableData method.
|
||||
* Oct 17, 2014 3220 skorolev Added condition into launchTrendPlot to avoid NPE.
|
||||
* Nov 03, 2014 3741 skorolev Updated zoom procedures.
|
||||
* Jan 27, 2015 3220 skorolev Added refreshZoneTableData method.Added condition into launchTrendPlot to avoid NPE.Updated code for better performance.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -260,9 +259,6 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
|
|||
this.site = LocalizationManager.getInstance().getCurrentSite();
|
||||
dFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
this.obData = obData;
|
||||
// the zone table data of the latest nominal time:
|
||||
zoneTblData = obData.getZoneTableData();
|
||||
zoneTblData.sortData();
|
||||
nominalTime = obData.getLatestNominalTime();
|
||||
}
|
||||
|
||||
|
@ -458,12 +454,16 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
|
|||
* their current values
|
||||
*/
|
||||
setZoneSortColumnAndDirection();
|
||||
zoneTblData = obData.getZoneTableData(date);
|
||||
zoneTblData
|
||||
.setSortColumnAndDirection(zoneSortColumn, zoneSortDirection);
|
||||
zoneTblData.sortData();
|
||||
zoneTable.setTableData(zoneTblData);
|
||||
zoneTable.table.redraw();
|
||||
// get tab cache data
|
||||
zoneTblData = obData.getMultiHrsTabData().get(date);
|
||||
// update table if there are tab data in cache
|
||||
if (zoneTblData != null) {
|
||||
zoneTblData.setSortColumnAndDirection(zoneSortColumn,
|
||||
zoneSortDirection);
|
||||
zoneTblData.sortData();
|
||||
zoneTable.setTableData(zoneTblData);
|
||||
zoneTable.table.redraw();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -495,7 +495,7 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
|
|||
/**
|
||||
* Sets Column and Sort Direction for Zone table.
|
||||
*/
|
||||
protected void setZoneSortColumnAndDirection() {
|
||||
public void setZoneSortColumnAndDirection() {
|
||||
if (zoneTblData != null) {
|
||||
zoneSortColumn = zoneTblData.getSortColumn();
|
||||
zoneSortDirection = zoneTblData.getSortDirection();
|
||||
|
@ -605,6 +605,9 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
|
|||
*/
|
||||
@Override
|
||||
public void zoneTableAction(int rowNum) {
|
||||
|
||||
zoneTblData = obData.getZoneTableData(nominalTime);
|
||||
zoneTblData.sortData();
|
||||
// set selectedZone to the selected zone
|
||||
selectedZone = zoneTblData.getTableRows().get(rowNum)
|
||||
.getTableCellData(0).getCellText();
|
||||
|
@ -968,14 +971,4 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
|
|||
}
|
||||
return varName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refreshes Zone Table.
|
||||
*
|
||||
* @param obData
|
||||
*/
|
||||
public void refreshZoneTableData(ObMultiHrsReports obData) {
|
||||
obData.getObHourReports().updateZones();
|
||||
this.updateTableDlg(obData.getObHourReports());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ Developed on the Raytheon Visualization Environment (viz)
|
|||
-Dorg.eclipse.update.reconcile=false
|
||||
-Dqpid.dest_syntax=BURL
|
||||
-Dorg.eclipse.update.reconcile=false
|
||||
-Dorg.eclipse.swt.internal.gtk.cairoGraphics=false
|
||||
-XX:MaxPermSize=128m
|
||||
-Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme
|
||||
-Dqpid.dest_syntax=BURL
|
||||
|
|
|
@ -62,6 +62,7 @@ import com.raytheon.uf.viz.thinclient.ui.ThinClientConnectivityDialog;
|
|||
* May 19, 2014 3164 bsteffen Disable request compression if it
|
||||
* doesn't work.
|
||||
* Sep 05, 2014 3570 bclement HTTP client API changes
|
||||
* Jan 26, 2014 3952 njensen gzip handled by default
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -87,7 +88,6 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer {
|
|||
HttpClient httpClient = HttpClient.getInstance();
|
||||
HttpClientConfigBuilder confBuilder = new HttpClientConfigBuilder(
|
||||
httpClient.getConfig());
|
||||
confBuilder.setHandlingGzipResponses(true);
|
||||
HttpClient.configureGlobalInstance(confBuilder.build());
|
||||
if (promptUI) {
|
||||
ThinClientConnectivityDialog dlg = new ThinClientConnectivityDialog(
|
||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.viz.gfe.smartscript.FieldDefinition;
|
|||
* Oct 14, 2014 3676 njensen Moved getNumpyResult(GridType) here and
|
||||
* hardened it by separating jep.getValue()
|
||||
* calls from python copying/casting to correct types
|
||||
* Feb 05, 2015 4089 njensen Replaced previous hardening with ensureResultType()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -116,11 +117,11 @@ public abstract class BaseGfePyController extends PythonScriptController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Processes a module's varDict (variable list inputs), or sets the varDict
|
||||
* to an empty dictionary if there is not a variable list
|
||||
* Sets a module's varDict (variable list inputs), or sets the varDict to
|
||||
* None if there is not a variable list
|
||||
*
|
||||
* @param moduleName
|
||||
* the name of the module to process the varDict for
|
||||
* @param varDict
|
||||
* a string representation of a python dictionary
|
||||
* @throws JepException
|
||||
*/
|
||||
public void setVarDict(String varDict) throws JepException {
|
||||
|
@ -203,59 +204,20 @@ public abstract class BaseGfePyController extends PythonScriptController {
|
|||
|
||||
if (resultFound) {
|
||||
int xDim, yDim = 0;
|
||||
/*
|
||||
* correctType is just a memory optimization. A copy is made when we
|
||||
* call getValue(numpyArray), but doing array.astype(dtype) or
|
||||
* numpy.ascontiguousarray(array, dtype) will create yet another
|
||||
* copy.
|
||||
*
|
||||
* Note that if you attempt jep.getValue(array.astype(dtype)) or
|
||||
* jep.getValue(numpy.ascontiguousarray(array, dtype)) you can
|
||||
* potentially crash the JVM. jep.getValue(variable) should
|
||||
* primarily retrieve variables that are globally scoped in the
|
||||
* python interpreter as opposed to created on the fly.
|
||||
*/
|
||||
boolean correctType = false;
|
||||
|
||||
// this will safely alter the result dtypes in place if necessary
|
||||
ensureResultType(type);
|
||||
|
||||
switch (type) {
|
||||
case SCALAR:
|
||||
correctType = (boolean) jep.getValue(RESULT
|
||||
+ ".dtype.name == 'float32'");
|
||||
if (!correctType) {
|
||||
/*
|
||||
* the following line needs to be separate from
|
||||
* jep.getValue() to be stable
|
||||
*/
|
||||
jep.eval(RESULT + " = numpy.ascontiguousarray(" + RESULT
|
||||
+ ", numpy.float32)");
|
||||
}
|
||||
// don't make python func calls within a jep.getValue() call
|
||||
float[] scalarData = (float[]) jep.getValue(RESULT);
|
||||
xDim = (Integer) jep.getValue(RESULT + ".shape[1]");
|
||||
yDim = (Integer) jep.getValue(RESULT + ".shape[0]");
|
||||
result = new Grid2DFloat(xDim, yDim, scalarData);
|
||||
break;
|
||||
case VECTOR:
|
||||
correctType = (boolean) jep.getValue(RESULT
|
||||
+ "[0].dtype.name == 'float32'");
|
||||
if (!correctType) {
|
||||
/*
|
||||
* the following line needs to be separate from
|
||||
* jep.getValue() to be stable
|
||||
*/
|
||||
jep.eval(RESULT + "[0] = numpy.ascontiguousarray(" + RESULT
|
||||
+ "[0], numpy.float32)");
|
||||
}
|
||||
|
||||
correctType = (boolean) jep.getValue(RESULT
|
||||
+ "[1].dtype.name == 'float32'");
|
||||
if (!correctType) {
|
||||
/*
|
||||
* the following line needs to be separate from
|
||||
* jep.getValue() to be stable
|
||||
*/
|
||||
jep.eval(RESULT + "[1] = numpy.ascontiguousarray(" + RESULT
|
||||
+ "[1], numpy.float32)");
|
||||
}
|
||||
|
||||
// don't make python func calls within a jep.getValue() call
|
||||
float[] mag = (float[]) jep.getValue(RESULT + "[0]");
|
||||
float[] dir = (float[]) jep.getValue(RESULT + "[1]");
|
||||
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
|
||||
|
@ -267,17 +229,7 @@ public abstract class BaseGfePyController extends PythonScriptController {
|
|||
break;
|
||||
case WEATHER:
|
||||
case DISCRETE:
|
||||
correctType = (boolean) jep.getValue(RESULT
|
||||
+ "[0].dtype.name == 'int8'");
|
||||
if (!correctType) {
|
||||
/*
|
||||
* the following line needs to be separate from
|
||||
* jep.getValue() to be stable
|
||||
*/
|
||||
jep.eval(RESULT + "[0] = numpy.ascontiguousarray(" + RESULT
|
||||
+ "[0], numpy.int8)");
|
||||
}
|
||||
|
||||
// don't make python func calls within a jep.getValue() call
|
||||
byte[] bytes = (byte[]) jep.getValue(RESULT + "[0]");
|
||||
String[] keys = (String[]) jep.getValue(RESULT + "[1]");
|
||||
xDim = (Integer) jep.getValue(RESULT + "[0].shape[1]");
|
||||
|
@ -297,4 +249,39 @@ public abstract class BaseGfePyController extends PythonScriptController {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that a result numpy array is of the correct dtype for the
|
||||
* GridType, and if not, corrects the type to ensure it comes across to Java
|
||||
* safely.
|
||||
*
|
||||
* If the correct type is found, nothing is done and therefore memory and
|
||||
* speed is saved over the alternative of always calling astype(dtype) or
|
||||
* ascontiguousarray(array, dtype), both of which will create a copy of the
|
||||
* array.
|
||||
*
|
||||
* Note that if you attempt jep.getValue(array.astype(dtype)) or
|
||||
* jep.getValue(numpy.ascontiguousarray(array, dtype)) you can potentially
|
||||
* crash the JVM. jep.getValue(variable) should primarily retrieve variables
|
||||
* that are globally scoped in the python interpreter as opposed to created
|
||||
* on the fly.
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
protected void ensureResultType(GridType type) throws JepException {
|
||||
String safeType = null;
|
||||
switch (type) {
|
||||
case SCALAR:
|
||||
case VECTOR:
|
||||
safeType = "'float32'";
|
||||
break;
|
||||
case DISCRETE:
|
||||
case WEATHER:
|
||||
safeType = "'int8'";
|
||||
break;
|
||||
}
|
||||
String safetyCheck = RESULT + " = " + "NumpyJavaEnforcer.checkdTypes("
|
||||
+ RESULT + ", " + safeType + ")";
|
||||
jep.eval("import NumpyJavaEnforcer");
|
||||
jep.eval(safetyCheck);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -548,7 +548,7 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
this.searchOptions.remove(FindReplaceOptions.SEARCH_POS_END);
|
||||
|
||||
int[] matchRange = findString(searchString);
|
||||
while (!(matchRange[0] == 0 && matchRange[1] == 0)) {
|
||||
while (!((matchRange[0] == 0) && (matchRange[1] == 0))) {
|
||||
int newOffset = matchRange[1];
|
||||
|
||||
editorST.replaceTextRange(matchRange[0], searchString.length(),
|
||||
|
@ -607,7 +607,7 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
|
||||
int[] replaceMatch = findString(replaceString,
|
||||
selectionToBeReplaced.x);
|
||||
if (!(replaceMatch[0] == 0 && replaceMatch[1] == 0)) {
|
||||
if (!((replaceMatch[0] == 0) && (replaceMatch[1] == 0))) {
|
||||
editorComp.reParse();
|
||||
editorST.setCaretOffset(replaceMatch[1]);
|
||||
}
|
||||
|
@ -630,8 +630,9 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
*
|
||||
*/
|
||||
private void handleClickFind(SelectionEvent event) {
|
||||
if (findTF.getText().equals(""))
|
||||
if (findTF.getText().equals("")) {
|
||||
return;
|
||||
}
|
||||
|
||||
cursorOffset = editorST.getCaretOffset();
|
||||
|
||||
|
@ -639,8 +640,8 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
// For BACKWARD_SEARCH option:
|
||||
// Need skip the previously found string
|
||||
if (searchOptions.contains(FindReplaceOptions.BACKWARD_SEARCH)) {
|
||||
if (editorST.getSelectionRange() != null
|
||||
&& editorST.getSelectionRange().y > 0) {
|
||||
if ((editorST.getSelectionRange() != null)
|
||||
&& (editorST.getSelectionRange().y > 0)) {
|
||||
cursorOffset -= editorST.getSelectionRange().y;
|
||||
if (cursorOffset < 0) {
|
||||
cursorOffset = 0;
|
||||
|
@ -671,7 +672,7 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
private boolean findAndSelectString(String searchString) {
|
||||
int[] matchRange = findString(searchString);
|
||||
|
||||
if (!(matchRange[0] == 0 && matchRange[1] == 0)) {
|
||||
if (!((matchRange[0] == 0) && (matchRange[1] == 0))) {
|
||||
editorST.setSelection(matchRange[0], matchRange[1]);
|
||||
editorST.showSelection();
|
||||
cursorOffset = editorST.getCaretOffset();
|
||||
|
@ -744,8 +745,9 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
// if (searchOptions.contains(FindReplaceOptions.EXACT_MATCH)
|
||||
// && !searchOptions.contains(FindReplaceOptions.REGEX_SEARCH))
|
||||
// searchRegex = "\\b" + searchRegex + "\\b";
|
||||
if (searchOptions.contains(FindReplaceOptions.IGNORE_CASE))
|
||||
if (searchOptions.contains(FindReplaceOptions.IGNORE_CASE)) {
|
||||
regexFlags |= Pattern.CASE_INSENSITIVE;
|
||||
}
|
||||
|
||||
// Need handle the PatternSyntaxException when user searches meta
|
||||
// character(s) but forgot to toggle on the regex option.
|
||||
|
@ -761,8 +763,9 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
match[0] = matcher.start();
|
||||
match[1] = matcher.end();
|
||||
if (searchOptions
|
||||
.contains(FindReplaceOptions.FORWARD_SEARCH))
|
||||
.contains(FindReplaceOptions.FORWARD_SEARCH)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PatternSyntaxException e) {
|
||||
|
@ -829,7 +832,7 @@ public class FindReplaceDlg extends CaveSWTDialog {
|
|||
int searchEndIndex;
|
||||
int[] match = { 0, 0 };
|
||||
|
||||
if (searchString == null || searchString.equals("")) {
|
||||
if ((searchString == null) || searchString.equals("")) {
|
||||
return match;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher;
|
|||
* @author lvenable
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface ITransmissionState
|
||||
{
|
||||
public interface ITransmissionState {
|
||||
void setTransmissionState(ConfigData.productStateEnum state);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.dialogs.formatterlauncher;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
|
@ -35,6 +36,7 @@ import org.eclipse.swt.graphics.Point;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 05 Jan 2008 1784 lvenable Initial creation
|
||||
* 28 Jan 2015 4018 randerso Code cleanup
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -51,12 +53,12 @@ public class ProductDataStruct {
|
|||
/**
|
||||
* HashMap of ci text index points.
|
||||
*/
|
||||
private HashMap<String, TextIndexPoints> ci;
|
||||
private Map<String, TextIndexPoints> ci;
|
||||
|
||||
/**
|
||||
* HashMap of mnd text index points.
|
||||
*/
|
||||
private HashMap<String, TextIndexPoints> mnd;
|
||||
private Map<String, TextIndexPoints> mnd;
|
||||
|
||||
/**
|
||||
* Array of segment data.
|
||||
|
@ -66,7 +68,7 @@ public class ProductDataStruct {
|
|||
/**
|
||||
* Parsed map containing the parsed product text.
|
||||
*/
|
||||
private HashMap<String, Object> parsedMap;
|
||||
private Map<String, Object> parsedMap;
|
||||
|
||||
/**
|
||||
* A String array containing the product text. Each element in the array is
|
||||
|
@ -89,8 +91,7 @@ public class ProductDataStruct {
|
|||
* @param productText
|
||||
* Product text.
|
||||
*/
|
||||
public ProductDataStruct(HashMap<String, Object> parsedMap,
|
||||
String productText) {
|
||||
public ProductDataStruct(Map<String, Object> parsedMap, String productText) {
|
||||
this.parsedMap = parsedMap;
|
||||
|
||||
this.productText = productText;
|
||||
|
@ -121,21 +122,20 @@ public class ProductDataStruct {
|
|||
return;
|
||||
}
|
||||
|
||||
if (parsedMap.get("frames") instanceof List == false) {
|
||||
if ((parsedMap.get("frames") instanceof List) == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
frames = new ArrayList<TextIndexPoints>();
|
||||
|
||||
List<?> parseFrames = (List<?>) parsedMap.get("frames");
|
||||
|
||||
for (Object object : parseFrames) {
|
||||
HashMap frameMap = (HashMap) object;
|
||||
List<Map<String, List<List<Integer>>>> parseFrames = (List<Map<String, List<List<Integer>>>>) parsedMap
|
||||
.get("frames");
|
||||
|
||||
for (Map<String, List<List<Integer>>> frameMap : parseFrames) {
|
||||
Set<String> keys = frameMap.keySet();
|
||||
|
||||
for (String key : keys) {
|
||||
List<?> frameIndexes = (List<?>) frameMap.get(key);
|
||||
List<List<Integer>> frameIndexes = frameMap.get(key);
|
||||
|
||||
TextIndexPoints tip = createTextIndexPoints(frameIndexes);
|
||||
|
||||
|
@ -156,15 +156,16 @@ public class ProductDataStruct {
|
|||
return;
|
||||
}
|
||||
|
||||
List<?> tmpArray;
|
||||
List<List<Integer>> tmpArray;
|
||||
TextIndexPoints tip;
|
||||
|
||||
HashMap parsedCi = (HashMap) parsedMap.get("ci");
|
||||
Map<String, List<List<Integer>>> parsedCi = (Map<String, List<List<Integer>>>) parsedMap
|
||||
.get("ci");
|
||||
|
||||
Set<String> keys = parsedCi.keySet();
|
||||
|
||||
for (String key : keys) {
|
||||
tmpArray = (List<?>) parsedCi.get(key);
|
||||
tmpArray = parsedCi.get(key);
|
||||
tip = createTextIndexPoints(tmpArray);
|
||||
ci.put(key, tip);
|
||||
}
|
||||
|
@ -181,19 +182,18 @@ public class ProductDataStruct {
|
|||
return;
|
||||
}
|
||||
|
||||
List<?> tmpArray;
|
||||
List<List<Integer>> tmpArray;
|
||||
TextIndexPoints tip;
|
||||
|
||||
HashMap parsedMnd = (HashMap) parsedMap.get("mnd");
|
||||
Map<String, List<List<Integer>>> parsedMnd = (Map<String, List<List<Integer>>>) parsedMap
|
||||
.get("mnd");
|
||||
|
||||
Set<String> keys = parsedMnd.keySet();
|
||||
|
||||
for (String key : keys) {
|
||||
tmpArray = (List<?>) parsedMnd.get(key);
|
||||
tmpArray = parsedMnd.get(key);
|
||||
tip = createTextIndexPoints(tmpArray);
|
||||
|
||||
// TODO : remove
|
||||
// System.out.println("mnd key = " + key + "\t\t" + tip.getText());
|
||||
mnd.put(key, tip);
|
||||
}
|
||||
}
|
||||
|
@ -210,36 +210,36 @@ public class ProductDataStruct {
|
|||
}
|
||||
|
||||
TextIndexPoints tip;
|
||||
List<?> tmpArray;
|
||||
List<List<Integer>> tmpArray;
|
||||
|
||||
// Get the Array of segments from the parsed map.
|
||||
List<?> parsedSegs = (List<?>) parsedMap.get("segs");
|
||||
List<Map<String, Object>> parsedSegs = (List<Map<String, Object>>) parsedMap
|
||||
.get("segs");
|
||||
|
||||
// Loop through each segment.
|
||||
for (Object seg : parsedSegs) {
|
||||
|
||||
HashMap curSegMap = (HashMap) seg;
|
||||
for (Map<String, Object> curSegMap : parsedSegs) {
|
||||
|
||||
Set<String> keys = curSegMap.keySet();
|
||||
|
||||
SegmentData segData = new SegmentData();
|
||||
|
||||
for (String key : keys) {
|
||||
if (key.compareTo("headInfo") == 0) {
|
||||
List<?> headInfoArray = (List<?>) curSegMap.get(key);
|
||||
if (key.equals("headInfo")) {
|
||||
List<Map<String, List<List<Integer>>>> headInfoArray = (List<Map<String, List<List<Integer>>>>) curSegMap
|
||||
.get(key);
|
||||
|
||||
for (Object hiObj : headInfoArray) {
|
||||
HashMap headInfoMap = (HashMap) hiObj;
|
||||
Map<String, List<List<Integer>>> headInfoMap = (Map<String, List<List<Integer>>>) hiObj;
|
||||
|
||||
Set<String> headInfoKeys = headInfoMap.keySet();
|
||||
for (String hiKey : headInfoKeys) {
|
||||
tmpArray = (List<?>) headInfoMap.get(hiKey);
|
||||
tmpArray = headInfoMap.get(hiKey);
|
||||
tip = createTextIndexPoints(tmpArray);
|
||||
segData.addToHeadInfoMap(hiKey, tip);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tmpArray = (List<?>) curSegMap.get(key);
|
||||
tmpArray = (List<List<Integer>>) curSegMap.get(key);
|
||||
tip = createTextIndexPoints(tmpArray);
|
||||
segData.addToSegmentMap(key, tip);
|
||||
}
|
||||
|
@ -256,19 +256,18 @@ public class ProductDataStruct {
|
|||
* Array of indexes.
|
||||
* @return TextIndexPoint data.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private TextIndexPoints createTextIndexPoints(List tmpArray) {
|
||||
private TextIndexPoints createTextIndexPoints(List<List<Integer>> tmpArray) {
|
||||
TextIndexPoints tip = new TextIndexPoints();
|
||||
|
||||
// Get the starting index
|
||||
List<?> startPoints = (List<?>) tmpArray.get(0);
|
||||
int startLine = ((Integer) startPoints.get(0)) - 1;
|
||||
int startCol = (Integer) startPoints.get(1);
|
||||
List<Integer> startPoints = tmpArray.get(0);
|
||||
int startLine = (startPoints.get(0)) - 1;
|
||||
int startCol = startPoints.get(1);
|
||||
|
||||
// Get the ending index
|
||||
List<?> endPoints = (List<?>) tmpArray.get(1);
|
||||
int endLine = ((Integer) endPoints.get(0)) - 1;
|
||||
int endCol = ((Integer) endPoints.get(1));
|
||||
List<Integer> endPoints = tmpArray.get(1);
|
||||
int endLine = (endPoints.get(0)) - 1;
|
||||
int endCol = (endPoints.get(1));
|
||||
|
||||
String text = getIndexString(startLine, startCol, endLine, endCol);
|
||||
|
||||
|
@ -320,7 +319,7 @@ public class ProductDataStruct {
|
|||
} else {
|
||||
|
||||
int endColOffset = 0;
|
||||
if (endCol - 1 == productTextArray[i].length()) {
|
||||
if ((endCol - 1) == productTextArray[i].length()) {
|
||||
endColOffset = -1;
|
||||
}
|
||||
|
||||
|
@ -363,7 +362,7 @@ public class ProductDataStruct {
|
|||
*
|
||||
* @return The CI map.
|
||||
*/
|
||||
public HashMap<String, TextIndexPoints> getCiMap() {
|
||||
public Map<String, TextIndexPoints> getCiMap() {
|
||||
return ci;
|
||||
}
|
||||
|
||||
|
@ -372,7 +371,7 @@ public class ProductDataStruct {
|
|||
*
|
||||
* @return The MND map.
|
||||
*/
|
||||
public HashMap<String, TextIndexPoints> getMndMap() {
|
||||
public Map<String, TextIndexPoints> getMndMap() {
|
||||
return mnd;
|
||||
}
|
||||
|
||||
|
@ -412,72 +411,70 @@ public class ProductDataStruct {
|
|||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public void printData() {
|
||||
// System.out.println("**** PRINT START ********************************");
|
||||
// System.out.println("****");
|
||||
System.out.println("**** PRINT START ********************************");
|
||||
System.out.println("****");
|
||||
|
||||
/*
|
||||
* Print the Frames information.
|
||||
*/
|
||||
// System.out.println("");
|
||||
// System.out.println("--- frames");
|
||||
System.out.println("");
|
||||
System.out.println("--- frames");
|
||||
for (TextIndexPoints frameData : frames) {
|
||||
// System.out.println("frame text = " + frameData.getText());
|
||||
System.out.println("frame text = " + frameData.getText());
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the CI information.
|
||||
*/
|
||||
// System.out.println("");
|
||||
// System.out.println("--- ci");
|
||||
System.out.println("");
|
||||
System.out.println("--- ci");
|
||||
Set<String> ciKeys = ci.keySet();
|
||||
|
||||
for (String key : ciKeys) {
|
||||
// System.out.println("key = " + key);
|
||||
// System.out.println("text = " + ci.get(key).getText());
|
||||
System.out.println("key = " + key);
|
||||
System.out.println("text = " + ci.get(key).getText());
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the MND information.
|
||||
*/
|
||||
// System.out.println("");
|
||||
// System.out.println("--- mnd");
|
||||
System.out.println("");
|
||||
System.out.println("--- mnd");
|
||||
Set<String> mndKeys = mnd.keySet();
|
||||
|
||||
for (String key : mndKeys) {
|
||||
// System.out.println("key = " + key);
|
||||
// System.out.println("text = " + mnd.get(key).getText());
|
||||
System.out.println("key = " + key);
|
||||
System.out.println("text = " + mnd.get(key).getText());
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the Segments information.
|
||||
*/
|
||||
// System.out.println("");
|
||||
// System.out.println("--- segments");
|
||||
System.out.println("");
|
||||
System.out.println("--- segments");
|
||||
for (SegmentData segData : segments) {
|
||||
// System.out.println("++++++ segment map");
|
||||
HashMap<String, TextIndexPoints> segMap = segData.getSementMap();
|
||||
System.out.println("++++++ segment map");
|
||||
Map<String, TextIndexPoints> segMap = segData.getSementMap();
|
||||
|
||||
Set<String> segMapKeys = segMap.keySet();
|
||||
for (String segMapKey : segMapKeys) {
|
||||
// TextIndexPoints tip = segMap.get(segMapKey);
|
||||
// System.out.println("SegMapKey = " + segMapKey);
|
||||
// System.out.println("Text = " +
|
||||
// segMap.get(segMapKey).getText());
|
||||
TextIndexPoints tip = segMap.get(segMapKey);
|
||||
System.out.println("SegMapKey = " + segMapKey);
|
||||
System.out.println("Text = " + segMap.get(segMapKey).getText());
|
||||
}
|
||||
|
||||
// System.out.println("++++++ headinfo map");
|
||||
HashMap<String, TextIndexPoints> headInfoMap = segData
|
||||
.getHeadInfoMap();
|
||||
System.out.println("++++++ headinfo map");
|
||||
Map<String, TextIndexPoints> headInfoMap = segData.getHeadInfoMap();
|
||||
|
||||
Set<String> headInfoKeys = headInfoMap.keySet();
|
||||
for (String headInfoKey : headInfoKeys) {
|
||||
// System.out.println("headInfoKey = " + headInfoKey);
|
||||
// System.out.println("Text = "
|
||||
// + headInfoMap.get(headInfoKey).getText());
|
||||
System.out.println("headInfoKey = " + headInfoKey);
|
||||
System.out.println("Text = "
|
||||
+ headInfoMap.get(headInfoKey).getText());
|
||||
}
|
||||
}
|
||||
|
||||
// System.out.println("**** PRINT END **********************************");
|
||||
System.out.println("**** PRINT END **********************************");
|
||||
}
|
||||
|
||||
public String getWmoId() {
|
||||
|
@ -505,7 +502,7 @@ public class ProductDataStruct {
|
|||
return mnd.get("pline");
|
||||
}
|
||||
|
||||
public TextIndexPoints getFunnyFiled() {
|
||||
public TextIndexPoints getFunnyField() {
|
||||
return ci.get("funnyfield");
|
||||
}
|
||||
|
||||
|
@ -535,8 +532,9 @@ public class ProductDataStruct {
|
|||
int column = 0;
|
||||
for (line = 0; line < productTextArray.length; line++) {
|
||||
int llen = productTextArray[line].length() + 1;
|
||||
if (offset < llen)
|
||||
if (offset < llen) {
|
||||
break;
|
||||
}
|
||||
offset -= llen;
|
||||
}
|
||||
column = offset;
|
||||
|
|
|
@ -163,8 +163,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* 12/01/2014 #624 zhao Modified saveFile()
|
||||
* 12/16/2014 #14946 ryu Modified updateIssueExpireTimes() so issuance time is displayed
|
||||
* for the local time zones for each segment.
|
||||
* 01/28/2015 #4018 randerso Code cleanup.
|
||||
* 02/04/2014 17039 ryu Removed menu item related to the HighlighFramingCodes feature.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -942,10 +942,7 @@ public class ProductEditorComp extends Composite implements
|
|||
*/
|
||||
private void createTextControl() {
|
||||
|
||||
textComp = new StyledTextComp(this);
|
||||
textComp.setWrapColumn(wrapColumn);
|
||||
|
||||
textComp.setAutoWrapMode(wrapMode);
|
||||
textComp = new StyledTextComp(this, wrapColumn, wrapMode);
|
||||
|
||||
createEditorPopupMenu();
|
||||
|
||||
|
@ -2000,8 +1997,7 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
if (pds != null) {
|
||||
String officeTimeZone = dm.getParmManager()
|
||||
.compositeGridLocation()
|
||||
.getTimeZone();
|
||||
.compositeGridLocation().getTimeZone();
|
||||
int numSegments = pds.getSegmentsArray().size();
|
||||
SimpleDateFormat fmt = new SimpleDateFormat(longLocalFmtStr);
|
||||
fmt.setTimeZone(localTimeZone);
|
||||
|
@ -2010,8 +2006,7 @@ public class ProductEditorComp extends Composite implements
|
|||
for (int i = 0; i < numSegments; i++) {
|
||||
textComp.startUpdate();
|
||||
HashMap<String, TextIndexPoints> segMap = pds
|
||||
.getSegmentsArray()
|
||||
.get(i).getSementMap();
|
||||
.getSegmentsArray().get(i).getSementMap();
|
||||
|
||||
TextIndexPoints tip = segMap.get("purgeT");
|
||||
if (tip != null) {
|
||||
|
@ -2031,10 +2026,10 @@ public class ProductEditorComp extends Composite implements
|
|||
// vtecs are fixed length and this is variable length,
|
||||
// which ensures we only need to reParse() once per
|
||||
// segment
|
||||
List<String> zones = decodeUGCs(pds.getSegmentsArray().get(i));
|
||||
List<String> zones = decodeUGCs(pds.getSegmentsArray()
|
||||
.get(i));
|
||||
List<String> timeZones = dm.getTextProductMgr()
|
||||
.getTimeZones(zones,
|
||||
officeTimeZone);
|
||||
.getTimeZones(zones, officeTimeZone);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String tz : timeZones) {
|
||||
|
@ -2241,9 +2236,9 @@ public class ProductEditorComp extends Composite implements
|
|||
private void saveFile() {
|
||||
|
||||
String fname = null;
|
||||
if ( productDefinition.get("outputFile") != null ) {
|
||||
if (productDefinition.get("outputFile") != null) {
|
||||
fname = getDefString("outputFile");
|
||||
if ( fname.equals(EMPTY) ) {
|
||||
if (fname.equals(EMPTY)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -58,8 +58,11 @@ public class SegmentData {
|
|||
|
||||
/**
|
||||
* Add entry into the segment map.
|
||||
* @param key Map key.
|
||||
* @param tip Text index point data.
|
||||
*
|
||||
* @param key
|
||||
* Map key.
|
||||
* @param tip
|
||||
* Text index point data.
|
||||
*/
|
||||
public void addToSegmentMap(String key, TextIndexPoints tip) {
|
||||
segMap.put(key, tip);
|
||||
|
@ -67,8 +70,11 @@ public class SegmentData {
|
|||
|
||||
/**
|
||||
* Add entry into the head info map.
|
||||
* @param key Map key.
|
||||
* @param tip Text index point data.
|
||||
*
|
||||
* @param key
|
||||
* Map key.
|
||||
* @param tip
|
||||
* Text index point data.
|
||||
*/
|
||||
public void addToHeadInfoMap(String key, TextIndexPoints tip) {
|
||||
headInfoMap.put(key, tip);
|
||||
|
@ -76,7 +82,9 @@ public class SegmentData {
|
|||
|
||||
/**
|
||||
* Get a text index point data from the segment map.
|
||||
* @param key Map key.
|
||||
*
|
||||
* @param key
|
||||
* Map key.
|
||||
* @return Segment text index point data.
|
||||
*/
|
||||
public TextIndexPoints getSegmentDataIndexPoints(String key) {
|
||||
|
@ -85,7 +93,9 @@ public class SegmentData {
|
|||
|
||||
/**
|
||||
* Get a text index point data from the head info map.
|
||||
* @param key Map key.
|
||||
*
|
||||
* @param key
|
||||
* Map key.
|
||||
* @return Segment text index point data.
|
||||
*/
|
||||
public TextIndexPoints getHeadInfoDataIndexPoints(String key) {
|
||||
|
@ -94,6 +104,7 @@ public class SegmentData {
|
|||
|
||||
/**
|
||||
* Get the segment map.
|
||||
*
|
||||
* @return The segment map.
|
||||
*/
|
||||
public HashMap<String, TextIndexPoints> getSementMap() {
|
||||
|
@ -102,6 +113,7 @@ public class SegmentData {
|
|||
|
||||
/**
|
||||
* Get the head info map.
|
||||
*
|
||||
* @return The head info map.
|
||||
*/
|
||||
public HashMap<String, TextIndexPoints> getHeadInfoMap() {
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.raytheon.viz.gfe.core.DataManager;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 18 APR 2008 ### lvenable Initial creation
|
||||
* 20 AUG 2010 4687 cjeanbap "null" showed up in
|
||||
* countdown message.
|
||||
* countdown message.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,182 +45,181 @@ import com.raytheon.viz.gfe.core.DataManager;
|
|||
*
|
||||
*/
|
||||
public class StoreTransmitCountdownThread extends Thread {
|
||||
/**
|
||||
* Parent display.
|
||||
*/
|
||||
private Display display;
|
||||
/**
|
||||
* Parent display.
|
||||
*/
|
||||
private Display display;
|
||||
|
||||
/**
|
||||
* Progress bar to be updated.
|
||||
*/
|
||||
private ProgressBar progressBar;
|
||||
/**
|
||||
* Progress bar to be updated.
|
||||
*/
|
||||
private ProgressBar progressBar;
|
||||
|
||||
/**
|
||||
* Flag indicating if the thread is done running.
|
||||
*/
|
||||
private boolean isDone = false;
|
||||
/**
|
||||
* Flag indicating if the thread is done running.
|
||||
*/
|
||||
private boolean isDone = false;
|
||||
|
||||
/**
|
||||
* Flag indicating if the thread has been canceled.
|
||||
*/
|
||||
private boolean isCancelled = false;
|
||||
/**
|
||||
* Flag indicating if the thread has been canceled.
|
||||
*/
|
||||
private boolean isCancelled = false;
|
||||
|
||||
/**
|
||||
* Count down label.
|
||||
*/
|
||||
private Label countdownLbl;
|
||||
/**
|
||||
* Count down label.
|
||||
*/
|
||||
private Label countdownLbl;
|
||||
|
||||
/**
|
||||
* Count down string.
|
||||
*/
|
||||
private String countdownStr;
|
||||
/**
|
||||
* Count down string.
|
||||
*/
|
||||
private String countdownStr;
|
||||
|
||||
/**
|
||||
* Counter.
|
||||
*/
|
||||
private int counter = 5;
|
||||
/**
|
||||
* Counter.
|
||||
*/
|
||||
private int counter = 5;
|
||||
|
||||
/**
|
||||
* Store/Transmit callback.
|
||||
*/
|
||||
private IStoreTransmitProduct storeCB;
|
||||
/**
|
||||
* Store/Transmit callback.
|
||||
*/
|
||||
private IStoreTransmitProduct storeCB;
|
||||
|
||||
/**
|
||||
* Count down prefix string.
|
||||
*/
|
||||
private String countdownPrefix;
|
||||
/**
|
||||
* Count down prefix string.
|
||||
*/
|
||||
private String countdownPrefix;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param display
|
||||
* Parent display.
|
||||
* @param progressBar
|
||||
* Progress bar.
|
||||
* @param countdownLbl
|
||||
* Count down label.
|
||||
* @param countdownStr
|
||||
* Count down string.
|
||||
* @param cb
|
||||
* Callback interface.
|
||||
* @param isStore
|
||||
* True to display store, false to display transmit.
|
||||
*/
|
||||
public StoreTransmitCountdownThread(Display display,
|
||||
ProgressBar progressBar, Label countdownLbl, String countdownStr,
|
||||
IStoreTransmitProduct cb, boolean isStore) {
|
||||
this.display = display;
|
||||
this.progressBar = progressBar;
|
||||
this.countdownLbl = countdownLbl;
|
||||
this.countdownStr = countdownStr;
|
||||
this.storeCB = cb;
|
||||
countdownPrefix = new String();
|
||||
CAVEMode opMode = DataManager.getCurrentInstance().getOpMode();
|
||||
if (!opMode.equals(CAVEMode.OPERATIONAL)) {
|
||||
countdownPrefix = "Simulated ";
|
||||
}
|
||||
if (isStore == true) {
|
||||
countdownPrefix += "Store in ";
|
||||
} else {
|
||||
countdownPrefix += "Transmit in ";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param display
|
||||
* Parent display.
|
||||
* @param progressBar
|
||||
* Progress bar.
|
||||
* @param countdownLbl
|
||||
* Count down label.
|
||||
* @param countdownStr
|
||||
* Count down string.
|
||||
* @param cb
|
||||
* Callback interface.
|
||||
* @param isStore
|
||||
* True to display store, false to display transmit.
|
||||
*/
|
||||
public StoreTransmitCountdownThread(Display display,
|
||||
ProgressBar progressBar, Label countdownLbl, String countdownStr,
|
||||
IStoreTransmitProduct cb, boolean isStore) {
|
||||
this.display = display;
|
||||
this.progressBar = progressBar;
|
||||
this.countdownLbl = countdownLbl;
|
||||
this.countdownStr = countdownStr;
|
||||
this.storeCB = cb;
|
||||
countdownPrefix = new String();
|
||||
CAVEMode opMode = DataManager.getCurrentInstance().getOpMode();
|
||||
if (!opMode.equals(CAVEMode.OPERATIONAL)) {
|
||||
countdownPrefix = "Simulated ";
|
||||
}
|
||||
if (isStore == true) {
|
||||
countdownPrefix += "Store in ";
|
||||
} else {
|
||||
countdownPrefix += "Transmit in ";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Thread's run method.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
isDone = false;
|
||||
countdownLabelStart();
|
||||
/**
|
||||
* Thread's run method.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
isDone = false;
|
||||
countdownLabelStart();
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
for (int i = 0; i < 6; i++) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (isCancelled == false) {
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
if (progressBar.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
// Increment the progress bar
|
||||
progressBar
|
||||
.setSelection(progressBar.getSelection() + 1);
|
||||
countdownLbl.setText(countdownPrefix + counter
|
||||
+ " seconds...");
|
||||
--counter;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isCancelled == false) {
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
if (progressBar.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
// Increment the progress bar
|
||||
progressBar.setSelection(progressBar.getSelection() + 1);
|
||||
countdownLbl.setText(countdownPrefix + counter
|
||||
+ " seconds...");
|
||||
--counter;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isCancelled == false) {
|
||||
countdownLabelFinished();
|
||||
}
|
||||
if (isCancelled == false) {
|
||||
countdownLabelFinished();
|
||||
}
|
||||
|
||||
isDone = true;
|
||||
isDone = true;
|
||||
|
||||
storeCB.storeTransmitProduct();
|
||||
}
|
||||
storeCB.storeTransmitProduct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the thread is done running.
|
||||
*
|
||||
* @return True if the thread is done running, false if it is still running.
|
||||
*/
|
||||
public boolean isDone() {
|
||||
return isDone;
|
||||
}
|
||||
/**
|
||||
* Check if the thread is done running.
|
||||
*
|
||||
* @return True if the thread is done running, false if it is still running.
|
||||
*/
|
||||
public boolean isDone() {
|
||||
return isDone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the running thread.
|
||||
*/
|
||||
public void cancelThread() {
|
||||
isCancelled = true;
|
||||
}
|
||||
/**
|
||||
* Cancel the running thread.
|
||||
*/
|
||||
public void cancelThread() {
|
||||
isCancelled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the thread has been canceled.
|
||||
*
|
||||
* @return True if the thread was canceled, false otherwise.
|
||||
*/
|
||||
public boolean threadCancelled() {
|
||||
return isCancelled;
|
||||
}
|
||||
/**
|
||||
* Check if the thread has been canceled.
|
||||
*
|
||||
* @return True if the thread was canceled, false otherwise.
|
||||
*/
|
||||
public boolean threadCancelled() {
|
||||
return isCancelled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the count down label to have a red background and white text while
|
||||
* the Store/Transmit is in count down mode.
|
||||
*/
|
||||
private void countdownLabelStart() {
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
countdownLbl.setBackground(display
|
||||
.getSystemColor(SWT.COLOR_RED));
|
||||
countdownLbl.setForeground(display
|
||||
.getSystemColor(SWT.COLOR_WHITE));
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Set the count down label to have a red background and white text while
|
||||
* the Store/Transmit is in count down mode.
|
||||
*/
|
||||
private void countdownLabelStart() {
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
countdownLbl.setBackground(display
|
||||
.getSystemColor(SWT.COLOR_RED));
|
||||
countdownLbl.setForeground(display
|
||||
.getSystemColor(SWT.COLOR_WHITE));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the count down label back to its original state.
|
||||
*/
|
||||
private void countdownLabelFinished() {
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
countdownLbl.setText(countdownStr);
|
||||
countdownLbl.setBackground(display
|
||||
.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
|
||||
countdownLbl.setForeground(display
|
||||
.getSystemColor(SWT.COLOR_BLACK));
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Set the count down label back to its original state.
|
||||
*/
|
||||
private void countdownLabelFinished() {
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
countdownLbl.setText(countdownStr);
|
||||
countdownLbl.setBackground(display
|
||||
.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
|
||||
countdownLbl.setForeground(display
|
||||
.getSystemColor(SWT.COLOR_BLACK));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ import org.eclipse.swt.widgets.Listener;
|
|||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||
import com.raytheon.uf.common.python.PythonScript;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.ProductEditorLogger;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.RGBColors;
|
||||
|
@ -83,6 +84,9 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
|
|||
* 29 AUG 2013 #2250 dgilling Better error handling for parseProductText().
|
||||
* 04 SEP 2013 16534 ryu Fixed word wrap to not insert duplicate text; refactor.
|
||||
* 20 DEC 2013 16854 ryu Force re-parsing of text on type change.
|
||||
* 28 JAN 2015 4018 randerso Code cleanup. Fixed reparsing when framing codes are cut
|
||||
* or pasted instead of just typed over.
|
||||
* Added logging of text changes to help diagnose future issues.
|
||||
* 04 FEB 2015 17039 ryu Removed HighlightFramingCodes feature which prevented
|
||||
* editing of framing codes.
|
||||
*
|
||||
|
@ -125,7 +129,7 @@ public class StyledTextComp extends Composite {
|
|||
/**
|
||||
* Parent composite.
|
||||
*/
|
||||
private Composite parent;
|
||||
private ProductEditorComp parent;
|
||||
|
||||
/**
|
||||
* Styled text editor.
|
||||
|
@ -155,7 +159,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
private boolean autoWrapMode;
|
||||
|
||||
private int wrapColumn = 80; // TODO: get from external
|
||||
private int wrapColumn;
|
||||
|
||||
private boolean dirty = false;
|
||||
|
||||
|
@ -173,6 +177,8 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
private boolean updatingForCor = false;
|
||||
|
||||
private ProductEditorLogger peLog;
|
||||
|
||||
private static final String NORM_SEP = "^\\s*$";
|
||||
|
||||
private static final String FUNNY_SEP = "^(\\s*)\\*(\\s*)";
|
||||
|
@ -195,11 +201,18 @@ public class StyledTextComp extends Composite {
|
|||
*
|
||||
* @param parent
|
||||
* Parent composite.
|
||||
* @param wrapMode
|
||||
* @param wrapColumn
|
||||
*/
|
||||
public StyledTextComp(Composite parent) {
|
||||
public StyledTextComp(ProductEditorComp parent, int wrapColumn,
|
||||
boolean wrapMode) {
|
||||
super(parent, SWT.BORDER);
|
||||
|
||||
this.parent = parent;
|
||||
this.wrapColumn = wrapColumn;
|
||||
this.autoWrapMode = wrapMode;
|
||||
|
||||
this.peLog = new ProductEditorLogger(parent.getProductName());
|
||||
|
||||
init();
|
||||
}
|
||||
|
@ -285,6 +298,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
@Override
|
||||
public void modifyText(ExtendedModifyEvent event) {
|
||||
logTextChange(event);
|
||||
updateTextStyle(event);
|
||||
checkAutoWrap(event);
|
||||
|
||||
|
@ -353,7 +367,7 @@ public class StyledTextComp extends Composite {
|
|||
/*
|
||||
* Lock the ci block text.
|
||||
*/
|
||||
HashMap<String, TextIndexPoints> ciMap = prodDataStruct.getCiMap();
|
||||
Map<String, TextIndexPoints> ciMap = prodDataStruct.getCiMap();
|
||||
TextIndexPoints ciBlockTip = ciMap.get("ciblock");
|
||||
|
||||
if (ciBlockTip != null) {
|
||||
|
@ -365,7 +379,7 @@ public class StyledTextComp extends Composite {
|
|||
/*
|
||||
* Lock the mnd text.
|
||||
*/
|
||||
HashMap<String, TextIndexPoints> mndMap = prodDataStruct.getMndMap();
|
||||
Map<String, TextIndexPoints> mndMap = prodDataStruct.getMndMap();
|
||||
TextIndexPoints mndTip = mndMap.get("mnd");
|
||||
|
||||
if (mndTip != null) {
|
||||
|
@ -401,7 +415,8 @@ public class StyledTextComp extends Composite {
|
|||
// should be unlocked. Cities list is unlocked for editing
|
||||
// when framing codes are present.
|
||||
if (newProduct) {
|
||||
if (cityTip != null && cityTip.getText().indexOf("|*") > 0) {
|
||||
if ((cityTip != null)
|
||||
&& (cityTip.getText().indexOf("|*") > 0)) {
|
||||
unlockCitySegs.add(ugc);
|
||||
}
|
||||
}
|
||||
|
@ -439,7 +454,7 @@ public class StyledTextComp extends Composite {
|
|||
* correct the end value.
|
||||
*/
|
||||
int endLineOffset = 0;
|
||||
if (endLine == productTextArray.length - 1) {
|
||||
if (endLine == (productTextArray.length - 1)) {
|
||||
++endLineOffset;
|
||||
}
|
||||
|
||||
|
@ -492,11 +507,11 @@ public class StyledTextComp extends Composite {
|
|||
* If python throws an Error trying to parse the product.
|
||||
*/
|
||||
private void parseProductText(String productText) throws JepException {
|
||||
HashMap<String, Object> fmtResult = TextFmtParserUtil
|
||||
Map<String, Object> fmtResult = TextFmtParserUtil
|
||||
.parseText(productText);
|
||||
prodDataStruct = new ProductDataStruct(fmtResult, productText);
|
||||
|
||||
prodDataStruct.printData();
|
||||
// prodDataStruct.printData();
|
||||
}
|
||||
|
||||
public void patchMND(String tag) {
|
||||
|
@ -555,11 +570,11 @@ public class StyledTextComp extends Composite {
|
|||
}
|
||||
|
||||
// Find the code and the pit
|
||||
TextIndexPoints ff = prodDataStruct.getFunnyFiled();
|
||||
TextIndexPoints ff = prodDataStruct.getFunnyField();
|
||||
TextIndexPoints pit = prodDataStruct.getPIT();
|
||||
|
||||
if (ff == null) {
|
||||
if (pit == null || newfield.length() == 0) {
|
||||
if ((pit == null) || (newfield.length() == 0)) {
|
||||
return; // No typecode or ci block found
|
||||
} else {
|
||||
ff = new TextIndexPoints();
|
||||
|
@ -599,8 +614,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
// only reparse if we replaced with different length text or forced
|
||||
// else, replace StyleRanges since the operation is safe
|
||||
if ((tip.getText().length() != text.length())
|
||||
|| forceReparse) {
|
||||
if ((tip.getText().length() != text.length()) || forceReparse) {
|
||||
dirty = true;
|
||||
} else {
|
||||
for (StyleRange range : ranges) {
|
||||
|
@ -611,7 +625,7 @@ public class StyledTextComp extends Composite {
|
|||
}
|
||||
|
||||
private void makeCorrections() {
|
||||
((ProductEditorComp) parent).setPTypeCategory(PTypeCategory.COR);
|
||||
parent.setPTypeCategory(PTypeCategory.COR);
|
||||
List<SegmentData> segs = prodDataStruct.getSegmentsArray();
|
||||
for (SegmentData seg : segs) {
|
||||
if (seg.getSementMap().keySet().contains("vtec")) {
|
||||
|
@ -626,20 +640,19 @@ public class StyledTextComp extends Composite {
|
|||
try {
|
||||
startUpdate();
|
||||
List<SegmentData> segs = prodDataStruct.getSegmentsArray();
|
||||
if (segs == null || segs.size() == 0) {
|
||||
if ((segs == null) || (segs.size() == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int offset = textEditorST.getCaretOffset();
|
||||
Pattern codePattern = Pattern.compile("\\.([A-Z]{3})\\.");
|
||||
for (SegmentData segData : segs) {
|
||||
HashMap<String, TextIndexPoints> segMap = segData
|
||||
.getSementMap();
|
||||
Map<String, TextIndexPoints> segMap = segData.getSementMap();
|
||||
TextIndexPoints tipUgc = segMap.get("ugc");
|
||||
int start = prodDataStruct.positionToOffset(tipUgc
|
||||
.getStartIndex());
|
||||
int end = prodDataStruct.positionToOffset(tipUgc.getEndIndex());
|
||||
if (offset <= start || offset >= end) {
|
||||
if ((offset <= start) || (offset >= end)) {
|
||||
continue;
|
||||
}
|
||||
TextIndexPoints tipVtec = segMap.get("vtec");
|
||||
|
@ -688,8 +701,10 @@ public class StyledTextComp extends Composite {
|
|||
}
|
||||
|
||||
/**
|
||||
* Handle the verify key event. This event fires after a change has been
|
||||
* made to the control (after the text has been updated, for example)
|
||||
* Handle the verify key event. Sent when the text is about to be modified.
|
||||
* A verify event occurs after the user has done something to modify the
|
||||
* text (typically typed a key), but before the text is modified. The doit
|
||||
* field in the verify event indicates whether or not to modify the text.
|
||||
*
|
||||
* @param event
|
||||
* Verify event that was fired.
|
||||
|
@ -726,8 +741,8 @@ public class StyledTextComp extends Composite {
|
|||
// this is specifically to handle the case of deleting line breaks
|
||||
// between two separate locked sections so a locked section cannot be
|
||||
// moved onto the end of an unlocked line
|
||||
if (length == 1 && event.text.length() == 0) {
|
||||
if (offset + 2 < textEditorST.getCharCount()
|
||||
if ((length == 1) && (event.text.length() == 0)) {
|
||||
if (((offset + 2) < textEditorST.getCharCount())
|
||||
&& rangeHasLockedText(offset, 2)) {
|
||||
event.doit = false;
|
||||
return;
|
||||
|
@ -739,21 +754,17 @@ public class StyledTextComp extends Composite {
|
|||
}
|
||||
|
||||
private void updateTextStyle(ExtendedModifyEvent event) {
|
||||
if (event.start + event.length + 1 < textEditorST.getCharCount()) {
|
||||
if ((event.start + event.length + 1) < textEditorST.getCharCount()) {
|
||||
int start = Math.max(0, event.start - 1);
|
||||
int end = Math.min(textEditorST.getCharCount() - 1, event.start
|
||||
+ event.length + 1);
|
||||
StyleRange startRange = textEditorST.getStyleRangeAtOffset(start);
|
||||
StyleRange endRange = textEditorST.getStyleRangeAtOffset(end);
|
||||
// StyleRange startRange = textEditorST
|
||||
// .getStyleRangeAtOffset(event.start - 1);
|
||||
// StyleRange endRange = textEditorST
|
||||
// .getStyleRangeAtOffset(event.start + event.length + 1);
|
||||
|
||||
// if it's in a framing code, turn it red
|
||||
if (startRange != null && endRange != null
|
||||
&& event.start > startRange.start
|
||||
&& event.start + event.length < endRange.start
|
||||
if ((startRange != null) && (endRange != null)
|
||||
&& (event.start > startRange.start)
|
||||
&& ((event.start + event.length) < endRange.start)
|
||||
&& startRange.similarTo(endRange)
|
||||
&& startRange.foreground.equals(frameColor)) {
|
||||
StyleRange style = (StyleRange) startRange.clone();
|
||||
|
@ -764,13 +775,14 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
// framing code was deleted, need to turn it black
|
||||
boolean framingCodeChange = false;
|
||||
if (("*").equals(event.replacedText)
|
||||
|| ("|").equals(event.replacedText)) {
|
||||
if (event.replacedText.contains("*")
|
||||
|| event.replacedText.contains("|")) {
|
||||
framingCodeChange = true;
|
||||
}
|
||||
// framing code was added, need to turn it red
|
||||
char newText = textEditorST.getText().charAt(event.start);
|
||||
if (newText == '*' || newText == '|') {
|
||||
String newText = textEditorST.getText().substring(event.start,
|
||||
event.start + event.length);
|
||||
if (newText.contains("*") || newText.contains("|")) {
|
||||
framingCodeChange = true;
|
||||
}
|
||||
|
||||
|
@ -826,10 +838,11 @@ public class StyledTextComp extends Composite {
|
|||
* @return True if the key is an arrow or "non-edit" key.
|
||||
*/
|
||||
private boolean isNonEditKey(KeyEvent event) {
|
||||
if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN
|
||||
|| event.keyCode == SWT.ARROW_LEFT
|
||||
|| event.keyCode == SWT.ARROW_RIGHT
|
||||
|| event.keyCode == SWT.SHIFT) {
|
||||
if ((event.keyCode == SWT.ARROW_UP)
|
||||
|| (event.keyCode == SWT.ARROW_DOWN)
|
||||
|| (event.keyCode == SWT.ARROW_LEFT)
|
||||
|| (event.keyCode == SWT.ARROW_RIGHT)
|
||||
|| (event.keyCode == SWT.SHIFT)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1039,15 +1052,15 @@ public class StyledTextComp extends Composite {
|
|||
int lineNum = textEditorST.getLineAtOffset(event.start);
|
||||
int lineLength = textEditorST.getLine(lineNum).length();
|
||||
|
||||
if (lineLength < wrapColumn
|
||||
&& event.length >= event.replacedText.length()) {
|
||||
if ((lineLength < wrapColumn)
|
||||
&& (event.length >= event.replacedText.length())) {
|
||||
return;
|
||||
}
|
||||
|
||||
String NL = textEditorST.getLineDelimiter();
|
||||
|
||||
String line = textEditorST.getLine(lineNum)
|
||||
+ ((lineNum + 1 < totalLines) ? NL : EMPTY);
|
||||
+ (((lineNum + 1) < totalLines) ? NL : EMPTY);
|
||||
lineLength = line.length();
|
||||
if (NL.equals(line) || EMPTY.equals(line)) {
|
||||
return;
|
||||
|
@ -1077,14 +1090,14 @@ public class StyledTextComp extends Composite {
|
|||
// check for locked text
|
||||
StyleRange styleRange = textEditorST.getStyleRangeAtOffset(lineOff
|
||||
+ index);
|
||||
if (styleRange != null && styleRange.foreground == lockColor) {
|
||||
if ((styleRange != null) && (styleRange.foreground == lockColor)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// deal with programmatic changes distant from the cursor
|
||||
int eventCursor = cursorOffset;
|
||||
if (eventCursor < event.start
|
||||
|| eventCursor > event.start + event.length) {
|
||||
if ((eventCursor < event.start)
|
||||
|| (eventCursor > (event.start + event.length))) {
|
||||
eventCursor = event.start + event.length;
|
||||
}
|
||||
|
||||
|
@ -1162,7 +1175,7 @@ public class StyledTextComp extends Composite {
|
|||
insertColor, lockColor };
|
||||
String[] labels = new String[] { "Background", "Foreground", "Frame",
|
||||
"Insert", "Locked" };
|
||||
for (int i = 0; i < colors.length - 1; i++) {
|
||||
for (int i = 0; i < (colors.length - 1); i++) {
|
||||
for (int j = i + 1; j < colors.length; j++) {
|
||||
warnIfEqual(colors[i], colors[j], labels[i], labels[j]);
|
||||
}
|
||||
|
@ -1346,7 +1359,7 @@ public class StyledTextComp extends Composite {
|
|||
lineCursorPos = 0;
|
||||
|
||||
// remember last good endIndex
|
||||
endIndex = lineStartOffset + line.length() - 1;
|
||||
endIndex = (lineStartOffset + line.length()) - 1;
|
||||
}
|
||||
|
||||
if (endIndex < 0) {
|
||||
|
@ -1375,7 +1388,7 @@ public class StyledTextComp extends Composite {
|
|||
|
||||
// get the text from the caret to the end of the block
|
||||
String post = "";
|
||||
if (endIndex >= cursorIndex && cursorIndex < st.getCharCount()) {
|
||||
if ((endIndex >= cursorIndex) && (cursorIndex < st.getCharCount())) {
|
||||
post = st.getText(cursorIndex, endIndex);
|
||||
}
|
||||
|
||||
|
@ -1384,7 +1397,7 @@ public class StyledTextComp extends Composite {
|
|||
if (cursorIndex > 0) {
|
||||
lchar = st.getTextRange(cursorIndex - 1, 1);
|
||||
char lchar0 = lchar.charAt(0);
|
||||
if (Character.isSpaceChar(lchar0) && lchar0 != NL.charAt(0)) {
|
||||
if (Character.isSpaceChar(lchar0) && (lchar0 != NL.charAt(0))) {
|
||||
lchar = " ";
|
||||
} else {
|
||||
lchar = "";
|
||||
|
@ -1394,7 +1407,7 @@ public class StyledTextComp extends Composite {
|
|||
String rchar = "";
|
||||
if (post.length() > 0) {
|
||||
char post0 = post.charAt(0);
|
||||
if (Character.isSpaceChar(post0) && post0 != NL.charAt(0)) {
|
||||
if (Character.isSpaceChar(post0) && (post0 != NL.charAt(0))) {
|
||||
rchar = " ";
|
||||
}
|
||||
}
|
||||
|
@ -1451,11 +1464,24 @@ public class StyledTextComp extends Composite {
|
|||
post = post.replaceAll("^\\s*", "");
|
||||
|
||||
String text = pre + rchar + post;
|
||||
st.replaceTextRange(startIndex, 1 + endIndex - startIndex, text);
|
||||
st.replaceTextRange(startIndex, (1 + endIndex) - startIndex, text);
|
||||
int newCaretOffset = startIndex + pre.length();
|
||||
st.setCaretOffset(newCaretOffset);
|
||||
|
||||
return new int[] { startIndex, endIndex, text.length() };
|
||||
}
|
||||
|
||||
protected void logTextChange(ExtendedModifyEvent event) {
|
||||
StyledText st = ((StyledText) event.widget);
|
||||
String oldText = event.replacedText;
|
||||
String newText = "";
|
||||
if (event.length > 0) {
|
||||
newText = st.getText(event.start, (event.start + event.length) - 1);
|
||||
}
|
||||
|
||||
if (!newText.equals(oldText)) {
|
||||
peLog.logEdit(event.start, oldText, newText);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,8 +37,6 @@ import javax.measure.unit.NonSI;
|
|||
import javax.measure.unit.Unit;
|
||||
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.opengis.referencing.FactoryException;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
|
@ -174,8 +172,6 @@ public class PointPrecipPlotResource extends
|
|||
strTree = new STRtree();
|
||||
gageData = dqc.new Station();
|
||||
|
||||
if (!station.isEmpty()) {
|
||||
|
||||
if (!dqc.precip_stations.isEmpty()) {
|
||||
int i = 0;
|
||||
for (ListIterator<Station> it = dqc.precip_stations.listIterator(); it
|
||||
|
@ -191,7 +187,8 @@ public class PointPrecipPlotResource extends
|
|||
kv.append(":");
|
||||
kv.append(pm);
|
||||
dataMap.put(kv.toString(), gageData);
|
||||
pdataMap.put(kv.toString(), DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i]);
|
||||
pdataMap.put(kv.toString(),
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i]);
|
||||
|
||||
/* Create a small envelope around the point */
|
||||
Coordinate p1 = new Coordinate(xy.x + .02, xy.y + .02);
|
||||
|
@ -336,7 +333,8 @@ public class PointPrecipPlotResource extends
|
|||
}
|
||||
|
||||
for (m = 0; m < tsmax; m++) {
|
||||
if (station.parm.substring(3, 5).equalsIgnoreCase(ts[m].abr)
|
||||
if (station.parm.substring(3, 5)
|
||||
.equalsIgnoreCase(dqc.ts[m].abr)
|
||||
&& (DailyQcUtils.dflag[m + 1] == 1)) {
|
||||
break;
|
||||
}
|
||||
|
@ -349,9 +347,9 @@ public class PointPrecipPlotResource extends
|
|||
for (m = 0; m < 9; m++) {
|
||||
|
||||
if ((m == pdataMap.get(key).frain[time_pos].qual)
|
||||
&& (qflag[m] == 1)) {
|
||||
&& (dqc.qflag[m] == 1)) {
|
||||
break;
|
||||
} else if ((m == 7) && (qflag[7] == 1)
|
||||
} else if ((m == 7) && (dqc.qflag[7] == 1)
|
||||
&& (pdataMap.get(key).frain[time_pos].data == -99)
|
||||
&& (pdataMap.get(key).frain[time_pos].qual == -99)) {
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.texteditor.scripting.dialogs.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.message.Message;
|
||||
import com.raytheon.uf.common.message.Property;
|
||||
import com.raytheon.viz.texteditor.TextDBQuery;
|
||||
|
||||
/**
|
||||
* Contains utility methods for interactions with the text database.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 22, 2009 mfegan Initial creation
|
||||
* Jul 13, 2010 2187 cjeanbap Add opertional mode functionality.
|
||||
* 02Aug2010 2187 cjeanbap Update variable/method signature to be consistent.
|
||||
* Feb 04, 2015 4086 njensen Resurrected class and changed to use TextDBQuery
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mfegan
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public final class TextDBUtilities {
|
||||
public static final String TYPE_PROD = "PROD";
|
||||
|
||||
public static final String TYPE_INFO = "INFO";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private TextDBUtilities() {
|
||||
// no class instances
|
||||
}
|
||||
|
||||
public static String writeProductToDatabase(String prodID, String contents,
|
||||
boolean operationalMode) throws Exception {
|
||||
TextDBQuery query = createProductStoreMessage(prodID, contents,
|
||||
operationalMode);
|
||||
Message message = query.executeQuery();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (Property property : message.getHeader().getProperties()) {
|
||||
String value = property.getValue();
|
||||
if (value.matches("^NORMAL")) {
|
||||
sb.append(value.split(":")[1]).append("\n");
|
||||
} else {
|
||||
throw new Exception("Received error from product retrieval - "
|
||||
+ value);
|
||||
}
|
||||
}
|
||||
return sb.toString().trim();
|
||||
}
|
||||
|
||||
public static String[] readProductFromDatabase(String prodID, String type,
|
||||
boolean operationalMode) throws Exception {
|
||||
TextDBQuery query = createProductRequestMessage(prodID, type,
|
||||
operationalMode);
|
||||
Message message = query.executeQuery();
|
||||
List<String> products = new ArrayList<String>();
|
||||
Property[] properties = message.getHeader().getProperties();
|
||||
if (properties == null) {
|
||||
return null;
|
||||
}
|
||||
for (Property property : message.getHeader().getProperties()) {
|
||||
if ("stdout".equalsIgnoreCase(property.getName())) {
|
||||
products.add(property.getValue());
|
||||
} else {
|
||||
throw new Exception(property.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
return products.toArray(new String[] {});
|
||||
}
|
||||
|
||||
private static TextDBQuery createProductRequestMessage(String prodID,
|
||||
String type, Boolean operationalMode) {
|
||||
TextDBQuery query = new TextDBQuery();
|
||||
query.setQueryViewName("text");
|
||||
query.setQueryOpName("GET");
|
||||
query.setQuerySubObName(type);
|
||||
query.setQueryAfosCmd(prodID);
|
||||
query.setQueryOperationalMode(operationalMode.toString());
|
||||
return query;
|
||||
}
|
||||
|
||||
private static TextDBQuery createProductStoreMessage(String prodID,
|
||||
String product, Boolean operationalMode) {
|
||||
TextDBQuery query = new TextDBQuery();
|
||||
query.setQueryViewName("text");
|
||||
query.setQueryOpName("PUT");
|
||||
query.setQueryProduct(product);
|
||||
query.addProductId(prodID);
|
||||
query.setQueryOperationalMode(operationalMode.toString());
|
||||
return query;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,504 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.texteditor.scripting.runner;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import jep.JepException;
|
||||
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.viz.core.mode.CAVEMode;
|
||||
import com.raytheon.viz.texteditor.msgs.IScriptRunnerObserver;
|
||||
import com.raytheon.viz.texteditor.scripting.dialogs.util.FileUtilities;
|
||||
import com.raytheon.viz.texteditor.scripting.dialogs.util.TextDBUtilities;
|
||||
import com.raytheon.viz.texteditor.scripting.dialogs.util.Utilities;
|
||||
|
||||
/**
|
||||
* Class providing the top level implementations of the special Text WS
|
||||
* scripting commands.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 29, 2009 mfegan Initial creation
|
||||
* Jul 13, 2010 2187 cjeanbap Add operational mode functionality
|
||||
* Feb 04, 2015 4086 njensen Resurrected class
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mfegan
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TextWsCommands {
|
||||
private final String TIME_FMT = "%1$tD %1$tT";
|
||||
|
||||
private String editor = "";
|
||||
|
||||
private IScriptRunnerObserver observer = null;
|
||||
|
||||
private boolean canceled = false;
|
||||
|
||||
private boolean operationalMode = true;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public TextWsCommands() {
|
||||
CAVEMode mode = CAVEMode.getMode();
|
||||
this.operationalMode = (CAVEMode.OPERATIONAL.equals(mode)
|
||||
|| CAVEMode.PRACTICE.equals(mode) ? true : false);
|
||||
}
|
||||
|
||||
public void setEditor(String editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public void setObserver(Object observer) {
|
||||
this.observer = (IScriptRunnerObserver) observer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the Text Workstation script runner's {@code run(file)}
|
||||
* command. The file to execute must be in the current user's home
|
||||
* directory.
|
||||
*
|
||||
* @param file
|
||||
* name of the script to execute
|
||||
*
|
||||
* @throws Exception
|
||||
* if any problem occurs
|
||||
*/
|
||||
public void runLocalFile(String file) throws JepException {
|
||||
String homeDir = System.getProperty("user.home");
|
||||
if (Utilities.isEmptyString(file)) {
|
||||
throw new JepException("no file specified -- unable to execute");
|
||||
}
|
||||
if (file.indexOf("/") != -1) {
|
||||
throw new JepException("expected local file but got \"" + file
|
||||
+ "\"");
|
||||
}
|
||||
|
||||
String script = homeDir + "/" + file;
|
||||
// try {
|
||||
// script = FileUtilities.loadFileToString(homeDir, file);
|
||||
// } catch (IOException e) {
|
||||
// throw new Exception("could not open \"" + file + "\"",e);
|
||||
// }
|
||||
System.out.println(script);
|
||||
observer.executeTextScript(script);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the Text Workstation script runner's {@code load(pid)}
|
||||
* command. Reads the latest product matching the specified PID from the
|
||||
* text database and sends it to the observer for display.
|
||||
*
|
||||
* @param pil
|
||||
* the product ID (PID)
|
||||
*
|
||||
* @throws Exception
|
||||
* when any error occurs
|
||||
*/
|
||||
public void loadTextProduct(String pil) throws Exception {
|
||||
if (Utilities.isEmptyString(pil)) {
|
||||
throw new Exception(
|
||||
"no product ID provided -- unable to load product");
|
||||
}
|
||||
if (observer.isEditMode()) {
|
||||
throw new Exception("Cannot load product: text window in edit mode");
|
||||
}
|
||||
if (pil.startsWith("E:") || pil.startsWith("M:")) {
|
||||
throw new Exception(
|
||||
"Cannot load product: cannot edit products while script is running");
|
||||
}
|
||||
observer.writeText("--- requesting " + pil
|
||||
+ " from text database ---\n");
|
||||
String[] products;// = observer.getProductFromDatabase(pid);
|
||||
try {
|
||||
products = TextDBUtilities.readProductFromDatabase(pil,
|
||||
TextDBUtilities.TYPE_PROD, this.operationalMode);
|
||||
} catch (Exception e) {
|
||||
observer.writeText("--- product \"" + pil
|
||||
+ "\" not available ---\n");
|
||||
observer.showErrorMessage("failure reading from database.", e);
|
||||
return;
|
||||
}
|
||||
if (products == null || products.length == 0) {
|
||||
observer.writeText("--- product \"" + pil
|
||||
+ "\" not available ---\n");
|
||||
observer.showScriptStatus("Requested product \"" + pil
|
||||
+ "\" not found in data base");
|
||||
return;
|
||||
}
|
||||
observer.postProductToEditor(products, new String[] { pil });
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the Text Workstation script runner's
|
||||
* {@code readdb(pid,filename)} command. Reads the latest product matching
|
||||
* the pid and writes the product to the specified file. Emulates the AWIPS
|
||||
* I <em>textdb -rd PIL</em> retrieval.
|
||||
*
|
||||
* @param pil
|
||||
* the AFOS PIL to retrieve
|
||||
* @param filename
|
||||
* path to the file to contain the results
|
||||
*
|
||||
* @throws Exception
|
||||
* if an error occurs
|
||||
*/
|
||||
public void saveProductToFile(String pil, String filename) throws Exception {
|
||||
if (Utilities.isEmptyString(pil)) {
|
||||
throw new Exception(
|
||||
"no product ID provided -- unable to read product");
|
||||
}
|
||||
if (Utilities.isEmptyString(filename)) {
|
||||
throw new Exception(
|
||||
"no file name provided -- unable to read product");
|
||||
}
|
||||
observer.writeText("--- requesting " + pil
|
||||
+ " from text database ---\n");
|
||||
String[] products = null;
|
||||
try {
|
||||
products = TextDBUtilities.readProductFromDatabase(pil,
|
||||
TextDBUtilities.TYPE_INFO, this.operationalMode);
|
||||
} catch (Exception e) {
|
||||
observer.writeText("--- product \"" + pil
|
||||
+ "\" not available ---\n");
|
||||
observer.showErrorMessage("failure reading from database.", e);
|
||||
return;
|
||||
}
|
||||
if (products == null || products.length == 0) {
|
||||
observer.writeText("--- product \"" + pil
|
||||
+ "\" not available ---\n");
|
||||
observer.showScriptStatus("Requested product \"" + pil
|
||||
+ "\" not found in data base");
|
||||
return;
|
||||
}
|
||||
int count = products.length;
|
||||
String ln = System.getProperty("line.separator", "\n");
|
||||
observer.writeText("--- obtained " + count + " records for " + pil
|
||||
+ " ---\n");
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (String product : products) {
|
||||
sb.append(product).append(ln);
|
||||
}
|
||||
observer.writeText("--- writing results for " + pil + " to " + filename
|
||||
+ " ---\n");
|
||||
try {
|
||||
FileUtilities.writeStringToFile(filename, sb.toString());
|
||||
} catch (Exception e) {
|
||||
observer.writeText("--- cannot write to " + filename + " ---");
|
||||
observer.showErrorMessage("cannot write to " + filename, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the Text Workstation script runner's
|
||||
* {@code writedb(pid,filename)} command. Reads the contents of the
|
||||
* specified file and posts the contents to the text database using the
|
||||
* specified product ID.
|
||||
*
|
||||
* @param pil
|
||||
* the product ID
|
||||
* @param filename
|
||||
* the path to the data file
|
||||
*
|
||||
* @throws Exception
|
||||
* if any problem occurs
|
||||
*/
|
||||
public void readProductFromFile(String pil, String filename)
|
||||
throws Exception {
|
||||
if (Utilities.isEmptyString(pil)) {
|
||||
throw new Exception(
|
||||
"no product ID provided -- unable to write product");
|
||||
}
|
||||
if (Utilities.isEmptyString(filename)) {
|
||||
throw new Exception(
|
||||
"no file name provided -- unable to write product");
|
||||
}
|
||||
observer.writeText("--- reading product from " + filename + " ---\n");
|
||||
String contents = "";
|
||||
try {
|
||||
contents = FileUtilities.loadFileToString(filename);
|
||||
} catch (Exception e) {
|
||||
throw new Exception("cannot read from " + filename);
|
||||
}
|
||||
try {
|
||||
String result = TextDBUtilities.writeProductToDatabase(pil,
|
||||
contents, this.operationalMode);
|
||||
observer.showScriptStatus(result);
|
||||
} catch (Exception e) {
|
||||
observer.showErrorMessage("failure writing to database ", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts the script runner into a "safe" wait state. This state can be
|
||||
* interrupted by the user in one of two ways; 'Continue' and 'Cancel'.
|
||||
*
|
||||
* @throws Exception
|
||||
* if an error occurs
|
||||
*/
|
||||
public void waitIndefinate() throws Exception {
|
||||
observer.showScriptStatus("Waiting for user to continue...");
|
||||
observer.activateControls(false, true);
|
||||
// indefinite sleep loop
|
||||
while (true) {
|
||||
if (observer.cancelScript()) {
|
||||
canceled = true;
|
||||
break;
|
||||
} else if (observer.continueScript()) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
doEvents();
|
||||
} catch (InterruptedException e) {
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
observer.activateControls(false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits until the specified number of minutes after the hour. the number of
|
||||
* minutes must be between 0 and 59 inclusive. If the specified time is less
|
||||
* than the current minutes after the hour, the delay is scheduled into the
|
||||
* next hour.
|
||||
*
|
||||
* @param time
|
||||
* time delay after the hour
|
||||
*
|
||||
* @throws Exception
|
||||
* in case of any error
|
||||
*/
|
||||
public void waitUntilTime(int minToWait) throws Exception {
|
||||
if (minToWait < 0 || minToWait > 59) {
|
||||
throw new Exception(
|
||||
"Invalid argument: expected integer between 0 and 59 but got \""
|
||||
+ minToWait + "\"");
|
||||
}
|
||||
/* determine when to end wait */
|
||||
Date date = (Date) SimulatedTime.getSystemTime().getTime().clone();
|
||||
Calendar target = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
target.setTime(date);
|
||||
int minPastHour = target.get(Calendar.MINUTE);
|
||||
if (minPastHour > minToWait) {
|
||||
// past target -- wait into next hour
|
||||
target.add(Calendar.HOUR_OF_DAY, 1);
|
||||
}
|
||||
target.set(Calendar.MINUTE, minToWait);
|
||||
target.set(Calendar.SECOND, 0);
|
||||
/* execute the safe sleep */
|
||||
safeSleep(target.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for the specified amount of time. The format of the time
|
||||
* specification is <em>HH:MM:SS</em>; resulting of a delay of up to 23hrs
|
||||
* 59min 59sec.
|
||||
*
|
||||
* @param time
|
||||
* the amount of time to delay
|
||||
*
|
||||
* @throws Exception
|
||||
* in case of any error
|
||||
*/
|
||||
public void waitForTime(String time) throws Exception {
|
||||
/* parse/validate the argument */
|
||||
Pattern p = Pattern.compile("(\\d{2}):(\\d{2}):(\\d{2})");
|
||||
Matcher m = p.matcher(time);
|
||||
if (!m.matches()) {
|
||||
throw new Exception(
|
||||
"Invalid argument: expected format HH:MM:SS but got \""
|
||||
+ time + "\"");
|
||||
}
|
||||
int hrs = 0;
|
||||
int mins = 0;
|
||||
int secs = 0;
|
||||
try {
|
||||
hrs = Integer.parseInt(m.group(1));
|
||||
mins = Integer.parseInt(m.group(2));
|
||||
secs = Integer.parseInt(m.group(3));
|
||||
} catch (NumberFormatException e) {
|
||||
throw new Exception(
|
||||
"Invalid argument: expected format HH:MM:SS but got \""
|
||||
+ time + "\"", e);
|
||||
}
|
||||
if (hrs < 0 || hrs > 23 || mins < 0 || mins > 59 || secs < 0
|
||||
|| secs > 59) {
|
||||
throw new Exception(
|
||||
"Invalid argument: expected format HH:MM:SS but got \""
|
||||
+ time + "\"");
|
||||
}
|
||||
/* delay time in seconds */
|
||||
int delay = 3600 * hrs + 60 * mins + secs;
|
||||
/* create a calendar representing the wait end time */
|
||||
Date now = (Date) SimulatedTime.getSystemTime().getTime().clone();
|
||||
Calendar date = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
date.setTime(now);
|
||||
date.add(Calendar.SECOND, delay);
|
||||
/* execute the safe sleep */
|
||||
safeSleep(date.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* Safely sleeps the specified number of seconds.
|
||||
*
|
||||
* @param sleepToTime
|
||||
* provides the end time of the sleep
|
||||
*
|
||||
* @throws Exception
|
||||
* if an error occurs
|
||||
*/
|
||||
private void safeSleep(Date sleepToTime) throws Exception {
|
||||
/* short circuit -- return if end time already past */
|
||||
if (SimulatedTime.getSystemTime().getTime().after(sleepToTime)) {
|
||||
return;
|
||||
}
|
||||
observer.activateControls(true, false);
|
||||
observer.showScriptStatus("Waiting until "
|
||||
+ String.format(TIME_FMT, sleepToTime) + " to proceed...");
|
||||
while (SimulatedTime.getSystemTime().getTime().before(sleepToTime)) {
|
||||
if (observer.cancelScript()) {
|
||||
canceled = true;
|
||||
break;
|
||||
} else if (observer.skipWait()) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
doEvents();
|
||||
} catch (InterruptedException e) {
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
observer.activateControls(false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns results accumulation on in the Text Editor Window.
|
||||
*
|
||||
* @param flag
|
||||
* true to start accumulation, false to stop accumulation
|
||||
*
|
||||
* @throws Exception
|
||||
* if an error occurs
|
||||
*/
|
||||
public void setAccumulation(boolean flag) throws Exception {
|
||||
if (observer.isEditMode()) {
|
||||
throw new Exception(
|
||||
"Cannot set accumulate: text window in edit mode");
|
||||
}
|
||||
observer.writeText("--- turning accumulation " + (flag ? "on" : "off")
|
||||
+ " ---\n");
|
||||
observer.setAccumulation(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the Text Editor Window
|
||||
*
|
||||
* @throws Exception
|
||||
* if an error occurs
|
||||
*/
|
||||
public void clearTextDisplay() throws Exception {
|
||||
if (observer.isEditMode()) {
|
||||
throw new Exception("Cannot clear: text window in edit mode");
|
||||
}
|
||||
observer.writeText("--- clearing text display window ---\n");
|
||||
observer.clearTextDisplay();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the specified text to the observer for display. This method is used
|
||||
* to cause output from Python's print command to be redirected to the
|
||||
* observer.
|
||||
*
|
||||
* @param text
|
||||
* the text to display
|
||||
*/
|
||||
public void writeText(String text) {
|
||||
observer.writeText(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the specified text to the observer for display. This method is used
|
||||
* to capture output from {@code stderr} in the a python script and redirect
|
||||
* it to the observer.
|
||||
*
|
||||
* @param errMsg
|
||||
* the stderr text to display
|
||||
*/
|
||||
public void writeError(String errMsg) {
|
||||
observer.scriptError();
|
||||
writeText(errMsg);
|
||||
observer.addStdErrMsg(errMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* allows the script to request a refresh of the GUI
|
||||
*/
|
||||
public void doEvents() {
|
||||
while (observer.getDisplay().readAndDispatch()) {
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// public boolean continueScript() {
|
||||
// return observer.continueScript();
|
||||
// }
|
||||
// /**
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// public boolean skipWait() {
|
||||
// return observer.skipWait();
|
||||
// }
|
||||
|
||||
/**
|
||||
* Returns {@code true} is the user has canceled the script via a user
|
||||
* interface element. This method should be called periodically during loops
|
||||
* and pauses to determine if a user ordered cancel has occurred.
|
||||
*/
|
||||
public boolean cancelScript() {
|
||||
return observer.cancelScript();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the script was canceled. This allows the Python
|
||||
* wrapper to properly relay the script cancellation to the script runner.
|
||||
* Note: this is not set by all commands.
|
||||
*/
|
||||
public boolean isCanceled() {
|
||||
return canceled;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,11 @@ architecture=x86_64
|
|||
includegen.filter=raytheon|noaa\.nws|noaa\.gsd|gov\.nasa\.msfc|edu\.wisc\.ssec\.cimss
|
||||
|
||||
# AWIPSII core repositories required for build
|
||||
core.repositories=ufcore,ufcore-foss,AWIPS2_foss
|
||||
core.repo=ufcore
|
||||
core-foss.repo=ufcore-foss
|
||||
awips2-foss.repo=AWIPS2_foss
|
||||
|
||||
core.repositories=${core.repo},${core-foss.repo},${awips2-foss.repo}
|
||||
|
||||
# Note: currently, there is a limit of 99 plugin directories.
|
||||
dir.01=cave
|
||||
|
|
|
@ -10,6 +10,8 @@ export FXA_DB_NAME=fxatext
|
|||
export HM_DB_NAME=hmdb
|
||||
export IH_DB_NAME=hd_ob92oax
|
||||
|
||||
# Resolve conflict on AFOS PILs by finding site with first letter in the following order.
|
||||
export PREFERRED_AFOS_FIRST_LETTER="KCPTXM"
|
||||
### end of localization variables ###
|
||||
|
||||
# setup environment for HPE
|
||||
|
@ -49,3 +51,4 @@ export SITE_IDENTIFIER=${AW_SITE_IDENTIFIER}
|
|||
# set Fax environment variables pointing to ldad@ls1
|
||||
export LDAD_EXTERNAL_HOME=/ldad
|
||||
export LDAD_EXTERNAL_PUBLIC=/data/ldad/public
|
||||
|
||||
|
|
|
@ -105,7 +105,6 @@
|
|||
<property name="maxConnections" value="${PYPIES_MAX_CONN}"/>
|
||||
<!-- value in milliseconds to allow socket to timeout, don't allow this to be zero, bad things could happen -->
|
||||
<property name="socketTimeout" value="180000"/>
|
||||
<property name="handlingGzipResponses" value="false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="httpClientConfig" factory-bean="httpClientConfigBuilder" factory-method="build"/>
|
||||
|
|
|
@ -29,6 +29,7 @@ SOFTWARE HISTORY
|
|||
Date Ticket# Engineer Description
|
||||
------------ ---------- ----------- --------------------------
|
||||
Jul 09, 2008 1222 jelkins Split command line loader from class
|
||||
Jan 26, 2015 4033 randerso Fix logging broken by #3685
|
||||
|
||||
@author: jelkins
|
||||
"""
|
||||
|
@ -46,12 +47,20 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request impo
|
|||
SCRIPT_DIR = abspath(dirname(argv[0]))
|
||||
|
||||
# ---- Setup Logging ----------------------------------------------------------
|
||||
LOG_CONF = join(SCRIPT_DIR,"preferences","logging.conf")
|
||||
import logging
|
||||
from time import strftime, gmtime
|
||||
timeStamp = strftime("%Y%m%d", gmtime())
|
||||
logFile = '/awips2/edex/logs/configureTextProducts-'+timeStamp+'.log'
|
||||
|
||||
import logging.config
|
||||
logging.config.fileConfig(LOG_CONF)
|
||||
|
||||
LOG = logging.getLogger(basename(argv[0]))
|
||||
LOG = logging.getLogger("configureTextProducts")
|
||||
LOG.setLevel(logging.DEBUG)
|
||||
handler = logging.FileHandler(logFile)
|
||||
handler.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter("%(levelname)-5s %(asctime)s [%(process)d:%(thread)d] %(filename)s: %(message)s")
|
||||
handler.setFormatter(formatter)
|
||||
for h in LOG.handlers:
|
||||
LOG.removeHandler(h)
|
||||
LOG.addHandler(handler)
|
||||
|
||||
class ConfigureTextProducts:
|
||||
"""Command Line Interface for the TextProductsGenerator
|
||||
|
|
|
@ -930,6 +930,7 @@ public class FSSObsMonitorConfigurationManager implements
|
|||
public void fileUpdated(FileUpdatedMessage message) {
|
||||
if (message.getFileName().equals(getConfigFileName())) {
|
||||
try {
|
||||
readConfigXml();
|
||||
// inform listeners
|
||||
for (MonitorConfigListener fl : listeners) {
|
||||
fl.configChanged(new MonitorConfigEvent(this));
|
||||
|
|
|
@ -27,10 +27,13 @@ import java.sql.ResultSet;
|
|||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -49,6 +52,7 @@ import org.springframework.orm.hibernate4.SessionFactoryUtils;
|
|||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.TransactionCallback;
|
||||
|
||||
import com.raytheon.edex.site.SiteUtil;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.OperationalStdTextProduct;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.PracticeStdTextProduct;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.StdTextProduct;
|
||||
|
@ -60,14 +64,15 @@ import com.raytheon.uf.common.localization.LocalizationContext;
|
|||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.site.SiteMap;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.Pair;
|
||||
import com.raytheon.uf.common.wmo.AFOSProductId;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
||||
import com.raytheon.uf.edex.database.dao.CoreDao;
|
||||
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
||||
import com.raytheon.uf.edex.database.purge.PurgeLogger;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
|
||||
/**
|
||||
* The dao implementation associated with the TextDao classes used for all
|
||||
|
@ -91,9 +96,10 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* 03Oct2012 15244 mgamazaychikov Added the fix to query the appropriate table
|
||||
* (operational or practice)
|
||||
* May 20, 2014 2536 bclement moved from edex.textdb to edex.plugin.text
|
||||
* Sep 18, 2014 3627 mapeters Updated deprecated {@link TimeTools} usage.
|
||||
* Sep 18, 2014 3627 mapeters Updated deprecated TimeTools usage.
|
||||
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
|
||||
* 10/28/2014 3454 bphillip Fix usage of getSession()
|
||||
* Jan 27, 2015 4031 rferrel Resolve AFOS PILs site conflict using preferredAfosFirstLetter.
|
||||
* </pre>
|
||||
*
|
||||
* @author garmendariz
|
||||
|
@ -125,6 +131,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
private static final String NNN_ID = "nnnid";
|
||||
|
||||
private static final String SITE = "site";
|
||||
|
||||
private static final String PRODUCT = "product";
|
||||
|
||||
private static final String ProdSITE = "prodId.site";
|
||||
|
@ -141,23 +149,42 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
private static final String TM_QUERY_FMT = "select refTime from table_name where cccid='%s' and nnnid='%s' and xxxid='%s';";
|
||||
|
||||
private static final String SITE_QUERY_FMT = "select distinct site from table_name where cccid='%s' and nnnid='%s' and xxxid='%s';";
|
||||
|
||||
private static final String DEFAULT_PREFERRED_AFOS_FIRST_LETTER = "KCPTXM";
|
||||
|
||||
private static final String AFOS_QUERY_STMT = "from StdTextProduct where "
|
||||
+ ProdCCC_ID
|
||||
+ " = :"
|
||||
+ CCC_ID
|
||||
+ " and "
|
||||
+ ProdNNN_ID
|
||||
+ " = :"
|
||||
+ NNN_ID
|
||||
+ " and "
|
||||
+ ProdXXX_ID
|
||||
+ " = :"
|
||||
+ XXX_ID
|
||||
+ " order by "
|
||||
+ REFTIME + " desc" + ", " + INSERTTIME + " desc";
|
||||
+ ProdCCC_ID + " = :" + CCC_ID
|
||||
|
||||
+ " and " + ProdNNN_ID + " = :" + NNN_ID
|
||||
|
||||
+ " and " + ProdXXX_ID + " = :" + XXX_ID
|
||||
|
||||
+ " and " + ProdSITE + " = :" + SITE
|
||||
|
||||
+ " order by " + REFTIME + " desc" + ", " + INSERTTIME + " desc";
|
||||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final static char[] preferredAfosFirstLetter;
|
||||
static {
|
||||
String afosLetters = System.getenv("PREFERRED_AFOS_FIRST_LETTER");
|
||||
if (afosLetters == null) {
|
||||
afosLetters = DEFAULT_PREFERRED_AFOS_FIRST_LETTER;
|
||||
}
|
||||
|
||||
// Place site's first letter at the start of the preferred letters.
|
||||
String awSite = SiteMap.getInstance().getSite4LetterId(
|
||||
SiteUtil.getSite());
|
||||
afosLetters = afosLetters.replaceAll(awSite.substring(0, 1), "");
|
||||
preferredAfosFirstLetter = new char[afosLetters.length() + 1];
|
||||
afosLetters.getChars(0, afosLetters.length(), preferredAfosFirstLetter,
|
||||
1);
|
||||
preferredAfosFirstLetter[0] = awSite.charAt(0);
|
||||
}
|
||||
|
||||
private String siteQueryFmt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -219,9 +246,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
String nnnid = prodId.getNnnid();
|
||||
String xxxid = prodId.getXxxid();
|
||||
Query query = session
|
||||
.createQuery(
|
||||
"SELECT versionstokeep FROM TextProductInfo WHERE "
|
||||
+ "prodId.cccid = :cccid AND prodId.nnnid = :nnnid AND prodId.xxxid = :xxxid");
|
||||
.createQuery("SELECT versionstokeep FROM TextProductInfo WHERE "
|
||||
+ "prodId.cccid = :cccid AND prodId.nnnid = :nnnid AND prodId.xxxid = :xxxid");
|
||||
query.setParameter("cccid", cccid);
|
||||
query.setParameter("nnnid", nnnid);
|
||||
query.setParameter("xxxid", xxxid);
|
||||
|
@ -261,81 +287,16 @@ public class StdTextProductDao extends CoreDao {
|
|||
* @param pastHours
|
||||
* @return
|
||||
*/
|
||||
public List<StdTextProduct> cccnnnxxxReadVersion(final String ccc, final String nnn,
|
||||
final String xxx, final int version) {
|
||||
public List<StdTextProduct> cccnnnxxxReadVersion(final String ccc,
|
||||
final String nnn, final String xxx, final int version) {
|
||||
List<StdTextProduct> products = null;
|
||||
boolean hasCCC = ((ccc != null) && (ccc.length() > 0) && (!ccc
|
||||
.equals("000")));
|
||||
boolean hasNNN = ((nnn != null) && (nnn.length() > 0) && (!nnn
|
||||
.equals("000")));
|
||||
boolean hasXXX = ((xxx != null) && (xxx.length() > 0) && (!xxx
|
||||
.equals("000")));
|
||||
final boolean createInitialFilter = !(hasCCC && hasNNN && hasXXX);
|
||||
|
||||
try {
|
||||
final AFOSProductId[] afosIds = txTemplate
|
||||
.execute(new TransactionCallback<AFOSProductId[]>() {
|
||||
final List<Pair<String, AFOSProductId>> siteAfosIdList = querySiteAfosId(
|
||||
ccc, nnn, xxx);
|
||||
|
||||
@Override
|
||||
public AFOSProductId[] doInTransaction(
|
||||
TransactionStatus status) {
|
||||
String paddedccc = StringUtils.rightPad(ccc,
|
||||
MAX_FIELD_LENGTH);
|
||||
String paddednnn = StringUtils.rightPad(nnn,
|
||||
MAX_FIELD_LENGTH);
|
||||
String paddedxxx = StringUtils.rightPad(xxx,
|
||||
MAX_FIELD_LENGTH);
|
||||
Session session = getCurrentSession();
|
||||
AFOSProductId[] afosIds = null;
|
||||
StdTextProduct stdTextProduct = getStdTextProductInstance();
|
||||
|
||||
if (createInitialFilter) {
|
||||
stdTextProduct.setCccid(paddedccc);
|
||||
stdTextProduct.setNnnid(paddednnn);
|
||||
stdTextProduct.setXxxid(paddedxxx);
|
||||
|
||||
Map<String, String> map = buildCriterions(
|
||||
ProdCCC_ID, paddedccc, ProdNNN_ID,
|
||||
paddednnn, ProdXXX_ID, paddedxxx);
|
||||
Criteria criteria = session
|
||||
.createCriteria(stdTextProduct
|
||||
.getClass());
|
||||
ProjectionList projList = Projections
|
||||
.projectionList();
|
||||
projList.add(Projections.property(ProdCCC_ID));
|
||||
projList.add(Projections.property(ProdNNN_ID));
|
||||
projList.add(Projections.property(ProdXXX_ID));
|
||||
criteria.setProjection(Projections
|
||||
.distinct(projList));
|
||||
criteria.add(Restrictions.allEq(map));
|
||||
criteria.addOrder(Order.asc(ProdCCC_ID));
|
||||
criteria.addOrder(Order.asc(ProdNNN_ID));
|
||||
criteria.addOrder(Order.asc(ProdXXX_ID));
|
||||
|
||||
List<?> list = criteria.list();
|
||||
if (list != null && list.size() > 0) {
|
||||
afosIds = new AFOSProductId[list.size()];
|
||||
int i = 0;
|
||||
for (Object row : list) {
|
||||
Object[] cols = (Object[]) row;
|
||||
afosIds[i++] = new AFOSProductId(
|
||||
(String) cols[0],
|
||||
(String) cols[1],
|
||||
(String) cols[2]);
|
||||
}
|
||||
} else {
|
||||
afosIds = new AFOSProductId[0];
|
||||
}
|
||||
} else {
|
||||
afosIds = new AFOSProductId[1];
|
||||
afosIds[0] = new AFOSProductId(paddedccc,
|
||||
paddednnn, paddedxxx);
|
||||
}
|
||||
return afosIds;
|
||||
}
|
||||
});
|
||||
|
||||
products = txTemplate.execute(new TransactionCallback<List<StdTextProduct>>() {
|
||||
products = txTemplate
|
||||
.execute(new TransactionCallback<List<StdTextProduct>>() {
|
||||
|
||||
@Override
|
||||
public List<StdTextProduct> doInTransaction(
|
||||
|
@ -343,41 +304,53 @@ public class StdTextProductDao extends CoreDao {
|
|||
List<StdTextProduct> products = null;
|
||||
Session session = getCurrentSession();
|
||||
/*
|
||||
* DR15244 - Make sure that the query is performed on the appropriate
|
||||
* table based on what StdTextProduct is requested (ultimately on CAVE mode)
|
||||
* DR15244 - Make sure that the query is performed
|
||||
* on the appropriate table based on what
|
||||
* StdTextProduct is requested (ultimately on CAVE
|
||||
* mode)
|
||||
*/
|
||||
Matcher m = Pattern.compile("StdTextProduct").matcher(AFOS_QUERY_STMT);
|
||||
String tableName = getStdTextProductInstance().getClass().getSimpleName();
|
||||
Matcher m = Pattern.compile("StdTextProduct")
|
||||
.matcher(AFOS_QUERY_STMT);
|
||||
String tableName = getStdTextProductInstance()
|
||||
.getClass().getSimpleName();
|
||||
String tableQuery = m.replaceAll(tableName);
|
||||
Query query = session.createQuery(tableQuery);
|
||||
|
||||
|
||||
if (version >= 0) {
|
||||
query.setMaxResults(version + 1);
|
||||
}
|
||||
for (AFOSProductId afosId : afosIds) {
|
||||
query.setParameter(CCC_ID, afosId.getCcc());
|
||||
query.setParameter(NNN_ID, afosId.getNnn());
|
||||
query.setParameter(XXX_ID, afosId.getXxx());
|
||||
|
||||
List<?> results = query.list();
|
||||
if (results != null && results.size() > 0) {
|
||||
if (version == -1) {
|
||||
// want all versions
|
||||
if (products == null) {
|
||||
products = new ArrayList<StdTextProduct>(
|
||||
results.size() * afosIds.length);
|
||||
for (Pair<String, AFOSProductId> siteAfosId : siteAfosIdList) {
|
||||
String site = siteAfosId.getFirst();
|
||||
AFOSProductId afosId = siteAfosId.getSecond();
|
||||
if (site != null) {
|
||||
query.setParameter(CCC_ID, afosId.getCcc());
|
||||
query.setParameter(NNN_ID, afosId.getNnn());
|
||||
query.setParameter(XXX_ID, afosId.getXxx());
|
||||
query.setParameter(SITE, site);
|
||||
|
||||
List<?> results = query.list();
|
||||
if (results != null && results.size() > 0) {
|
||||
if (version == -1) {
|
||||
// want all versions
|
||||
if (products == null) {
|
||||
products = new ArrayList<StdTextProduct>(
|
||||
results.size()
|
||||
* siteAfosIdList
|
||||
.size());
|
||||
}
|
||||
for (Object row : results) {
|
||||
products.add((StdTextProduct) row);
|
||||
}
|
||||
} else if (results.size() > version) {
|
||||
// want specific version
|
||||
if (products == null) {
|
||||
products = new ArrayList<StdTextProduct>(
|
||||
siteAfosIdList.size());
|
||||
}
|
||||
products.add((StdTextProduct) results
|
||||
.get(version));
|
||||
}
|
||||
for (Object row : results) {
|
||||
products.add((StdTextProduct) row);
|
||||
}
|
||||
} else if (results.size() > version) {
|
||||
// want specific version
|
||||
if (products == null) {
|
||||
products = new ArrayList<StdTextProduct>(
|
||||
afosIds.length);
|
||||
}
|
||||
products.add((StdTextProduct) results.get(version));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -385,8 +358,6 @@ public class StdTextProductDao extends CoreDao {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error occurred reading products", e);
|
||||
}
|
||||
|
@ -398,6 +369,188 @@ public class StdTextProductDao extends CoreDao {
|
|||
return products;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get desired site for the afosId the pairs are order by AfosId.
|
||||
*
|
||||
* @param ccc
|
||||
* @param nnn
|
||||
* @param xxx
|
||||
* @return siteAfosIds
|
||||
*/
|
||||
private List<Pair<String, AFOSProductId>> querySiteAfosId(final String ccc,
|
||||
final String nnn, final String xxx) {
|
||||
boolean hasCCC = ((ccc != null) && (ccc.length() > 0) && (!ccc
|
||||
.equals("000")));
|
||||
boolean hasNNN = ((nnn != null) && (nnn.length() > 0) && (!nnn
|
||||
.equals("000")));
|
||||
boolean hasXXX = ((xxx != null) && (xxx.length() > 0) && (!xxx
|
||||
.equals("000")));
|
||||
final boolean createInitialFilter = !(hasCCC && hasNNN && hasXXX);
|
||||
|
||||
return txTemplate
|
||||
.execute(new TransactionCallback<List<Pair<String, AFOSProductId>>>() {
|
||||
|
||||
@Override
|
||||
public List<Pair<String, AFOSProductId>> doInTransaction(
|
||||
TransactionStatus status) {
|
||||
String paddedccc = StringUtils.rightPad(ccc,
|
||||
MAX_FIELD_LENGTH);
|
||||
String paddednnn = StringUtils.rightPad(nnn,
|
||||
MAX_FIELD_LENGTH);
|
||||
String paddedxxx = StringUtils.rightPad(xxx,
|
||||
MAX_FIELD_LENGTH);
|
||||
Session session = getCurrentSession();
|
||||
List<Pair<String, AFOSProductId>> siteProductPairList = null;
|
||||
StdTextProduct stdTextProduct = getStdTextProductInstance();
|
||||
|
||||
if (createInitialFilter) {
|
||||
stdTextProduct.setCccid(paddedccc);
|
||||
stdTextProduct.setNnnid(paddednnn);
|
||||
stdTextProduct.setXxxid(paddedxxx);
|
||||
|
||||
Map<String, String> map = buildCriterions(
|
||||
ProdCCC_ID, paddedccc, ProdNNN_ID,
|
||||
paddednnn, ProdXXX_ID, paddedxxx);
|
||||
Criteria criteria = session
|
||||
.createCriteria(stdTextProduct.getClass());
|
||||
ProjectionList projList = Projections
|
||||
.projectionList();
|
||||
projList.add(Projections.property(ProdCCC_ID));
|
||||
projList.add(Projections.property(ProdNNN_ID));
|
||||
projList.add(Projections.property(ProdXXX_ID));
|
||||
projList.add(Projections.property(ProdSITE));
|
||||
criteria.setProjection(Projections
|
||||
.distinct(projList));
|
||||
criteria.add(Restrictions.allEq(map));
|
||||
criteria.addOrder(Order.asc(ProdCCC_ID));
|
||||
criteria.addOrder(Order.asc(ProdNNN_ID));
|
||||
criteria.addOrder(Order.asc(ProdXXX_ID));
|
||||
|
||||
List<?> list = criteria.list();
|
||||
if ((list != null) && !list.isEmpty()) {
|
||||
Map<Integer, Set<String>> siteMap = new HashMap<>();
|
||||
List<AFOSProductId> orderedAfosIds = new ArrayList<>(
|
||||
list.size());
|
||||
for (Object row : list) {
|
||||
Object[] cols = (Object[]) row;
|
||||
AFOSProductId afosId = new AFOSProductId(
|
||||
(String) cols[0], (String) cols[1],
|
||||
(String) cols[2]);
|
||||
String site = (String) cols[3];
|
||||
int index = orderedAfosIds.indexOf(afosId);
|
||||
if (index < 0) {
|
||||
index = orderedAfosIds.size();
|
||||
orderedAfosIds.add(afosId);
|
||||
}
|
||||
Set<String> sites = siteMap.get(index);
|
||||
if (sites == null) {
|
||||
sites = new HashSet<>();
|
||||
siteMap.put(index, sites);
|
||||
}
|
||||
sites.add(site);
|
||||
}
|
||||
siteProductPairList = new ArrayList<>(siteMap
|
||||
.size());
|
||||
List<Integer> indices = new ArrayList<>(siteMap
|
||||
.keySet());
|
||||
Collections.sort(indices);
|
||||
for (int index : indices) {
|
||||
String site = getSite(siteMap.get(index)
|
||||
.toArray());
|
||||
AFOSProductId afosId = orderedAfosIds
|
||||
.get(index);
|
||||
Pair<String, AFOSProductId> pair = new Pair<String, AFOSProductId>(
|
||||
site, afosId);
|
||||
siteProductPairList.add(pair);
|
||||
}
|
||||
} else {
|
||||
siteProductPairList = new ArrayList<Pair<String, AFOSProductId>>(
|
||||
0);
|
||||
}
|
||||
} else {
|
||||
AFOSProductId afosId = new AFOSProductId(paddedccc,
|
||||
paddednnn, paddedxxx);
|
||||
String site = getSite(afosId);
|
||||
if (site == null) {
|
||||
siteProductPairList = new ArrayList<Pair<String, AFOSProductId>>(
|
||||
0);
|
||||
} else {
|
||||
siteProductPairList = new ArrayList<>(1);
|
||||
siteProductPairList
|
||||
.add(new Pair<String, AFOSProductId>(
|
||||
site, afosId));
|
||||
}
|
||||
}
|
||||
return siteProductPairList;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get site based on the ordering from preferredAfosFirstLetter.
|
||||
*
|
||||
* @param afosId
|
||||
* @return site or null when no data.
|
||||
*/
|
||||
private String getSite(AFOSProductId afosId) {
|
||||
String ccc = afosId.getCcc();
|
||||
String nnn = afosId.getNnn();
|
||||
String xxx = afosId.getXxx();
|
||||
|
||||
if (siteQueryFmt == null) {
|
||||
Matcher m = Pattern.compile("table_name").matcher(SITE_QUERY_FMT);
|
||||
siteQueryFmt = m.replaceAll((operationalMode ? OPERATIONAL_TABLE
|
||||
: PRACTICE_TABLE));
|
||||
}
|
||||
|
||||
String siteQuery = String.format(siteQueryFmt, ccc, nnn, xxx);
|
||||
|
||||
Object[] values = null;
|
||||
|
||||
try {
|
||||
values = executeSQLQuery(siteQuery);
|
||||
} catch (Exception e) {
|
||||
values = null;
|
||||
}
|
||||
|
||||
return getSite(values);
|
||||
}
|
||||
|
||||
/**
|
||||
* From the array of sites determine which one is the preferred site.
|
||||
*
|
||||
* @param values
|
||||
* - Assume sites with common afosId
|
||||
* @return site first site based on preferredAfosFirstLetter
|
||||
*/
|
||||
private String getSite(Object[] values) {
|
||||
if (values != null) {
|
||||
if (values.length == 1) {
|
||||
return (String) values[0];
|
||||
} else if (values.length > 1) {
|
||||
String[] sites = new String[values.length];
|
||||
for (int i = 0; i < values.length; ++i) {
|
||||
sites[i] = (String) values[i];
|
||||
}
|
||||
for (char c : preferredAfosFirstLetter) {
|
||||
for (String site : sites) {
|
||||
if (site.charAt(0) == c) {
|
||||
return site;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (logger.isInfoEnabled()) {
|
||||
String message = "None of the sites first character in preferred AFOS first letter list \""
|
||||
+ new String(preferredAfosFirstLetter)
|
||||
+ "\". Using site: " + sites[0];
|
||||
logger.info(message);
|
||||
}
|
||||
return sites[0];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the reference/creation time to restrict the results when obtaining a
|
||||
* product.
|
||||
|
@ -415,8 +568,10 @@ public class StdTextProductDao extends CoreDao {
|
|||
xxx = StringUtils.rightPad(xxx, MAX_FIELD_LENGTH);
|
||||
Session session = null;
|
||||
|
||||
List<StdTextProduct> products = new ArrayList<StdTextProduct>();
|
||||
try {
|
||||
List<Pair<String, AFOSProductId>> siteAfosIdList = querySiteAfosId(
|
||||
ccc, nnn, xxx);
|
||||
|
||||
session = getSession();
|
||||
|
||||
Map<String, Object> tmp = new HashMap<String, Object>();
|
||||
|
@ -434,23 +589,15 @@ public class StdTextProductDao extends CoreDao {
|
|||
criteria.addOrder(Order.desc(REFTIME));
|
||||
criteria.addOrder(Order.desc(ProdHDRTIME));
|
||||
|
||||
Iterator<?> iter = criteria.list().iterator();
|
||||
return listProducts(criteria, siteAfosIdList);
|
||||
|
||||
while (iter.hasNext()) {
|
||||
StdTextProduct prod = (StdTextProduct) iter.next();
|
||||
|
||||
if (prod != null && prod.getProduct() != null
|
||||
&& prod.getProduct().length() > 0) {
|
||||
products.add(prod);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Error occurred reading products", e);
|
||||
} finally {
|
||||
closeSession(session);
|
||||
}
|
||||
|
||||
return products;
|
||||
return new ArrayList<StdTextProduct>(0);
|
||||
|
||||
}
|
||||
|
||||
|
@ -475,8 +622,10 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
Session session = null;
|
||||
|
||||
List<StdTextProduct> products = new ArrayList<StdTextProduct>();
|
||||
try {
|
||||
List<Pair<String, AFOSProductId>> siteAfosIdList = querySiteAfosId(
|
||||
ccc, nnn, xxx);
|
||||
|
||||
session = getSession();
|
||||
|
||||
Map<String, String> tmp = buildCriterions(ProdCCC_ID, ccc,
|
||||
|
@ -495,22 +644,67 @@ public class StdTextProductDao extends CoreDao {
|
|||
criteria.addOrder(Order.desc(INSERTTIME));
|
||||
criteria.addOrder(Order.desc(ProdHDRTIME));
|
||||
|
||||
Iterator<?> iter = criteria.list().iterator();
|
||||
return listProducts(criteria, siteAfosIdList);
|
||||
|
||||
while (iter.hasNext()) {
|
||||
StdTextProduct prod = (StdTextProduct) iter.next();
|
||||
|
||||
if (prod != null && prod.getProduct() != null
|
||||
&& prod.getProduct().length() > 0) {
|
||||
products.add(prod);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Error occurred reading products", e);
|
||||
} finally {
|
||||
closeSession(session);
|
||||
}
|
||||
|
||||
return new ArrayList<StdTextProduct>(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get non-empty products and when sites have the same afoisId only add the
|
||||
* products from the site based on preferredAfosFirstLetter. Keep products
|
||||
* in the order returned by the criteria list. This assumes the results are
|
||||
* ordered so identical afosIds are together.
|
||||
*
|
||||
*
|
||||
* @param criteria
|
||||
* - Assume results ordered by afosId
|
||||
* @param siteAfosIdList
|
||||
* - Assume ordered by afosId
|
||||
* @return products
|
||||
* @throws HibernateException
|
||||
*/
|
||||
private List<StdTextProduct> listProducts(Criteria criteria,
|
||||
List<Pair<String, AFOSProductId>> siteAfosIdList)
|
||||
throws HibernateException {
|
||||
|
||||
List<?> prodList = criteria.list();
|
||||
List<StdTextProduct> products = null;
|
||||
|
||||
if ((prodList == null) || prodList.isEmpty()) {
|
||||
products = new ArrayList<>(0);
|
||||
} else {
|
||||
products = new ArrayList<>(prodList.size());
|
||||
|
||||
Iterator<?> iter = prodList.iterator();
|
||||
Iterator<Pair<String, AFOSProductId>> siteAfosIdIter = siteAfosIdList
|
||||
.iterator();
|
||||
Pair<String, AFOSProductId> pair = siteAfosIdIter.next();
|
||||
|
||||
while (iter.hasNext()) {
|
||||
StdTextProduct prod = (StdTextProduct) iter.next();
|
||||
|
||||
if ((prod != null) && (prod.getProduct() != null)
|
||||
&& !prod.getProduct().isEmpty()) {
|
||||
|
||||
AFOSProductId afosId = new AFOSProductId(prod.getCccid(),
|
||||
prod.getNnnid(), prod.getXxxid());
|
||||
while (!afosId.equals(pair.getSecond())) {
|
||||
pair = siteAfosIdIter.next();
|
||||
}
|
||||
String site = prod.getSite();
|
||||
if (site.equals(pair.getFirst())) {
|
||||
products.add(prod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return products;
|
||||
}
|
||||
|
||||
|
@ -581,8 +775,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Error occurred getting latest time", e);
|
||||
}finally{
|
||||
if(sess != null){
|
||||
} finally {
|
||||
if (sess != null) {
|
||||
sess.close();
|
||||
}
|
||||
}
|
||||
|
@ -746,13 +940,13 @@ public class StdTextProductDao extends CoreDao {
|
|||
refTimeQueryBuilder.append(ProdXXX_ID).append(" = :xxxid");
|
||||
refTimeQueryBuilder.append(" ORDER BY refTime DESC");
|
||||
refTimeQueryBuilder.append(", insertTime DESC");
|
||||
final String refTimeQueryString = refTimeQueryBuilder.toString();
|
||||
|
||||
final String refTimeQueryString = refTimeQueryBuilder
|
||||
.toString();
|
||||
|
||||
StringBuilder delQueryBuilder = new StringBuilder(200);
|
||||
delQueryBuilder.append("DELETE FROM ");
|
||||
delQueryBuilder.append(getStdTextProductInstance()
|
||||
.getClass().getSimpleName());
|
||||
delQueryBuilder.append(getStdTextProductInstance().getClass()
|
||||
.getSimpleName());
|
||||
delQueryBuilder.append(" WHERE ");
|
||||
delQueryBuilder.append(ProdCCC_ID).append(" = :cccid")
|
||||
.append(" AND ");
|
||||
|
@ -763,67 +957,85 @@ public class StdTextProductDao extends CoreDao {
|
|||
delQueryBuilder.append("refTime < :refTime");
|
||||
final String delQueryString = delQueryBuilder.toString();
|
||||
|
||||
|
||||
for (final TextProductInfo prodInfo : ids) {
|
||||
rval += txTemplate.execute(new TransactionCallback<Integer>() {
|
||||
rval += txTemplate
|
||||
.execute(new TransactionCallback<Integer>() {
|
||||
|
||||
@Override
|
||||
public Integer doInTransaction(TransactionStatus status) {
|
||||
Session session = getCurrentSession();
|
||||
TextProductInfoPK pk = prodInfo.getProdId();
|
||||
String cccid = pk.getCccid();
|
||||
String nnnid = pk.getNnnid();
|
||||
String xxxid = pk.getXxxid();
|
||||
int rowsDeleted = 0;
|
||||
@Override
|
||||
public Integer doInTransaction(
|
||||
TransactionStatus status) {
|
||||
Session session = getCurrentSession();
|
||||
TextProductInfoPK pk = prodInfo.getProdId();
|
||||
String cccid = pk.getCccid();
|
||||
String nnnid = pk.getNnnid();
|
||||
String xxxid = pk.getXxxid();
|
||||
int rowsDeleted = 0;
|
||||
|
||||
try {
|
||||
Query refTimeQuery = session
|
||||
.createQuery(refTimeQueryString);
|
||||
refTimeQuery.setString("cccid", cccid);
|
||||
refTimeQuery.setString("nnnid", nnnid);
|
||||
refTimeQuery.setString("xxxid", xxxid);
|
||||
refTimeQuery
|
||||
.setMaxResults(prodInfo.getVersionstokeep());
|
||||
List<?> refTimes = refTimeQuery.list();
|
||||
if (refTimes.size() >= prodInfo.getVersionstokeep()) {
|
||||
long refTime = ((Number) refTimes.get(prodInfo
|
||||
.getVersionstokeep() - 1)).longValue();
|
||||
Query delQuery = session
|
||||
.createQuery(delQueryString);
|
||||
delQuery.setString("cccid", cccid);
|
||||
delQuery.setString("nnnid", nnnid);
|
||||
delQuery.setString("xxxid", xxxid);
|
||||
delQuery.setLong("refTime", refTime);
|
||||
try {
|
||||
Query refTimeQuery = session
|
||||
.createQuery(refTimeQueryString);
|
||||
refTimeQuery.setString("cccid", cccid);
|
||||
refTimeQuery.setString("nnnid", nnnid);
|
||||
refTimeQuery.setString("xxxid", xxxid);
|
||||
refTimeQuery.setMaxResults(prodInfo
|
||||
.getVersionstokeep());
|
||||
List<?> refTimes = refTimeQuery.list();
|
||||
if (refTimes.size() >= prodInfo
|
||||
.getVersionstokeep()) {
|
||||
long refTime = ((Number) refTimes.get(prodInfo
|
||||
.getVersionstokeep() - 1))
|
||||
.longValue();
|
||||
Query delQuery = session
|
||||
.createQuery(delQueryString);
|
||||
delQuery.setString("cccid", cccid);
|
||||
delQuery.setString("nnnid", nnnid);
|
||||
delQuery.setString("xxxid", xxxid);
|
||||
delQuery.setLong("refTime", refTime);
|
||||
|
||||
if (PurgeLogger.isDebugEnabled()) {
|
||||
PurgeLogger.logDebug("Purging records for ["
|
||||
+ cccid + nnnid + xxxid
|
||||
+ "] before refTime [" + refTime + "]",
|
||||
PLUGIN_NAME);
|
||||
if (PurgeLogger.isDebugEnabled()) {
|
||||
PurgeLogger
|
||||
.logDebug(
|
||||
"Purging records for ["
|
||||
+ cccid
|
||||
+ nnnid
|
||||
+ xxxid
|
||||
+ "] before refTime ["
|
||||
+ refTime
|
||||
+ "]",
|
||||
PLUGIN_NAME);
|
||||
}
|
||||
|
||||
rowsDeleted = delQuery
|
||||
.executeUpdate();
|
||||
if (PurgeLogger.isDebugEnabled()) {
|
||||
PurgeLogger.logDebug("Purged ["
|
||||
+ rowsDeleted
|
||||
+ "] records for ["
|
||||
+ cccid + nnnid + xxxid
|
||||
+ "]", PLUGIN_NAME);
|
||||
}
|
||||
} else if (PurgeLogger.isDebugEnabled()) {
|
||||
PurgeLogger
|
||||
.logDebug(
|
||||
"VersionPurge: Product ["
|
||||
+ cccid
|
||||
+ nnnid
|
||||
+ xxxid
|
||||
+ "] has fewer than ["
|
||||
+ prodInfo
|
||||
.getVersionstokeep()
|
||||
+ "] versions",
|
||||
PLUGIN_NAME);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
PurgeLogger.logError(
|
||||
"Exception occurred purging text products ["
|
||||
+ cccid + nnnid + xxxid
|
||||
+ "]", PLUGIN_NAME, e);
|
||||
}
|
||||
|
||||
rowsDeleted = delQuery.executeUpdate();
|
||||
if (PurgeLogger.isDebugEnabled()) {
|
||||
PurgeLogger.logDebug("Purged [" + rowsDeleted
|
||||
+ "] records for [" + cccid + nnnid
|
||||
+ xxxid + "]", PLUGIN_NAME);
|
||||
}
|
||||
} else if (PurgeLogger.isDebugEnabled()) {
|
||||
PurgeLogger.logDebug(
|
||||
"VersionPurge: Product [" + cccid + nnnid
|
||||
+ xxxid + "] has fewer than ["
|
||||
+ prodInfo.getVersionstokeep()
|
||||
+ "] versions", PLUGIN_NAME);
|
||||
return rowsDeleted;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
PurgeLogger.logError(
|
||||
"Exception occurred purging text products ["
|
||||
+ cccid + nnnid + xxxid + "]",
|
||||
PLUGIN_NAME, e);
|
||||
}
|
||||
return rowsDeleted;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -898,13 +1110,13 @@ public class StdTextProductDao extends CoreDao {
|
|||
String nnn, String xxx, String hdrTime, Long startTimeMillis,
|
||||
String bbb, int intlProd, boolean readAllVersions,
|
||||
boolean returnAllData) {
|
||||
List<StdTextProduct> products = new ArrayList<StdTextProduct>();
|
||||
Session session = null;
|
||||
Connection conn = null;
|
||||
|
||||
try {
|
||||
session = getSession();
|
||||
conn = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
conn = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
|
||||
String ccc = null;
|
||||
|
||||
|
@ -917,7 +1129,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
List<StdTextProduct> distinctProducts = getDistinctProducts(conn,
|
||||
wmoId, site, ccc, nnn, xxx, bbb, hdrTime, startTimeMillis);
|
||||
|
||||
products = getProductMetaData(conn, distinctProducts, bbb, hdrTime,
|
||||
return getProductMetaData(conn, distinctProducts, bbb, hdrTime,
|
||||
startTimeMillis, readAllVersions);
|
||||
} catch (Exception e) {
|
||||
logger.error("Error occurred reading products", e);
|
||||
|
@ -926,7 +1138,7 @@ public class StdTextProductDao extends CoreDao {
|
|||
closeSession(session);
|
||||
}
|
||||
|
||||
return products;
|
||||
return new ArrayList<StdTextProduct>(0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -1119,7 +1331,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps2 = c.prepareStatement(query2);
|
||||
ps3 = c.prepareStatement(query3);
|
||||
|
@ -1243,7 +1456,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setInt(2, startTimeSeconds);
|
||||
|
@ -1310,7 +1524,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps2 = c.prepareStatement(query2);
|
||||
ps3 = c.prepareStatement(query3);
|
||||
|
@ -1434,7 +1649,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query);
|
||||
ps1.setString(1, site);
|
||||
ps1.setInt(2, startTimeSeconds);
|
||||
|
@ -1501,7 +1717,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps2 = c.prepareStatement(query2);
|
||||
ps1.setString(1, nnnId);
|
||||
|
@ -1597,7 +1814,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -1664,7 +1882,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query1);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -1757,7 +1976,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
int count = 0;
|
||||
|
||||
/*
|
||||
|
@ -1906,7 +2126,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(query);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -1964,7 +2185,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -2054,7 +2276,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
ps1.setString(2, site);
|
||||
|
@ -2151,7 +2374,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
|
||||
if (xxxId == null || xxxId.length() > 0) {
|
||||
ps1 = c.prepareStatement(noXxxQuery);
|
||||
|
@ -2252,7 +2476,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
|
@ -2349,7 +2574,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
|
||||
ps1 = c.prepareStatement(hdrQuery);
|
||||
ps1.setString(1, wmoId);
|
||||
|
@ -2449,7 +2675,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
|
||||
switch (intlProd) {
|
||||
case 0: // fall through
|
||||
|
@ -2573,7 +2800,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
|
||||
switch (intlProd) {
|
||||
case 0: // fall through
|
||||
|
@ -2678,7 +2906,8 @@ public class StdTextProductDao extends CoreDao {
|
|||
|
||||
try {
|
||||
session = getSession();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
|
||||
c = SessionFactoryUtils.getDataSource(getSessionFactory())
|
||||
.getConnection();
|
||||
ret = read_product(c, wmoId, site, cccId, nnnId, xxxId, version);
|
||||
} catch (SQLException e) {
|
||||
// don't need to worry about rolling back transaction
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
via openfire whenever a user logs in to openfire.
|
||||
</description>
|
||||
<author>bkowal</author>
|
||||
<version>2.0.0</version>
|
||||
<version>2.1.0</version>
|
||||
<date>8/08/2012</date>
|
||||
<minServerVersion>3.7.1</minServerVersion>
|
||||
|
||||
|
|
|
@ -81,6 +81,14 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
#create a list of all files packaged for /awips2/edex/data/utility
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
if [ -d %{_build_root}/$UTILITY ]; then
|
||||
cd %{_build_root}/$UTILITY
|
||||
find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt
|
||||
fi
|
||||
|
||||
%pre
|
||||
%post
|
||||
# EDEX installed?
|
||||
|
@ -88,13 +96,26 @@ fi
|
|||
# when the plugins are for EDEX, we just leave
|
||||
# them on the filesystem; no action required.
|
||||
rpm -q awips2-edex > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
retVal=$?
|
||||
if [ $retVal -ne 0 ]; then
|
||||
# hide the edex plugins
|
||||
pushd . > /dev/null 2>&1
|
||||
cd /awips2
|
||||
rm -rf .edex
|
||||
mv edex .edex
|
||||
popd > /dev/null 2>&1
|
||||
else if [ $retVal -eq 0 ]; then
|
||||
#change date stamp of utility files
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt
|
||||
if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then
|
||||
while read fileName
|
||||
do
|
||||
touch "$UTILITY/$fileName"
|
||||
done < $UTIL_FILENAME
|
||||
rm -f $UTIL_FILENAME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# CAVE installed?
|
||||
|
@ -114,6 +135,8 @@ else
|
|||
popd > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
%preun
|
||||
if [ -d /awips2/.cave ]; then
|
||||
rm -rf /awips2/.cave
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
Name: awips2-%{_xmpp_server}
|
||||
Summary: AWIPS II XMPP Server
|
||||
Version: %{_xmpp_software_version}
|
||||
Release: 2
|
||||
Release: 3
|
||||
Group: AWIPSII
|
||||
BuildRoot: /tmp
|
||||
URL: %{_xmpp_software_url}
|
||||
|
|
|
@ -50,12 +50,33 @@ fi
|
|||
|
||||
unzip %{_baseline_workspace}/build.edex/edex/dist/%{_component_name}.zip \
|
||||
-d %{_build_root}
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#create a list of all files packaged for /awips2/edex/data/utility
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
if [ -d %{_build_root}/$UTILITY ]; then
|
||||
cd %{_build_root}/$UTILITY
|
||||
find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt
|
||||
fi
|
||||
|
||||
%pre
|
||||
%post
|
||||
|
||||
|
||||
#change date stamp of utility files
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt
|
||||
if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then
|
||||
while read fileName
|
||||
do
|
||||
touch "$UTILITY/$fileName"
|
||||
done < $UTIL_FILENAME
|
||||
rm -f $UTIL_FILENAME
|
||||
fi
|
||||
|
||||
%preun
|
||||
%postun
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
diff -crB a/component.spec b/component.spec
|
||||
*** a/component.spec 2013-09-03 10:51:59.952913214 -0500
|
||||
--- b/component.spec 2013-09-03 11:10:40.703226553 -0500
|
||||
*** Installer.edex-component/component.spec 2015-02-03 16:00:27.487303049 -0600
|
||||
--- Installer.edex-datadelivery/component.spec 2015-02-03 17:49:00.775069314 -0600
|
||||
***************
|
||||
*** 6,13 ****
|
||||
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
||||
|
@ -38,24 +37,18 @@ diff -crB a/component.spec b/component.spec
|
|||
requires: awips2-edex-base
|
||||
requires: awips2-python
|
||||
***************
|
||||
*** 47,62 ****
|
||||
*** 47,56 ****
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
! unzip %{_baseline_workspace}/build.edex/edex/dist/%{_component_name}.zip \
|
||||
-d %{_build_root}
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%pre
|
||||
%post
|
||||
%preun
|
||||
%postun
|
||||
|
||||
%clean
|
||||
--- 47,104 ----
|
||||
--- 47,85 ----
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -67,9 +60,9 @@ diff -crB a/component.spec b/component.spec
|
|||
|
||||
! unzip %{_baseline_workspace}/build.edex/edex/dist/edex-datadelivery.zip \
|
||||
-d %{_build_root}
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
+ if [ $? -ne 0 ]; then
|
||||
+ exit 1
|
||||
+ fi
|
||||
|
||||
+ # include the init.d script
|
||||
+ INSTALLER_RPM="%{_baseline_workspace}/rpms"
|
||||
|
@ -85,20 +78,48 @@ diff -crB a/component.spec b/component.spec
|
|||
+ mv edexServiceList edexServiceList-datadelivery
|
||||
+ popd > /dev/null 2>&1
|
||||
+
|
||||
%pre
|
||||
%post
|
||||
+ # replace the service list script with the datadelivery service list script
|
||||
+ if [ -f /etc/init.d/edexServiceList ]; then
|
||||
+ mv /etc/init.d/edexServiceList /etc/init.d/edexServiceList.orig
|
||||
+ if [ $? -ne 0 ]; then
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ fi
|
||||
+ mv /etc/init.d/edexServiceList-datadelivery /etc/init.d/edexServiceList
|
||||
+ #add central registry script
|
||||
+ mkdir -p %{_build_root}/awips2/edex/bin/
|
||||
+ if [ $? -ne 0 ]; then
|
||||
+ exit 1
|
||||
+ fi
|
||||
+
|
||||
+ cp -v %{_baseline_workspace}/deploy.edex-Data_Delivery/esb/bin/centralRegistryProviderCredentials.sh %{_build_root}/awips2/edex/bin/
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
***************
|
||||
*** 64,70 ****
|
||||
|
||||
%pre
|
||||
%post
|
||||
!
|
||||
|
||||
#change date stamp of utility files
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
--- 93,109 ----
|
||||
|
||||
%pre
|
||||
%post
|
||||
! # replace the service list script with the datadelivery service list script
|
||||
! if [ -f /etc/init.d/edexServiceList ]; then
|
||||
! mv /etc/init.d/edexServiceList /etc/init.d/edexServiceList.orig
|
||||
! if [ $? -ne 0 ]; then
|
||||
! exit 1
|
||||
! fi
|
||||
! fi
|
||||
! mv /etc/init.d/edexServiceList-datadelivery /etc/init.d/edexServiceList
|
||||
! if [ $? -ne 0 ]; then
|
||||
! exit 1
|
||||
! fi
|
||||
|
||||
#change date stamp of utility files
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
***************
|
||||
*** 78,83 ****
|
||||
--- 117,133 ----
|
||||
fi
|
||||
|
||||
%preun
|
||||
+ if [ "${1}" = "1" ]; then
|
||||
+ exit 0
|
||||
|
@ -115,11 +136,12 @@ diff -crB a/component.spec b/component.spec
|
|||
|
||||
%clean
|
||||
***************
|
||||
*** 67,69 ****
|
||||
--- 109,113 ----
|
||||
*** 88,90 ****
|
||||
--- 138,144 ----
|
||||
%dir /awips2
|
||||
%dir /awips2/edex
|
||||
/awips2/edex/*
|
||||
+ %dir /awips2/edex/bin
|
||||
+ %attr(744, -, -) /awips2/edex/bin/centralRegistryProviderCredentials.sh
|
||||
+
|
||||
+ %attr(744,root,root) /etc/init.d/*
|
||||
\ No newline at end of file
|
||||
|
|
|
@ -76,10 +76,30 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
#create a list of all files packaged for /awips2/edex/data/utility
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
if [ -d %{_build_root}/$UTILITY ]; then
|
||||
cd %{_build_root}/$UTILITY
|
||||
find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt
|
||||
fi
|
||||
|
||||
%pre
|
||||
|
||||
%post
|
||||
|
||||
|
||||
#change date stamp of utility files
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt
|
||||
if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then
|
||||
while read fileName
|
||||
do
|
||||
touch "$UTILITY/$fileName"
|
||||
done < $UTIL_FILENAME
|
||||
rm -f $UTIL_FILENAME
|
||||
fi
|
||||
|
||||
%preun
|
||||
|
||||
%postun
|
||||
|
|
|
@ -108,6 +108,15 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
#create a list of all files packaged for /awips2/edex/data/utility
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
if [ -d %{_build_root}/$UTILITY ]; then
|
||||
cd %{_build_root}/$UTILITY
|
||||
find . -type f > %{_build_root}/awips2/edex/etc/util_filelist.%{name}.txt
|
||||
fi
|
||||
|
||||
|
||||
%pre
|
||||
|
||||
%post
|
||||
|
@ -146,6 +155,18 @@ if [ -d /awips2/.edex ]; then
|
|||
rm -rf /awips2/.edex
|
||||
fi
|
||||
|
||||
#change date stamp of utility files
|
||||
UTILITY=/awips2/edex/data/utility
|
||||
UTIL_FILENAME=/awips2/edex/etc/util_filelist.%{name}.txt
|
||||
if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then
|
||||
while read fileName
|
||||
do
|
||||
touch "$UTILITY/$fileName"
|
||||
done < $UTIL_FILENAME
|
||||
rm -f $UTIL_FILENAME
|
||||
fi
|
||||
|
||||
|
||||
%preun
|
||||
if [ "${1}" = "1" ]; then
|
||||
exit 0
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
The Academic Free License
|
||||
v. 2.1
|
||||
|
||||
This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
|
||||
|
||||
Licensed under the Academic Free License version 2.1
|
||||
|
||||
1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following:
|
||||
|
||||
a) to reproduce the Original Work in copies;
|
||||
|
||||
b) to prepare derivative works ("Derivative Works") based upon the Original Work;
|
||||
|
||||
c) to distribute copies of the Original Work and Derivative Works to the public;
|
||||
|
||||
d) to perform the Original Work publicly; and
|
||||
|
||||
e) to display the Original Work publicly.
|
||||
|
||||
2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.
|
||||
|
||||
3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.
|
||||
|
||||
4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.
|
||||
|
||||
5) This section intentionally omitted.
|
||||
|
||||
6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
|
||||
|
||||
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer.
|
||||
|
||||
8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
|
||||
|
||||
9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions.
|
||||
|
||||
10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
|
||||
|
||||
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License.
|
||||
|
||||
12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
|
||||
|
||||
13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
|
||||
|
||||
14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For 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.
|
||||
|
||||
15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
|
||||
|
||||
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner.
|
|
@ -1,18 +0,0 @@
|
|||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,7 +0,0 @@
|
|||
Copyright (c) 2013 Gregory McWhirter
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,8 +0,0 @@
|
|||
ICU License - ICU 1.8.1 and later
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
Copyright (c) 1995-2012 International Business Machines Corporation and others
|
||||
All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
|
||||
|
152
rpms/legal/FOSS_licenses/JOGL-1.1.1_BSD_License.txt
Normal file
152
rpms/legal/FOSS_licenses/JOGL-1.1.1_BSD_License.txt
Normal file
|
@ -0,0 +1,152 @@
|
|||
JOGL is released under the BSD license. The full license terms follow:
|
||||
|
||||
Copyright (c) 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistribution of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistribution in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
Neither the name of Sun Microsystems, Inc. or the names of
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
This software is provided "AS IS," without a warranty of any kind. ALL
|
||||
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
|
||||
MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
|
||||
ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
|
||||
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
|
||||
ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
|
||||
DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
|
||||
DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
|
||||
ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
|
||||
SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
You acknowledge that this software is not designed or intended for use
|
||||
in the design, construction, operation or maintenance of any nuclear
|
||||
facility.
|
||||
|
||||
The JOGL source tree contains code ported from the OpenGL sample
|
||||
implementation by Silicon Graphics, Inc. This code is licensed under
|
||||
the SGI Free Software License B (Sun is redistributing the modified code
|
||||
under a slightly modified, alternative license, which is described two
|
||||
paragraphs below after "NOTE:"):
|
||||
|
||||
License Applicability. Except to the extent portions of this file are
|
||||
made subject to an alternative license as permitted in the SGI Free
|
||||
Software License B, Version 1.1 (the "License"), the contents of this
|
||||
file are subject only to the provisions of the License. You may not use
|
||||
this file except in compliance with the License. You may obtain a copy
|
||||
of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
|
||||
http://oss.sgi.com/projects/FreeB
|
||||
|
||||
Note that, as provided in the License, the Software is distributed on an
|
||||
"AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
|
||||
NOTE: The Original Code (as defined below) has been licensed to Sun
|
||||
Microsystems, Inc. ("Sun") under the SGI Free Software License B
|
||||
(Version 1.1), shown above ("SGI License"). Pursuant to Section
|
||||
3.2(3) of the SGI License, Sun is distributing the Covered Code to
|
||||
you under an alternative license ("Alternative License"). This
|
||||
Alternative License includes all of the provisions of the SGI License
|
||||
except that Section 2.2 and 11 are omitted. Any differences between
|
||||
the Alternative License and the SGI License are offered solely by Sun
|
||||
and not by SGI.
|
||||
|
||||
Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
Copyright in any portions created by third parties is as indicated
|
||||
elsewhere herein. All Rights Reserved.
|
||||
|
||||
Additional Notice Provisions: The application programming interfaces
|
||||
established by SGI in conjunction with the Original Code are The
|
||||
OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
published by SGI, but has not been independently verified as being
|
||||
compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
|
||||
|
||||
The JOGL source tree contains code from the LWJGL project which is
|
||||
similarly covered by the BSD license:
|
||||
|
||||
Copyright (c) 2002-2004 LWJGL Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of 'LWJGL' nor the names of
|
||||
its contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The JOGL source tree also contains a Java port of Brian Paul's Tile
|
||||
Rendering library, used with permission of the author under the BSD
|
||||
license instead of the original LGPL:
|
||||
|
||||
Copyright (c) 1997-2005 Brian Paul. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistribution of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistribution in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
Neither the name of Brian Paul or the names of contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
This software is provided "AS IS," without a warranty of any
|
||||
kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
|
||||
WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
|
||||
EXCLUDED. THE COPYRIGHT HOLDERS AND CONTRIBUTORS SHALL NOT BE
|
||||
LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
|
||||
MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO
|
||||
EVENT WILL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
|
||||
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
|
||||
REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
|
||||
INABILITY TO USE THIS SOFTWARE, EVEN IF THE COPYRIGHT HOLDERS OR
|
||||
CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
@ -1,13 +0,0 @@
|
|||
JScience - Java Tools and Libraries for the Advancement of Sciences
|
||||
Copyright (c) 2005-2009, JScience (http://jscience.org/)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,50 @@
|
|||
License agreement for matplotlib |version|
|
||||
==============================================
|
||||
|
||||
1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the
|
||||
Individual or Organization ("Licensee") accessing and otherwise using
|
||||
matplotlib software in source or binary form and its associated
|
||||
documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, JDH
|
||||
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
|
||||
to reproduce, analyze, test, perform and/or display publicly, prepare
|
||||
derivative works, distribute, and otherwise use matplotlib |version|
|
||||
alone or in any derivative version, provided, however, that JDH's
|
||||
License Agreement and JDH's notice of copyright, i.e., "Copyright (c)
|
||||
2002-2009 John D. Hunter; All Rights Reserved" are retained in
|
||||
matplotlib |version| alone or in any derivative version prepared by
|
||||
Licensee.
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on or
|
||||
incorporates matplotlib |version| or any part thereof, and wants to
|
||||
make the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to matplotlib |version|.
|
||||
|
||||
4. JDH is making matplotlib |version| available to Licensee on an "AS
|
||||
IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB |version|
|
||||
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
|
||||
|version| FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
|
||||
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
|
||||
MATPLOTLIB |version|, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. Nothing in this License Agreement shall be deemed to create any
|
||||
relationship of agency, partnership, or joint venture between JDH and
|
||||
Licensee. This License Agreement does not grant permission to use JDH
|
||||
trademarks or trade name in a trademark sense to endorse or promote
|
||||
products or services of Licensee, or any third party.
|
||||
|
||||
8. By copying, installing or otherwise using matplotlib |version|,
|
||||
Licensee agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
Copyright (c) 2002-2006, Marc Prud'hommeaux <mwp1@cornell.edu> All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
Neither the name of JLine nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
19
rpms/legal/FOSS_licenses/Matthew_J_Francis_c_2010.txt
Normal file
19
rpms/legal/FOSS_licenses/Matthew_J_Francis_c_2010.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2010 Matthew J. Francis and Contributors of the jbzip2 Project
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -1,9 +0,0 @@
|
|||
OSGi Specification License, Version 1.0.
|
||||
|
||||
The OSGi Alliance ("OSGi Alliance") hereby grants you a fully-paid, non-exclusive, non-transferable, worldwide, limited license (without the right to sublicense), under the OSGi Alliance's applicable intellectual property rights to view, download, and reproduce the OSGi Specification ("Specification") which follows this License Agreement ("Agreement"). You are not authorized to create any derivative work of the Specification. The OSGi Alliance also grants you a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, limited license (without the right to sublicense) under any applicable copyrights, to create and/or distribute an implementation of the Specification that: (i) fully implements the Specification including all its required interfaces and functionality; (ii) does not modify, subset, superset or otherwise extend the OSGi Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the OSGi Name Space other than those required and authorized by the Specification. An implementation that does not satisfy limitations (i)-(ii) is not considered an implementation of the Specification, does not receive the benefits of this license, and must not be described as an implementation of the Specification. An implementation of the Specification must not claim to be a compliant implementation of the Specification unless it passes the OSGi Alliance Compliance Tests for the Specification in accordance with OSGi Alliance processes. "OSGi Name Space" shall mean the public class or interface declarations whose names begin with "org.osgi" or any recognized successors or replacements thereof.
|
||||
|
||||
THE SPECIFICATION IS PROVIDED "AS IS," AND THE OSGi ALLIANCE, ITS MEMBERS AND ANY OTHER AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. THE OSGi ALLIANCE, ITS MEMBERS AND ANY OTHER AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SPECIFICATION OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.
|
||||
|
||||
The name and trademarks of the OSGi Alliance or any other Authors may NOT be used in any manner, including advertising or publicity pertaining to the Specification or its contents without specific, written prior permission. Title to copyright in the Specification will at all times remain with the Authors.
|
||||
|
||||
No other rights are granted by implication, estoppel or otherwise.
|
|
@ -1,13 +0,0 @@
|
|||
BSD License
|
||||
The PostgreSQL JDBC driver is distributed under the BSD license, same as the server. The simplest explanation of the licensing terms is that you can do whatever you want with the product and source code as long as you don't claim you wrote it or sue us. You should give it a read though, it's only half a page.
|
||||
Copyright (c) 1997-2011, PostgreSQL Global Development Group
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the PostgreSQL Global Development Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
rpms/legal/FOSS_licenses/QOS.ch_c_2004-2008.txt
Normal file
24
rpms/legal/FOSS_licenses/QOS.ch_c_2004-2008.txt
Normal file
|
@ -0,0 +1,24 @@
|
|||
Copyright (c) 2004-2008 QOS.ch
|
||||
All rights reserved.
|
||||
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,44 +0,0 @@
|
|||
SGI FREE SOFTWARE LICENSE B (Version 1.1 [02/22/2000])
|
||||
|
||||
1. Definitions.
|
||||
1.1 "Additional Notice Provisions" means such additional provisions as appear in the Notice in Original Code under the heading "Additional Notice Provisions."
|
||||
1.2 "Covered Code" means the Original Code or Modifications, or any combination thereof.
|
||||
1.3 "Hardware" means any physical device that accepts input, processes input, stores the results of processing, and/or provides output.
|
||||
1.4 "Larger Work" means a work that combines Covered Code or portions thereof with code not governed by the terms of this License.
|
||||
1.5 "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
|
||||
1.6 "License" means this document.
|
||||
1.7 "Licensed Patents" means patent claims Licensable by SGI that are infringed by the use or sale of Original Code or any Modifications provided by SGI, or any combination thereof.
|
||||
1.8 "Modifications" means any addition to or deletion from the substance or structure of the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
|
||||
A. Any addition to the contents of a file containing Original Code and/or addition to or deletion from the contents of a file containing previous Modifications.
|
||||
B. Any new file that contains any part of the Original Code or previous Modifications.
|
||||
1.9 "Notice" means any notice in Original Code or Covered Code, as required by and in compliance with this License.
|
||||
1.10 "Original Code" means source code of computer software code that is described in the source code Notice required by Exhibit A as Original Code, and updates and error corrections specifically thereto.
|
||||
1.11 "Recipient" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 8. For legal entities, "Recipient" includes any entity that controls, is controlled by, or is under common control with Recipient. For purposes of this definition, "control" of an entity means (a) the power, direct or indirect, to direct or manage such entity, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
|
||||
1.12 "Recipient Patents" means patent claims Licensable by a Recipient that are infringed by the use or sale of Original Code or any Modifications provided by SGI, or any combination thereof.
|
||||
1.13 "SGI" means Silicon Graphics, Inc.
|
||||
1.14 "SGI Patents" means patent claims Licensable by SGI other than the Licensed Patents.
|
||||
2. License Grant and Restrictions.
|
||||
2.1 SGI License Grant. Subject to the terms of this License and any third party intellectual property claims, for the duration of intellectual property protections inherent in the Original Code, SGI hereby grants Recipient a worldwide, royalty-free, non-exclusive license, to do the following: (i) under copyrights Licensable by SGI, to reproduce, distribute, create derivative works from, and, to the extent applicable, display and perform the Original Code and/or any Modifications provided by SGI alone and/or as part of a Larger Work; and (ii) under any Licensable Patents, to make, have made, use, sell, offer for sale, import and/or otherwise transfer the Original Code and/or any Modifications provided by SGI. Recipient accepts the terms and conditions of this License by undertaking any of the aforementioned actions. The patent license shall apply to the Covered Code if, at the time any related Modification is added, such addition of the Modification causes such combination to be covered by the Licensed Patents. The patent license in Section 2.1(ii) shall not apply to any other combinations that include the Modification. No patent license is provided under SGI Patents for infringements of SGI Patents by Modifications not provided by SGI or combinations of Original Code and Modifications not provided by SGI.
|
||||
2.2 Recipient License Grant. Subject to the terms of this License and any third party intellectual property claims, Recipient hereby grants SGI and any other Recipients a worldwide, royalty-free, non-exclusive license, under any Recipient Patents, to make, have made, use, sell, offer for sale, import and/or otherwise transfer the Original Code and/or any Modifications provided by SGI.
|
||||
2.3 No License For Hardware Implementations. The licenses granted in Section 2.1 and 2.2 are not applicable to implementation in Hardware of the algorithms embodied in the Original Code or any Modifications provided by SGI .
|
||||
3. Redistributions.
|
||||
3.1 Retention of Notice/Copy of License. The Notice set forth in Exhibit A, below, must be conspicuously retained or included in any and all redistributions of Covered Code. For distributions of the Covered Code in source code form, the Notice must appear in every file that can include a text comments field; in executable form, the Notice and a copy of this License must appear in related documentation or collateral where the Recipient's rights relating to Covered Code are described. Any Additional Notice Provisions which actually appears in the Original Code must also be retained or included in any and all redistributions of Covered Code.
|
||||
3.2 Alternative License. Provided that Recipient is in compliance with the terms of this License, Recipient may, so long as without derogation of any of SGI's rights in and to the Original Code, distribute the source code and/or executable version(s) of Covered Code under (1) this License; (2) a license identical to this License but for only such changes as are necessary in order to clarify Recipient's role as licensor of Modifications; and/or (3) a license of Recipient's choosing, containing terms different from this License, provided that the license terms include this Section 3 and Sections 4, 6, 7, 10, 12, and 13, which terms may not be modified or superseded by any other terms of such license. If Recipient elects to use any license other than this License, Recipient must make it absolutely clear that any of its terms which differ from this License are offered by Recipient alone, and not by SGI. It is emphasized that this License is a limited license, and, regardless of the license form employed by Recipient in accordance with this Section 3.2, Recipient may relicense only such rights, in Original Code and Modifications by SGI, as it has actually been granted by SGI in this License.
|
||||
3.3 Indemnity. Recipient hereby agrees to indemnify SGI for any liability incurred by SGI as a result of any such alternative license terms Recipient offers.
|
||||
4. Termination. This License and the rights granted hereunder will terminate automatically if Recipient breaches any term herein and fails to cure such breach within 30 days thereof. Any sublicense to the Covered Code that is properly granted shall survive any termination of this License, absent termination by the terms of such sublicense. Provisions that, by their nature, must remain in effect beyond the termination of this License, shall survive.
|
||||
5. No Trademark Or Other Rights. This License does not grant any rights to: (i) any software apart from the Covered Code, nor shall any other rights or licenses not expressly granted hereunder arise by implication, estoppel or otherwise with respect to the Covered Code; (ii) any trade name, trademark or service mark whatsoever, including without limitation any related right for purposes of endorsement or promotion of products derived from the Covered Code, without prior written permission of SGI; or (iii) any title to or ownership of the Original Code, which shall at all times remains with SGI. All rights in the Original Code not expressly granted under this License are reserved.
|
||||
6. Compliance with Laws; Non-Infringement. There are various worldwide laws, regulations, and executive orders applicable to dispositions of Covered Code, including without limitation export, re-export, and import control laws, regulations, and executive orders, of the U.S. government and other countries, and Recipient is reminded it is obliged to obey such laws, regulations, and executive orders. Recipient may not distribute Covered Code that (i) in any way infringes (directly or contributorily) any intellectual property rights of any kind of any other person or entity or (ii) breaches any representation or warranty, express, implied or statutory, to which, under any applicable law, it might be deemed to have been subject.
|
||||
7. Claims of Infringement. If Recipient learns of any third party claim that any disposition of Covered Code and/or functionality wholly or partially infringes the third party's intellectual property rights, Recipient will promptly notify SGI of such claim.
|
||||
8. Versions of the License. SGI may publish revised and/or new versions of the License from time to time, each with a distinguishing version number. Once Covered Code has been published under a particular version of the License, Recipient may, for the duration of the license, continue to use it under the terms of that version, or choose to use such Covered Code under the terms of any subsequent version published by SGI. Subject to the provisions of Sections 3 and 4 of this License, only SGI may modify the terms applicable to Covered Code created under this License.
|
||||
9. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED "AS IS." ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. SGI ASSUMES NO RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. SHOULD THE SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY IS AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT SUBJECT TO THIS DISCLAIMER.
|
||||
10. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES NOR LEGAL THEORY, WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT LIABILITY), CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOSS OF DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SGI's NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO RECIPIENT.
|
||||
11. Indemnity. Recipient shall be solely responsible for damages arising, directly or indirectly, out of its utilization of rights under this License. Recipient will defend, indemnify and hold harmless Silicon Graphics, Inc. from and against any loss, liability, damages, costs or expenses (including the payment of reasonable attorneys fees) arising out of Recipient's use, modification, reproduction and distribution of the Covered Code or out of any representation or warranty made by Recipient.
|
||||
12. U.S. Government End Users. The Covered Code is a "commercial item" consisting of "commercial computer software" as such terms are defined in title 48 of the Code of Federal Regulations and all U.S. Government End Users acquire only the rights set forth in this License and are subject to the terms of this License.
|
||||
13. Miscellaneous. This License represents the complete agreement concerning the its subject matter. If any provision of this License is held to be unenforceable, such provision shall be reformed so as to achieve as nearly as possible the same legal and economic effect as the original provision and the remainder of this License will remain in effect. This License shall be governed by and construed in accordance with the laws of the United States and the State of California as applied to agreements entered into and to be performed entirely within California between California residents. Any litigation relating to this License shall be subject to the exclusive jurisdiction of the Federal Courts of the Northern District of California (or, absent subject matter jurisdiction in such courts, the courts of the State of California), with venue lying exclusively in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation that provides that the language of a contract shall be construed against the drafter shall not apply to this License.
|
||||
|
||||
Exhibit A
|
||||
License Applicability. Except to the extent portions of this file are made subject to an alternative license as permitted in the SGI Free Software License B, Version 1.1 (the "License"), the contents of this file are subject only to the provisions of the License. You may not use this file except in compliance with the License. You may obtain a copy of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
http://oss.sgi.com/projects/FreeB
|
||||
Note that, as provided in the License, the Software is distributed on an "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
Original Code. The Original Code is: [name of software, version number, and release date], developed by Silicon Graphics, Inc. The Original Code is Copyright (c) [dates of first publication, as appearing in the Notice in the Original Code] Silicon Graphics, Inc. Copyright in any portions created by third parties is as indicated elsewhere herein. All Rights Reserved.
|
||||
Additional Notice Provisions: [such additional provisions, if any, as appear in the Notice in the Original Code under the heading "Additional Notice Provisions"]
|
27
rpms/legal/FOSS_licenses/Sean_C_Gilles_c_2007.txt
Normal file
27
rpms/legal/FOSS_licenses/Sean_C_Gilles_c_2007.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2007, Sean C. Gillies
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Sean C. Gillies nor the names of
|
||||
its contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
Copyright (c) 2006, Sun Microsystems, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Sun Microsystems, Inc. nor the names of
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
27
rpms/legal/FOSS_licenses/jscience_c_2007.txt
Normal file
27
rpms/legal/FOSS_licenses/jscience_c_2007.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
|
||||
Copyright (C) 2007 - JScience (http://jscience.org/)
|
||||
All rights reserved.
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice
|
||||
and include this license agreemeent.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
rpms/legal/FOSS_licenses/pgadmin_3_c_2002-2009.txt
Normal file
23
rpms/legal/FOSS_licenses/pgadmin_3_c_2002-2009.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
pgAdmin III
|
||||
|
||||
|
||||
Copyright (c) 2002 - 2009, The pgAdmin Development Team
|
||||
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose, without fee, and without a written agreement is
|
||||
hereby granted, provided that the above copyright notice and this paragraph and
|
||||
the following two paragraphs appear in all copies.
|
||||
|
||||
|
||||
IN NO EVENT SHALL THE PGADMIN DEVELOPMENT TEAM BE LIABLE TO ANY PARTY FOR
|
||||
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST
|
||||
PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
|
||||
THE PGADMIN DEVELOPMENT TEAM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
THE PGADMIN DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
|
||||
THE PGADMIN DEVELOPMENT TEAM HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
|
||||
UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
22
rpms/legal/FOSS_licenses/zlib_libpng_license.txt
Normal file
22
rpms/legal/FOSS_licenses/zlib_libpng_license.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) 2004 - 2008 Mike Johnson.
|
||||
|
||||
This file is licenced under the the zlib/libpng License.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
Binary file not shown.
Loading…
Add table
Reference in a new issue