[rhq] 3 commits - modules/common
by mazz
modules/common/ant-bundle/src/main/assembly/bin/antenv.cmd | 98 -----
modules/common/ant-bundle/src/main/assembly/bin/envset.cmd | 131 ------
modules/common/ant-bundle/src/main/assembly/bin/lcp.bat | 31 -
modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat | 231 ++++++++++++
modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.cmd | 93 ----
modules/common/ant-bundle/src/main/assembly/bin/runrc.cmd | 60 ---
modules/common/ant-bundle/src/main/scripts/assembly.xml | 2
7 files changed, 232 insertions(+), 414 deletions(-)
New commits:
commit d3799e2f59f40845bdf2da3898d347ae4e795cdd
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Feb 11 14:52:59 2011 -0500
missed two places where the rhq ant main should be specified
diff --git a/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat b/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat
index 69e5cf6..da43fe8 100644
--- a/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat
+++ b/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat
@@ -135,14 +135,14 @@ if not "%JIKESPATH%"=="" goto runAntWithJikes
:runAnt
if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
:runAntWithClasspath
-"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
+"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" -main org.rhq.bundle.ant.AntMain %ANT_CMD_LINE_ARGS%
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end
:runAntNoClasspath
-"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
+"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -main org.rhq.bundle.ant.AntMain %ANT_CMD_LINE_ARGS%
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
commit 5a7f6fb357fab1abfdfe1d40735596e1f7ad5baf
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Feb 11 13:49:38 2011 -0500
remove the old windows scripts and replace with the newer one that should work on current windows machines
diff --git a/modules/common/ant-bundle/src/main/assembly/bin/antenv.cmd b/modules/common/ant-bundle/src/main/assembly/bin/antenv.cmd
deleted file mode 100644
index 170d89f..0000000
--- a/modules/common/ant-bundle/src/main/assembly/bin/antenv.cmd
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-'@echo off'
-call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
-call SysLoadFuncs
-
-/* Prepare the parameters for later use */
-parse arg argv
-mode = ''
-args = ''
-opts = ''
-cp = ''
-lcp = ''
-
-do i = 1 to words(argv)
- param = word(argv, i)
- select
- when param='-lcp' then mode = 'l'
- when param='-cp' | param='-classpath' then mode = 'c'
- when abbrev('-opts', param, 4) then mode = 'o'
- when abbrev('-args', param, 4) then mode = 'a'
- otherwise
- select
- when mode = 'a' then args = space(args param, 1)
- when mode = 'c' then cp = space(cp param, 1)
- when mode = 'l' then lcp = space(lcp param, 1)
- when mode = 'o' then opts = space(opts param, 1)
- otherwise
- say 'Option' param 'ignored'
- end
- end
-end
-
-env="OS2ENVIRONMENT"
-antconf = _getenv_('antconf' 'antconf.cmd')
-runrc = _getenv_('runrc')
-interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC'
-ANT_HOME = value('ANT_HOME',,env)
-JAVA_HOME = value('JAVA_HOME',,env)
-classpath = value('CLASSPATH',,env)
-classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS")
-if classes \= '' then classpath = prepend(classpath classes)
-classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS")
-if classes \= '' then classpath = prepend(classpath classes)
-
-classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar')
-'SET CLASSPATH=' || classpath
-
-/* Setting classpathes, options and arguments */
-envset = _getenv_('envset')
-if cp\='' then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"'
-if lcp\='' then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"'
-if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"'
-if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"'
-
-exit 0
-
-addpath: procedure
-parse arg path elem
-if elem = '' then do
- if path\='' & right(path, 1)\=';' then path = path || ';'
- return path
-end
-if substr(path, length(path)) = ';' then glue = ''
-else glue = ';'
-if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';'
-return path
-
-prepend: procedure
-parse arg path elem
-if elem = '' then do
- if path\='' & right(path, 1)\=';' then path = path || ';'
- return path
-end
-if pos(translate(elem), translate(path)) = 0 then path = elem || ';' || path
-return path
-
-_getenv_: procedure expose env
-parse arg envar default
-if default = '' then default = envar
-var = value(translate(envar),,env)
-if var = '' then var = default
-return var
diff --git a/modules/common/ant-bundle/src/main/assembly/bin/envset.cmd b/modules/common/ant-bundle/src/main/assembly/bin/envset.cmd
deleted file mode 100644
index 3b07419..0000000
--- a/modules/common/ant-bundle/src/main/assembly/bin/envset.cmd
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-SET environment variables
-First optional parameter:
- ; parameters are considered parts of a path variable, semicolons are
- appended to each element if not already present
- -D parameters are properties for Java or Makefile etc., -D will be
- prepended and the parameters will be separated by a space
- =D the same as above but equal sign is not required
- , parameters should be comma separated in the environment variable
- - parameters should be separated by the next parameter
- Other values mean that the first parameter is missing and the environment
- variable will be set to the space separated parameters
-
-Second parameter: name of the environment variable
-
-Next parameters: values
-; implies that the equal sign is considered a part of the parameter and is
-not interpreted
-
--D requires parameters in the form name=value. If the equal sign is not found,
-the parameters are changed to name=expanded_name
-
-Other options have optional equal sign. If it is found, only the part after
-the equal sign will be oprionally expanded.
-
-If the parameter is the minus sign, the next parameter will not be expanded.
-If the parameter is a single dot, it will be replaced with the value of the
-environment variable as it existed before envset was invoked.
-
-For other parameters the batch looks for the environment variable with the
-same name (in uppercase). If it is found, it forms the expanded_name. If
-the environment variable with such a name does not exist, the expanded_name
-will hold the parameter name without case conversion.
-*/
-
-parse arg mode envar args
-
-equal = 0
-sep = ' '
-
-/* Parse command line parameters */
-select
- when mode='-' then do
- sep = envar
- parse var args envar args
- end
- when mode=';' then do
- sep = ''
- equal = -1
- end
- when mode='-D' then equal = 1
- when mode='=D' then mode = '-D'
- when mode=',' then sep = ','
-otherwise
- args = envar args
- envar = mode
- mode = ''
-end
-
-env = 'OS2ENVIRONMENT'
-envar = translate(envar)
-orig = value(envar,,env)
-newval = ''
-expand = 1
-
-/* for each parameter... */
-do i = 1 to words(args)
- if expand > 0 & word(args, i) = '-' then expand = 0
- else call addval word(args, i)
-end
-
-/* Optionally enclose path variable by quotes */
-if mode = ';' & pos(' ', newval) > 0 then newval = '"' || newval || '"'
-
-/* Set the new value, 'SET' cannot be used since it does not allow '=' */
-x = value(envar, newval, env)
-exit 0
-
-addval: procedure expose sep equal orig expand newval mode env
-parse arg var
-
-if var = '.' then expvar = orig
-else do
- if equal >= 0 then do
- parse var var name '=' val
- if val = '' then var = name
- else var = val
- end
- if expand = 0 then expvar = var
- else expvar = value(translate(var),,env)
- if expvar = '' then expvar = var
- if equal >= 0 then do
- if val = '' then do
- parse var expvar key '=' val
- if val <> '' then name = key
- else do
- if equal > 0 then val = key
- else name = key
- end
- end
- else val = expvar
- if pos(' ', val) > 0 | pos('=', val) > 0 then val = '"' || val || '"'
- if val = '' then expvar = name
- else expvar = name || '=' || val
- end
- if mode = '-D' then expvar = '-D' || expvar
- if mode = ';' then do
- if right(expvar, 1) <> ';' then expvar = expvar || ';'
- end
-end
-
-if newval = '' then newval = expvar
-else newval = newval || sep || expvar
-expand = 1
-return
diff --git a/modules/common/ant-bundle/src/main/assembly/bin/lcp.bat b/modules/common/ant-bundle/src/main/assembly/bin/lcp.bat
deleted file mode 100644
index 4bf2e7c..0000000
--- a/modules/common/ant-bundle/src/main/assembly/bin/lcp.bat
+++ /dev/null
@@ -1,31 +0,0 @@
-REM
-REM Licensed to the Apache Software Foundation (ASF) under one or more
-REM contributor license agreements. See the NOTICE file distributed with
-REM this work for additional information regarding copyright ownership.
-REM The ASF licenses this file to You under the Apache License, Version 2.0
-REM (the "License"); you may not use this file except in compliance with
-REM the License. You may obtain a copy of the License at
-REM
-REM http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing, software
-REM distributed under the License is distributed on an "AS IS" BASIS,
-REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-REM See the License for the specific language governing permissions and
-REM limitations under the License.
-REM
-REM
-
-set _CLASSPATHCOMPONENT=%1
-if ""%1""=="""" goto gotAllArgs
-shift
-
-:argCheck
-if ""%1""=="""" goto gotAllArgs
-set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
-shift
-goto argCheck
-
-:gotAllArgs
-set LOCALCLASSPATH=%LOCALCLASSPATH%;%_CLASSPATHCOMPONENT%
-
diff --git a/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat b/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat
new file mode 100644
index 0000000..69e5cf6
--- /dev/null
+++ b/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.bat
@@ -0,0 +1,231 @@
+@echo off
+
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+
+REM This is an inordinately troublesome piece of code, particularly because it
+REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x
+REM support, things would be much easier, but sadly, it is not yet time.
+REM Be cautious about editing this, and only add WinNT specific stuff in code that
+REM only runs on WinNT.
+
+REM -----RHQ CHANGES START-----
+REM THIS FILE WAS ORIGINALLY ANT.BAT VERSION 1.8.0
+REM IT HAS BEEN ALTERED IN THE FOLLOWING WAYS:
+REM 1. -main ARGUMENT WAS ADDED TO THE ANT START COMMAND
+REM 2. ANT_HOME HAS BEEN RENAMED TO RHQ_ANT_HOME
+REM 3. antrc_pre/post.bat HAVE BEEN RENAMED TO rhq-antrc_pre/post.bat
+REM -----RHQ CHANGES STOP-----
+
+if "%HOME%"=="" goto homeDrivePathPre
+if exist "%HOME%\rhq-antrc_pre.bat" call "%HOME%\rhq-antrc_pre.bat"
+
+:homeDrivePathPre
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
+if exist "%HOMEDRIVE%%HOMEPATH%\rhq-antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\rhq-antrc_pre.bat"
+
+:userProfilePre
+if "%USERPROFILE%"=="" goto alpha
+if "%USERPROFILE%"=="%HOME%" goto alpha
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
+if exist "%USERPROFILE%\rhq-antrc_pre.bat" call "%USERPROFILE%\rhq-antrc_pre.bat"
+
+:alpha
+
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+if "%RHQ_ANT_HOME%"=="" goto setDefaultAntHome
+
+:stripAntHome
+if not _%RHQ_ANT_HOME:~-1%==_\ goto checkClasspath
+set RHQ_ANT_HOME=%RHQ_ANT_HOME:~0,-1%
+goto stripAntHome
+
+:setDefaultAntHome
+rem %~dp0 is expanded pathname of the current script under NT
+set RHQ_ANT_HOME=%~dp0..
+
+:checkClasspath
+set _USE_CLASSPATH=yes
+rem CLASSPATH must not be used if it is equal to ""
+if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
+if "%CLASSPATH%"=="" set _USE_CLASSPATH=no
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+:setupArgs
+if ""%1""=="""" goto doneStart
+if ""%1""==""-noclasspath"" goto clearclasspath
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
+shift
+goto setupArgs
+
+rem here is there is a -noclasspath in the options
+:clearclasspath
+set _USE_CLASSPATH=no
+shift
+goto setupArgs
+
+rem This label provides a place for the argument list loop to break out
+rem and for NT handling to skip to.
+
+:doneStart
+
+if "%_USE_CLASSPATH%"=="no" goto findAntHome
+
+:stripClasspath
+if not _%CLASSPATH:~-1%==_\ goto findAntHome
+set CLASSPATH=%CLASSPATH:~0,-1%
+goto stripClasspath
+
+:findAntHome
+rem find RHQ_ANT_HOME if it does not exist due to either an invalid value passed
+rem by the user or the %0 problem on Windows 9x
+if exist "%RHQ_ANT_HOME%\lib\ant.jar" goto checkJava
+
+rem check for ant in Program Files
+if not exist "%ProgramFiles%\ant" goto checkSystemDrive
+set RHQ_ANT_HOME=%ProgramFiles%\ant
+goto checkJava
+
+:checkSystemDrive
+rem check for ant in root directory of system drive
+if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
+set RHQ_ANT_HOME=%SystemDrive%\ant
+goto checkJava
+
+:checkCDrive
+rem check for ant in C:\ant for Win9X users
+if not exist C:\ant\lib\ant.jar goto noAntHome
+set RHQ_ANT_HOME=C:\ant
+goto checkJava
+
+:noAntHome
+echo RHQ_ANT_HOME is set incorrectly or ant could not be located. Please set RHQ_ANT_HOME.
+goto end
+
+:checkJava
+set _JAVACMD=%JAVACMD%
+
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
+goto checkJikes
+
+:noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe
+
+:checkJikes
+if not "%JIKESPATH%"=="" goto runAntWithJikes
+
+:runAnt
+if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
+:runAntWithClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntNoClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntWithJikes
+
+if not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspath
+set JIKESPATH=%JIKESPATH:~0,-1%
+goto runAntWithJikes
+
+:checkJikesAndClasspath
+
+if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath
+
+:runAntWithJikesAndClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" -main org.rhq.bundle.ant.AntMain %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntWithJikesNoClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%RHQ_ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%RHQ_ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -main org.rhq.bundle.ant.AntMain %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:onError
+rem Windows 9x way of checking the error code. It matches via brute force.
+for %%i in (1 10 100) do set err%%i=
+for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
+if %err100%==2 goto onError200
+if %err100%==0 set err100=
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
+if "%err100%"=="" if %err10%==0 set err10=
+:onError1
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
+goto onErrorEnd
+:onError200
+for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
+if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
+if not err10==5 goto onError1
+:onErrorEnd
+set ANT_ERROR=%err100%%err10%%err1%
+for %%i in (1 10 100) do set err%%i=
+
+:end
+rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
+if not "%_JAVACMD%"=="" set _JAVACMD=
+if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS=
+
+if "%ANT_ERROR%"=="0" goto mainEnd
+
+rem Set the return code if we are not in NT. We can only set
+rem a value of 1, but it's better than nothing.
+if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
+
+rem Set the ERRORLEVEL if we are running NT.
+if "%OS%"=="Windows_NT" color 00
+
+goto omega
+
+:mainEnd
+
+rem If there were no errors, we run the post script.
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+
+if "%HOME%"=="" goto homeDrivePathPost
+if exist "%HOME%\rhq-antrc_post.bat" call "%HOME%\rhq-antrc_post.bat"
+
+:homeDrivePathPost
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
+if exist "%HOMEDRIVE%%HOMEPATH%\rhq-antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\rhq-antrc_post.bat"
+
+:userProfilePost
+if "%USERPROFILE%"=="" goto omega
+if "%USERPROFILE%"=="%HOME%" goto omega
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
+if exist "%USERPROFILE%\rhq-antrc_post.bat" call "%USERPROFILE%\rhq-antrc_post.bat"
+
+:omega
+
diff --git a/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.cmd b/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.cmd
deleted file mode 100644
index d221a40..0000000
--- a/modules/common/ant-bundle/src/main/assembly/bin/rhq-ant.cmd
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Run ant
-*/
-
-'@echo off'
-parse arg mode envarg '::' antarg
-
-if mode\='.' & mode\='..' & mode\='/' then do
- envarg = mode envarg
- mode = ''
-end
-
-if antarg = '' then do
- antarg = envarg
- envarg = ''
-end
-
-x = setlocal()
-
-env="OS2ENVIRONMENT"
-antenv = _getenv_('antenv')
-if _testenv_() = 0 then interpret 'call "' || antenv || '"' '"' || envarg || '"'
-
-if mode = '' then mode = _getenv_('ANT_MODE' '..')
-if mode \= '/' then do
- runrc = _getenv_('runrc')
- antrc = _getenv_('antrc' 'antrc.cmd')
- if mode = '..' then mode = '-r'
- else mode = ''
- interpret 'call "' || runrc || '"' antrc '"' || mode || '"'
-end
-
-if _testenv_() = 0 then do
- say 'Ant environment is not set properly'
- x = endlocal()
- exit 16
-end
-
-settings = '-Dant.home=' || ANT_HOME '-Djava.home=' || JAVA_HOME
-
-java = _getenv_('javacmd' 'java')
-opts = value('ANT_OPTS',,env)
-args = value('ANT_ARGS',,env)
-lcp = value('LOCALCLASSPATH',,env)
-cp = value('CLASSPATH',,env)
-if value('ANT_USE_CP',,env) \= '' then do
- if lcp \= '' & right(lcp, 1) \= ';' then lcp = lcp || ';'
- lcp = lcp || cp
- 'SET CLASSPATH='
-end
-if lcp\='' then lcp = '-classpath' lcp
-
-cmd = java opts lcp '-jar' ANT_HOME ||'\lib\ant-launcher.jar' settings args antarg
-launcher = stream(ANT_HOME ||'\lib\ant-launcher.jar', 'C', 'query exists')
-if launcher = '' then entry = 'org.apache.tools.ant.Main'
-else entry = 'org.apache.tools.ant.launch.Launcher'
-java opts lcp entry settings args antarg
-
-x = endlocal()
-
-return rc
-
-_testenv_: procedure expose env ANT_HOME JAVA_HOME
-ANT_HOME = value('ANT_HOME',,env)
-if ANT_HOME = '' then return 0
-JAVA_HOME = value('JAVA_HOME',,env)
-if JAVA_HOME = '' then return 0
-cp = translate(value('CLASSPATH',,env))
-if pos(translate(ANT_HOME), cp) = 0 then return 0
-if pos(translate(JAVA_HOME), cp) = 0 then return 0
-return 1
-
-_getenv_: procedure expose env
-parse arg envar default
-if default = '' then default = envar
-var = value(translate(envar),,env)
-if var = '' then var = default
-return var
diff --git a/modules/common/ant-bundle/src/main/assembly/bin/runrc.cmd b/modules/common/ant-bundle/src/main/assembly/bin/runrc.cmd
deleted file mode 100644
index c68f04d..0000000
--- a/modules/common/ant-bundle/src/main/assembly/bin/runrc.cmd
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- Run RC file, name is in the first arg, second arg is either PATH
- ENV or -r or nothing
-*/
-
-parse arg name path rest
-
-if name = '' then do
- say 'RC file name is missing'
- exit 1
-end
-
-if rest \= '' then do
- say 'Too many parameters'
- exit 1
-end
-
-call runit name path
-exit 0
-
-runit: procedure
-parse arg name path dir
-
-if path \= '' & path \= '-r' then do
- dir = value(translate(path),,'OS2ENVIRONMENT')
- if dir = '' then return
- dir = translate(dir, '\', '/') /* change UNIX-like path to OS/2 */
-end
-
-if dir = '' then dir = directory()
-
-if path = '-r' then do /* recursive call */
- subdir = filespec('path', dir)
- if subdir \= '\' then do
- subdir = left(subdir, length(subdir)-1)
- call runit name path filespec('drive', dir) || subdir
- end
-end
-
-/* Look for the file and run it */
-if right(dir, 1) \= '\' then dir = dir || '\'
-rcfile = stream(dir || name, 'c', 'query exists')
-if rcfile \= '' then interpret 'call "' || rcfile || '"'
-
-return
commit 180ef219ff8014635a543c98d75b09ee65c9fcd3
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Feb 11 13:43:00 2011 -0500
make the name of the base directory the same as the name of the zip as it will appear to the user.
this means when we extract the bundle tool, the top zip directory that gets created will be
rhq-bundle-deployer-VERSION
diff --git a/modules/common/ant-bundle/src/main/scripts/assembly.xml b/modules/common/ant-bundle/src/main/scripts/assembly.xml
index d7c9af7..4477694 100644
--- a/modules/common/ant-bundle/src/main/scripts/assembly.xml
+++ b/modules/common/ant-bundle/src/main/scripts/assembly.xml
@@ -9,7 +9,7 @@
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
- <baseDirectory>${project.build.finalName}</baseDirectory>
+ <baseDirectory>rhq-bundle-deployer-${project.version}</baseDirectory> <!-- matches the zip when it is renamed in rhq-container.build.xml -->
<fileSets>
13 years, 3 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 4 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java | 4 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java | 17 ++++++++--
5 files changed, 24 insertions(+), 3 deletions(-)
New commits:
commit b0b0a4a89cc58b8d9bbfaa18c4314f95be616dc3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Feb 11 14:27:49 2011 -0500
on resource op history detail view, link to parent group op history, if there is a parent group op
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index 9c9307e..1dc2dcf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -87,6 +87,10 @@ public class LinkManager {
return getResourceGroupLink(groupId) + "/Inventory/ConnectionSettingsHistory";
}
+ public static String getGroupOperationHistoryLink(int groupId, int groupOperationHistoryId) {
+ return getResourceGroupLink(groupId) + "/Operations/History/" + groupOperationHistoryId;
+ }
+
public static String getGroupDefinitionLink(int groupDefinitionId) {
if (GWT) {
return "#Inventory/Groups/DynagroupDefinitions/" + groupDefinitionId;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
index 989857d..6b8fcb4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
@@ -32,7 +32,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.OperationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
-import java.util.Date;
import java.util.List;
/**
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
index fc87592..b74a387 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
@@ -142,6 +142,10 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
OperationRequestStatus status = operationHistory.getStatus();
+ StaticTextItem idItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.ID, "Execution ID");
+ idItem.setValue(operationHistory.getId());
+ items.add(idItem);
+
StaticTextItem operationItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.OPERATION_NAME, MSG
.view_operationHistoryDetails_operation());
OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
index 1597f8b..15d1f01 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
@@ -47,6 +47,7 @@ public class ResourceOperationHistoryDataSource extends AbstractOperationHistory
public static abstract class Field extends AbstractOperationHistoryDataSource.Field {
public static final String RESOURCE = "resource";
+ public static final String GROUP_OPERATION_HISTORY = "groupOperationHistory";
}
public static abstract class CriteriaField {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
index 09a50fe..9c93065 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
@@ -26,12 +26,14 @@ import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
+import org.rhq.core.domain.operation.GroupOperationHistory;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.core.domain.operation.ResourceOperationHistory;
import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDetailsView;
@@ -63,9 +65,20 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
List<FormItem> items = super.createFields(operationHistory);
if (this.showResourceField) {
- StaticTextItem resourceItem = new StaticTextItem("resource", "Resource");
+ StaticTextItem resourceItem = new StaticTextItem(ResourceOperationHistoryDataSource.Field.RESOURCE,
+ "Resource");
resourceItem.setValue(this.disambiguatedResourceName);
- items.add(0, resourceItem);
+ items.add(1, resourceItem);
+ }
+
+ GroupOperationHistory groupOperationHistory = operationHistory.getGroupOperationHistory();
+ if (groupOperationHistory != null) {
+ StaticTextItem groupOperationHistoryItem = new StaticTextItem(
+ ResourceOperationHistoryDataSource.Field.GROUP_OPERATION_HISTORY, "Parent Group Execution");
+ String groupOperationHistoryUrl = LinkManager.getGroupOperationHistoryLink(groupOperationHistory.getGroup().getId(), groupOperationHistory.getId());
+ String value = "<a href=\"" + groupOperationHistoryUrl + "\">" + groupOperationHistory.getId() + "</a> (on group '" + groupOperationHistory.getGroup().getName() + "')";
+ groupOperationHistoryItem.setValue(value);
+ items.add(groupOperationHistoryItem);
}
return items;
13 years, 3 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java | 8 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java | 15 +++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java | 18 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java | 3 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java | 9 +++++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java | 2 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java | 5 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/ResourceOperationJob.java | 9 +++--
8 files changed, 50 insertions(+), 19 deletions(-)
New commits:
commit d3495c26ceec0485cb0c39b14e4a1a0c015b663e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Feb 11 13:31:37 2011 -0500
fix several issues with startedTime field in operation history views
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
index eba0a2e..b18c14e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
@@ -750,7 +750,15 @@ public class JobTriggerEditor extends LocatableVLayout {
}
}
+ /**
+ * Returns the start time, if one was specified, otherwise returns null to indicate an immediate start.
+ *
+ * @return the start time, if one was specified, otherwise returns null to indicate an immediate start
+ */
public Date getStartTime() {
+ if (!this.isStartLater) {
+ return null;
+ }
Date startTime;
if (this.isStartDelay) {
// start delay - compute start time
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
index 78198bd..989857d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
@@ -26,7 +26,6 @@ import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.fields.DataSourceDateTimeField;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;
-import com.smartgwt.client.types.FieldType;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.operation.OperationHistory;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -95,9 +94,13 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
DataSourceTextField statusField = new DataSourceTextField(Field.STATUS, MSG.common_title_status());
fields.add(statusField);
- DataSourceDateTimeField startedField = new DataSourceDateTimeField(Field.STARTED_TIME,
+ DataSourceDateTimeField createdTimeField = new DataSourceDateTimeField(Field.CREATED_TIME,
+ "Created Time");
+ fields.add(createdTimeField);
+
+ DataSourceDateTimeField startedTimeField = new DataSourceDateTimeField(Field.STARTED_TIME,
MSG.dataSource_operationHistory_startedTime());
- fields.add(startedField);
+ fields.add(startedTimeField);
DataSourceTextField subjectField = new DataSourceTextField(Field.SUBJECT, "Requester");
fields.add(subjectField);
@@ -117,8 +120,8 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
ListGridRecord record = new ListGridRecord();
record.setAttribute(Field.ID, from.getId());
- record.setAttribute(Field.CREATED_TIME, from.getCreatedTime());
- record.setAttribute(Field.STARTED_TIME, new Date(from.getStartedTime()));
+ record.setAttribute(Field.CREATED_TIME, convertTimestampToDate(from.getCreatedTime()));
+ record.setAttribute(Field.STARTED_TIME, convertTimestampToDate(from.getStartedTime()));
record.setAttribute(Field.DURATION, from.getDuration());
record.setAttribute(Field.SUBJECT, from.getSubjectName());
record.setAttribute(Field.OPERATION_DEFINITION, from.getOperationDefinition());
@@ -130,4 +133,6 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
return record;
}
+
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
index 98c7331..9d296ce 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
@@ -19,14 +19,14 @@
package org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
+import com.google.gwt.i18n.client.DateTimeFormat;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.types.DateDisplayFormat;
-import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Window;
@@ -132,10 +132,20 @@ public abstract class AbstractOperationHistoryListView<T extends AbstractOperati
protected ListGridField createStartedTimeField() {
ListGridField startedTimeField = new ListGridField(AbstractOperationHistoryDataSource.Field.STARTED_TIME);
- startedTimeField.setType(ListGridFieldType.DATE);
- startedTimeField.setDateFormatter(DateDisplayFormat.TOLOCALESTRING);
+ //startedTimeField.setType(ListGridFieldType.DATE);
+ //startedTimeField.setDateFormatter(DateDisplayFormat.TOLOCALESTRING);
startedTimeField.setAlign(Alignment.LEFT);
startedTimeField.setCellAlign(Alignment.LEFT);
+ startedTimeField.setCellFormatter(new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ if (value != null) {
+ Date date = (Date) value;
+ return DateTimeFormat.getMediumDateTimeFormat().format(date);
+ } else {
+ return "<i>not yet started</i>";
+ }
+ }
+ });
return startedTimeField;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
index 797f5bb..1597f8b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
@@ -87,7 +87,8 @@ public class ResourceOperationHistoryDataSource extends AbstractOperationHistory
}
public void onSuccess(PageList<DisambiguationReport<ResourceOperationHistory>> result) {
- response.setData(buildRecordsFromDisambiguationReports(result));
+ ListGridRecord[] resourceOperationHistoryRecords = buildRecordsFromDisambiguationReports(result);
+ response.setData(resourceOperationHistoryRecords);
processResponse(request.getRequestId(), response);
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index 9583cae..82fba82 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Date;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
@@ -574,4 +575,12 @@ public abstract class RPCDataSource<T> extends DataSource {
return textField;
}
+ protected static Date convertTimestampToDate(Long timestamp) {
+ if (timestamp == null) {
+ return null;
+ }
+ // Assume 0 means null, not Jan 1, 1970.
+ return (timestamp != 0) ? new Date(timestamp) : null;
+ }
+
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java
index 42e0312..cbdd54e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/GroupOperationJob.java
@@ -82,7 +82,7 @@ public class GroupOperationJob extends OperationJob {
public void execute(JobExecutionContext context) throws JobExecutionException {
GroupOperationSchedule schedule = null;
- GroupOperationHistory groupHistory = null;
+ GroupOperationHistory groupHistory;
try {
JobDetail jobDetail = context.getJobDetail();
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java
index db58484..8e56a35 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationJob.java
@@ -99,11 +99,6 @@ public abstract class OperationJob implements Job {
history = new ResourceOperationHistory(jobName, jobGroup, schedule.getSubject().getName(), op, parameters,
schedule.getResource(), groupHistory);
- // resource-level ops can start immediately, group ops will be started as appropriate by the GroupOperationJob
- if (groupHistory == null) {
- history.setStartedTime();
- }
-
// persist the results of the initial create
history = (ResourceOperationHistory) operationManager.updateOperationHistory(schedule.getSubject(), history);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/ResourceOperationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/ResourceOperationJob.java
index d85c323..c9e7b35 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/ResourceOperationJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/ResourceOperationJob.java
@@ -28,6 +28,7 @@ import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.operation.OperationHistory;
import org.rhq.core.domain.operation.ResourceOperationHistory;
import org.rhq.core.domain.operation.bean.ResourceOperationSchedule;
import org.rhq.core.domain.resource.InventoryStatus;
@@ -150,10 +151,8 @@ public class ResourceOperationJob extends OperationJob {
* call this for each member resource in the group. If groupHistory is not <code>null</code>, it means this resource
* job is being executed as part of a group execution.
*
- * @param jobName
- * @param jobGroup
* @param schedule
- * @param groupHistory
+ * @param resourceHistory
* @param operationManager
*
* @return the history item that you can use to track progress
@@ -165,6 +164,10 @@ public class ResourceOperationJob extends OperationJob {
// make sure the session is still valid
schedule.setSubject(getUserWithSession(schedule.getSubject(), true));
+ resourceHistory.setStartedTime();
+ resourceHistory = (ResourceOperationHistory) operationManager.updateOperationHistory(
+ getUserWithSession(schedule.getSubject(), true), resourceHistory);
+
// now tell the agent to invoke it!
try {
Resource resource = schedule.getResource();
13 years, 3 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 975eccc9f3720d79f84beeff8985ff6a5f9e137e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Feb 11 11:40:13 2011 -0500
add a window closing handler that will prevent the user from accidentally clicking the browser's Back button and leaving RHQ
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 6c034c6..f4bc54b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -138,6 +138,12 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
}
});
+ Window.addWindowClosingHandler(new Window.ClosingHandler() {
+ public void onWindowClosing(Window.ClosingEvent event) {
+ event.setMessage("Are you sure you want to leave RHQ?");
+ }
+ });
+
messageCenter = new MessageCenter();
UserSessionManager.login();
13 years, 3 months
[rhq] modules/enterprise
by Heiko W. Rupp
modules/enterprise/gui/installer-war/pom.xml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit e12ce69d9c57128379aaf1db0686d6d3fec89c93
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Feb 11 16:25:12 2011 +0100
BZ 667015 - fix links from installer to documentation.
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 8035d20..c36a444 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -35,12 +35,12 @@
<product.sales.email>sales(a)rhq-project.org</product.sales.email>
<product.support.email>info(a)rhq-project.org</product.support.email>
<product.version>${project.version}</product.version>
- <product.help.doc.root>http://support.rhq-project.org/display/RHQ/</product.help.doc.root>
- <product.help.installation>Installing</product.help.installation>
- <product.help.guide.server>Running+the+Server</product.help.guide.server>
- <product.help.guide.agent>Running+the+Agent</product.help.guide.agent>
+ <product.help.doc.root>http://support.rhq-project.org/display/JOPR2/</product.help.doc.root>
+ <product.help.installation>Installation</product.help.installation>
+ <product.help.guide.server>Running+the+RHQ+Server</product.help.guide.server>
+ <product.help.guide.agent>Running+the+RHQ+Agent</product.help.guide.agent>
<product.help.FAQ>FAQ</product.help.FAQ>
- <product.help.config.props>http://support.rhq-project.org/display/RHQ/Configuring+the+Server#Configu...</product.help.config.props>
+ <product.help.config.props>http://support.rhq-project.org/display/JOPR2/Startup+Properties#Configuri...</product.help.config.props>
</properties>
<dependencies>
13 years, 3 months
[rhq] 5 commits - modules/enterprise
by Heiko W. Rupp
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 22 +++++++++
modules/enterprise/gui/installer-war/pom.xml | 23 ++++++++++
modules/enterprise/gui/installer-war/src/main/webapp/images/logo.png |binary
3 files changed, 45 insertions(+)
New commits:
commit 2023e69cd5d405f92c2401bdd66af4d2e0fb35ef
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Feb 11 11:42:41 2011 +0100
Add some more translations.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index a2223fa..3ed231a 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -1624,6 +1624,28 @@ view_tree_common_loadFailed_group=Konnte die Gruppe mit ID [{0}] nicht laden
view_tree_common_loadFailed_groupTree=Konnte die Baumansicht der Gruppe nicht laden
view_tree_common_contextMenu_loadFail_dashboards=Konnte die benutzerspezifischen Dashboards nicht laden
view_group_membership_failFetch=Konnte die Ressourcen-Gruppe nicht laden
+common_label_yesterday=Gestern
+view_admin_systemSettings_savedSettings=Sie haben die Systemeinstellungen erfolgreich gespeichert
+view_admin_systemSettings_saveFailure=Das Speichern der Systemeinstellungen ist fehlgeschlagen
+view_admin_content=Inhalte
+view_admin_downloads_agent_buildNumber=Build-Nummer des Agents
+view_admin_downloads_agent_md5=MD5 Prüfsumme des Agents
+view_admin_downloads_agent_version=Version des Agents
+view_admin_downloads_cli_md5=MD5 Prüfsumme des CLI
+view_admin_downloads_cli_version=Version des CLI
+view_admin_systemSettings_AlertPurge_name=Lösche Alarme, die älter sind als
+view_admin_systemSettings_AvailabilityPurge_name=Lösche Verfügbarkeitsdaten, die älter sind als
+view_admin_systemSettings_serverDetails_time=Lokale Zeit des Servers
+view_admin_systemSettings_serverDetails_tz=Zeitzone des Servers
+view_admin_systemSettings_serverDetails_dbDriverName=Name des Datenbanktreibers
+view_admin_systemSettings_serverDetails_dbDriverVersion=Version des Datenbanktreibers
+view_admin_systemSettings_serverDetails_dbName=Produktname der Datenbank
+view_admin_systemSettings_serverDetails_dbUrl=URL der Datenbankverbindung
+view_admin_systemSettings_serverDetails_dbVersion=Produktversion der Datenbank
+view_admin_systemSettings_serverDetails_installDir=Installationsverzeichnis des Servers
+view_admin_systemSettings_serverDetails_nextRotation=Nächste Rotation der Metrik-Tabellen
+view_admin_systemSettings_serverDetails_currentTable=Aktuelle Datenbanktablee für Metrikdaten
+view_admin_systemSettings_TraitPurge_name=Lösche Trait-Daten, die älter sind als
commit 43c05bc680dfe7f06bdd99813b85a09df47f4ddb
Merge: b377d2e... e2a10e7...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Feb 11 10:37:05 2011 +0100
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit b377d2e2d9e194217a01ec8ef4c1f3ead964ea3b
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Feb 11 10:36:37 2011 +0100
Put the new logo in.
diff --git a/modules/enterprise/gui/installer-war/src/main/webapp/images/logo.png b/modules/enterprise/gui/installer-war/src/main/webapp/images/logo.png
index e9fcfaf..6850b02 100644
Binary files a/modules/enterprise/gui/installer-war/src/main/webapp/images/logo.png and b/modules/enterprise/gui/installer-war/src/main/webapp/images/logo.png differ
commit e2b376bb8a53ff992db6a040437fd36a6b5aea08
Merge: fdb7d18... 51a76f5...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Feb 10 18:24:15 2011 +0100
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit fdb7d18bc967a49f32af9b259d61dea2bb80220b
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Feb 10 18:19:55 2011 +0100
Include i18n properties files in filtering.
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 6f51d5a..8035d20 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -198,6 +198,29 @@
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <!-- here the phase you need -->
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
13 years, 3 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java | 6 ------
1 file changed, 6 deletions(-)
New commits:
commit e2a10e758a3a1913c2bb927990f90a1c2c0efec4
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Feb 10 17:42:45 2011 -0500
revert unneeded change in LocatableListGrid
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
index 53dbed5..1582171 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
@@ -1,8 +1,6 @@
package org.rhq.enterprise.gui.coregui.client.util.selenium;
import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
/**
* Wrapper for com.smartgwt.client.widgets.grid.ListGrid that sets the ID for use with selenium scLocators.
@@ -33,8 +31,4 @@ public class LocatableListGrid extends ListGrid implements Locatable {
return this.locatorId + "_" + extension;
}
- public String getValueIcon(ListGridField field, Object value, ListGridRecord record) {
- return null;
- }
-
}
13 years, 3 months
[rhq] modules/core modules/enterprise
by ips
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java | 6
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/DisambiguationReport.java | 14 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java | 25 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java | 125 +++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java | 68 +++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java | 63 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java | 48 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java | 62 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java | 78 +++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/schedule/ResourceOperationScheduleListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java | 38 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java | 29 +-
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/MutableDisambiguationReport.java | 3
20 files changed, 416 insertions(+), 163 deletions(-)
New commits:
commit 35cf748323049a16078ef9db4de0fa81cbe2c70f
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Feb 10 17:39:59 2011 -0500
more work on group history views; disambiguated Resource names are now displayed where appropriate
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
index 8e58e69..da9ada3 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceOperationHistoryCriteria.java
@@ -41,11 +41,13 @@ public class ResourceOperationHistoryCriteria extends OperationHistoryCriteria {
private static final long serialVersionUID = 1L;
private List<Integer> filterResourceIds; // requires override
+ private Integer filterGroupOperationHistoryId; // requires override
private boolean fetchResults;
public ResourceOperationHistoryCriteria() {
filterOverrides.put("resourceIds", "resource.id IN ( ? )");
+ filterOverrides.put("groupOperationHistoryId", "groupOperationHistory.id = ?");
}
@Override
@@ -57,6 +59,10 @@ public class ResourceOperationHistoryCriteria extends OperationHistoryCriteria {
this.filterResourceIds = Arrays.asList(filterResourceIds);
}
+ public void addFilterGroupOperationHistoryId(Integer groupOperationHistoryId) {
+ this.filterGroupOperationHistoryId = groupOperationHistoryId;
+ }
+
public void fetchResults(boolean fetchResults) {
this.fetchResults = fetchResults;
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/DisambiguationReport.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/DisambiguationReport.java
index 717721b..f1cb2e8 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/DisambiguationReport.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/DisambiguationReport.java
@@ -37,6 +37,7 @@ public class DisambiguationReport<T> implements Serializable {
private List<Resource> parents;
private ResourceType resourceType;
private String name;
+ private int id;
public static class ResourceType implements Serializable {
@@ -127,13 +128,14 @@ public class DisambiguationReport<T> implements Serializable {
public DisambiguationReport() {
}
- public DisambiguationReport(T original, List<Resource> parents, ResourceType resourceType, String name) {
+ public DisambiguationReport(T original, List<Resource> parents, ResourceType resourceType, String name, int id) {
this.original = original;
// this.parents = Collections.unmodifiableList(parents);
//spinder: the returned type is not Serializable and causes GWT serialization errors.
this.parents = parents;
this.resourceType = resourceType;
this.name = name;
+ this.id = id;
}
public T getOriginal() {
@@ -164,8 +166,16 @@ public class DisambiguationReport<T> implements Serializable {
return name;
}
+ /**
+ *
+ * @return the Resource id
+ */
+ public int getId() {
+ return id;
+ }
+
public String toString() {
return "DisambiguationReport(type=" + resourceType + ", parents=" + parents + ", original=" + original
- + ", name=" + name + ")";
+ + ", name=" + name + ", id=" + id + ")";
}
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index 79b8a88..2b4848f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -466,7 +466,7 @@ public class LoginView extends LocatableCanvas {
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_login_registerLdapSuccess(), Message.Severity.Info));
- Log.trace("Succesfully registered the new ldap Subject.");
+ Log.trace("Successfully registered the new ldap Subject.");
window.destroy();
loginShowing = false;
//indicate to login callback success
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java
index a3b402a..06a61b2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java
@@ -41,7 +41,7 @@ import org.rhq.enterprise.gui.coregui.server.util.SerialUtility;
*/
public interface OperationGWTService extends RemoteService {
- PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(
+ PageList<DisambiguationReport<ResourceOperationHistory>> findResourceOperationHistoriesByCriteria(
ResourceOperationHistoryCriteria criteria) throws RuntimeException;
PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(GroupOperationHistoryCriteria criteria)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
index 5ddebb5..78198bd 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDataSource.java
@@ -23,7 +23,10 @@ import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
+import com.smartgwt.client.data.fields.DataSourceDateTimeField;
+import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.types.FieldType;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.operation.OperationHistory;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -44,7 +47,6 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
public static abstract class Field {
public static final String ID = "id";
public static final String OPERATION_NAME = "operationName";
- public static final String RESOURCE = "resource";
public static final String STATUS = "status";
public static final String STARTED_TIME = "startedTime";
public static final String CREATED_TIME = "createdTime";
@@ -79,29 +81,26 @@ public abstract class AbstractOperationHistoryDataSource<T extends OperationHist
}
@Override
+ // TODO: i18n
protected List<DataSourceField> addDataSourceFields() {
List<DataSourceField> fields = super.addDataSourceFields();
- /*
- DataSourceIntegerField idField = new DataSourceIntegerField(Field.ID);
+ DataSourceIntegerField idField = new DataSourceIntegerField(Field.ID, "ID");
idField.setPrimaryKey(true);
fields.add(idField);
- */
- DataSourceTextField nameField = new DataSourceTextField(Field.OPERATION_NAME);
+ DataSourceTextField nameField = new DataSourceTextField(Field.OPERATION_NAME, "Operation");
fields.add(nameField);
- /*
- DataSourceTextField resourceField = new DataSourceTextField(Field.RESOURCE);
- fields.add(resourceField);
-
- DataSourceTextField statusField = new DataSourceTextField(Field.STATUS);
+ DataSourceTextField statusField = new DataSourceTextField(Field.STATUS, MSG.common_title_status());
fields.add(statusField);
- DataSourceTextField startedField = new DataSourceTextField(Field.STARTED_TIME);
- startedField.setType(FieldType.DATETIME);
+ DataSourceDateTimeField startedField = new DataSourceDateTimeField(Field.STARTED_TIME,
+ MSG.dataSource_operationHistory_startedTime());
fields.add(startedField);
- */
+
+ DataSourceTextField subjectField = new DataSourceTextField(Field.SUBJECT, "Requester");
+ fields.add(subjectField);
return fields;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
index 0d7681a..fc87592 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
@@ -25,6 +25,7 @@ import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.events.CloseClientEvent;
import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.LinkItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
@@ -42,7 +43,9 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
/**
* @author Greg Hinkle
@@ -50,22 +53,13 @@ import java.util.Date;
public abstract class AbstractOperationHistoryDetailsView<T extends OperationHistory> extends LocatableVLayout
implements BookmarkableView {
- private OperationDefinition definition;
private T operationHistory;
private DynamicForm form;
public AbstractOperationHistoryDetailsView(String locatorId) {
- this(locatorId, null, null);
- }
-
- public AbstractOperationHistoryDetailsView(String locatorId, OperationDefinition definition,
- T operationHistory) {
super(locatorId);
- this.definition = definition;
- this.operationHistory = operationHistory;
-
setWidth100();
setHeight100();
setOverflow(Overflow.AUTO);
@@ -80,17 +74,21 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
destroyMembers();
if (this.operationHistory != null) {
- displayDetails(operationHistory);
+ displayDetails(this.operationHistory);
}
}
+ /**
+ * This method should be called by {@link #lookupDetails(int)} upon successful lookup of an operation history.
+ *
+ * @param operationHistory the operation history to be displayed
+ */
protected void displayDetails(final T operationHistory) {
for (Canvas child : getMembers()) {
removeChild(child);
}
- this.definition = operationHistory.getOperationDefinition();
this.operationHistory = operationHistory;
// Information Form
@@ -98,16 +96,62 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
form = new DynamicForm();
form.setWidth100();
form.setWrapItemTitles(false);
+ List<FormItem> items = createFields(operationHistory);
+ form.setFields(items.toArray(new FormItem[items.size()]));
+ addMember(form);
+
+ // params/results
+
+ if (operationHistory.getParameters() != null) {
+ LocatableVLayout parametersSection = new LocatableVLayout(extendLocatorId("ParametersSection"));
+
+ Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_parameters() + "</h4>");
+ title.setHeight(27);
+ parametersSection.addMember(title);
+
+ OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
+ ConfigurationDefinition parametersConfigurationDefinition = operationDefinition
+ .getParametersConfigurationDefinition();
+ if (parametersConfigurationDefinition != null &&
+ !parametersConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
+ ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("params"),
+ parametersConfigurationDefinition, operationHistory.getParameters());
+ editor.setReadOnly(true);
+ parametersSection.addMember(editor);
+ } else {
+ Label noParametersLabel = new Label("This operation does not take any parameters.");
+ noParametersLabel.setHeight(17);
+ parametersSection.addMember(noParametersLabel);
+ }
+
+ addMember(parametersSection);
+ }
+
+ Canvas resultsSection = buildResultsSection(operationHistory);
+ if (resultsSection != null) {
+ addMember(resultsSection);
+ }
+
+ VLayout verticalSpacer = new VLayout();
+ verticalSpacer.setHeight100();
+ addMember(verticalSpacer);
+ }
+
+ protected List<FormItem> createFields(final T operationHistory) {
+ List<FormItem> items = new ArrayList<FormItem>();
OperationRequestStatus status = operationHistory.getStatus();
StaticTextItem operationItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.OPERATION_NAME, MSG
.view_operationHistoryDetails_operation());
- operationItem.setValue(definition.getDisplayName());
+ OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
+ operationItem.setValue(operationDefinition.getDisplayName());
+ items.add(operationItem);
StaticTextItem submittedItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STARTED_TIME, MSG
.view_operationHistoryDetails_dateSubmitted());
submittedItem.setValue(new Date(operationHistory.getStartedTime()));
+ items.add(submittedItem);
StaticTextItem completedItem = new StaticTextItem("completed", MSG.view_operationHistoryDetails_dateCompleted());
if (status == OperationRequestStatus.INPROGRESS) {
@@ -117,12 +161,12 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
} else {
completedItem.setValue(new Date(operationHistory.getStartedTime() + operationHistory.getDuration()));
}
+ items.add(completedItem);
StaticTextItem requesterItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.SUBJECT, MSG
.view_operationHistoryDetails_requestor());
requesterItem.setValue(operationHistory.getSubjectName());
-
- LinkItem errorLinkItem = null;
+ items.add(requesterItem);
StaticTextItem statusItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STATUS, MSG
.view_operationHistoryDetails_status());
@@ -134,7 +178,7 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
break;
case FAILURE:
statusItem.setTooltip(MSG.common_status_failed());
- errorLinkItem = new LinkItem("errorLink");
+ LinkItem errorLinkItem = new LinkItem("errorLink");
errorLinkItem.setTitle(MSG.common_title_error());
errorLinkItem.setLinkTitle(getShortErrorMessage(operationHistory));
errorLinkItem.addClickHandler(new ClickHandler() {
@@ -174,7 +218,7 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
winModal.show();
}
});
-
+ items.add(errorLinkItem);
break;
case INPROGRESS:
statusItem.setTooltip(MSG.common_status_inprogress());
@@ -190,57 +234,20 @@ public abstract class AbstractOperationHistoryDetailsView<T extends OperationHis
Date Completed: 3/11/10, 12:24:03 PM, EST
Requester: rhqadmin
Status: Failure
- Error Message: __Exception: Cannot connect...__
+ Error Message: __Exception: Cannot connect...__
*/
- if (errorLinkItem != null) {
- form.setItems(operationItem, submittedItem, completedItem, requesterItem, statusItem, errorLinkItem);
- } else {
- form.setItems(operationItem, submittedItem, completedItem, requesterItem, statusItem);
- }
-
- addMember(form);
-
- // params/results
-
- if (operationHistory.getParameters() != null) {
- LocatableVLayout parametersSection = new LocatableVLayout(extendLocatorId("ParametersSection"));
-
- Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_parameters() + "</h4>");
- title.setHeight(27);
- parametersSection.addMember(title);
-
- ConfigurationDefinition parametersConfigurationDefinition = definition
- .getParametersConfigurationDefinition();
- if (parametersConfigurationDefinition != null &&
- !parametersConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
- ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("params"),
- parametersConfigurationDefinition, operationHistory.getParameters());
- editor.setReadOnly(true);
- parametersSection.addMember(editor);
- } else {
- Label noParametersLabel = new Label("This operation does not take any parameters.");
- noParametersLabel.setHeight(17);
- parametersSection.addMember(noParametersLabel);
- }
-
- addMember(parametersSection);
- }
-
- Canvas resultsSection = buildResultsSection(operationHistory);
- if (resultsSection != null) {
- addMember(resultsSection);
- }
-
- VLayout verticalSpacer = new VLayout();
- verticalSpacer.setHeight100();
- addMember(verticalSpacer);
+ return items;
}
protected abstract Canvas buildResultsSection(T operationHistory);
protected abstract void lookupDetails(int historyId);
+ protected T getOperationHistory() {
+ return this.operationHistory;
+ }
+
@Override
public void renderView(ViewPath viewPath) {
int historyId = viewPath.getCurrentAsInt();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
index a010a23..98c7331 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryListView.java
@@ -43,24 +43,26 @@ import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDataSource;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
/**
* @author Greg Hinkle
* @author John Mazzitelli
+ * @author Ian Springer
*/
-public abstract class AbstractOperationHistoryListView extends TableSection<AbstractOperationHistoryDataSource> {
+public abstract class AbstractOperationHistoryListView<T extends AbstractOperationHistoryDataSource> extends TableSection<T > {
private static final String HEADER_ICON = "subsystems/control/Operation_24.png";
- public AbstractOperationHistoryListView(String locatorId, AbstractOperationHistoryDataSource dataSource, String title) {
+ public AbstractOperationHistoryListView(String locatorId, T dataSource, String title) {
super(locatorId, title);
setDataSource(dataSource);
setHeaderIcon(HEADER_ICON);
}
- public AbstractOperationHistoryListView(String locatorId, AbstractOperationHistoryDataSource dataSource, String title,
+ public AbstractOperationHistoryListView(String locatorId, T dataSource, String title,
Criteria criteria) {
super(locatorId, title, criteria);
setDataSource(dataSource);
@@ -106,22 +108,39 @@ public abstract class AbstractOperationHistoryListView extends TableSection<Abst
protected List<ListGridField> createFields() {
List<ListGridField> fields = new ArrayList<ListGridField>();
- ListGridField idField = new ListGridField(AbstractOperationHistoryDataSource.Field.ID, MSG.common_title_id());
+ ListGridField idField = new ListGridField(AbstractOperationHistoryDataSource.Field.ID);
idField.setWidth(38);
fields.add(idField);
- ListGridField opNameField = new ListGridField(AbstractOperationHistoryDataSource.Field.OPERATION_NAME,
- MSG.dataSource_operationHistory_operationName());
+ ListGridField opNameField = new ListGridField(AbstractOperationHistoryDataSource.Field.OPERATION_NAME);
opNameField.setWidth("34%");
fields.add(opNameField);
- ListGridField subjectField = new ListGridField(AbstractOperationHistoryDataSource.Field.SUBJECT,
- MSG.common_title_user());
+ ListGridField subjectField = new ListGridField(AbstractOperationHistoryDataSource.Field.SUBJECT);
subjectField.setWidth("33%");
fields.add(subjectField);
- ListGridField statusField = new ListGridField(AbstractOperationHistoryDataSource.Field.STATUS,
- MSG.common_title_status());
+ ListGridField statusField = createStatusField();
+ fields.add(statusField);
+
+ ListGridField startedTimeField = createStartedTimeField();
+ startedTimeField.setWidth("33%");
+ fields.add(startedTimeField);
+
+ return fields;
+ }
+
+ protected ListGridField createStartedTimeField() {
+ ListGridField startedTimeField = new ListGridField(AbstractOperationHistoryDataSource.Field.STARTED_TIME);
+ startedTimeField.setType(ListGridFieldType.DATE);
+ startedTimeField.setDateFormatter(DateDisplayFormat.TOLOCALESTRING);
+ startedTimeField.setAlign(Alignment.LEFT);
+ startedTimeField.setCellAlign(Alignment.LEFT);
+ return startedTimeField;
+ }
+
+ protected ListGridField createStatusField() {
+ ListGridField statusField = new ListGridField(AbstractOperationHistoryDataSource.Field.STATUS);
statusField.setAlign(Alignment.CENTER);
statusField.setCellAlign(Alignment.CENTER);
statusField.setShowHover(true);
@@ -197,18 +216,25 @@ public abstract class AbstractOperationHistoryListView extends TableSection<Abst
}
});
statusField.setWidth(44);
- fields.add(statusField);
- ListGridField startedTimeField = new ListGridField(AbstractOperationHistoryDataSource.Field.STARTED_TIME,
- MSG.dataSource_operationHistory_startedTime());
- startedTimeField.setType(ListGridFieldType.DATE);
- startedTimeField.setDateFormatter(DateDisplayFormat.TOLOCALESTRING);
- startedTimeField.setAlign(Alignment.LEFT);
- startedTimeField.setCellAlign(Alignment.LEFT);
- startedTimeField.setWidth("33%");
- fields.add(startedTimeField);
+ return statusField;
+ }
- return fields;
+ protected ListGridField createResourceField() {
+ ListGridField resourceField = new ListGridField(ResourceOperationHistoryDataSource.Field.RESOURCE,
+ MSG.common_title_resource());
+ resourceField.setAlign(Alignment.LEFT);
+ resourceField.setCellAlign(Alignment.LEFT);
+ //resourceField.setSuppressValueIcon(true);
+ //resourceField.setValueIcons(new HashMap<String, String>(0));
+ /*resourceField.setCellFormatter(new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
+ Resource resource = (Resource) value;
+ String url = LinkManager.getResourceLink(resource.getId());
+ return "<a href=\"" + url + "\">" + resource.getName() + "</a>";
+ }
+ });*/
+ return resourceField;
}
@Override
@@ -216,4 +242,6 @@ public abstract class AbstractOperationHistoryListView extends TableSection<Abst
return AbstractOperationHistoryDataSource.Field.OPERATION_NAME;
}
+
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java
new file mode 100644
index 0000000..250c2c9
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupMemberResourceOperationHistoryListView.java
@@ -0,0 +1,63 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.history;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDataSource;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryListView;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDataSource;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDetailsView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Ian Springer
+ */
+public class GroupMemberResourceOperationHistoryListView
+ extends AbstractOperationHistoryListView<ResourceOperationHistoryDataSource> {
+
+ private ResourceGroupComposite groupComposite;
+
+ public GroupMemberResourceOperationHistoryListView(String locatorId, ResourceGroupComposite groupComposite,
+ int groupOperationHistoryId) {
+ super(locatorId, new ResourceOperationHistoryDataSource(), null,
+ new Criteria(ResourceOperationHistoryDataSource.CriteriaField.GROUP_OPERATION_HISTORY_ID,
+ String.valueOf(groupOperationHistoryId)));
+ this.groupComposite = groupComposite;
+ }
+
+ @Override
+ protected List<ListGridField> createFields() {
+ List<ListGridField> fields = new ArrayList<ListGridField>();
+
+ ListGridField idField = new ListGridField(AbstractOperationHistoryDataSource.Field.ID, MSG.common_title_id());
+ idField.setWidth(38);
+ fields.add(idField);
+
+ ListGridField resourceField = createResourceField();
+ resourceField.setWidth("70%");
+ fields.add(resourceField);
+
+ ListGridField statusField = createStatusField();
+ fields.add(statusField);
+
+ ListGridField startedTimeField = createStartedTimeField();
+ startedTimeField.setWidth("30%");
+ fields.add(startedTimeField);
+
+ return fields;
+ }
+
+ @Override
+ protected boolean hasControlPermission() {
+ return groupComposite.getResourcePermission().isControl();
+ }
+
+ @Override
+ public Canvas getDetailsView(int id) {
+ return new ResourceOperationHistoryDetailsView(extendLocatorId("DetailsView"), true);
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java
index 937c163..2d114b7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java
@@ -1,29 +1,48 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.history;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
import org.rhq.core.domain.criteria.GroupOperationHistoryCriteria;
import org.rhq.core.domain.operation.GroupOperationHistory;
-import org.rhq.core.domain.operation.OperationDefinition;
-import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDetailsView;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
* @author Ian Springer
*/
public class GroupOperationHistoryDetailsView extends AbstractOperationHistoryDetailsView<GroupOperationHistory> {
- public GroupOperationHistoryDetailsView(String locatorId) {
+ private ResourceGroupComposite groupComposite;
+
+ public GroupOperationHistoryDetailsView(String locatorId, ResourceGroupComposite groupComposite) {
super(locatorId);
- }
- public GroupOperationHistoryDetailsView(String locatorId, OperationDefinition definition,
- GroupOperationHistory operationHistory) {
- super(locatorId, definition, operationHistory);
+ this.groupComposite = groupComposite;
}
protected void lookupDetails(int historyId) {
@@ -50,9 +69,20 @@ public class GroupOperationHistoryDetailsView extends AbstractOperationHistoryDe
@Override
protected Canvas buildResultsSection(GroupOperationHistory operationHistory) {
- OperationRequestStatus status = operationHistory.getStatus();
+ LocatableVLayout resultsSection = new LocatableVLayout(extendLocatorId("ResultsSection"));
+
+ Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_results() + "</h4>");
+ title.setHeight(27);
+ resultsSection.addMember(title);
+
+ GroupMemberResourceOperationHistoryListView memberHistoryListView =
+ new GroupMemberResourceOperationHistoryListView(extendLocatorId("MembersListView"), this.groupComposite,
+ getOperationHistory().getId());
+ memberHistoryListView.setOverflow(Overflow.VISIBLE);
+ memberHistoryListView.setHeight(200);
+ resultsSection.addMember(memberHistoryListView);
- return new Label("<h5>TODO</h5>");
+ return resultsSection;
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java
index af0e786..6a415c2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java
@@ -45,7 +45,7 @@ public class GroupOperationHistoryListView extends AbstractOperationHistoryListV
@Override
public Canvas getDetailsView(int id) {
- return new GroupOperationHistoryDetailsView(extendLocatorId("DetailsView"));
+ return new GroupOperationHistoryDetailsView(extendLocatorId("DetailsView"), this.groupComposite);
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
index ca53ba0..797f5bb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDataSource.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2010-2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -23,12 +23,22 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.DataSourceField;
+import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
import org.rhq.core.domain.operation.ResourceOperationHistory;
+import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDataSource;
+import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* @author Ian Springer
@@ -41,6 +51,17 @@ public class ResourceOperationHistoryDataSource extends AbstractOperationHistory
public static abstract class CriteriaField {
public static final String RESOURCE_ID = "resourceId";
+ public static final String GROUP_OPERATION_HISTORY_ID = "groupOperationHistoryId";
+ }
+
+ @Override
+ protected List<DataSourceField> addDataSourceFields() {
+ List<DataSourceField> fields = super.addDataSourceFields();
+
+ DataSourceTextField resourceField = new DataSourceTextField(Field.RESOURCE);
+ fields.add(resourceField);
+
+ return fields;
}
@Override
@@ -48,31 +69,50 @@ public class ResourceOperationHistoryDataSource extends AbstractOperationHistory
ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
if (request.getCriteria().getValues().containsKey(CriteriaField.RESOURCE_ID)) {
- int resourceId = Integer.parseInt((String)request.getCriteria().getValues().get(
- CriteriaField.RESOURCE_ID));
+ int resourceId = getFilter(request, CriteriaField.RESOURCE_ID, Integer.class);
criteria.addFilterResourceIds(resourceId);
}
+ if (request.getCriteria().getValues().containsKey(CriteriaField.GROUP_OPERATION_HISTORY_ID)) {
+ int groupOperationHistoryId = getFilter(request, CriteriaField.GROUP_OPERATION_HISTORY_ID, Integer.class);
+ criteria.addFilterGroupOperationHistoryId(groupOperationHistoryId);
+ }
+
criteria.setPageControl(getPageControl(request));
operationService.findResourceOperationHistoriesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceOperationHistory>>() {
+ new AsyncCallback<PageList<DisambiguationReport<ResourceOperationHistory>>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.dataSource_operationHistory_error_fetchFailure(), caught);
}
- public void onSuccess(PageList<ResourceOperationHistory> result) {
- response.setData(buildRecords(result));
+ public void onSuccess(PageList<DisambiguationReport<ResourceOperationHistory>> result) {
+ response.setData(buildRecordsFromDisambiguationReports(result));
processResponse(request.getRequestId(), response);
}
});
}
- @Override
- public ListGridRecord copyValues(ResourceOperationHistory from) {
- ListGridRecord record = super.copyValues(from);
- record.setAttribute(Field.RESOURCE, from.getResource());
- return record;
+ private ListGridRecord[] buildRecordsFromDisambiguationReports(
+ Collection<DisambiguationReport<ResourceOperationHistory>> disambiguationReports) {
+ List<ResourceOperationHistory> dataObjects = new ArrayList<ResourceOperationHistory>(disambiguationReports.size());
+ Map<Integer, String> idToDisambiguatedNameMap = new HashMap<Integer, String>();
+ for (DisambiguationReport<ResourceOperationHistory> disambiguationReport : disambiguationReports) {
+ ResourceOperationHistory dataObject = disambiguationReport.getOriginal();
+ dataObjects.add(dataObject);
+ String disambiguatedName = ReportDecorator.decorateDisambiguationReport(disambiguationReport,
+ disambiguationReport.getId(), true);
+ idToDisambiguatedNameMap.put(dataObject.getId(), disambiguatedName);
+ }
+
+ ListGridRecord[] records = buildRecords(dataObjects, true);
+ for (ListGridRecord record : records) {
+ Integer id = record.getAttributeAsInt(Field.ID);
+ String disambiguatedName = idToDisambiguatedNameMap.get(id);
+ record.setAttribute(Field.RESOURCE, disambiguatedName);
+ }
+
+ return records;
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
index f9de542..09a50fe 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
@@ -1,31 +1,74 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.core.domain.operation.ResourceOperationHistory;
+import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDetailsView;
+import org.rhq.enterprise.gui.coregui.client.resource.disambiguation.ReportDecorator;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import java.util.List;
+
/**
* @author Ian Springer
*/
public class ResourceOperationHistoryDetailsView extends AbstractOperationHistoryDetailsView<ResourceOperationHistory> {
+ private String disambiguatedResourceName;
+ private boolean showResourceField;
+
public ResourceOperationHistoryDetailsView(String locatorId) {
+ this(locatorId, false);
+ }
+
+ public ResourceOperationHistoryDetailsView(String locatorId, boolean showResourceField) {
super(locatorId);
+
+ this.showResourceField = showResourceField;
}
- public ResourceOperationHistoryDetailsView(String locatorId, OperationDefinition definition,
- ResourceOperationHistory operationHistory) {
- super(locatorId, definition, operationHistory);
+ @Override
+ protected List<FormItem> createFields(ResourceOperationHistory operationHistory) {
+ List<FormItem> items = super.createFields(operationHistory);
+
+ if (this.showResourceField) {
+ StaticTextItem resourceItem = new StaticTextItem("resource", "Resource");
+ resourceItem.setValue(this.disambiguatedResourceName);
+ items.add(0, resourceItem);
+ }
+
+ return items;
}
protected void lookupDetails(int historyId) {
@@ -38,14 +81,19 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
criteria.fetchResults(true);
GWTServiceLookup.getOperationService().findResourceOperationHistoriesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceOperationHistory>>() {
+ new AsyncCallback<PageList<DisambiguationReport<ResourceOperationHistory>>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler()
.handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
}
- public void onSuccess(PageList<ResourceOperationHistory> result) {
- ResourceOperationHistory item = result.get(0);
+ public void onSuccess(PageList<DisambiguationReport<ResourceOperationHistory>> result) {
+ DisambiguationReport<ResourceOperationHistory> disambiguationReport = result.get(0);
+ if (showResourceField) {
+ disambiguatedResourceName = ReportDecorator.decorateDisambiguationReport(disambiguationReport,
+ disambiguationReport.getId(), true);
+ }
+ ResourceOperationHistory item = disambiguationReport.getOriginal();
displayDetails(item);
}
});
@@ -54,7 +102,7 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
@Override
protected Canvas buildResultsSection(ResourceOperationHistory operationHistory) {
OperationRequestStatus status = operationHistory.getStatus();
- if (status == OperationRequestStatus.SUCCESS && operationHistory.getResults() != null) {
+ if (status == OperationRequestStatus.SUCCESS) {
LocatableVLayout resultsSection = new LocatableVLayout(extendLocatorId("ResultsSection"));
Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_results() + "</h4>");
@@ -62,10 +110,18 @@ public class ResourceOperationHistoryDetailsView extends AbstractOperationHistor
resultsSection.addMember(title);
OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
- ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("results"), operationDefinition
- .getResultsConfigurationDefinition(), operationHistory.getResults());
- editor.setReadOnly(true);
- resultsSection.addMember(editor);
+ ConfigurationDefinition resultsConfigurationDefinition = operationDefinition.getResultsConfigurationDefinition();
+ if (resultsConfigurationDefinition != null &&
+ !resultsConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
+ ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("results"), operationDefinition
+ .getResultsConfigurationDefinition(), operationHistory.getResults());
+ editor.setReadOnly(true);
+ resultsSection.addMember(editor);
+ } else {
+ Label noResultsLabel = new Label("This operation does not return any results.");
+ noResultsLabel.setHeight(17);
+ resultsSection.addMember(noResultsLabel);
+ }
return resultsSection;
} else {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java
index 3cd24ce..291bf07 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java
@@ -25,6 +25,8 @@ import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryListView;
/**
+ * A table that displays all of the operation histories for a particular Resource.
+ *
* @author Ian Springer
*/
public class ResourceOperationHistoryListView extends AbstractOperationHistoryListView {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/schedule/ResourceOperationScheduleListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/schedule/ResourceOperationScheduleListView.java
index 1f37161..eec89cc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/schedule/ResourceOperationScheduleListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/schedule/ResourceOperationScheduleListView.java
@@ -25,6 +25,8 @@ import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.schedule.AbstractOperationScheduleListView;
/**
+ * A table that displays all of the operation schedules for a particular Resource.
+ *
* @author Ian Springer
*/
public class ResourceOperationScheduleListView extends AbstractOperationScheduleListView {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java
index b4c3091..d3126d8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java
@@ -19,19 +19,9 @@
*/
package org.rhq.enterprise.gui.coregui.client.report.operation;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Set;
-
-import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-
import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.PermissionsLoadedListener;
import org.rhq.enterprise.gui.coregui.client.PermissionsLoader;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
@@ -40,6 +30,10 @@ import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.h
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDataSource;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDetailsView;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+
/**
* @author Ian Springer
*/
@@ -74,35 +68,27 @@ public class SubsystemOperationHistoryListView extends AbstractOperationHistoryL
protected List<ListGridField> createFields() {
List<ListGridField> fields = super.createFields();
+ ListGridField resourceField = createResourceField();
+ resourceField.setWidth("40%");
+ fields.add(1, resourceField);
+
for (ListGridField field : fields) {
String fieldName = field.getName();
+ if (fieldName.equals(AbstractOperationHistoryDataSource.Field.SUBJECT)) {
+ field.setWidth("10%");
+ }
if (fieldName.equals(AbstractOperationHistoryDataSource.Field.OPERATION_NAME) ||
- fieldName.equals(AbstractOperationHistoryDataSource.Field.SUBJECT) ||
fieldName.equals(AbstractOperationHistoryDataSource.Field.STARTED_TIME)) {
field.setWidth("25%");
}
}
- ListGridField resourceField = new ListGridField(AbstractOperationHistoryDataSource.Field.RESOURCE,
- MSG.common_title_resource());
- resourceField.setAlign(Alignment.LEFT);
- resourceField.setCellAlign(Alignment.LEFT);
- resourceField.setCellFormatter(new CellFormatter() {
- public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- Resource resource = (Resource) o;
- String url = LinkManager.getResourceLink(resource.getId());
- return "<a href=\"" + url + "\">" + resource.getName() + "</a>";
- }
- });
- resourceField.setWidth("25%");
- fields.add(resourceField);
-
return fields;
}
@Override
public Canvas getDetailsView(int id) {
- return new ResourceOperationHistoryDetailsView(this.extendLocatorId("DetailsView"));
+ return new ResourceOperationHistoryDetailsView(this.extendLocatorId("DetailsView"), true);
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index 47d9d49..9583cae 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -50,6 +50,7 @@ import org.hibernate.validator.RangeValidator;
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.event.EventSeverity;
import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
index 28e6169..53dbed5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableListGrid.java
@@ -1,6 +1,8 @@
package org.rhq.enterprise.gui.coregui.client.util.selenium;
import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
/**
* Wrapper for com.smartgwt.client.widgets.grid.ListGrid that sets the ID for use with selenium scLocators.
@@ -30,4 +32,9 @@ public class LocatableListGrid extends ListGrid implements Locatable {
public String extendLocatorId(String extension) {
return this.locatorId + "_" + extension;
}
+
+ public String getValueIcon(ListGridField field, Object value, ListGridRecord record) {
+ return null;
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
index 0bc70db..4d06805 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/OperationGWTServiceImpl.java
@@ -53,11 +53,19 @@ public class OperationGWTServiceImpl extends AbstractGWTServiceImpl implements O
private OperationManagerLocal operationManager = LookupUtil.getOperationManager();
private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
- public PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(
+ public PageList<DisambiguationReport<ResourceOperationHistory>> findResourceOperationHistoriesByCriteria(
ResourceOperationHistoryCriteria criteria) throws RuntimeException {
try {
- return SerialUtility.prepare(operationManager.findResourceOperationHistoriesByCriteria(getSessionSubject(),
- criteria), "OperationService.findResourceOperationHistoriesByCriteria");
+ PageList<ResourceOperationHistory> resourceOperationHistories =
+ SerialUtility.prepare(operationManager.findResourceOperationHistoriesByCriteria(getSessionSubject(),
+ criteria), "OperationService.findResourceOperationHistoriesByCriteria");
+
+ List<DisambiguationReport<ResourceOperationHistory>> disambiguatedLastCompletedResourceOps = resourceManager
+ .disambiguate(resourceOperationHistories, RESOURCE_OPERATION_HISTORY_RESOURCE_ID_EXTRACTOR,
+ DefaultDisambiguationUpdateStrategies.getDefault());
+
+ return new PageList<DisambiguationReport<ResourceOperationHistory>>(disambiguatedLastCompletedResourceOps,
+ resourceOperationHistories.getTotalSize(), resourceOperationHistories.getPageControl());
} catch (Throwable t) {
throw new RuntimeException(ThrowableUtil.getAllMessages(t));
}
@@ -219,15 +227,22 @@ public class OperationGWTServiceImpl extends AbstractGWTServiceImpl implements O
}
}
+ private static final IntExtractor<ResourceOperationHistory> RESOURCE_OPERATION_HISTORY_RESOURCE_ID_EXTRACTOR =
+ new IntExtractor<ResourceOperationHistory>() {
+ public int extract(ResourceOperationHistory resourceOperationHistory) {
+ return resourceOperationHistory.getResource().getId();
+ }
+ };
+
private static final IntExtractor<ResourceOperationLastCompletedComposite> RESOURCE_OPERATION_RESOURCE_ID_EXTRACTOR = new IntExtractor<ResourceOperationLastCompletedComposite>() {
- public int extract(ResourceOperationLastCompletedComposite object) {
- return object.getResourceId();
+ public int extract(ResourceOperationLastCompletedComposite resourceOperationLastCompletedComposite) {
+ return resourceOperationLastCompletedComposite.getResourceId();
}
};
private static final IntExtractor<ResourceOperationScheduleComposite> RESOURCE_OPERATION_SCHEDULE_RESOURCE_ID_EXTRACTOR = new IntExtractor<ResourceOperationScheduleComposite>() {
- public int extract(ResourceOperationScheduleComposite object) {
- return object.getResourceId();
+ public int extract(ResourceOperationScheduleComposite resourceOperationScheduleComposite) {
+ return resourceOperationScheduleComposite.getResourceId();
}
};
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
index e3d4723..042d760 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java
@@ -154,7 +154,7 @@ public class ViewAction extends TilesAction {
}
public DisambiguatedRecentlyAddedResourceComposite(DisambiguationReport<RecentlyAddedResourceComposite> report) {
- super(report.getOriginal(), report.getParents(), report.getResourceType(), report.getName());
+ super(report.getOriginal(), report.getParents(), report.getResourceType(), report.getName(), report.getId());
children = new ArrayList<DisambiguatedRecentlyAddedResourceComposite>();
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/MutableDisambiguationReport.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/MutableDisambiguationReport.java
index 8c4f78b..779ff2c 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/MutableDisambiguationReport.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/MutableDisambiguationReport.java
@@ -99,7 +99,8 @@ public class MutableDisambiguationReport<T> {
realParents.add(p.getResource());
}
}
- return new DisambiguationReport<T>(original, realParents, resource.resourceType.getResourceType(), resource.name);
+ return new DisambiguationReport<T>(original, realParents, resource.resourceType.getResourceType(),
+ resource.name, resource.id);
}
@Override
13 years, 3 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 81747946d4b44a8352e02c275e72b90b44c23399
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Feb 10 17:26:27 2011 -0500
change the link manager to use the new gwt downloads link
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index b8e0dbd..9c9307e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -327,7 +327,11 @@ public class LinkManager {
}
public static String getAdminDownloadsLink() {
- return "/rhq/admin/downloads.xhtml";
+ if (GWT) {
+ return "#Administration/Configuration/Downloads";
+ } else {
+ return "/rhq/admin/downloads.xhtml";
+ }
}
public static String getDebugSqlLink() {
13 years, 3 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 13 ++++------
1 file changed, 6 insertions(+), 7 deletions(-)
New commits:
commit 5dfdc1093028539ddc76e353eacb68f35e02a2f6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Feb 10 17:23:21 2011 -0500
ConfigEditor - assign the property name as the name of the associated
Item. This allows for locators that are name-based as opposed to positional,
which is better for test automation.
- also, remove some unused var decls
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index 23b0f5e..ff33cc7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -141,7 +141,6 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
// but there were problems with having different editors active for different rows in the table at the same time.
// Smart says they're working on enhancing this area, but the DynamicForm might be a better option anyway. (ghinkle)
//
-@SuppressWarnings( { "UnnecessarySemicolon" })
public class ConfigurationEditor extends LocatableVLayout {
private static final String RHQ_PROPERTY_ATTRIBUTE_NAME = "rhq:property";
@@ -156,8 +155,6 @@ public class ConfigurationEditor extends LocatableVLayout {
private ValuesManager valuesManager = new ValuesManager();
- private boolean changed = false;
-
private Label loadingLabel = new Label("<b>" + MSG.common_msg_loading() + "</b>");
private int resourceId;
@@ -333,8 +330,8 @@ public class ConfigurationEditor extends LocatableVLayout {
if (groupDefinitions.isEmpty()) {
// No prop groups, so we just need a single form for the non-grouped props.
- List<PropertyDefinition> propertyDefinitions =
- new ArrayList<PropertyDefinition>(configurationDefinition.getNonGroupedProperties());
+ List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>(configurationDefinition
+ .getNonGroupedProperties());
DynamicForm form = buildPropertiesForm(layout.extendLocatorId("Props"), propertyDefinitions, configuration);
form.setBorder("1px solid #AAA");
@@ -622,7 +619,6 @@ public class ConfigurationEditor extends LocatableVLayout {
private FormItem buildMapField(String parentLocatorId, PropertyDefinitionMap propertyDefinitionMap,
final PropertyMap propertyMap) {
- String locatorId = parentLocatorId + "_" + propertyDefinitionMap.getName();
boolean isDynamic = isDynamic(propertyDefinitionMap);
if (isDynamic) {
PropertyDefinitionMap propertyDefinitionMapClone = new PropertyDefinitionMap(propertyDefinitionMap
@@ -1224,6 +1220,10 @@ public class ConfigurationEditor extends LocatableVLayout {
}
}
+ // for more robust and repeatable item locators (not positional) assign a name and title
+ valueItem.setName(propertySimple.getName());
+ valueItem.setTitle("none");
+ valueItem.setShowTitle(false);
valueItem.setDefaultValue(propertySimple.getStringValue());
valueItem.setRequired(propertyDefinitionSimple.isRequired());
@@ -1244,7 +1244,6 @@ public class ConfigurationEditor extends LocatableVLayout {
});
*/
- valueItem.setShowTitle(false);
valueItem.setWidth(220);
// Only update the underlying property when the input is changed if it's a top-level simple or a simple within a
13 years, 3 months