Merge branch 'omaha_14.4.1' into omaha_15.1.1
Conflicts: cave/com.raytheon.viz.lightning/src/com/raytheon/viz/lightning/LightningResource.java Former-commit-id: 6d1d1a86cfb70e9ca096f59d9aadf8219efdaeb3
This commit is contained in:
commit
05de3fbe54
58 changed files with 429 additions and 3382 deletions
|
@ -30,6 +30,7 @@
|
|||
# around this script.
|
||||
# Jan 24, 2014 #2739 bsteffen Log exit status
|
||||
# Jan 30, 2014 #2593 bclement warns based on memory usage, fixed for INI files with spaces
|
||||
# Jul 10, 2014 #3363 bclement logs command used to launch application to console logs
|
||||
#
|
||||
#
|
||||
|
||||
|
@ -240,10 +241,13 @@ curTime=`date +%Y%m%d_%H%M%S`
|
|||
nohup ${CAVE_INSTALL}/monitorThreads.sh $pid >> /dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
echo "Launching cave application using the following command: " >> ${LOGFILE}
|
||||
echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} ${USER_ARGS[@]}" >> ${LOGFILE}
|
||||
|
||||
if [[ "${redirect}" == "true" ]] ; then
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" > ${LOGFILE} 2>&1
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" >> ${LOGFILE} 2>&1
|
||||
else
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1 | tee ${LOGFILE}
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1 | tee -a ${LOGFILE}
|
||||
fi
|
||||
) &
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
# Mar 13 2014 #15348 kjohnson added function to remove logs
|
||||
# Jun 20, 2014 #3245 bclement forEachRunningCave now accounts for child processes
|
||||
# Jul 02, 2014 #3245 bclement account for memory override in vm arguments
|
||||
# Jul 10, 2014 #3363 bclement fixed precedence order for ini file lookup
|
||||
# Jul 11, 2014 #3371 bclement added killSpawn()
|
||||
|
||||
|
||||
source /awips2/cave/iniLookup.sh
|
||||
|
@ -50,40 +52,46 @@ BYTES_IN_KB=1024
|
|||
BYTES_IN_MB=1048576
|
||||
BYTES_IN_GB=1073741824
|
||||
|
||||
# Looks up ini file first by component/perspective
|
||||
# then by SITE_TYPE before falling back to cave.ini.
|
||||
# Sets ini file cave argument string in $CAVE_INI_ARG.
|
||||
# Returns 0 if component/perspective found in args, else 1.
|
||||
function lookupINI()
|
||||
{
|
||||
# Arguments:
|
||||
#
|
||||
if [ "${1}" == "" ]; then
|
||||
return 1
|
||||
# only check for component/perspective if arguments aren't empty
|
||||
if [[ "${1}" != "" ]]; then
|
||||
position=1
|
||||
for arg in $@; do
|
||||
if [ "${arg}" == "-component" ] ||
|
||||
[ "${arg}" == "-perspective" ]; then
|
||||
# Get The Next Argument.
|
||||
position=$(( $position + 1 ))
|
||||
nextArg=${!position}
|
||||
|
||||
retrieveAssociatedINI ${arg} "${nextArg}"
|
||||
RC=$?
|
||||
if [ ${RC} -eq 0 ]; then
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/${ASSOCIATED_INI}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
position=$(( $position + 1 ))
|
||||
done
|
||||
fi
|
||||
|
||||
position=1
|
||||
for arg in $@; do
|
||||
if [ "${arg}" == "-component" ] ||
|
||||
[ "${arg}" == "-perspective" ]; then
|
||||
# Get The Next Argument.
|
||||
position=$(( $position + 1 ))
|
||||
nextArg=${!position}
|
||||
|
||||
retrieveAssociatedINI ${arg} "${nextArg}"
|
||||
RC=$?
|
||||
if [ ${RC} -eq 0 ]; then
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/${ASSOCIATED_INI}"
|
||||
else
|
||||
siteTypeIni="/awips2/cave/${SITE_TYPE}.ini"
|
||||
if [[ -e ${siteTypeIni} ]]
|
||||
then
|
||||
export CAVE_INI_ARG="--launcher.ini ${siteTypeIni}"
|
||||
else
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/cave.ini"
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
position=$(( $position + 1 ))
|
||||
done
|
||||
|
||||
# if ini wasn't found through component or perspective
|
||||
if [[ -z $CAVE_INI_ARG ]]
|
||||
then
|
||||
# attempt to fall back to site type specific ini
|
||||
siteTypeIni="/awips2/cave/${SITE_TYPE}.ini"
|
||||
if [[ -e ${siteTypeIni} ]]
|
||||
then
|
||||
export CAVE_INI_ARG="--launcher.ini ${siteTypeIni}"
|
||||
else
|
||||
# cave.ini if all else fails
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/cave.ini"
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
|
@ -305,13 +313,23 @@ function deleteOldCaveDiskCaches()
|
|||
cd $curDir
|
||||
}
|
||||
|
||||
# takes in a process id
|
||||
# kills spawned subprocesses of pid
|
||||
# and then kills the process itself
|
||||
function killSpawn()
|
||||
{
|
||||
pid=$1
|
||||
pkill -P $pid
|
||||
kill $pid
|
||||
}
|
||||
|
||||
# log the exit status and time to a log file, requires 2 args pid and log file
|
||||
function logExitStatus()
|
||||
{
|
||||
pid=$1
|
||||
logFile=$2
|
||||
|
||||
trap 'kill $pid' SIGHUP SIGINT SIGQUIT SIGTERM
|
||||
trap 'killSpawn $pid' SIGHUP SIGINT SIGQUIT SIGTERM
|
||||
wait $pid
|
||||
exitCode=$?
|
||||
curTime=`date --rfc-3339=seconds`
|
||||
|
|
|
@ -74,9 +74,6 @@
|
|||
<logger name="org.springframework">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
<logger name="uk.ltd.getahead">
|
||||
<level value="WARN"/>
|
||||
</logger>
|
||||
|
||||
<!-- default logging -->
|
||||
<root>
|
||||
|
|
|
@ -2,4 +2,5 @@ source.. = src/
|
|||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
||||
plugin.xml,\
|
||||
config.xml
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
|
|||
import com.raytheon.uf.viz.collaboration.display.Activator;
|
||||
import com.raytheon.uf.viz.core.RGBColors;
|
||||
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
|
||||
import com.raytheon.viz.core.ColorUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
|
|||
* Jan 30, 2014 2698 bclement changed UserId to VenueParticipant
|
||||
* Mar 06, 2014 2848 bclement synchronized color access
|
||||
* Jul 02, 2014 1255 bclement collaboration specific RGB presets
|
||||
* falls back to ColorUtil resource color presets
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,10 +65,14 @@ public class SessionColorManager {
|
|||
HierarchicalPreferenceStore prefs = (HierarchicalPreferenceStore) Activator
|
||||
.getDefault().getPreferenceStore();
|
||||
String[] names = prefs.getStringArray(SESSION_COLOR_PREFERENCE_KEY);
|
||||
rgbPresets = new RGB[names.length];
|
||||
int i = 0;
|
||||
for (String name : names) {
|
||||
rgbPresets[i++] = RGBColors.getRGBColor(name);
|
||||
if (names.length > 0) {
|
||||
rgbPresets = new RGB[names.length];
|
||||
int i = 0;
|
||||
for (String name : names) {
|
||||
rgbPresets[i++] = RGBColors.getRGBColor(name);
|
||||
}
|
||||
} else {
|
||||
rgbPresets = ColorUtil.getResourceColorPresets();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
package com.raytheon.viz.gfe.actions.parametervalues;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.commands.IParameterValues;
|
||||
|
||||
import com.raytheon.viz.gfe.procedures.ProcedureCatalog;
|
||||
|
||||
public class ProcedureValues implements IParameterValues {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public Map getParameterValues() {
|
||||
Map<String, String> values = new HashMap<String, String>();
|
||||
|
||||
ProcedureCatalog catalog = new ProcedureCatalog();
|
||||
for (String name : catalog.getNames()) {
|
||||
values.put(name, name);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
}
|
|
@ -24,20 +24,22 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import jep.JepException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.python.PyUtil;
|
||||
import com.raytheon.uf.common.python.PythonScript;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.viz.gfe.core.script.AbstractScriptCatalog;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Catalog of gfe config files
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -45,6 +47,7 @@ import com.raytheon.viz.gfe.core.script.AbstractScriptCatalog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 21, 2010 randerso Initial creation
|
||||
* Jul 08, 2014 3361 njensen Consolidated code
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -52,11 +55,12 @@ import com.raytheon.viz.gfe.core.script.AbstractScriptCatalog;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ConfigCatalog extends AbstractScriptCatalog {
|
||||
public class ConfigCatalog {
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ConfigCatalog.class);
|
||||
|
||||
private static final String[] EXTENSIONS = new String[] { ".py" };
|
||||
private static final String EXTENSION = ".py";
|
||||
|
||||
protected List<String> preEvals;
|
||||
|
||||
|
@ -68,41 +72,6 @@ public class ConfigCatalog extends AbstractScriptCatalog {
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#
|
||||
* getScriptTypePathPrefix()
|
||||
*/
|
||||
@Override
|
||||
public String getScriptTypePathPrefix() {
|
||||
return GfePyIncludeUtil.CONFIG;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getExtensions
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public String[] getExtensions() {
|
||||
return EXTENSIONS;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getNames()
|
||||
*/
|
||||
@Override
|
||||
public Collection<String> getNames() {
|
||||
Collection<String> result = new HashSet<String>();
|
||||
LocalizationFile[] procFiles = getFiles();
|
||||
result = scriptNames(procFiles);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if HideConfigFile is set to true when the script is loaded.
|
||||
*
|
||||
|
@ -145,4 +114,67 @@ public class ConfigCatalog extends AbstractScriptCatalog {
|
|||
}
|
||||
return rtnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the localization files for this catalog.
|
||||
*
|
||||
* @return the localization files for the procedures.
|
||||
*/
|
||||
public LocalizationFile[] getFiles() {
|
||||
LocalizationFile[] procFiles = PathManagerFactory.getPathManager()
|
||||
.listStaticFiles(GfePyIncludeUtil.CONFIG,
|
||||
new String[] { EXTENSION },
|
||||
false, true);
|
||||
return procFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simple names of the procedures.
|
||||
*
|
||||
* @return the simple names of the procedures.
|
||||
*/
|
||||
public Collection<String> getNames() {
|
||||
Collection<String> result = new HashSet<String>();
|
||||
LocalizationFile[] procFiles = getFiles();
|
||||
result = scriptNames(procFiles);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param scriptName
|
||||
* The simple name of a procedure, i.e., "Align_Grids".
|
||||
* @return The localization file for the script
|
||||
*/
|
||||
public LocalizationFile getFile(String scriptName) {
|
||||
String fname = GfePyIncludeUtil.CONFIG + File.separator + scriptName
|
||||
+ EXTENSION;
|
||||
LocalizationFile file = PathManagerFactory.getPathManager()
|
||||
.getStaticLocalizationFile(fname);
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the script names from an array of LocalizationFiles, with any leading
|
||||
* directories and trailing ".py"s removed.
|
||||
*
|
||||
* @param scriptFiles
|
||||
* the array of LocalizationFiles.
|
||||
* @return a Collection of simple script names with no duplicates.
|
||||
*/
|
||||
protected Collection<String> scriptNames(LocalizationFile[] scriptFiles) {
|
||||
Set<String> procs = new HashSet<String>();
|
||||
String fname = null;
|
||||
String[] fsplit = null;
|
||||
String script = null;
|
||||
if (scriptFiles != null) {
|
||||
for (LocalizationFile file : scriptFiles) {
|
||||
fname = file.getName();
|
||||
fsplit = fname.split(FileUtil.fileSeparatorRegex);
|
||||
script = fsplit[fsplit.length - 1].replaceAll("\\.py$", "");
|
||||
procs.add(script);
|
||||
}
|
||||
}
|
||||
return procs;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import com.raytheon.viz.gfe.core.DataManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 20, 2011 dgilling Initial creation
|
||||
* Jul 08, 2014 3361 njensen Only build include path once
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -49,6 +50,8 @@ import com.raytheon.viz.gfe.core.DataManager;
|
|||
|
||||
public class VCModuleControllerFactory {
|
||||
|
||||
private static String includePath;
|
||||
|
||||
/**
|
||||
* A private constructor so that Java does not attempt to create one for us.
|
||||
* As this class should not be instantiated, do not attempt to ever call
|
||||
|
@ -69,10 +72,14 @@ public class VCModuleControllerFactory {
|
|||
|
||||
public static VCModuleController buildInstance(DataManager dataMgr)
|
||||
throws JepException {
|
||||
String includePath = PyUtil.buildJepIncludePath(
|
||||
synchronized (VCModuleController.class) {
|
||||
if (includePath == null) {
|
||||
includePath = PyUtil.buildJepIncludePath(
|
||||
GfePyIncludeUtil.getVCModUtilsIncludePath(),
|
||||
GfePyIncludeUtil.getVCModulesIncludePath(),
|
||||
GfePyIncludeUtil.getCommonPythonIncludePath());
|
||||
}
|
||||
}
|
||||
|
||||
return new VCModuleController(getScriptPath(), includePath,
|
||||
VCModuleControllerFactory.class.getClassLoader(), dataMgr);
|
||||
|
|
|
@ -1,180 +0,0 @@
|
|||
/**
|
||||
* 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.gfe.core.script;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
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.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
|
||||
/**
|
||||
* @author wldougher
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractScriptCatalog {
|
||||
|
||||
protected IPathManager pathManager;
|
||||
|
||||
protected LocalizationFile baseDir;
|
||||
|
||||
protected LocalizationFile procDir;
|
||||
|
||||
protected LocalizationFile siteDir;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public AbstractScriptCatalog() {
|
||||
IPathManager defaultPathManager = PathManagerFactory.getPathManager();
|
||||
setPathManager(defaultPathManager);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the path manager used by this catalog. This is a public method to
|
||||
* facilitate unit testing. The userCtx and procDir fields, which depend
|
||||
* entirely on static constants and the path manager, are set, too.
|
||||
*
|
||||
* @param pathManager
|
||||
*/
|
||||
protected void setPathManager(IPathManager pathManager) {
|
||||
if (pathManager == null) {
|
||||
throw new NullPointerException("Attempt to set a null path manager");
|
||||
}
|
||||
|
||||
this.pathManager = pathManager;
|
||||
LocalizationContext userCtx = pathManager.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
|
||||
LocalizationContext siteCtx = pathManager.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
|
||||
LocalizationContext baseCtx = pathManager.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE);
|
||||
String pathPrefix = getScriptTypePathPrefix();
|
||||
procDir = pathManager.getLocalizationFile(userCtx, pathPrefix);
|
||||
siteDir = pathManager.getLocalizationFile(siteCtx, pathPrefix);
|
||||
baseDir = pathManager.getLocalizationFile(baseCtx, pathPrefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the localization files representing Python procedures.
|
||||
*
|
||||
* @return the localization files for the procedures.
|
||||
*/
|
||||
public LocalizationFile[] getFiles() {
|
||||
LocalizationFile[] procFiles = pathManager.listStaticFiles(
|
||||
getScriptTypePathPrefix(), getExtensions(), false, true);
|
||||
return procFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simple names of the procedures.
|
||||
*
|
||||
* @return the simple names of the procedures.
|
||||
*/
|
||||
public Collection<String> getNames() {
|
||||
Collection<String> result = new HashSet<String>();
|
||||
LocalizationFile[] procFiles = getFiles();
|
||||
result = scriptNames(procFiles);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param scriptName
|
||||
* The simple name of a procedure, i.e., "Align_Grids".
|
||||
* @return The localization file for the script
|
||||
*/
|
||||
public LocalizationFile getFile(String scriptName) {
|
||||
String fname = getScriptTypePathPrefix() + File.separator + scriptName
|
||||
+ getExtensions()[0];
|
||||
LocalizationFile file = pathManager.getStaticLocalizationFile(fname);
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an observer that will be notified when the directory of the procedure
|
||||
* catalog changes. This is just a wrapper around the appropriate method of
|
||||
* procDir. Users are responsible for removing any listeners they create.
|
||||
*
|
||||
* @param observer
|
||||
* the observer to add
|
||||
*/
|
||||
public void addObserver(ILocalizationFileObserver observer) {
|
||||
procDir.addFileUpdatedObserver(observer);
|
||||
siteDir.addFileUpdatedObserver(observer);
|
||||
baseDir.addFileUpdatedObserver(observer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified observer.
|
||||
*
|
||||
* @param observer
|
||||
* The observer to remove.
|
||||
*/
|
||||
public void removeObserver(ILocalizationFileObserver observer) {
|
||||
procDir.removeFileUpdatedObserver(observer);
|
||||
siteDir.removeFileUpdatedObserver(observer);
|
||||
baseDir.removeFileUpdatedObserver(observer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the script names from an array of LocalizationFiles, with any leading
|
||||
* directories and trailing ".py"s removed.
|
||||
*
|
||||
* @param scriptFiles
|
||||
* the array of LocalizationFiles.
|
||||
* @return a Collection of simple script names with no duplicates.
|
||||
*/
|
||||
protected Collection<String> scriptNames(LocalizationFile[] scriptFiles) {
|
||||
Set<String> procs = new HashSet<String>();
|
||||
String fname = null;
|
||||
String[] fsplit = null;
|
||||
String script = null;
|
||||
if (scriptFiles != null) {
|
||||
for (LocalizationFile file : scriptFiles) {
|
||||
fname = file.getName();
|
||||
fsplit = fname.split(FileUtil.fileSeparatorRegex);
|
||||
script = fsplit[fsplit.length - 1].replaceAll("\\.py$", "");
|
||||
procs.add(script);
|
||||
}
|
||||
}
|
||||
return procs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public abstract String getScriptTypePathPrefix();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public abstract String[] getExtensions();
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
/**
|
||||
* 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.gfe.procedures;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||
import com.raytheon.viz.gfe.core.script.AbstractScriptCatalog;
|
||||
|
||||
/**
|
||||
* @author wldougher
|
||||
*
|
||||
*/
|
||||
public class ProcedureCatalog extends AbstractScriptCatalog {
|
||||
|
||||
private static final String[] EXTENSIONS = new String[] { ".py" };
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seecom.raytheon.viz.gfe.core.script.AbstractScriptCatalog#
|
||||
* getScriptTypePathPrefix()
|
||||
*/
|
||||
@Override
|
||||
public String getScriptTypePathPrefix() {
|
||||
return GfePyIncludeUtil.PROCEDURES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public String[] getExtensions() {
|
||||
return EXTENSIONS;
|
||||
}
|
||||
}
|
|
@ -1,203 +0,0 @@
|
|||
/**
|
||||
* 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.gfe.textproduct;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
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.LocalizationFile;
|
||||
import com.raytheon.viz.gfe.core.script.AbstractScriptCatalog;
|
||||
|
||||
/**
|
||||
* @author wldougher
|
||||
*
|
||||
*/
|
||||
public class TextProductCatalog extends AbstractScriptCatalog {
|
||||
|
||||
private static final String[] EXTENSIONS = { ".py" };
|
||||
|
||||
private LocalizationFile siteConfDir;
|
||||
|
||||
private LocalizationFile siteModDir;
|
||||
|
||||
private LocalizationFile userDir;
|
||||
|
||||
/**
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getExtensions()
|
||||
*/
|
||||
@Override
|
||||
public String[] getExtensions() {
|
||||
return EXTENSIONS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getScriptTypePathPrefix()
|
||||
*/
|
||||
@Override
|
||||
public String getScriptTypePathPrefix() {
|
||||
return GfePyIncludeUtil.TEXT_PRODUCTS;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getFiles()
|
||||
*/
|
||||
@Override
|
||||
public LocalizationFile[] getFiles() {
|
||||
LocalizationFile[] modProducts = pathManager.listStaticFiles(
|
||||
getScriptTypePathPrefix() + File.separator + "modified",
|
||||
getExtensions(), false, true);
|
||||
LocalizationFile[] confProducts = pathManager.listStaticFiles(
|
||||
getScriptTypePathPrefix() + File.separator + "configured",
|
||||
getExtensions(), false, true);
|
||||
LocalizationFile[] userProducts = pathManager.listFiles(pathManager
|
||||
.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.USER), getScriptTypePathPrefix(),
|
||||
getExtensions(), false, true);
|
||||
|
||||
// combine arrays, setting the modified products first in order
|
||||
return concatArrays(userProducts, modProducts, confProducts);
|
||||
}
|
||||
|
||||
private LocalizationFile[] concatArrays(LocalizationFile[] first,
|
||||
LocalizationFile[]... rest) {
|
||||
int totalLength = first.length;
|
||||
for (LocalizationFile[] array : rest) {
|
||||
totalLength += array.length;
|
||||
}
|
||||
|
||||
LocalizationFile[] result = Arrays.copyOf(first, totalLength);
|
||||
int offset = first.length;
|
||||
for (LocalizationFile[] array : rest) {
|
||||
System.arraycopy(array, 0, result, offset, array.length);
|
||||
offset += array.length;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#addObserver(com
|
||||
* .raytheon.uf.common.localization.ILocalizationFileObserver)
|
||||
*/
|
||||
@Override
|
||||
public void addObserver(ILocalizationFileObserver observer) {
|
||||
userDir.addFileUpdatedObserver(observer);
|
||||
siteConfDir.addFileUpdatedObserver(observer);
|
||||
siteModDir.addFileUpdatedObserver(observer);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getFile(java.lang
|
||||
* .String)
|
||||
*/
|
||||
@Override
|
||||
public LocalizationFile getFile(String scriptName) {
|
||||
String path;
|
||||
LocalizationFile result;
|
||||
|
||||
path = getScriptTypePathPrefix() + File.separator + scriptName;
|
||||
result = pathManager.getLocalizationFile(pathManager.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), path);
|
||||
if (result != null && !result.exists()) {
|
||||
result = null;
|
||||
}
|
||||
|
||||
if (result == null) {
|
||||
path = GfePyIncludeUtil.TEXT_PRODUCTS + File.separator + scriptName;
|
||||
result = pathManager
|
||||
.getLocalizationFile(pathManager.getContext(
|
||||
LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.SITE), path);
|
||||
}
|
||||
if (result != null && !result.exists()) {
|
||||
result = null;
|
||||
}
|
||||
|
||||
if (result == null) {
|
||||
path = GfePyIncludeUtil.TEXT_PRODUCTS + File.separator + scriptName;
|
||||
result = pathManager.getLocalizationFile(
|
||||
pathManager.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.CONFIGURED), path);
|
||||
}
|
||||
if (result != null && !result.exists()) {
|
||||
result = null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#removeObserver
|
||||
* (com.raytheon.uf.common.localization.ILocalizationFileObserver)
|
||||
*/
|
||||
@Override
|
||||
public void removeObserver(ILocalizationFileObserver observer) {
|
||||
userDir.removeFileUpdatedObserver(observer);
|
||||
siteConfDir.removeFileUpdatedObserver(observer);
|
||||
siteModDir.removeFileUpdatedObserver(observer);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#setPathManager
|
||||
* (com.raytheon.uf.common.localization.IPathManager)
|
||||
*/
|
||||
@Override
|
||||
protected void setPathManager(IPathManager pathManager) {
|
||||
if (pathManager == null) {
|
||||
throw new NullPointerException("Attempt to set a null path manager");
|
||||
}
|
||||
|
||||
this.pathManager = pathManager;
|
||||
LocalizationContext userCtx = pathManager.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
|
||||
LocalizationContext siteCtx = pathManager.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
|
||||
String pathPrefix = getScriptTypePathPrefix();
|
||||
userDir = pathManager.getLocalizationFile(userCtx, pathPrefix);
|
||||
siteConfDir = pathManager.getLocalizationFile(siteCtx, pathPrefix
|
||||
+ File.separator + "configured");
|
||||
siteModDir = pathManager.getLocalizationFile(siteCtx, pathPrefix
|
||||
+ File.separator + "modified");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
/**
|
||||
* 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.gfe.textproduct;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||
import com.raytheon.viz.gfe.core.script.AbstractScriptCatalog;
|
||||
|
||||
/**
|
||||
* @author wldougher
|
||||
*
|
||||
*/
|
||||
public class TextUtilityCatalog extends AbstractScriptCatalog {
|
||||
|
||||
private static final String[] EXTENSIONS = { ".py" };
|
||||
|
||||
private static final String PATH_PREFIX = GfePyIncludeUtil.TEXT_UTILITIES
|
||||
+ File.separator + "regular";
|
||||
|
||||
/**
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getExtensions()
|
||||
*/
|
||||
@Override
|
||||
public String[] getExtensions() {
|
||||
return EXTENSIONS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see com.raytheon.viz.gfe.core.script.AbstractScriptCatalog#getScriptTypePathPrefix()
|
||||
*/
|
||||
@Override
|
||||
public String getScriptTypePathPrefix() {
|
||||
return PATH_PREFIX;
|
||||
}
|
||||
}
|
|
@ -23,6 +23,7 @@
|
|||
<vbSource key="MRF205" category="Volume" />
|
||||
<vbSource key="AVN203" category="Volume" />
|
||||
<vbSource key="GFS201" category="Volume" />
|
||||
<vbSource key="GEFS" category="Volume" />
|
||||
<vbSource key="ENSEMBLE" category="Volume" views="PLANVIEW TIMESERIES" />
|
||||
<vbSource key="AVN-NorthernHemisphere" category="Volume" />
|
||||
<vbSource key="HiResW-ARW-AK" category="Volume" />
|
||||
|
|
81
deltaScripts/14.4.1/DR3318/renameGefs.py
Executable file
81
deltaScripts/14.4.1/DR3318/renameGefs.py
Executable file
|
@ -0,0 +1,81 @@
|
|||
#!/usr/bin/env python
|
||||
# Convert gefs' directories to the new GEFS' directories
|
||||
|
||||
import h5py
|
||||
import os
|
||||
import sys
|
||||
|
||||
PSQL='/awips2/psql/bin/psql'
|
||||
|
||||
GRID_DIR= os.sep + 'awips2' + os.sep + 'edex' + os.sep + 'data' + os.sep + 'hdf5' + os.sep + 'grid'
|
||||
OLD_DIR= os.path.join(GRID_DIR, 'gefs')
|
||||
NEW_DIR= os.path.join(GRID_DIR, 'GEFS')
|
||||
|
||||
OLD_VALUE=':gefs:'
|
||||
NEW_VALUE=':GEFS:'
|
||||
|
||||
def convertH5(dir):
|
||||
for file in os.listdir(dir):
|
||||
oldFilename = os.path.join(dir, file)
|
||||
if os.path.isdir(oldFilename):
|
||||
print 'INFO Converting %s' % (oldFilename)
|
||||
convertH5(oldFilename)
|
||||
elif file.startswith('gefs') and file.endswith('h5'):
|
||||
newFile = file.replace('gefs', 'GEFS', 1)
|
||||
filename = os.path.join(os.path.split(oldFilename)[0], newFile)
|
||||
try:
|
||||
os.rename(oldFilename, filename)
|
||||
except Exception, e:
|
||||
print 'WARNING: unable to rename %s to %s %s: ' % (oldFilename, filename, e)
|
||||
continue
|
||||
h5file = None
|
||||
try:
|
||||
h5file = h5py.File(filename, 'r+')
|
||||
for g in h5file.keys():
|
||||
if str.find(g, OLD_VALUE) > 0 :
|
||||
new = str.replace(g, OLD_VALUE, NEW_VALUE, 1)
|
||||
h5file[new] = h5file[g]
|
||||
except Exception, e:
|
||||
print "WARNING: in file %s: %s" % (filename, e)
|
||||
finally:
|
||||
if h5file:
|
||||
h5file.close()
|
||||
|
||||
def moveDir(old, new):
|
||||
if not os.path.isdir(old) :
|
||||
print 'INFO: No %s directory to move.' % (old)
|
||||
return
|
||||
|
||||
if os.path.exists(new):
|
||||
print 'ERROR: Unable to create directory %s' % (new)
|
||||
print 'Fatal: %s already exists.' % (new)
|
||||
exit(1)
|
||||
try:
|
||||
os.rename(old, new)
|
||||
except Exception, e:
|
||||
print 'ERROR: Unable to create directory %s.' % (new)
|
||||
print 'Fatal: %s' % (e)
|
||||
exit(1)
|
||||
|
||||
|
||||
print 'INFO: Updates for GEFS.'
|
||||
|
||||
print 'INFO: updating directory'
|
||||
|
||||
moveDir(OLD_DIR, NEW_DIR)
|
||||
|
||||
if os.path.isdir(NEW_DIR) :
|
||||
print 'INFO: Converting h5 files'
|
||||
convertH5(NEW_DIR)
|
||||
else:
|
||||
print "WARNING: %s directory not found" % (NEW_DIR)
|
||||
|
||||
print 'INFO: Update database'
|
||||
|
||||
cmd = '%s -U awips -d metadata -c "update grid_info set datasetid=%s where datasetid=%s"' % (PSQL, "'GEFS'", "'gefs'")
|
||||
if os.system(cmd) :
|
||||
print 'ERROR Unable to update database'
|
||||
exit(1)
|
||||
|
||||
print 'INFO: Updated GEFS successfully.'
|
||||
|
|
@ -60,9 +60,6 @@
|
|||
<logger name="org.springframework">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
<logger name="uk.ltd.getahead">
|
||||
<level value="WARN"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" additivity="false">
|
||||
<level value="ERROR"/>
|
||||
<appender-ref ref="HibernateLog" />
|
||||
|
|
|
@ -197,9 +197,6 @@
|
|||
<logger name="org.springframework">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
<logger name="uk.ltd.getahead">
|
||||
<level value="WARN"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" additivity="false">
|
||||
<level value="ERROR"/>
|
||||
<appender-ref ref="HibernateLog" />
|
||||
|
|
|
@ -126,9 +126,6 @@
|
|||
<logger name="org.springframework">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
<logger name="uk.ltd.getahead">
|
||||
<level value="WARN"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" additivity="false">
|
||||
<level value="ERROR"/>
|
||||
<appender-ref ref="HibernateLog" />
|
||||
|
|
|
@ -151,9 +151,6 @@
|
|||
<logger name="org.springframework">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
<logger name="uk.ltd.getahead">
|
||||
<level value="WARN"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" additivity="false">
|
||||
<level value="ERROR"/>
|
||||
<appender-ref ref="HibernateLog" />
|
||||
|
|
|
@ -29,7 +29,7 @@ fi
|
|||
|
||||
while [ -z $keystorePw ];
|
||||
do
|
||||
echo -n "Enter password for keystore [$keystore]: "
|
||||
echo -n "Enter desired password for keystore [$keystore]: "
|
||||
read keystorePw
|
||||
if [ -z $keystorePw ];
|
||||
then
|
||||
|
@ -49,7 +49,7 @@ done
|
|||
|
||||
while [ -z $keyPw ];
|
||||
do
|
||||
echo -n "Enter password for key [$keyAlias]: "
|
||||
echo -n "Enter desired password for key [$keyAlias]: "
|
||||
read keyPw
|
||||
if [ -z $keyPw ];
|
||||
then
|
||||
|
@ -110,6 +110,10 @@ echo -n "Moving key store and trust store to [$securityDir] ..."
|
|||
mv $truststore $keystore $securityDir
|
||||
echo "Done!"
|
||||
|
||||
echo "Keystores are located at $securityDir"
|
||||
echo "The public key for this server is located at $(pwd)/$keyAlias$publicKeyFile"
|
||||
echo "This file may be disseminated to other registry federation memebers who wish to interact with this server"
|
||||
|
||||
}
|
||||
|
||||
function addKey() {
|
||||
|
@ -157,4 +161,4 @@ elif [ "$1" = "-usage" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]
|
|||
then
|
||||
usage
|
||||
exit 0
|
||||
fi
|
||||
fi
|
|
@ -19,6 +19,8 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.gfe.config;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.HashMap;
|
||||
|
@ -73,8 +75,10 @@ import com.raytheon.uf.edex.site.notify.SendSiteActivationNotifications;
|
|||
* May 02, 2013 #1969 randerso Moved updateDbs method into IFPGridDatabase
|
||||
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer
|
||||
* Oct 16, 2013 #2475 dgilling Better error handling for IRT activation.
|
||||
* Mar 21, 2014 2726 rjpeter Updated wait for running loop.
|
||||
* Mar 21, 2014 #2726 rjpeter Updated wait for running loop.
|
||||
* May 15, 2014 #3157 dgilling Mark getActiveSites() as deprecated.
|
||||
* Jul 09, 2014 #3146 randerso Eliminated redundant evaluation of serverConfig
|
||||
* Sent activation failure message to alertViz
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -232,13 +236,6 @@ public class GFESiteActivation implements ISiteActivationListener {
|
|||
}
|
||||
|
||||
try {
|
||||
|
||||
IFPServerConfig config = IFPServerConfigManager
|
||||
.initializeConfig(siteID);
|
||||
if (config == null) {
|
||||
throw new GfeConfigurationException(
|
||||
"Error validating configuration for " + siteID);
|
||||
}
|
||||
internalActivateSite(siteID);
|
||||
} catch (GfeMissingConfigurationException e) {
|
||||
sendActivationFailedNotification(siteID);
|
||||
|
@ -248,7 +245,15 @@ public class GFESiteActivation implements ISiteActivationListener {
|
|||
throw e;
|
||||
} catch (Exception e) {
|
||||
sendActivationFailedNotification(siteID);
|
||||
statusHandler.error(siteID + " Error activating site " + siteID, e);
|
||||
String message = "Error activating IFPServer for site " + siteID
|
||||
+ ". GFE will be unavailable for this site!";
|
||||
statusHandler.error(message, e);
|
||||
|
||||
StringWriter stackTrace = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(stackTrace));
|
||||
EDEXUtil.sendMessageAlertViz(Priority.ERROR,
|
||||
"com.raytheon.edex.plugin.gfe", "GFE", "GFE", message,
|
||||
stackTrace.toString(), null);
|
||||
throw e;
|
||||
}
|
||||
sendActivationCompleteNotification(siteID);
|
||||
|
|
|
@ -25,8 +25,6 @@ import java.util.HashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import jep.JepException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
@ -56,6 +54,7 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Dec 11, 2012 14360 ryu Throw specific exception for missing configuration.
|
||||
* Feb 20, 2014 #2824 randerso Fixed import of localVTECPartners to use siteID
|
||||
* Added common python path for LogStream
|
||||
* Jul 09, 2014 #3146 randerso Improved exception handling
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -178,7 +177,7 @@ public class IFPServerConfigManager {
|
|||
SimpleServerConfig simpleConfig = (SimpleServerConfig) py.execute(
|
||||
"getSimpleConfig", null);
|
||||
siteConfig = new IFPServerConfig(simpleConfig);
|
||||
} catch (JepException e) {
|
||||
} catch (Throwable e) {
|
||||
throw new GfeConfigurationException(
|
||||
"Exception occurred while processing serverConfig for site "
|
||||
+ siteID, e);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/09/2013 #1571 randerso Changed projections to use the Java
|
||||
# ProjectionType enumeration
|
||||
# 07/09/2014 #3146 randerso Added check for duplicate smartInit
|
||||
#
|
||||
########################################################################
|
||||
import types
|
||||
|
@ -438,7 +439,7 @@ def otherParse(serverhost, mhsid, port,
|
|||
"not an int: " + `vtecRequestTime`
|
||||
if type(port) != int:
|
||||
raise TypeError, "GFESUITE_PORT not an int: " + `port`
|
||||
initmodules = dictCheck(initmodules, list, str, "INITMODULES")
|
||||
javainitmodules = dictCheck(initmodules, list, str, "INITMODULES")
|
||||
accumElem = dictCheck(accumElem, list, str, "D2DAccumulativeElements")
|
||||
initskips = dictCheck(initskips, list, int, "INITSKIPS")
|
||||
d2ddbver = dictCheck(d2ddbver, int, None, "D2DDBVERSIONS")
|
||||
|
@ -507,9 +508,40 @@ def otherParse(serverhost, mhsid, port,
|
|||
raise TypeError, "TRANSMIT_SCRIPT not None or str: " + `transmitScript`
|
||||
elif transmitScript is None:
|
||||
transmitScript = ""
|
||||
|
||||
# build model to init mapping
|
||||
modelToInit = {}
|
||||
for module in initmodules:
|
||||
for model in initmodules[module]:
|
||||
if modelToInit.has_key(model):
|
||||
modelToInit[model].append(module)
|
||||
else:
|
||||
modelToInit[model] = [module]
|
||||
|
||||
# check for duplicate init modules
|
||||
for model in modelToInit:
|
||||
modules = modelToInit[model]
|
||||
if len(modules) > 1:
|
||||
message = "Multiple smartInit modules " + str(modules) + \
|
||||
" are enabled for D2D model: " + model + ". " + str(modules[1:]) + \
|
||||
" will be disabled. Please edit your localConfig.py file and disable all but one."
|
||||
|
||||
# log error message to edex log
|
||||
import LogStream
|
||||
LogStream.logProblem(message);
|
||||
|
||||
# log error to alertViz
|
||||
from ufpy import NotificationMessage
|
||||
nfm = NotificationMessage.NotificationMessage(message=message,
|
||||
category="GFE", priority=1, source="GFE")
|
||||
nfm.send()
|
||||
|
||||
# remove duplicate
|
||||
for module in modules[1:]:
|
||||
javainitmodules.remove(module)
|
||||
|
||||
return serverhost, mhsid, \
|
||||
port, initmodules, accumElem, \
|
||||
port, javainitmodules, accumElem, \
|
||||
initskips, d2ddbver, logfilepurge, prddir, home,\
|
||||
extraWEPrecision, vtecRequestTime, \
|
||||
autoConfigureNotifyTextProd, \
|
||||
|
|
|
@ -39,11 +39,12 @@
|
|||
# 02/20/2014 #2824 randerso Added log message when local override files are not found
|
||||
# 03/11/2014 #2897 dgilling Add new MHWM databases to default configuration.
|
||||
# 03/20/2014 #2418 dgilling Remove unneeded D2D source PHISH.
|
||||
# 04/17/14 2934 dgilling Remove alias for TPCSurgeProb D2D database.
|
||||
# 05/09/2014 3148 randerso Add tpHPCndfd to D2DAccumulativeElements for HPCERP
|
||||
# 04/17/2014 #2934 dgilling Remove alias for TPCSurgeProb D2D database.
|
||||
# 05/09/2014 #3148 randerso Add tpHPCndfd to D2DAccumulativeElements for HPCERP
|
||||
# 06/20/2014 #3230 rferrel Added URMA25.
|
||||
#
|
||||
# 05/29/2014 3224 randerso Added "SPC":8 to D2DDBVERSIONS
|
||||
# 05/29/2014 #3224 randerso Added "SPC":8 to D2DDBVERSIONS
|
||||
# 07/09/2014 #3146 randerso Removed unused import
|
||||
########################################################################
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
@ -1988,7 +1989,7 @@ DATABASES.append((ISC, ISCPARMS))
|
|||
#----------------------------------------------------------------------------
|
||||
# Server settings DO NOT CHANGE THESE DEFINITIONS
|
||||
#----------------------------------------------------------------------------
|
||||
from com.raytheon.edex.plugin.gfe.config import IFPServerConfig, SimpleServerConfig
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleServerConfig
|
||||
IFPConfigServer = SimpleServerConfig()
|
||||
#IFPConfigServer.allowedNodes = []
|
||||
IFPConfigServer.allowTopoBelowZero = 1
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<?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.
|
||||
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. -->
|
||||
|
||||
|
||||
<gribModelSet>
|
||||
<model>
|
||||
<name>GEFS</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>2</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>GEFS</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>3</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>GEFS</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>361181001</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>GEFS</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>372</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>GEFS</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>375</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
</gribModelSet>
|
|
@ -2284,57 +2284,7 @@
|
|||
<id>96</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>gefs</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>2</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>gefs</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>3</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>gefs</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>361181001</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>gefs</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>372</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>gefs</name>
|
||||
<center>7</center>
|
||||
<subcenter>2</subcenter>
|
||||
<grid>375</grid>
|
||||
<process>
|
||||
<id>107</id>
|
||||
</process>
|
||||
</model>
|
||||
|
||||
|
||||
<model>
|
||||
<name>SREF132</name>
|
||||
<center>7</center>
|
||||
|
|
|
@ -7,6 +7,6 @@ Bundle-Vendor: RAYTHEON
|
|||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Export-Package: com.raytheon.uf.common.nc4,
|
||||
com.raytheon.uf.common.nc4.cf
|
||||
Require-Bundle: ll.netcdf;bundle-version="1.0.0",
|
||||
Require-Bundle: edu.mit.ll.netcdf;bundle-version="1.3.0",
|
||||
org.apache.commons.lang;bundle-version="2.3.0",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174"
|
||||
|
|
|
@ -4,8 +4,7 @@ Bundle-Name: Hpe
|
|||
Bundle-SymbolicName: com.raytheon.uf.common.plugin.hpe
|
||||
Bundle-Version: 1.14.3.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.common.util;bundle-version="1.14.0",
|
||||
Require-Bundle: com.raytheon.uf.common.util;bundle-version="1.14.0",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.time;bundle-version="1.12.1174",
|
||||
javax.persistence;bundle-version="1.0.0",
|
||||
|
|
|
@ -53,12 +53,6 @@
|
|||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="uk.ltd.getahead"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="org.objectweb"
|
||||
download-size="0"
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="obsDecoder" class="com.raytheon.edex.plugin.obs.ObsDecoder">
|
||||
<constructor-arg ref="obsPluginName" />
|
||||
</bean>
|
||||
|
||||
<bean id="metarPointData" class="com.raytheon.edex.plugin.obs.metar.MetarPointDataTransform" depends-on="registerObsPlugin"/>
|
||||
|
||||
<bean id="obsSeparator" class="com.raytheon.edex.plugin.obs.metar.MetarSeparator" />
|
||||
|
||||
<bean id="obsDistRegistry" factory-bean="distributionSrv"
|
||||
factory-method="register">
|
||||
<constructor-arg value="obs" />
|
||||
<constructor-arg value="jms-durable:queue:Ingest.obs" />
|
||||
</bean>
|
||||
|
||||
<bean id="metarIngestFilter" class="com.raytheon.uf.edex.ogc.common.util.PluginFilterProcessor"/>
|
||||
|
||||
<camelContext id="obs-camel"
|
||||
xmlns="http://camel.apache.org/schema/spring"
|
||||
errorHandlerRef="errorHandler">
|
||||
|
||||
<!--METAR file route -->
|
||||
<endpoint id="metarFileEndpoint" uri="file:${edex.home}/data/sbn/metar?noop=true&idempotent=false" />
|
||||
|
||||
<route id="metarFileConsumerRoute">
|
||||
<from ref="metarFileEndpoint" />
|
||||
<bean ref="fileToString" />
|
||||
<setHeader headerName="pluginName">
|
||||
<constant>obs</constant>
|
||||
</setHeader>
|
||||
<to uri="jms-generic:queue:Ingest.obs" />
|
||||
</route>
|
||||
|
||||
<!-- Begin METAR routes -->
|
||||
<route id="metarIngestRoute">
|
||||
<from uri="jms-durable:queue:Ingest.obs"/>
|
||||
<setHeader headerName="pluginName">
|
||||
<constant>obs</constant>
|
||||
</setHeader>
|
||||
<doTry>
|
||||
<pipeline>
|
||||
<bean ref="stringToFile" />
|
||||
<bean ref="obsDecoder" method="decode" />
|
||||
<bean ref="metarIngestFilter"/>
|
||||
<bean ref="metarPointData" method="toPointData" />
|
||||
<bean ref="metarLayerCollector" method="add"/>
|
||||
<to uri="direct-vm:persistIndex" />
|
||||
</pipeline>
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
<to uri="log:metar"/>
|
||||
</doCatch>
|
||||
</doTry>
|
||||
</route>
|
||||
|
||||
</camelContext>
|
||||
</beans>
|
|
@ -30,7 +30,6 @@ Require-Bundle: com.raytheon.uf.common.registry.schemas.ebxml;bundle-version="1.
|
|||
org.apache.commons.lang;bundle-version="2.3.0",
|
||||
com.raytheon.uf.edex.database;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
uk.ltd.getahead;bundle-version="1.0.0",
|
||||
javax.mail;bundle-version="1.0.0",
|
||||
org.apache.commons.validator;bundle-version="1.2.0",
|
||||
com.sun.xml.bind;bundle-version="1.0.0",
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
</bean>
|
||||
|
||||
<!-- QUERY -->
|
||||
<!-- Define concrete implementation of the service -->
|
||||
<bean id="queryServiceImpl"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl">
|
||||
<property name="federationDao" ref="federationDao" />
|
||||
|
@ -71,7 +70,6 @@
|
|||
</bean>
|
||||
|
||||
<!-- NOTIFICATION LISTENER -->
|
||||
<!-- Define concrete implementation of the service -->
|
||||
<bean id="notificationServiceImpl"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationListenerImpl">
|
||||
<property name="lcm" ref="lcmServiceImpl" />
|
||||
|
@ -82,7 +80,6 @@
|
|||
|
||||
|
||||
<!-- LIFE CYCLE MANAGER -->
|
||||
<!-- Define concrete implementation of the service -->
|
||||
<bean id="lcmServiceImpl"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl">
|
||||
<property name="queryManager" ref="queryServiceImpl" />
|
||||
|
@ -94,7 +91,6 @@
|
|||
</bean>
|
||||
|
||||
<!-- VALIDATOR -->
|
||||
<!-- Define concrete implementation of the service -->
|
||||
<bean id="validatorServiceImpl"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.validator.ValidatorImpl">
|
||||
<property name="queryManager" ref="queryServiceImpl" />
|
||||
|
@ -102,35 +98,13 @@
|
|||
<property name="registryObjectTypeValidator" ref="registryObjectTypeValidator" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- CATALOGER -->
|
||||
<!-- Define concrete implementation of the service -->
|
||||
<bean id="catalogerServiceImpl"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.cataloger.CatalogerImpl">
|
||||
<property name="registryObjectDao" ref="registryObjectDao" />
|
||||
</bean>
|
||||
|
||||
<!-- REST Service Beans -->
|
||||
<bean name="AddRegistryParty"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.web.AddRegistryParty">
|
||||
<property name="partyDao" ref="partyDao" />
|
||||
<property name="lcm" ref="lcmServiceImpl" />
|
||||
<property name="webUtil" ref="RegistryWebUtil" />
|
||||
</bean>
|
||||
|
||||
<bean name="ModifyRegistryParty"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.web.ModifyRegistryParty">
|
||||
<property name="partyDao" ref="partyDao" />
|
||||
<property name="lcm" ref="lcmServiceImpl" />
|
||||
<property name="webUtil" ref="RegistryWebUtil" />
|
||||
</bean>
|
||||
|
||||
<bean name="DeleteRegistryParty"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.web.DeleteRegistryParty">
|
||||
<property name="partyDao" ref="partyDao" />
|
||||
<property name="webUtil" ref="RegistryWebUtil" />
|
||||
</bean>
|
||||
|
||||
<bean id="registryObjectsRestService"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.rest.RegistryObjectsRestService">
|
||||
<property name="registryObjectDao" ref="registryObjectDao" />
|
||||
|
@ -147,21 +121,6 @@
|
|||
<property name="queryDefinitionDao" ref="queryDefinitionDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="RegistryWebUtil" class="com.raytheon.uf.edex.registry.ebxml.web.RegistryWebUtil">
|
||||
<property name="lcm" ref="lcmServiceImpl" />
|
||||
<property name="personDao" ref="personDao" />
|
||||
<property name="classificationNodeDao" ref="classificationNodeDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="RegistryWebAdmin"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.web.RegistryWebAdmin">
|
||||
<property name="partyDao" ref="partyDao" />
|
||||
<property name="classificationNodeDao" ref="classificationNodeDao" />
|
||||
<property name="organizationDao" ref="organizationDao" />
|
||||
<property name="personDao" ref="personDao" />
|
||||
<property name="roleDao" ref="roleDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="AuditableEventService"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.AuditableEventService">
|
||||
<constructor-arg ref="AuditableEventTypeDao" />
|
||||
|
|
|
@ -1,176 +0,0 @@
|
|||
/**
|
||||
* 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.uf.edex.registry.ebxml.web;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
||||
import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* Servlet implementation used to add a user or organization to the registry.
|
||||
* FIXME: This class will be refactored in a later ticket
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/31/2012 #724 bphillip Initial creation
|
||||
* 3/13/2013 1082 bphillip Made transactional
|
||||
* 4/19/2013 1931 bphillip Refactored to use web application spring container and cxf services
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1.0
|
||||
*/
|
||||
@Path("/AddRegistryParty")
|
||||
@Service
|
||||
@Transactional
|
||||
public class AddRegistryParty {
|
||||
|
||||
/** Serial */
|
||||
private static final long serialVersionUID = 1422748054768442033L;
|
||||
|
||||
/** The logger */
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(AddRegistryParty.class);
|
||||
|
||||
/** The page to display upon success */
|
||||
private static final String SUCCESS_RESPONSE_PAGE = "addPartySuccess";
|
||||
|
||||
/** the page to display upon failure */
|
||||
private static final String ERROR_RESPONSE_PAGE = "addPartyFailure";
|
||||
|
||||
private PartyDao partyDao;
|
||||
|
||||
private LifecycleManagerImpl lcm;
|
||||
|
||||
private RegistryWebUtil webUtil;
|
||||
|
||||
@POST
|
||||
@Produces("text/html")
|
||||
public Response doPost(@Context HttpServletRequest request)
|
||||
throws IOException {
|
||||
String partyId = request.getParameter(WebFields.ID.fieldName());
|
||||
String objectType = request
|
||||
.getParameter(WebFields.OBJ_TYPE.fieldName());
|
||||
PartyType existingParty = null;
|
||||
|
||||
// The EDEX internal user cannot be modified
|
||||
if (partyId.equals(RegistryUtil.DEFAULT_OWNER)) {
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType,
|
||||
// "Cannot modify EDEX Internal User");
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if the party already exists. If so, the user cannot be
|
||||
* added
|
||||
*/
|
||||
existingParty = partyDao.getById(partyId);
|
||||
|
||||
if (existingParty != null) {
|
||||
statusHandler.error("Error adding " + objectType + " to registry. "
|
||||
+ objectType + " " + partyId + " already exists");
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType, objectType
|
||||
// + " Already Exists");
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a new submit request containing the new party
|
||||
*/
|
||||
SubmitObjectsRequest submitRequest = null;
|
||||
try {
|
||||
submitRequest = webUtil.createParty(request);
|
||||
} catch (EbxmlRegistryException e) {
|
||||
statusHandler.error("Error creating " + objectType, e);
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(
|
||||
// request,
|
||||
// response,
|
||||
// ERROR_RESPONSE_PAGE,
|
||||
// partyId,
|
||||
// objectType,
|
||||
// "Error creating " + objectType + "\n"
|
||||
// + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
// Submit the objects to the registry
|
||||
try {
|
||||
lcm.submitObjects(submitRequest);
|
||||
webUtil.updatePC(request);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Error submitting new " + objectType
|
||||
+ " to the registry", e);
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(
|
||||
// request,
|
||||
// response,
|
||||
// ERROR_RESPONSE_PAGE,
|
||||
// partyId,
|
||||
// objectType,
|
||||
// "Error submitting new " + objectType
|
||||
// + " to the registry\n"
|
||||
// + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
// Send success response back to the caller
|
||||
return Response.ok().build();
|
||||
// webUtil.sendSuccessResponse(request, response, SUCCESS_RESPONSE_PAGE,
|
||||
// partyId, objectType);
|
||||
}
|
||||
|
||||
public void setWebUtil(RegistryWebUtil webUtil) {
|
||||
this.webUtil = webUtil;
|
||||
}
|
||||
|
||||
public void setPartyDao(PartyDao partyDao) {
|
||||
this.partyDao = partyDao;
|
||||
}
|
||||
|
||||
public void setLcm(LifecycleManagerImpl lcm) {
|
||||
this.lcm = lcm;
|
||||
}
|
||||
}
|
|
@ -1,144 +0,0 @@
|
|||
/**
|
||||
* 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.uf.edex.registry.ebxml.web;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
|
||||
|
||||
/**
|
||||
*
|
||||
* Servlet implementation used to delete a user or organization from the
|
||||
* registry. FIXME: This class will be refactored in a later ticket
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/31/2012 #724 bphillip Initial creation
|
||||
* 3/13/2013 1082 bphillip Made transactional
|
||||
* 4/19/2013 1931 bphillip Refactored to use web application spring container and cxf services
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1.0
|
||||
*/
|
||||
@Path("/DeleteRegistryParty")
|
||||
@Service
|
||||
@Transactional
|
||||
public class DeleteRegistryParty {
|
||||
|
||||
/** The serial ID */
|
||||
private static final long serialVersionUID = -9009661529309992652L;
|
||||
|
||||
/** The page to display upon success */
|
||||
private static final String SUCCESS_RESPONSE_PAGE = "deletePartySuccess";
|
||||
|
||||
/** The page to display upon failure */
|
||||
private static final String ERROR_RESPONSE_PAGE = "deletePartyFailure";
|
||||
|
||||
private PartyDao partyDao;
|
||||
|
||||
private RegistryWebUtil webUtil;
|
||||
|
||||
/** The logger */
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(DeleteRegistryParty.class);
|
||||
|
||||
@POST
|
||||
@Produces("text/html")
|
||||
public Response doPost(@Context HttpServletRequest request)
|
||||
throws IOException {
|
||||
String partyId = request.getParameter(WebFields.ID.fieldName());
|
||||
String objectType = request
|
||||
.getParameter(WebFields.OBJ_TYPE.fieldName());
|
||||
PartyType existingParty = null;
|
||||
|
||||
// The EDEX internal user cannot be modified
|
||||
if (partyId.equals(RegistryUtil.DEFAULT_OWNER)) {
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType,
|
||||
// "Cannot remove EDEX Internal User");
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the party exists. If not, the party obviously cannot be
|
||||
* deleted
|
||||
*/
|
||||
|
||||
existingParty = partyDao.getById(partyId);
|
||||
|
||||
if (existingParty == null) {
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType,
|
||||
// "Unable to delete " + objectType + " " + partyId + ". "
|
||||
// + objectType + " does not exist");
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove any associations to the party
|
||||
*/
|
||||
try {
|
||||
webUtil.removeAssociations(existingParty);
|
||||
webUtil.removeParty(existingParty);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Error modifying user", e);
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType,
|
||||
// "Error removing associations to " + objectType + "\n"
|
||||
// + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
// Send back a successful response to the requester
|
||||
// webUtil.sendSuccessResponse(request, response,
|
||||
// SUCCESS_RESPONSE_PAGE, partyId, objectType);
|
||||
return Response.ok().build();
|
||||
}
|
||||
|
||||
public void setPartyDao(PartyDao partyDao) {
|
||||
this.partyDao = partyDao;
|
||||
}
|
||||
|
||||
public void setWebUtil(RegistryWebUtil webUtil) {
|
||||
this.webUtil = webUtil;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,174 +0,0 @@
|
|||
/**
|
||||
* 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.uf.edex.registry.ebxml.web;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
||||
import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* Servlet implementation used to modify a user or organization in the registry
|
||||
* FIXME: This class will be refactored in a later ticket
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/31/2012 #724 bphillip Initial creation
|
||||
* 3/13/2013 1082 bphillip Made transactional
|
||||
* 4/19/2013 1931 bphillip Refactored to use web application spring container and cxf services
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1.0
|
||||
*/
|
||||
@Path("/DeleteRegistryParty")
|
||||
@Service
|
||||
@Transactional
|
||||
public class ModifyRegistryParty {
|
||||
|
||||
/** The serial ID */
|
||||
private static final long serialVersionUID = -2361555059266130462L;
|
||||
|
||||
/** Page to display upon success */
|
||||
private static final String SUCCESS_RESPONSE_PAGE = "modifyPartySuccess";
|
||||
|
||||
/** Page to display upon failure */
|
||||
private static final String ERROR_RESPONSE_PAGE = "modifyPartyFailure";
|
||||
|
||||
private PartyDao partyDao;
|
||||
|
||||
private LifecycleManagerImpl lcm;
|
||||
|
||||
private RegistryWebUtil webUtil;
|
||||
|
||||
/** The logger */
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ModifyRegistryParty.class);
|
||||
|
||||
@POST
|
||||
@Produces("text/html")
|
||||
public Response doPost(@Context HttpServletRequest request)
|
||||
throws IOException {
|
||||
|
||||
String partyId = request.getParameter(WebFields.ID.fieldName());
|
||||
String objectType = request
|
||||
.getParameter(WebFields.OBJ_TYPE.fieldName());
|
||||
PartyType existingParty = null;
|
||||
|
||||
// The EDEX internal user cannot be modified
|
||||
if (partyId.equals(RegistryUtil.DEFAULT_OWNER)) {
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType,
|
||||
// "Cannot modify EDEX Internal User");
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the party already exists. If the party does not exist, the
|
||||
* party cannot be modified. An error response is sent to the requester
|
||||
*/
|
||||
existingParty = partyDao.getById(partyId);
|
||||
|
||||
if (existingParty == null) {
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType,
|
||||
// "Unable to modify " + objectType + " " + partyId + ". "
|
||||
// + objectType + " does not exist");
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the submit request
|
||||
*/
|
||||
SubmitObjectsRequest submitRequest = null;
|
||||
try {
|
||||
submitRequest = webUtil.createParty(request);
|
||||
} catch (EbxmlRegistryException e) {
|
||||
statusHandler.error("Error modifying user", e);
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(
|
||||
// request,
|
||||
// response,
|
||||
// ERROR_RESPONSE_PAGE,
|
||||
// partyId,
|
||||
// objectType,
|
||||
// "Error modifying " + objectType + "\n"
|
||||
// + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove any associations originating from the modified party
|
||||
*/
|
||||
try {
|
||||
webUtil.removeAssociationsFrom(existingParty);
|
||||
lcm.submitObjects(submitRequest);
|
||||
webUtil.updatePC(request);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Error modifying user", e);
|
||||
return Response.serverError().build();
|
||||
// webUtil.sendErrorResponse(request, response,
|
||||
// ERROR_RESPONSE_PAGE, partyId, objectType,
|
||||
// "Error removing associations to " + objectType + "\n"
|
||||
// + e.getLocalizedMessage());
|
||||
}
|
||||
/*
|
||||
* Send back success message to the requester
|
||||
*/
|
||||
// webUtil.sendSuccessResponse(request, response, SUCCESS_RESPONSE_PAGE,
|
||||
// partyId, objectType);
|
||||
return Response.ok().build();
|
||||
}
|
||||
|
||||
public void setPartyDao(PartyDao partyDao) {
|
||||
this.partyDao = partyDao;
|
||||
}
|
||||
|
||||
public void setWebUtil(RegistryWebUtil webUtil) {
|
||||
this.webUtil = webUtil;
|
||||
}
|
||||
|
||||
public void setLcm(LifecycleManagerImpl lcm) {
|
||||
this.lcm = lcm;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,457 +0,0 @@
|
|||
/**
|
||||
* 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.uf.edex.registry.ebxml.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.EmailAddressType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PostalAddressType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RoleType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TelephoneNumberType;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.OrganizationDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.PartyDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.PersonDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.RoleDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
||||
|
||||
/**
|
||||
* Class used to get registry information for displaying information on the Data
|
||||
* Delivery Registry Admin Web Page
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/30/2012 724 bphillip Initial creation
|
||||
* 3/13/2013 1082 bphillip Made transaction and modified to use spring injection
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1.0
|
||||
*/
|
||||
@Transactional
|
||||
public class RegistryWebAdmin {
|
||||
|
||||
/** Static list of role types */
|
||||
private static final String[] ROLE_TYPES = new String[] {
|
||||
"RegistryAdministrator", "RegistryLocalAdministrator",
|
||||
"RegistryUser", "RegistryGuest" };
|
||||
|
||||
private PartyDao partyDao;
|
||||
|
||||
private ClassificationNodeDao classificationNodeDao;
|
||||
|
||||
private OrganizationDao organizationDao;
|
||||
|
||||
private PersonDao personDao;
|
||||
|
||||
private RoleDao roleDao;
|
||||
|
||||
/**
|
||||
* Gets the array of address types from the registry
|
||||
*
|
||||
* @return The array of address types from the registry
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String[] getAddressTypes() throws EbxmlRegistryException {
|
||||
List<String> result = classificationNodeDao.getAddressTypes();
|
||||
return result.toArray(new String[result.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the array of telephone number types from the registry
|
||||
*
|
||||
* @return The array of telephone number types from the registry
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String[] getTelephoneTypes() throws EbxmlRegistryException {
|
||||
List<String> result = classificationNodeDao.getTelephoneTypes();
|
||||
return result.toArray(new String[result.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the array of email address types from the registry
|
||||
*
|
||||
* @return The array of email address types from the registry
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String[] getEmailTypes() throws EbxmlRegistryException {
|
||||
List<String> result = classificationNodeDao.getEmailTypes();
|
||||
return result.toArray(new String[result.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the static list of role types
|
||||
*
|
||||
* @return The static list of role types
|
||||
*/
|
||||
public String[] getRoleTypes() {
|
||||
return ROLE_TYPES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets organization names for names matching the provided search criteria
|
||||
*
|
||||
* @param name
|
||||
* The name (may be a partial name) of the organization to search
|
||||
* for
|
||||
* @return The list of organization names matching the given search criteria
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String[] getOrganizationNames(String name)
|
||||
throws EbxmlRegistryException {
|
||||
List<OrganizationType> orgs = organizationDao
|
||||
.getOrganizationByName(name);
|
||||
List<String> retVal = new ArrayList<String>(orgs.size());
|
||||
for (OrganizationType org : orgs) {
|
||||
retVal.add(org.getId());
|
||||
}
|
||||
return retVal.toArray(new String[retVal.size()]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTML formatted table with the details for the given organization
|
||||
*
|
||||
* @param name
|
||||
* The name of the organization to get details for
|
||||
* @return The HTML formatted table with the details of the given
|
||||
* organization
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String getOrganization(String name) throws EbxmlRegistryException {
|
||||
// Instantiate the necessary data access objects
|
||||
StringBuffer retVal = new StringBuffer(1024);
|
||||
|
||||
// Query the organization table for matching organization names
|
||||
List<OrganizationType> orgs = organizationDao
|
||||
.getOrganizationByName(name);
|
||||
if (orgs.size() == 1) {
|
||||
retVal.append("<b>" + orgs.size() + " Match</b>");
|
||||
} else {
|
||||
retVal.append("<b>" + orgs.size() + " Matches</b>");
|
||||
}
|
||||
|
||||
retVal.append("<table>");
|
||||
retVal.append("<tr>");
|
||||
retVal.append("<th>ID</th>");
|
||||
retVal.append("<th>Name</th>");
|
||||
retVal.append("<th>Local Admin</th>");
|
||||
retVal.append("<th>Users</th>");
|
||||
retVal.append("</tr>");
|
||||
|
||||
/*
|
||||
* Loop over the returned organizations and fill in the table rows
|
||||
*/
|
||||
for (OrganizationType org : orgs) {
|
||||
String primaryContactId = org.getPrimaryContact();
|
||||
PersonType primaryContact = personDao.getById(primaryContactId);
|
||||
String pcString = "";
|
||||
if (primaryContact != null) {
|
||||
pcString = "<a id=\"" + primaryContactId
|
||||
+ "\" onclick=\"getUserDetails(" + "'"
|
||||
+ primaryContactId + "'" + ")\">"
|
||||
+ primaryContact.getPersonName().getFirstName() + " "
|
||||
+ primaryContact.getPersonName().getLastName() + "</a>";
|
||||
}
|
||||
|
||||
String orgId = org.getId();
|
||||
retVal.append("<tr>");
|
||||
retVal.append("<td>")
|
||||
.append("<a id=\"" + orgId
|
||||
+ "\" onclick=\"getOrgDetails(this.id)\">" + orgId
|
||||
+ "</a>").append("</td>");
|
||||
retVal.append("<td>")
|
||||
.append(org.getName().getLocalizedString().get(0)
|
||||
.getValue()).append("</td>");
|
||||
retVal.append("<td>").append(pcString).append("</td>");
|
||||
|
||||
List<PersonType> users = personDao
|
||||
.getEmployeesOfOrganization(orgId);
|
||||
retVal.append("<td style=\"word-wrap: break-word\">");
|
||||
for (int i = 0; i < users.size(); i++) {
|
||||
|
||||
retVal.append("<a id=\"" + orgId
|
||||
+ "\" onclick=\"getUserDetails(" + "'"
|
||||
+ users.get(i).getId() + "'" + ")\">"
|
||||
+ users.get(i).getPersonName().getFirstName() + " "
|
||||
+ users.get(i).getPersonName().getLastName() + "</a>");
|
||||
if (i != users.size() - 1) {
|
||||
retVal.append(", ");
|
||||
}
|
||||
}
|
||||
|
||||
retVal.append("</td>").append("</tr>");
|
||||
}
|
||||
retVal.append("</table>");
|
||||
|
||||
return retVal.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTML formatted table with details for the given user name
|
||||
*
|
||||
* @param firstName
|
||||
* The first name of the user to search for
|
||||
* @param lastName
|
||||
* The last name of the user to search for
|
||||
* @return The HTML formatted table with the details for the given user name
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String getUser(String firstName, String lastName)
|
||||
throws EbxmlRegistryException {
|
||||
|
||||
// Instantiate the necessary data access objects
|
||||
StringBuffer retVal = new StringBuffer(1024);
|
||||
|
||||
// Query for users matching the given search criteria
|
||||
List<PersonType> users = personDao.getByFirstAndLastName(firstName,
|
||||
lastName);
|
||||
for (int i = 0; i < users.size(); i++) {
|
||||
if (users.get(i).getId().equals(RegistryUtil.DEFAULT_OWNER)) {
|
||||
users.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (users.size() == 1) {
|
||||
retVal.append("<b>" + users.size() + " Match</b>");
|
||||
} else {
|
||||
retVal.append("<b>" + users.size() + " Matches</b>");
|
||||
}
|
||||
retVal.append("<table>");
|
||||
retVal.append("<tr>");
|
||||
retVal.append("<th>ID</th>");
|
||||
retVal.append("<th>Name</th>");
|
||||
retVal.append("<th>Organization</th>");
|
||||
retVal.append("<th>Role</th>");
|
||||
retVal.append("</tr>");
|
||||
|
||||
/*
|
||||
* Loop over the returned users and populate the table
|
||||
*/
|
||||
for (PersonType user : users) {
|
||||
String userId = user.getId();
|
||||
OrganizationType userOrg = organizationDao
|
||||
.getOrganizationForUser(userId);
|
||||
RoleType userRole = roleDao.getUserRole(userId);
|
||||
retVal.append("<tr>");
|
||||
retVal.append("<td>")
|
||||
.append("<a id=\"" + userId
|
||||
+ "\" onclick=\"getUserDetails(this.id)\">"
|
||||
+ userId + "</a>").append("</td>");
|
||||
retVal.append("<td>")
|
||||
.append(user.getPersonName().getFirstName() + " "
|
||||
+ user.getPersonName().getLastName())
|
||||
.append("</td>");
|
||||
if (userOrg == null) {
|
||||
retVal.append("<td></td>");
|
||||
} else {
|
||||
retVal.append("<td>")
|
||||
.append("<a id=\"" + userOrg.getId() + userId
|
||||
+ "\" onclick=\"getOrgDetails('"
|
||||
+ userOrg.getId() + "')\">" + userOrg.getId()
|
||||
+ "</a>").append("</td>");
|
||||
}
|
||||
if (userRole == null) {
|
||||
retVal.append("<td></td>");
|
||||
} else {
|
||||
retVal.append("<td>").append(userRole.getId()).append("</td>");
|
||||
}
|
||||
retVal.append("</tr>");
|
||||
}
|
||||
retVal.append("</table>");
|
||||
|
||||
return retVal.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the details of a party(user or organization) to populate the web form
|
||||
*
|
||||
* @param objId
|
||||
* The id of the party to get information for
|
||||
* @return The details of the party as a property map in string format
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String getPartyDetails(String objId) throws EbxmlRegistryException {
|
||||
/*
|
||||
* Spaces need to be converted from the hex value to the actual space
|
||||
* character
|
||||
*/
|
||||
objId = objId.replaceAll("%20", " ");
|
||||
Map<String, String> propMap = new HashMap<String, String>();
|
||||
|
||||
PartyType party = partyDao.getById(objId);
|
||||
|
||||
if (party == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
propMap.put(WebFields.ID.field(), party.getId());
|
||||
if (party instanceof PersonType) {
|
||||
propMap.put(WebFields.FIRST_NAME.field(), ((PersonType) party)
|
||||
.getPersonName().getFirstName());
|
||||
propMap.put(WebFields.MIDDLE_NAME.field(), ((PersonType) party)
|
||||
.getPersonName().getMiddleName());
|
||||
propMap.put(WebFields.LAST_NAME.field(), ((PersonType) party)
|
||||
.getPersonName().getLastName());
|
||||
OrganizationType userOrg = organizationDao
|
||||
.getOrganizationForUser(party.getId());
|
||||
String orgId = "";
|
||||
if (userOrg != null) {
|
||||
orgId = userOrg.getId();
|
||||
}
|
||||
RoleType role = roleDao.getUserRole(party.getId());
|
||||
String roleId = "";
|
||||
if (role != null) {
|
||||
roleId = role.getId();
|
||||
}
|
||||
propMap.put(WebFields.USER_ORG.field(), orgId);
|
||||
propMap.put(WebFields.USER_ROLE.field(), roleId);
|
||||
} else if (party instanceof OrganizationType) {
|
||||
propMap.put(WebFields.ORGANIZATION_NAME.field(), party.getName()
|
||||
.getLocalizedString().get(0).getValue());
|
||||
PersonType primaryContact = personDao
|
||||
.getById(((OrganizationType) party).getPrimaryContact());
|
||||
if (primaryContact == null) {
|
||||
propMap.put(WebFields.PRIMARY_CONTACT.field(), "Not Specified");
|
||||
} else {
|
||||
propMap.put(WebFields.PRIMARY_CONTACT.field(), "<a id=\""
|
||||
+ primaryContact.getId()
|
||||
+ "\" onclick=\"getUserDetails(this.id)\">"
|
||||
+ primaryContact.getPersonName().getLastName() + ", "
|
||||
+ primaryContact.getPersonName().getFirstName()
|
||||
+ "</a>");
|
||||
}
|
||||
}
|
||||
|
||||
if (!party.getPostalAddress().isEmpty()) {
|
||||
PostalAddressType addr = party.getPostalAddress().get(0);
|
||||
propMap.put(WebFields.ADDRESS_TYPE.field(),
|
||||
classificationNodeDao.getCodeFromNode(addr.getType()));
|
||||
propMap.put(WebFields.ADDRESS_1.field(), addr.getStreet());
|
||||
propMap.put(WebFields.ADDRESS_2.field(), addr.getStreetNumber());
|
||||
propMap.put(WebFields.CITY.field(), addr.getCity());
|
||||
propMap.put(WebFields.STATE.field(), addr.getStateOrProvince());
|
||||
propMap.put(WebFields.COUNTRY.field(), addr.getCountry());
|
||||
propMap.put(WebFields.POSTAL_CODE.field(), addr.getPostalCode());
|
||||
}
|
||||
|
||||
if (!party.getTelephoneNumber().isEmpty()) {
|
||||
TelephoneNumberType phone = party.getTelephoneNumber().get(0);
|
||||
propMap.put(WebFields.TELEPHONE_TYPE.field(),
|
||||
classificationNodeDao.getCodeFromNode(phone.getType()));
|
||||
propMap.put(WebFields.AREA_CODE.field(), phone.getAreaCode());
|
||||
|
||||
if (phone.getNumber().length() == 7) {
|
||||
propMap.put(WebFields.PHONE_1.field(), phone.getNumber()
|
||||
.substring(0, 3));
|
||||
propMap.put(WebFields.PHONE_2.field(), phone.getNumber()
|
||||
.substring(3));
|
||||
}
|
||||
propMap.put(WebFields.EXTENSION.field(), phone.getExtension());
|
||||
}
|
||||
|
||||
if (!party.getEmailAddress().isEmpty()) {
|
||||
EmailAddressType email = party.getEmailAddress().get(0);
|
||||
propMap.put(WebFields.EMAIL_TYPE.field(),
|
||||
classificationNodeDao.getCodeFromNode(email.getType()));
|
||||
propMap.put(WebFields.EMAIL.field(), email.getAddress());
|
||||
}
|
||||
|
||||
return mapToString(propMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the array of ids associated with users. This function is used to
|
||||
* list the members of a given organization
|
||||
*
|
||||
* @return The array of user ids and names
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database access
|
||||
*/
|
||||
public String[] getUserIdsAndNames() throws EbxmlRegistryException {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object[]> allUsers = (List<Object[]>) personDao.getAllUserNames();
|
||||
List<String> retVal = new ArrayList<String>(allUsers.size());
|
||||
for (Object[] userInfo : allUsers) {
|
||||
for (Object obj : userInfo) {
|
||||
retVal.add(obj.toString());
|
||||
}
|
||||
}
|
||||
return retVal.toArray(new String[] {});
|
||||
}
|
||||
|
||||
public String mapToString(Map<String, String> map) {
|
||||
StringBuffer retVal = new StringBuffer();
|
||||
int idx = 0;
|
||||
for (String key : map.keySet()) {
|
||||
retVal.append(key).append("===").append(map.get(key));
|
||||
if (idx != map.size() - 1) {
|
||||
retVal.append("_____");
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
return retVal.toString();
|
||||
}
|
||||
|
||||
public void setPartyDao(PartyDao partyDao) {
|
||||
this.partyDao = partyDao;
|
||||
}
|
||||
|
||||
public void setClassificationNodeDao(
|
||||
ClassificationNodeDao classificationNodeDao) {
|
||||
this.classificationNodeDao = classificationNodeDao;
|
||||
}
|
||||
|
||||
public void setOrganizationDao(OrganizationDao organizationDao) {
|
||||
this.organizationDao = organizationDao;
|
||||
}
|
||||
|
||||
public void setPersonDao(PersonDao personDao) {
|
||||
this.personDao = personDao;
|
||||
}
|
||||
|
||||
public void setRoleDao(RoleDao roleDao) {
|
||||
this.roleDao = roleDao;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,554 +0,0 @@
|
|||
/**
|
||||
* 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.uf.edex.registry.ebxml.web;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.Mode;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.RemoveObjectsRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.EmailAddressType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PartyType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonNameType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PostalAddressType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TelephoneNumberType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryExceptionType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType;
|
||||
|
||||
import com.raytheon.uf.common.registry.constants.AssociationTypes;
|
||||
import com.raytheon.uf.common.registry.constants.RegistryObjectTypes;
|
||||
import com.raytheon.uf.common.registry.constants.StatusTypes;
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.AssociationDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.OrganizationDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.PersonDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
||||
import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl;
|
||||
import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
||||
|
||||
/**
|
||||
* Utility class used to modify parties in the registry
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/30/2012 724 bphillip Initial creation
|
||||
* 3/13/2013 1082 bphillip Modified to use spring injection
|
||||
* Apr 23, 2013 1910 djohnson RegistryResponseStatus is now an enum.
|
||||
* Mar 31, 2014 2889 dhladky Added username for notification center tracking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1.0
|
||||
*/
|
||||
public class RegistryWebUtil {
|
||||
|
||||
private LifecycleManagerImpl lcm;
|
||||
|
||||
private ClassificationNodeDao classificationNodeDao;
|
||||
|
||||
private PersonDao personDao;
|
||||
|
||||
/**
|
||||
* Creates a party (user or organization) based on parameters contained in
|
||||
* the servlet request
|
||||
*
|
||||
* @param request
|
||||
* The servlet request object
|
||||
* @return The registry submit object request
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during registry interaction
|
||||
*/
|
||||
public SubmitObjectsRequest createParty(HttpServletRequest request)
|
||||
throws EbxmlRegistryException {
|
||||
|
||||
List<RegistryObjectType> objectList = new ArrayList<RegistryObjectType>();
|
||||
|
||||
String partyId = request.getParameter("id");
|
||||
PartyType party = null;
|
||||
|
||||
// Creating a user object
|
||||
if (request.getParameter(WebFields.OBJ_TYPE.fieldName()).equals("User")) {
|
||||
String employer = request.getParameter(WebFields.USER_ORG
|
||||
.fieldName());
|
||||
String roleName = request.getParameter(WebFields.USER_ROLE
|
||||
.fieldName());
|
||||
party = new PersonType();
|
||||
|
||||
/*
|
||||
* Assign the person name to the person
|
||||
*/
|
||||
PersonNameType personName = new PersonNameType();
|
||||
personName.setFirstName(request.getParameter(WebFields.FIRST_NAME
|
||||
.fieldName()));
|
||||
if (request.getParameter(WebFields.MIDDLE_NAME.fieldName()) == null) {
|
||||
personName.setMiddleName("");
|
||||
} else {
|
||||
personName.setMiddleName(request
|
||||
.getParameter(WebFields.MIDDLE_NAME.fieldName()));
|
||||
}
|
||||
personName.setLastName(request.getParameter(WebFields.LAST_NAME
|
||||
.fieldName()));
|
||||
((PersonType) party).setPersonName(personName);
|
||||
party.setLid(partyId);
|
||||
party.setOwner(RegistryUtil.DEFAULT_OWNER);
|
||||
party.setStatus(StatusTypes.APPROVED);
|
||||
party.setName(RegistryUtil.getInternationalString("User "
|
||||
+ personName.getFirstName() + " "
|
||||
+ personName.getMiddleName() + " "
|
||||
+ personName.getLastName()));
|
||||
party.setDescription(RegistryUtil
|
||||
.getInternationalString("Profile description for user "
|
||||
+ personName.getFirstName() + " "
|
||||
+ personName.getMiddleName() + " "
|
||||
+ personName.getLastName()));
|
||||
party.setObjectType(RegistryObjectTypes.PERSON);
|
||||
|
||||
/* Create an association to the organization if specified */
|
||||
if (!employer.trim().isEmpty()) {
|
||||
objectList.add(createEmployeeOfAssociation(partyId, employer));
|
||||
}
|
||||
|
||||
/* Create an association to the role if specified */
|
||||
if (!roleName.trim().isEmpty()) {
|
||||
objectList.add(createHasRoleAssociation(partyId, roleName));
|
||||
}
|
||||
|
||||
}
|
||||
// Creating an organization
|
||||
else {
|
||||
party = new OrganizationType();
|
||||
party.setLid(partyId);
|
||||
party.setOwner(RegistryUtil.DEFAULT_OWNER);
|
||||
party.setStatus(StatusTypes.APPROVED);
|
||||
party.setName(RegistryUtil.getInternationalString(request
|
||||
.getParameter(WebFields.ORGANIZATION_NAME.fieldName())));
|
||||
String primaryContactStr = request
|
||||
.getParameter(WebFields.PRIMARY_CONTACT.fieldName());
|
||||
|
||||
// Setting the primary contact name
|
||||
if (!primaryContactStr.equals("Not Specified")
|
||||
&& !primaryContactStr.isEmpty()) {
|
||||
String[] nameTokens = primaryContactStr.split(", ");
|
||||
((OrganizationType) party).setPrimaryContact(personDao
|
||||
.getByFirstAndLastName(nameTokens[1], nameTokens[0])
|
||||
.get(0).getId());
|
||||
}
|
||||
|
||||
party.setDescription(RegistryUtil
|
||||
.getInternationalString("Profile description for organization "
|
||||
+ partyId));
|
||||
party.setObjectType(RegistryObjectTypes.ORGANIZATION);
|
||||
}
|
||||
|
||||
// Assign the postal address
|
||||
PostalAddressType address = new PostalAddressType();
|
||||
address.setType(classificationNodeDao.getNodeFromCode(request
|
||||
.getParameter(WebFields.ADDRESS_TYPE.fieldName())));
|
||||
address.setStreet(request.getParameter(WebFields.ADDRESS_1.fieldName()));
|
||||
address.setStreetNumber(request.getParameter(WebFields.ADDRESS_2
|
||||
.fieldName()));
|
||||
address.setCity(request.getParameter(WebFields.CITY.fieldName()));
|
||||
address.setCountry(request.getParameter(WebFields.COUNTRY.fieldName()));
|
||||
address.setStateOrProvince(request.getParameter(WebFields.STATE
|
||||
.fieldName()));
|
||||
address.setPostalCode(request.getParameter(WebFields.POSTAL_CODE
|
||||
.fieldName()));
|
||||
party.getPostalAddress().add(address);
|
||||
|
||||
// Assign the telephone number
|
||||
TelephoneNumberType phone = new TelephoneNumberType();
|
||||
phone.setType(classificationNodeDao.getNodeFromCode(request
|
||||
.getParameter(WebFields.TELEPHONE_TYPE.fieldName())));
|
||||
phone.setAreaCode(request.getParameter(WebFields.AREA_CODE.fieldName()));
|
||||
phone.setNumber(request.getParameter(WebFields.PHONE_1.fieldName())
|
||||
+ request.getParameter(WebFields.PHONE_2.fieldName()));
|
||||
phone.setExtension(request.getParameter(WebFields.EXTENSION.fieldName()));
|
||||
party.getTelephoneNumber().add(phone);
|
||||
|
||||
// Assign the email address
|
||||
EmailAddressType email = new EmailAddressType();
|
||||
email.setType(classificationNodeDao.getNodeFromCode(request
|
||||
.getParameter(WebFields.EMAIL_TYPE.fieldName())));
|
||||
email.setAddress(request.getParameter(WebFields.EMAIL.fieldName()));
|
||||
party.getEmailAddress().add(email);
|
||||
|
||||
party.setId(partyId);
|
||||
objectList.add(party);
|
||||
return getSubmitRequest(objectList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an association from a user to an organization
|
||||
*
|
||||
* @param user
|
||||
* The user (The source of the association)
|
||||
* @param organization
|
||||
* The organization (The target of the association)
|
||||
* @return The association object
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database interaction
|
||||
*/
|
||||
private AssociationType createEmployeeOfAssociation(String user,
|
||||
String organization) throws EbxmlRegistryException {
|
||||
|
||||
AssociationType association = new AssociationType();
|
||||
association.setId(EbxmlObjectUtil.getUUID());
|
||||
association.setLid(association.getId());
|
||||
association.setName(RegistryUtil.getInternationalString(user + "-->"
|
||||
+ organization));
|
||||
association.setDescription(RegistryUtil.getInternationalString(user
|
||||
+ " is an employee of " + organization));
|
||||
association.setStatus(StatusTypes.APPROVED);
|
||||
association.setOwner(RegistryUtil.DEFAULT_OWNER);
|
||||
association.setObjectType(RegistryObjectTypes.ASSOCIATION);
|
||||
association.setSourceObject(user);
|
||||
association.setTargetObject(organization);
|
||||
association.setType(AssociationTypes.EMPLOYEE_OF);
|
||||
return association;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an association from a user to a role
|
||||
*
|
||||
* @param user
|
||||
* The user (The source of the association)
|
||||
* @param roleName
|
||||
* The role (The target of the association)
|
||||
* @return The association object
|
||||
*/
|
||||
private AssociationType createHasRoleAssociation(String user,
|
||||
String roleName) {
|
||||
AssociationType association = new AssociationType();
|
||||
association.setId(EbxmlObjectUtil.getUUID());
|
||||
association.setLid(association.getId());
|
||||
association.setName(RegistryUtil.getInternationalString(user + "-->"
|
||||
+ roleName));
|
||||
association.setDescription(RegistryUtil.getInternationalString(user
|
||||
+ " has role of " + roleName));
|
||||
association.setStatus(StatusTypes.APPROVED);
|
||||
association.setOwner(RegistryUtil.DEFAULT_OWNER);
|
||||
association.setObjectType(RegistryObjectTypes.ASSOCIATION);
|
||||
association.setSourceObject(user);
|
||||
association.setTargetObject(roleName);
|
||||
association.setType(AssociationTypes.HAS_ROLE);
|
||||
return association;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a successful response back the servlet requester
|
||||
*
|
||||
* @param request
|
||||
* The servlet request
|
||||
* @param response
|
||||
* The servlet response
|
||||
* @param responsePage
|
||||
* The page to display
|
||||
* @param userId
|
||||
* The requester's user ID
|
||||
* @param partyType
|
||||
* The type of party
|
||||
* @throws ServletException
|
||||
* If an error occurs while sending the response back
|
||||
* @throws IOException
|
||||
* If the message cannot be forwarded
|
||||
*/
|
||||
public void sendSuccessResponse(HttpServletRequest request,
|
||||
HttpServletResponse response, String responsePage, String userId,
|
||||
String partyType) throws ServletException, IOException {
|
||||
request.setAttribute("partyType", partyType);
|
||||
request.setAttribute("userId", userId);
|
||||
request.getRequestDispatcher("/response/" + responsePage + ".jsp")
|
||||
.forward(request, response);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an error response back to the servlet requester
|
||||
*
|
||||
* @param request
|
||||
* The servlet request
|
||||
* @param response
|
||||
* The servlet response
|
||||
* @param responsePage
|
||||
* The page to display
|
||||
* @param userId
|
||||
* The requester's user ID
|
||||
* @param partyType
|
||||
* The type of the party
|
||||
* @param cause
|
||||
* The cause of the error
|
||||
* @throws ServletException
|
||||
* If an error occurs while sending the response back
|
||||
* @throws IOException
|
||||
* If the message cannot be forwarded
|
||||
*/
|
||||
public void sendErrorResponse(HttpServletRequest request,
|
||||
HttpServletResponse response, String responsePage, String userId,
|
||||
String partyType, String cause) throws ServletException,
|
||||
IOException {
|
||||
request.setAttribute("partyType", partyType);
|
||||
request.setAttribute("userId", userId);
|
||||
request.setAttribute("cause", cause);
|
||||
request.getRequestDispatcher("/response/" + responsePage + ".jsp")
|
||||
.forward(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all associations to and from a given party
|
||||
*
|
||||
* @param party
|
||||
* The party for which to remove associations to and from
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database interaction
|
||||
* @throws MsgRegistryException
|
||||
* If errors occur when submitting the remove object request
|
||||
*/
|
||||
public void removeAssociations(PartyType party)
|
||||
throws EbxmlRegistryException, MsgRegistryException {
|
||||
AssociationDao associationDao = new AssociationDao();
|
||||
List<AssociationType> associations = associationDao
|
||||
.getAllAssociations(party.getId());
|
||||
if (!associations.isEmpty()) {
|
||||
RemoveObjectsRequest removeRequest = getRemoveRequest(associations);
|
||||
lcm.removeObjects(removeRequest);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes associations with the source specified as the given party
|
||||
*
|
||||
* @param party
|
||||
* The source of the associations to remove
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database interaction
|
||||
* @throws MsgRegistryException
|
||||
* If errors occur when submitting the remove object request
|
||||
*/
|
||||
public void removeAssociationsFrom(PartyType party)
|
||||
throws EbxmlRegistryException, MsgRegistryException {
|
||||
AssociationDao associationDao = new AssociationDao();
|
||||
List<AssociationType> associations = associationDao
|
||||
.getAssociationsFrom(party.getId());
|
||||
if (!associations.isEmpty()) {
|
||||
RemoveObjectsRequest removeRequest = getRemoveRequest(associations);
|
||||
lcm.removeObjects(removeRequest);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes associations with the target specified as the given party
|
||||
*
|
||||
* @param party
|
||||
* The target of the associations to remove
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database interaction
|
||||
* @throws MsgRegistryException
|
||||
* If errors occur when submitting the remove object request
|
||||
*/
|
||||
public void removeAssociationsTo(PartyType party)
|
||||
throws EbxmlRegistryException, MsgRegistryException {
|
||||
AssociationDao associationDao = new AssociationDao();
|
||||
List<AssociationType> associations = associationDao
|
||||
.getAssociationsTo(party.getId());
|
||||
if (!associations.isEmpty()) {
|
||||
RemoveObjectsRequest removeRequest = getRemoveRequest(associations);
|
||||
lcm.removeObjects(removeRequest);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the primary contact information for a given request
|
||||
*
|
||||
* @param request
|
||||
* The servlet request
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database interaction
|
||||
*/
|
||||
public void updatePC(HttpServletRequest request)
|
||||
throws EbxmlRegistryException {
|
||||
if (request.getParameter(WebFields.OBJ_TYPE.fieldName()).equals("User")) {
|
||||
String user = request.getParameter(WebFields.ID.fieldName());
|
||||
String orgName = request.getParameter(WebFields.USER_ORG
|
||||
.fieldName());
|
||||
String roleName = request.getParameter(WebFields.USER_ROLE
|
||||
.fieldName());
|
||||
OrganizationDao orgDao = new OrganizationDao();
|
||||
OrganizationType org = orgDao.getOrganizationByName(orgName).get(0);
|
||||
String currentPrimaryContact = org.getPrimaryContact();
|
||||
boolean update = false;
|
||||
if (currentPrimaryContact == null
|
||||
|| roleName.equals("RegistryLocalAdministrator")) {
|
||||
org.setPrimaryContact(user);
|
||||
update = true;
|
||||
} else if (currentPrimaryContact.equals(user)) {
|
||||
org.setPrimaryContact(null);
|
||||
update = true;
|
||||
}
|
||||
if (update) {
|
||||
orgDao.createOrUpdate(org);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a party from the registry
|
||||
*
|
||||
* @param party
|
||||
* The party to delete
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur during database interaction
|
||||
* @throws MsgRegistryException
|
||||
* If errors occur when submitting the remove objects request
|
||||
*/
|
||||
public void removeParty(PartyType party) throws EbxmlRegistryException,
|
||||
MsgRegistryException {
|
||||
|
||||
RemoveObjectsRequest request = getRemoveRequest(party);
|
||||
RegistryResponseType response = lcm.removeObjects(request);
|
||||
if (!response.getStatus().equals(RegistryResponseStatus.SUCCESS)) {
|
||||
StringBuilder exceptionText = new StringBuilder();
|
||||
exceptionText.append("Remove Objects Failed:\n");
|
||||
for (RegistryExceptionType exception : response.getException()) {
|
||||
exceptionText.append("Exception: ")
|
||||
.append(exception.getMessage()).append(":")
|
||||
.append(exception.getDetail()).append("\n");
|
||||
throw new EbxmlRegistryException(exceptionText.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a submit object request to be submitted to the
|
||||
* LifecycleManager with the given objects as the payload
|
||||
*
|
||||
* @param <T>
|
||||
* RegistryObjectType
|
||||
* @param obj
|
||||
* The object to be submitted to the registry
|
||||
* @return The submit object request
|
||||
*/
|
||||
public <T extends RegistryObjectType> SubmitObjectsRequest getSubmitRequest(
|
||||
T obj) {
|
||||
List<RegistryObjectType> objs = new ArrayList<RegistryObjectType>();
|
||||
objs.add(obj);
|
||||
return getSubmitRequest(objs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a submit object request to be submitted to the
|
||||
* LifecycleManager with the given objects as the payload
|
||||
*
|
||||
* @param <T>
|
||||
* RegistryObjectType
|
||||
* @param objs
|
||||
* The objects to be submitted to the registry
|
||||
* @return The submit object request
|
||||
*/
|
||||
public <T extends RegistryObjectType> SubmitObjectsRequest getSubmitRequest(
|
||||
List<T> objs) {
|
||||
SubmitObjectsRequest submitRequest = new SubmitObjectsRequest();
|
||||
submitRequest.setComment("Object submission");
|
||||
submitRequest.setCheckReferences(false);
|
||||
submitRequest.setMode(Mode.CREATE_OR_REPLACE);
|
||||
submitRequest.setUsername(RegistryUtil.registryUser);
|
||||
submitRequest.setId("User/Organization Profiles and Roles");
|
||||
|
||||
submitRequest.setRegistryObjectList(EbxmlObjectUtil
|
||||
.createRegistryObjectList(objs));
|
||||
return submitRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a remove object request to be submitted to the
|
||||
* LifecycleManager with the given object as the payload
|
||||
*
|
||||
* @param <T>
|
||||
* RegistryObjectType
|
||||
* @param obj
|
||||
* The object to be removed from the registry
|
||||
* @return The RemoveObjectRequest object
|
||||
*/
|
||||
public <T extends RegistryObjectType> RemoveObjectsRequest getRemoveRequest(
|
||||
T obj) {
|
||||
List<RegistryObjectType> objs = new ArrayList<RegistryObjectType>(1);
|
||||
objs.add(obj);
|
||||
return getRemoveRequest(objs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a remove object request to be submitted to the
|
||||
* LifecycleManager with the given objects as the payload
|
||||
*
|
||||
* @param <T>
|
||||
* RegistryObjectType
|
||||
* @param objs
|
||||
* The objects to be removed from the registry
|
||||
* @return The RemoveObjectRequest object
|
||||
*/
|
||||
public <T extends RegistryObjectType> RemoveObjectsRequest getRemoveRequest(
|
||||
List<T> objs) {
|
||||
StringBuilder comment = new StringBuilder(objs.size() * 38);
|
||||
comment.append("Removing objects: ");
|
||||
for (RegistryObjectType regObj : objs) {
|
||||
comment.append("[");
|
||||
comment.append(regObj.getId());
|
||||
comment.append("] ");
|
||||
}
|
||||
RemoveObjectsRequest request = new RemoveObjectsRequest();
|
||||
request.setId(EbxmlObjectUtil.getUUID());
|
||||
request.setComment(comment.toString());
|
||||
request.setObjectRefList(EbxmlObjectUtil.createObjectRefList(objs));
|
||||
return request;
|
||||
|
||||
}
|
||||
|
||||
public void setLcm(LifecycleManagerImpl lcm) {
|
||||
this.lcm = lcm;
|
||||
}
|
||||
|
||||
public void setClassificationNodeDao(
|
||||
ClassificationNodeDao classificationNodeDao) {
|
||||
this.classificationNodeDao = classificationNodeDao;
|
||||
}
|
||||
|
||||
public void setPersonDao(PersonDao personDao) {
|
||||
this.personDao = personDao;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,181 +0,0 @@
|
|||
/**
|
||||
* 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.uf.edex.registry.ebxml.web;
|
||||
|
||||
/**
|
||||
* Utility enum class used to defined the fields on the Data Delivery Registry
|
||||
* Web interface pages
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/30/2012 724 bphillip Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum WebFields {
|
||||
|
||||
/** The user ID field */
|
||||
ID("id", TYPE.Text),
|
||||
|
||||
/**
|
||||
* The object type metadata information. Valid values are User and
|
||||
* Organization
|
||||
*/
|
||||
OBJ_TYPE("objType", TYPE.Meta),
|
||||
|
||||
/** The action being performed on the web page */
|
||||
ACTION("action", TYPE.Meta),
|
||||
|
||||
/** The first name field */
|
||||
FIRST_NAME("firstName", TYPE.Text),
|
||||
|
||||
/** The middle name field */
|
||||
MIDDLE_NAME("middlName", TYPE.Text),
|
||||
|
||||
/** The last name field */
|
||||
LAST_NAME("lastName", TYPE.Text),
|
||||
|
||||
/** The user organization field */
|
||||
USER_ORG("userOrg", TYPE.Select),
|
||||
|
||||
/** The organization name field */
|
||||
ORGANIZATION_NAME("organizationName", TYPE.Text),
|
||||
|
||||
/** The user role field */
|
||||
USER_ROLE("userRole", TYPE.Select),
|
||||
|
||||
/** The address type field */
|
||||
ADDRESS_TYPE("addressType", TYPE.Select),
|
||||
|
||||
/** The address 1 field */
|
||||
ADDRESS_1("streetAddress1", TYPE.Text),
|
||||
|
||||
/** The address 2 field */
|
||||
ADDRESS_2("streetAddress2", TYPE.Text),
|
||||
|
||||
/** The city field */
|
||||
CITY("city", TYPE.Text),
|
||||
|
||||
/** The state field */
|
||||
STATE("state", TYPE.Select),
|
||||
|
||||
/** The country field */
|
||||
COUNTRY("country", TYPE.Select),
|
||||
|
||||
/** The postal code field */
|
||||
POSTAL_CODE("postalCode", TYPE.Text),
|
||||
|
||||
/** The telephone type field */
|
||||
TELEPHONE_TYPE("telephoneType", TYPE.Select),
|
||||
|
||||
/** The area code field */
|
||||
AREA_CODE("areaCode", TYPE.Text),
|
||||
|
||||
/** The telephone number prefix field */
|
||||
PHONE_1("phone1", TYPE.Text),
|
||||
|
||||
/** The telephone number suffix field */
|
||||
PHONE_2("phone2", TYPE.Text),
|
||||
|
||||
/** The telephone extension field */
|
||||
EXTENSION("extension", TYPE.Text),
|
||||
|
||||
/** The email type field */
|
||||
EMAIL_TYPE("emailType", TYPE.Select),
|
||||
|
||||
/** The email address field */
|
||||
EMAIL("email", TYPE.Text),
|
||||
|
||||
/** The primary contact field */
|
||||
PRIMARY_CONTACT("primaryContact", TYPE.Span);
|
||||
|
||||
/**
|
||||
* The type of HTML element
|
||||
*
|
||||
* @author bphillip
|
||||
*
|
||||
*/
|
||||
private enum TYPE {
|
||||
/** A text field */
|
||||
Text,
|
||||
|
||||
/** A select box */
|
||||
Select,
|
||||
|
||||
/** An HTML span */
|
||||
Span,
|
||||
|
||||
/** A metadata element not displayed on the web page */
|
||||
Meta
|
||||
}
|
||||
|
||||
/** The name of the field on the web page */
|
||||
private final String fieldName;
|
||||
|
||||
/** The type of the field on the web page */
|
||||
private final TYPE fieldType;
|
||||
|
||||
/**
|
||||
* Constructs a new web field with the given name and type
|
||||
*
|
||||
* @param fieldName
|
||||
* The name of the field
|
||||
* @param fieldType
|
||||
* The type of the field
|
||||
*/
|
||||
WebFields(String fieldName, TYPE fieldType) {
|
||||
this.fieldName = fieldName;
|
||||
this.fieldType = fieldType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the field
|
||||
*
|
||||
* @return The name of the field
|
||||
*/
|
||||
public String fieldName() {
|
||||
return this.fieldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type of the field
|
||||
*
|
||||
* @return The type of the field
|
||||
*/
|
||||
public String fieldType() {
|
||||
return this.fieldType.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name and type of the field concatenated together
|
||||
*
|
||||
* @return The name and type of the field concatenated together
|
||||
*/
|
||||
public String field() {
|
||||
return this.fieldName + fieldType.toString();
|
||||
}
|
||||
}
|
|
@ -1,150 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
a {font-weight:bold;}
|
||||
td {width:270px;}
|
||||
input{width:200px;}
|
||||
table {border:0;}
|
||||
select {width:200px;}
|
||||
</style>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
|
||||
<script type="text/javascript" src='/dwr/engine.js'></script>
|
||||
<script type="text/javascript" src='/dwr/util.js'></script>
|
||||
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
|
||||
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
|
||||
<script type='text/javascript' src='/validateForm.js'></script>
|
||||
<title>Data Delivery Registry Admin: Add New Organization</title>
|
||||
</head>
|
||||
|
||||
<body onLoad="populateFormData('Organization')">
|
||||
|
||||
<span id="titleSpan" style="font-weight:bold; font-size:20pt"></span>
|
||||
<p>
|
||||
<a href="javascript:javascript:history.go(-1)">Back</a>
|
||||
<br>
|
||||
<a href="RegistryOrganizationMenu.html">Organization Search</a>
|
||||
<a href="RegistryUserMenu.html">User Search</a>
|
||||
<hr width="500" align="left"/>
|
||||
<button id="deleteOrgButton" onclick="deleteParty()">Delete Organization</button>
|
||||
<button id="modifyOrgButton" onclick="goToModifyOrg()">Modify Organization</button>
|
||||
<h4>Organization Name</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Organization ID</td>
|
||||
<td><input id="idText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Organization Name</td>
|
||||
<td><input id="organizationNameText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Local Registry Admin</td>
|
||||
<td><span id="primaryContactSpan">Not Specified</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr width="100" align="left"/>
|
||||
<h4>Primary Address</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Address Type</td>
|
||||
<td><select id="addressTypeSelect"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Address 1</td>
|
||||
<td><input id="streetAddress1Text" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Address 2</td>
|
||||
<td><input id="streetAddress2Text" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>City</td>
|
||||
<td><input id="cityText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>State/Province</td>
|
||||
<td><select id="stateSelect"\></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Country</td>
|
||||
<td><select onclick="populateStates('stateSelect')" id="countrySelect"\></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Postal Code</td>
|
||||
<td><input id="postalCodeText" type="text"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr width="100" align="left"/>
|
||||
|
||||
<h4>Primary Telephone</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Telephone Type</td>
|
||||
<td><select id="telephoneTypeSelect"></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Telephone Number</td>
|
||||
<td>(<input id="areaCodeText" type="text" maxlength=3 style='width: 28px;'/>)
|
||||
<input id="phone1Text" type="text" maxlength=3 style='width: 28px;'/>-
|
||||
<input id="phone2Text" type="text" maxlength=4 style='width: 36px;'/>
|
||||
Ext:<input id="extensionText" type="text" maxlength=8 style='width: 70px;'/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr width="100" align="left" />
|
||||
<h4>Primary Email</h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Email Type</td>
|
||||
<td><select id="emailTypeSelect"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email Address</td>
|
||||
<td><input id="emailText" type="text" style='width: 260px;'/>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr width="100" align="left"/>
|
||||
<p>
|
||||
<button id="userActionButton" type="button" onclick="partyAction()"/>
|
||||
</body>
|
||||
|
||||
<script language="JavaScript">
|
||||
/*
|
||||
* The user currently be looked at by this page. Null if none
|
||||
*/
|
||||
self.userId = getUserId();
|
||||
|
||||
/*
|
||||
* The current mode of the page. Valid modes are 'add', 'modify', and 'view'
|
||||
* The add mode is used when adding a new user to the registry
|
||||
* The modify mode is used when modifying a user in the registry
|
||||
* The view mode is used when viewing a user in the registry
|
||||
*/
|
||||
self.mode=getMode()
|
||||
|
||||
RegistryWeb.getUserIdsAndNames(function(users){
|
||||
//clearComboBox("primaryContactSelect");
|
||||
//addOptionToList("primaryContactSelect","","");
|
||||
//for(var i = 0; i < users.length; i+=3){
|
||||
//addOptionToList("primaryContactSelect",users[i+2]+", "+users[i+1]+" ("+users[i]+")", users[i]);
|
||||
//}
|
||||
});
|
||||
|
||||
/*
|
||||
* This function redirects the browser to the registry user interface in the modify mode
|
||||
*/
|
||||
function goToModifyOrg(){
|
||||
window.location="RegistryOrganizationInterface.html?id="+self.userId+"&mode=modify"
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</html>
|
|
@ -1,53 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
a {font-weight:bold;}
|
||||
table{border:3;}
|
||||
td {width:200; background-color:deepskyblue}
|
||||
th {width:200; background-color:aqua; font-size:14pt;}
|
||||
input{width:200;}
|
||||
</style>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
|
||||
<script type="text/javascript" src='/dwr/engine.js'></script>
|
||||
<script type="text/javascript" src='/dwr/util.js'></script>
|
||||
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
|
||||
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
|
||||
<title>Data Delivery Registry Organization Admin</title>
|
||||
</head>
|
||||
<body onload="getOrgs()">
|
||||
<h2>Registry Organization Management Interface</h2>
|
||||
<a href="RegistryUserMenu.html">View Users</a>
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:100; background-color: transparent">Name</td>
|
||||
<td style="width:100; background-color: transparent"> <input type="text" id="nameText" onkeyup="getOrgs()"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<hr width="500" align="left"/>
|
||||
<p>
|
||||
<button type="button" id="newOrgButton" onclick="location.href='RegistryOrganizationInterface.html?mode=add'">Add New Organization</button>
|
||||
<hr width="500" align="left"/>
|
||||
<p>
|
||||
<span id="resultsSpan"></span>
|
||||
</body>
|
||||
|
||||
<script language="JavaScript">
|
||||
function getOrgs() {
|
||||
var name=getElementValue("nameText");
|
||||
RegistryWeb.getOrganization(name,function(output){self.updateResults(output);});
|
||||
}
|
||||
|
||||
function updateResults(result){
|
||||
document.getElementById("resultsSpan").innerHTML = result;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
|
@ -1,136 +0,0 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<style type="text/css">
|
||||
a {font-weight:bold;}
|
||||
td {width:200px;}
|
||||
button {width:190px;}
|
||||
input{width:300px;}
|
||||
table {border:0;}
|
||||
select {width:200px;}
|
||||
body { font-family: Helvetica;
|
||||
margin-left: 75px;
|
||||
margin-right: 75px;
|
||||
background: #D3D3D3;}
|
||||
</style>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<script type="text/javascript" src='/dwr/engine.js'></script>
|
||||
<script type="text/javascript" src='/dwr/util.js'></script>
|
||||
<title>Backup/Restore Subscriptions</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>Backup/Restore Data Delivery Subscriptions</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="backupSubscriptionButton" onClick="backupSubscription()" >Backup Subscription</button>
|
||||
</td>
|
||||
<td>
|
||||
<input id="backupSubscriptionText" type="text"/></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="backupAllSubscriptionsButton" onClick="backupAllSubscriptions()">Backup All Subscriptions</button>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="restoreSubscriptionButton" onClick="restoreSubscription()" >Restore Subscription</button>
|
||||
</td>
|
||||
<td>
|
||||
<input id="restoreSubscriptionText" type="text"/></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="restoreSubscriptionsButton" onClick="restoreSubscriptions()">Restore Subscriptions</button>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="viewSubscriptionsButton" onClick="viewSubscriptions()">View Subscriptions</button>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="clearBackedUpSubscriptionsButton" onClick="clearBackupDir()">Clear Backup Files</button>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<p>
|
||||
<div id="statusSpan" style="font-weight:bold; font-size:8pt"></span>
|
||||
<br>
|
||||
</body>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function clearBackupDir(){
|
||||
updateStatus("Clearing backup files...")
|
||||
updateStatus(callRESTService("clearSubscriptionBackupFiles"))
|
||||
}
|
||||
|
||||
function viewSubscriptions(){
|
||||
updateStatus("Retrieving Subscriptions...")
|
||||
updateStatus(callRESTService("getSubscriptions"))
|
||||
}
|
||||
|
||||
function restoreSubscription(){
|
||||
subscription = document.getElementById("restoreSubscriptionText").value
|
||||
if(subscription){
|
||||
updateStatus("Restoring subscription: ["+subscription+"]...")
|
||||
updateStatus(callRESTService("restoreSubscription/"+subscription))
|
||||
}else{
|
||||
updateStatus("Please input a subscription name to be restored")
|
||||
}
|
||||
}
|
||||
|
||||
function restoreSubscriptions(){
|
||||
updateStatus("Restoring Subscriptions...")
|
||||
updateStatus(callRESTService("restoreSubscriptions"))
|
||||
}
|
||||
|
||||
function backupSubscription(){
|
||||
subscription = document.getElementById("backupSubscriptionText").value
|
||||
if(subscription){
|
||||
updateStatus("Backing up subscription: ["+subscription+"]...")
|
||||
updateStatus(callRESTService("backupSubscription/"+subscription))
|
||||
}else{
|
||||
updateStatus("Please input a subscription name to be backed up")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function backupAllSubscriptions(){
|
||||
updateStatus("Backing up subscriptions...")
|
||||
updateStatus(callRESTService("backupAllSubscriptions"))
|
||||
}
|
||||
|
||||
function callRESTService(func){
|
||||
var url = "http://"+window.location.host+"/dataDelivery/dataAccess/"+func;
|
||||
var client = new XMLHttpRequest();
|
||||
client.open("GET", url, false);
|
||||
client.setRequestHeader("Content-Type", "text/plain");
|
||||
client.send();
|
||||
return client.responseText
|
||||
}
|
||||
|
||||
function updateStatus(status){
|
||||
document.getElementById("statusSpan").innerHTML = status
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
|
@ -1,245 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
a {font-weight:bold;}
|
||||
td {width:270px;}
|
||||
input{width:200px;}
|
||||
table {border:0;}
|
||||
select {width:200px;}
|
||||
</style>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
|
||||
<script type="text/javascript" src='/dwr/engine.js'></script>
|
||||
<script type="text/javascript" src='/dwr/util.js'></script>
|
||||
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
|
||||
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
|
||||
<script type='text/javascript' src='/validateForm.js'></script>
|
||||
<title>Data Delivery Registry Admin: Add New User</title>
|
||||
</head>
|
||||
|
||||
<body onLoad="populateFormData('User')">
|
||||
|
||||
<span id="titleSpan" style="font-weight:bold; font-size:20pt"></span>
|
||||
<p>
|
||||
<a href="javascript:javascript:history.go(-1)">Back</a>
|
||||
<br>
|
||||
<a href="RegistryOrganizationMenu.html">Organization Search</a>
|
||||
<a href="RegistryUserMenu.html">User Search</a>
|
||||
<hr width="500" align="left"/>
|
||||
<button id="deletePartyButton" onclick="deleteParty()">Delete User</button>
|
||||
<button id="modifyPartyButton" onclick="goToModifyUser()">Modify User</button>
|
||||
<h4>User Information</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<td>User ID</td>
|
||||
<td><input id="idText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>First Name</td>
|
||||
<td><input id="firstNameText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Middle Name</td>
|
||||
<td><input id="middleNameText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Name</td>
|
||||
<td><input id="lastNameText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Organization</td>
|
||||
<td><select id="userOrgSelect"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Role</td>
|
||||
<td><select id="userRoleSelect"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><hr width="100" align="left"/></td>
|
||||
<td></td>
|
||||
<tr>
|
||||
<tr>
|
||||
<td><b>Address</b></td>
|
||||
<td><input type="checkbox" onclick="populateOrgAddress()" id="useOrgAddressCheck" name="addressCheck" value="addressCheck" ><span id="useOrgAddressSpan"><i>Use Organization Address</i></span></input></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Address Type</td>
|
||||
<td><select id="addressTypeSelect"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Address 1</td>
|
||||
<td><input id="streetAddress1Text" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Address 2</td>
|
||||
<td><input id="streetAddress2Text" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>City</td>
|
||||
<td><input id="cityText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>State/Province</td>
|
||||
<td><select id="stateSelect"\></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Country</td>
|
||||
<td><select id="countrySelect" onchange="populateStates('stateSelect')"\></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Postal Code</td>
|
||||
<td><input id="postalCodeText" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><hr width="100" align="left"/></td>
|
||||
<td></td>
|
||||
<tr>
|
||||
<tr>
|
||||
<td><b>Telephone</b></td>
|
||||
<td><input type="checkbox" onclick="populateOrgPhone()" id="useOrgPhoneCheck" name="phoneCheck" value="phoneCheck" ><span id="useOrgPhoneSpan"><i>Use Organization Telephone</i></span></input></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Telephone Type</td>
|
||||
<td><select id="telephoneTypeSelect"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Telephone Number</td>
|
||||
<td>(<input id="areaCodeText" type="text" maxlength=3 style='width: 28px;'/>)
|
||||
<input id="phone1Text" type="text" maxlength=3 style='width: 28px;'/>-
|
||||
<input id="phone2Text" type="text" maxlength=4 style='width: 36px;'/>
|
||||
Ext:<input id="extensionText" type="text" maxlength=8 style='width: 70px;'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><hr width="100" align="left"/></td>
|
||||
<td></td>
|
||||
<tr>
|
||||
<tr>
|
||||
<td><b>Email</b></td>
|
||||
<td><input type="checkbox" onclick="populateOrgEmail()" id="useOrgEmailCheck" name="emailCheck" value="emailCheck" ><span id="useOrgEmailSpan"><i>Use Organization Email</i></span></input></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email Type</td>
|
||||
<td><select id="emailTypeSelect"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email Address</td>
|
||||
<td><input id="emailText" type="text" style='width: 260px;'/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><hr width="100" align="left"/></td>
|
||||
<td></td>
|
||||
<tr>
|
||||
</table>
|
||||
<p>
|
||||
<button id="userActionButton" type="button" onclick="partyAction()"/>
|
||||
</body>
|
||||
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
/*
|
||||
* The user currently be looked at by this page. Null if none
|
||||
*/
|
||||
self.userId = getUserId();
|
||||
|
||||
RegistryWeb.getOrganizationNames("",function(organizations){
|
||||
clearComboBox("userOrgSelect")
|
||||
addOptionToList("userOrgSelect","","");
|
||||
var orgs = splitArray(organizations);
|
||||
for(var i = 0; i < orgs.length; i++){
|
||||
addOptionToList("userOrgSelect",orgs[i],orgs[i]);
|
||||
}
|
||||
});
|
||||
|
||||
RegistryWeb.getRoleTypes(function(roles){
|
||||
var roleTypes = splitArray(roles);
|
||||
addOptionToList("userRoleSelect","", "");
|
||||
for(var i = 0; i < roleTypes.length;i++){
|
||||
addOptionToList("userRoleSelect",roleTypes[i],roleTypes[i]);
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* The current mode of the page. Valid modes are 'add', 'modify', and 'view'
|
||||
* The add mode is used when adding a new user to the registry
|
||||
* The modify mode is used when modifying a user in the registry
|
||||
* The view mode is used when viewing a user in the registry
|
||||
*/
|
||||
self.mode=getMode()
|
||||
|
||||
/*
|
||||
* This function redirects the browser to the registry user interface in the modify mode
|
||||
*/
|
||||
function goToModifyUser(){
|
||||
window.location="RegistryUserInterface.html?id="+self.userId+"&mode=modify"
|
||||
}
|
||||
|
||||
function populateOrgAddress(){
|
||||
var fields=['addressTypeSelect','streetAddress1Text','streetAddress2Text','cityText',
|
||||
'stateSelect','countrySelect','postalCodeText'];
|
||||
if (document.getElementById("useOrgAddressCheck").checked){
|
||||
var org = getComboValue("userOrgSelect");
|
||||
RegistryWeb.getPartyDetails(org,function(orgString){
|
||||
var tokens = orgString.split("_____");
|
||||
for(var i = 0; i < tokens.length; i++){
|
||||
var subTokens = tokens[i].split("===");
|
||||
if(fields.indexOf(subTokens[0])!=-1){
|
||||
setElementValue(subTokens[0],subTokens[1]);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else{
|
||||
for(var i = 0; i < fields.length;i++){
|
||||
setElementValue(fields[i],"");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function populateOrgPhone(){
|
||||
var fields=['telephoneTypeSelect','areaCodeText','phone1Text','phone2Text',
|
||||
'extensionText'];
|
||||
if (document.getElementById("useOrgPhoneCheck").checked){
|
||||
var org = getComboValue("userOrgSelect");
|
||||
RegistryWeb.getPartyDetails(org,function(orgString){
|
||||
var tokens = orgString.split("_____");
|
||||
for(var i = 0; i < tokens.length; i++){
|
||||
var subTokens = tokens[i].split("===");
|
||||
if(fields.indexOf(subTokens[0])!=-1){
|
||||
setElementValue(subTokens[0],subTokens[1]);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else{
|
||||
for(var i = 0; i < fields.length;i++){
|
||||
setElementValue(fields[i],"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function populateOrgEmail(){
|
||||
var fields=['emailTypeSelect','emailText'];
|
||||
if (document.getElementById("useOrgEmailCheck").checked){
|
||||
var org = getComboValue("userOrgSelect");
|
||||
RegistryWeb.getPartyDetails(org,function(orgString){
|
||||
var tokens = orgString.split("_____");
|
||||
for(var i = 0; i < tokens.length; i++){
|
||||
var subTokens = tokens[i].split("===");
|
||||
if(fields.indexOf(subTokens[0])!=-1){
|
||||
setElementValue(subTokens[0],subTokens[1]);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else{
|
||||
for(var i = 0; i < fields.length;i++){
|
||||
setElementValue(fields[i],"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</html>
|
|
@ -1,58 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
a {font-weight:bold;}
|
||||
table{border:3;}
|
||||
td {width:200; background-color:deepskyblue}
|
||||
th {width:200; background-color:aqua; font-size:14pt;}
|
||||
input{width:200;}
|
||||
</style>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
|
||||
<script type="text/javascript" src='/dwr/engine.js'></script>
|
||||
<script type="text/javascript" src='/dwr/util.js'></script>
|
||||
<script type='text/javascript' src='/dwr/interface/RegistryWeb.js'></script>
|
||||
<script type='text/javascript' src='/dataDeliveryUtil.js'></script>
|
||||
<title>Data Delivery Registry Admin</title>
|
||||
</head>
|
||||
<body onload="getUsers()">
|
||||
<h2>Registry User Management Interface</h2>
|
||||
<a href="RegistryOrganizationMenu.html">View Organizations</a>
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:100; background-color: transparent">First Name</td>
|
||||
<td style="width:100; background-color: transparent"> <input type="text" id="firstNameText" onkeyup="getUsers()"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width:100; background-color: transparent">Last Name</td>
|
||||
<td style="width:100; background-color: transparent"><input type="text" id="lastNameText" onkeyup="getUsers()"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<hr width="500" align="left"/>
|
||||
<p>
|
||||
<button type="button" id="newUserButton" onclick="location.href='RegistryUserInterface.html?mode=add'">Add New User</button>
|
||||
<hr width="500" align="left"/>
|
||||
<p>
|
||||
<span id="resultsSpan"></span>
|
||||
</body>
|
||||
|
||||
<script language="JavaScript">
|
||||
function getUsers() {
|
||||
var firstName= getElementValue("firstNameText");
|
||||
var lastName=getElementValue("lastNameText");
|
||||
RegistryWeb.getUser(firstName,lastName,function(output){self.updateResults(output);});
|
||||
}
|
||||
|
||||
function updateResults(result){
|
||||
document.getElementById("resultsSpan").innerHTML = result;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
|
@ -66,17 +66,6 @@
|
|||
<url-pattern>/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet>
|
||||
<display-name>DWR Servlet</display-name>
|
||||
<servlet-name>dwr-invoker</servlet-name>
|
||||
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>dwr-invoker</servlet-name>
|
||||
<url-pattern>/dwr/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>registry/RegistryInterface.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
|
||||
body{
|
||||
font-family: Helvetica;
|
||||
margin-left: 75px;
|
||||
margin-right: 75px;
|
||||
background: #D3D3D3;
|
||||
}
|
||||
#banner{
|
||||
background: white;
|
||||
font-family: Lucida Sans;
|
||||
font-size: 24pt;
|
||||
text-align: center;
|
||||
border: 1px solid #C0C0C0;
|
||||
}
|
||||
#interfaceBody{
|
||||
margin-top: 10px;
|
||||
}
|
||||
#interfaceRight{
|
||||
border: 1px solid #000000;
|
||||
background: white;
|
||||
margin-left: 149px;
|
||||
padding: 10px;
|
||||
}
|
||||
#leftTabs{
|
||||
font-size: 10pt;
|
||||
float: left;
|
||||
width: 150px;
|
||||
}
|
||||
.leftTabSelected{
|
||||
background: white;
|
||||
text-align: center;
|
||||
border-top: 1px solid black;
|
||||
border-left: 1px solid black;
|
||||
border-bottom: 1px solid black;
|
||||
cursor: default;
|
||||
}
|
||||
.leftTabEntry{
|
||||
background: #A0A0A0;
|
||||
text-align: center;
|
||||
border: 1px solid black;
|
||||
cursor: pointer;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<title>Error Adding Registry ${partyType}</title>
|
||||
<body>
|
||||
Error adding ${partyType} ${userId}
|
||||
<p>
|
||||
Cause:
|
||||
<br>
|
||||
${cause}
|
||||
<p>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<title>Successfully Added ${partyType}</title>
|
||||
<body>
|
||||
Successfully added ${partyType}: ${userId}
|
||||
<p>
|
||||
<a href="Registry${partyType}Interface.html?id=${userId}&mode=view"><--Back</a>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<title>Error Deleting Registry ${partyType}</title>
|
||||
<body>
|
||||
Error deleting ${partyType} ${userId}
|
||||
<p>
|
||||
Cause:
|
||||
<br>
|
||||
${cause}
|
||||
<p>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<title>Successfully Deleted ${partyType}</title>
|
||||
<body>
|
||||
Successfully deleted ${partyType}: ${userId}
|
||||
<p>
|
||||
<a href="Registry${partyType}Menu.html?id=${userId}&mode=view"><--Back</a>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<title>Error Modifying Registry ${partyType}</title>
|
||||
<body>
|
||||
Error modifying ${partyType} ${userId}
|
||||
<p>
|
||||
Cause:
|
||||
<br>
|
||||
${cause}
|
||||
<p>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<title>Successfully Modified ${partyType}</title>
|
||||
<body>
|
||||
Successfully modified ${partyType}: ${userId}
|
||||
<p>
|
||||
<a href="Registry${partyType}Interface.html?id=${userId}&mode=view"><--Back</a>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,97 +0,0 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
/**
|
||||
*
|
||||
* Utility for validating entries on the web page before submission to the server
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 8/8/2012 #724 bphillip Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1.0
|
||||
*/
|
||||
var requiredMessage ="The following fields are required:\n";
|
||||
|
||||
var userReqFields=['id','firstName','lastName',
|
||||
'userOrg','userRole','addressType',
|
||||
'streetAddress1','city','state','country',
|
||||
'postalCode','telephoneType','areaCode','phone1','phone2',
|
||||
'emailType','email'];
|
||||
|
||||
var orgReqFields=['id','organizationName','addressType',
|
||||
'streetAddress1','city','state','country',
|
||||
'postalCode','telephoneType','areaCode','phone1','phone2',
|
||||
'emailType','email'];
|
||||
|
||||
var fieldMap={};
|
||||
fieldMap['id']='ID';
|
||||
fieldMap['organizationName']='Organization Name';
|
||||
fieldMap['firstName']='First Name';
|
||||
fieldMap['middleName']='Middle Name';
|
||||
fieldMap['lastName']='Last Name';
|
||||
fieldMap['userOrg']='Organization';
|
||||
fieldMap['userRole']='Role';
|
||||
fieldMap['addressType']='Address Type';
|
||||
fieldMap['streetAddress1']='Address 1';
|
||||
fieldMap['streetAddress2']='Address 2';
|
||||
fieldMap['city']='City';
|
||||
fieldMap['state']='State/Province';
|
||||
fieldMap['country']='Country';
|
||||
fieldMap['postalCode']='Postal Code';
|
||||
fieldMap['telephoneType']='Telephone Type';
|
||||
fieldMap['areaCode']='Area Code';
|
||||
fieldMap['phone1']='Telephone Prefix';
|
||||
fieldMap['phone2']='Telephone Suffix';
|
||||
fieldMap['extension']='Telephone Extension';
|
||||
fieldMap['emailType']='Email Type';
|
||||
fieldMap['email']='Email Address';
|
||||
|
||||
function validateFormValues(values){
|
||||
|
||||
var requiredFields = null;
|
||||
if(values.objType=='User'){
|
||||
requiredFields = userReqFields;
|
||||
}else{
|
||||
requiredFields = orgReqFields;
|
||||
}
|
||||
|
||||
var reqFields = "";
|
||||
for(var property in values){
|
||||
if(requiredFields.contains(property)){
|
||||
var val = eval("values."+property);
|
||||
if(val.isBlank()){
|
||||
reqFields+="\t"+fieldMap[property]+"\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!reqFields.isBlank()){
|
||||
alert(requiredMessage+reqFields)
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
}
|
|
@ -117,9 +117,6 @@
|
|||
<ref bean="registryObjectsRestService" />
|
||||
<ref bean="repositoryObjectsRestService" />
|
||||
<ref bean="queryProtocolRestService" />
|
||||
<ref bean="AddRegistryParty" />
|
||||
<ref bean="ModifyRegistryParty" />
|
||||
<ref bean="DeleteRegistryParty" />
|
||||
</jaxrs:serviceBeans>
|
||||
</jaxrs:server>
|
||||
<!-- End REST Endpoint definitions -->
|
||||
|
|
|
@ -342,26 +342,32 @@ runJmap() {
|
|||
local t1=`date "+%Y%m%d %H:%M:%S"`
|
||||
local log="${prePath}dump.log"
|
||||
local dumpPath="${prePath}dump"
|
||||
local heapPath="${prePath}heap"
|
||||
|
||||
if [ "$ACCUM" == "y" ]; then
|
||||
# accum needs to change hprof by date
|
||||
local t2=`date "+%Y%m%d_%H%M%S"`
|
||||
dumpPath="${dumpPath}_${t2}.hprof"
|
||||
heapPath="${heapPath}_${t2}.txt"
|
||||
else
|
||||
dumpPath="${dumpPath}.hprof"
|
||||
heapPath="${heapPath}.txt"
|
||||
fi
|
||||
|
||||
echo "${t1}: Running command: /awips2/java/bin/jmap -heap $pid" >> $processFile
|
||||
/awips2/java/bin/jmap -heap $pid >> ${heapPath} 2>&1
|
||||
|
||||
# Java 1.7 has a bug that causes jmap to crash processes using the G1 garbage collector
|
||||
# more info at http://stackoverflow.com/questions/20571004/garbage-collector-first-and-jmap-eof-bug
|
||||
# workaround is to add the 'live' option to jmap to limit the dump to only live objects
|
||||
local cmd="/awips2/java/bin/jmap -dump:live,format=b,file=${dumpPath}"
|
||||
echo "${t1}: Running command: $cmd $options $pid >> $log 2>&1 &" >> $processFile
|
||||
$cmd $options $pid >> $log 2>&1 &
|
||||
echo "${t1}: Running command: $cmd $options $pid >> $log 2>&1" >> $processFile
|
||||
$cmd $options $pid >> $log 2>&1
|
||||
|
||||
if [[ "$?" != "0" && $FORCE != "y" ]]; then
|
||||
t1=`date "+%Y%m%d %H:%M:%S"`
|
||||
echo "${t1}: jmap for $pid failed to connect, rerunning with -F" >> $processFile
|
||||
$cmd $options -F $pid >> $log 2>&1 &
|
||||
$cmd $options -F $pid >> $log 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,6 @@
|
|||
<logger name="org.springframework">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
<logger name="uk.ltd.getahead">
|
||||
<level value="WARN"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
|
|
|
@ -16,8 +16,6 @@ Require-Bundle: org.geotools;bundle-version="2.6.4",
|
|||
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.cpgsrv;bundle-version="1.12.1174",
|
||||
org.eclipse.ui;bundle-version="3.6.1",
|
||||
org.eclipse.core.runtime;bundle-version="3.6.0",
|
||||
com.raytheon.uf.common.monitor;bundle-version="1.12.1174",
|
||||
com.raytheon.edex.plugin.radar,
|
||||
com.raytheon.uf.common.ohd;bundle-version="1.12.1174",
|
||||
|
|
|
@ -2,19 +2,13 @@ package gov.noaa.nws.ohd.edex.plugin.hydrodualpol;
|
|||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.eclipse.jface.viewers.deferred.SetModel;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||
import com.raytheon.uf.common.dataplugin.radar.level3.Layer;
|
||||
import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyBlock;
|
||||
|
@ -22,11 +16,9 @@ import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyPacket;
|
|||
import com.raytheon.uf.common.dataplugin.radar.level3.TextSymbolPacket;
|
||||
import com.raytheon.uf.common.dataplugin.shef.tables.DAARadar;
|
||||
import com.raytheon.uf.common.dataplugin.shef.tables.DAARadarId;
|
||||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||
import com.raytheon.uf.edex.database.dao.CoreDao;
|
||||
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
||||
import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
||||
|
|
44
rpms/build/x86_64/WA_rpm_build.sh
Normal file
44
rpms/build/x86_64/WA_rpm_build.sh
Normal file
|
@ -0,0 +1,44 @@
|
|||
function WA_rpm_build()
|
||||
{
|
||||
echo "Scanning the Baseline for WA-Contributed RPMs ..."
|
||||
|
||||
files=(${WORKSPACE}/rpms-*)
|
||||
if [ ! -d "${files[0]}" ]; then
|
||||
echo "No WA-Contributed RPMs were found!"
|
||||
return
|
||||
fi
|
||||
|
||||
wa_contrib_count=`ls -1d ${WORKSPACE}/rpms-* | wc -l`
|
||||
|
||||
echo "Found ${wa_contrib_count} WA-Contributed RPMs."
|
||||
for rpm_contribution in `ls -1d ${WORKSPACE}/rpms-*`; do
|
||||
echo "Processing WA-Contributed RPMs ... ${rpm_contribution}"
|
||||
|
||||
_build_dir="${rpm_contribution}/build"
|
||||
_lookup_script="${_build_dir}/lookupWA_RPM.sh"
|
||||
_contribution_txt="${_build_dir}/wa-rpms.txt"
|
||||
|
||||
source "${_lookup_script}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: unable to access the expected WA lookup script - ${_lookup_script}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "${_contribution_txt}" ]; then
|
||||
echo "ERROR: unable to access the expected contribution text - ${_contribution_txt}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for contribution in `cat ${_contribution_txt}`; do
|
||||
lookupWA_RPM "${contribution}" "${rpm_contribution}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: '${contribution}' is not a recognized AWIPS II RPM."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
buildRPMExec "${RPM_SPECIFICATION}"
|
||||
done
|
||||
|
||||
return 0
|
||||
done
|
||||
}
|
|
@ -10,6 +10,16 @@ function buildRPM()
|
|||
exit 1
|
||||
fi
|
||||
|
||||
buildRPMExec "${RPM_SPECIFICATION}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function buildRPMExec()
|
||||
{
|
||||
# Arguments:
|
||||
# 1) specs file location
|
||||
|
||||
/usr/bin/rpmbuild -ba \
|
||||
--define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
|
||||
--define '_baseline_workspace %(echo ${WORKSPACE})' \
|
||||
|
@ -22,13 +32,11 @@ function buildRPM()
|
|||
--define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \
|
||||
--define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \
|
||||
--buildroot ${AWIPSII_BUILD_ROOT} \
|
||||
${RPM_SPECIFICATION}/component.spec
|
||||
${1}/component.spec
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Failed to build RPM ${1}."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# This script will build all of the 64-bit rpms.
|
||||
|
@ -78,6 +86,11 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
source ${dir}/WA_rpm_build.sh
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: Unable to find the WA-RPM Build Contributions."
|
||||
fi
|
||||
|
||||
export LIGHTNING=true
|
||||
# Determine if the optional '-nobinlightning' argument has been specified.
|
||||
if [ "${2}" = "-nobinlightning" ]; then
|
||||
|
@ -99,6 +112,11 @@ if [ "${1}" = "-buildRPM" -a -n "${2}" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${1}" = "-WA" ]; then
|
||||
WA_rpm_build
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${1}" = "-64bit" ]; then
|
||||
buildCAVE
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue