Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 209317 Details for
Bug 368356
Update of LML_da (-> 1.14)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch (version 1.12 -> 1.14)
Bug-368356.patch (text/plain), 308.81 KB, created by
Wolfgang Frings
on 2012-01-11 10:34:42 EST
(
hide
)
Description:
Patch (version 1.12 -> 1.14)
Filename:
MIME Type:
Creator:
Wolfgang Frings
Created:
2012-01-11 10:34:42 EST
Size:
308.81 KB
patch
obsolete
>diff --git a/.gitignore b/.gitignore >index fdb3c3b..c6b0a60 100644 >--- a/.gitignore >+++ b/.gitignore >@@ -17,3 +17,4 @@ > bitset_test > rangeset_test > testaif >+/.project >diff --git a/core/org.eclipse.ptp.proxy/META-INF/MANIFEST.MF b/core/org.eclipse.ptp.proxy/META-INF/MANIFEST.MF >index a1a0c95..c55952a 100644 >--- a/core/org.eclipse.ptp.proxy/META-INF/MANIFEST.MF >+++ b/core/org.eclipse.ptp.proxy/META-INF/MANIFEST.MF >@@ -2,6 +2,6 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ptp.proxy >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Vendor: %pluginProvider > Bundle-Localization: plugin >diff --git a/core/org.eclipse.ptp.remote.remotetools.ui/src/org/eclipse/ptp/remote/remotetools/ui/RemoteToolsUIFileManager.java b/core/org.eclipse.ptp.remote.remotetools.ui/src/org/eclipse/ptp/remote/remotetools/ui/RemoteToolsUIFileManager.java >index d8723c2..d1278ce 100644 >--- a/core/org.eclipse.ptp.remote.remotetools.ui/src/org/eclipse/ptp/remote/remotetools/ui/RemoteToolsUIFileManager.java >+++ b/core/org.eclipse.ptp.remote.remotetools.ui/src/org/eclipse/ptp/remote/remotetools/ui/RemoteToolsUIFileManager.java >@@ -39,6 +39,7 @@ > connection, shell, RemoteResourceBrowser.SINGLE); > browser.setType(RemoteResourceBrowser.DIRECTORY_BROWSER); > browser.setInitialPath(filterPath); >+ browser.setTitle(message); > browser.showConnections(showConnections); > if (browser.open() == Window.CANCEL) { > return null; >@@ -64,6 +65,7 @@ > connection, shell, RemoteResourceBrowser.SINGLE); > browser.setType(RemoteResourceBrowser.FILE_BROWSER); > browser.setInitialPath(filterPath); >+ browser.setTitle(message); > browser.showConnections(showConnections); > if (browser.open() == Window.CANCEL) { > return null; >@@ -89,6 +91,7 @@ > connection, shell, RemoteResourceBrowser.MULTI); > browser.setType(RemoteResourceBrowser.FILE_BROWSER); > browser.setInitialPath(filterPath); >+ browser.setTitle(message); > browser.showConnections(showConnections); > if (browser.open() == Window.CANCEL) { > return null; >diff --git a/core/org.eclipse.ptp.utils/META-INF/MANIFEST.MF b/core/org.eclipse.ptp.utils/META-INF/MANIFEST.MF >index afd36b2..079b3ea 100644 >--- a/core/org.eclipse.ptp.utils/META-INF/MANIFEST.MF >+++ b/core/org.eclipse.ptp.utils/META-INF/MANIFEST.MF >@@ -2,6 +2,6 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ptp.utils >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Vendor: %pluginProvider > Bundle-Localization: plugin >diff --git a/debug/org.eclipse.ptp.debug.sdm/META-INF/MANIFEST.MF b/debug/org.eclipse.ptp.debug.sdm/META-INF/MANIFEST.MF >index 06477d5..383292c 100644 >--- a/debug/org.eclipse.ptp.debug.sdm/META-INF/MANIFEST.MF >+++ b/debug/org.eclipse.ptp.debug.sdm/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ptp.debug.sdm >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Vendor: %pluginProvider > Require-Bundle: org.eclipse.ptp.proxy, > org.eclipse.ptp.utils >diff --git a/pom.xml b/pom.xml >index eca992a..347d388 100644 >--- a/pom.xml >+++ b/pom.xml >@@ -16,6 +16,7 @@ > <tycho-version>0.13.0</tycho-version> > <eclipse-release>indigo</eclipse-release> > <eclipse-site>http://download.eclipse.org/releases/${eclipse-release}</eclipse-site> >+ <photran-site>file://home/data/httpd/download.eclipse.org/tools/ptp/builds/hudson/ptp-photran-release</photran-site> > </properties> > > <licenses> >@@ -196,6 +197,11 @@ > <url>${eclipse-site}</url> > <layout>p2</layout> > </repository> >+ <repository> >+ <id>photran</id> >+ <url>${photran-site}</url> >+ <layout>p2</layout> >+ </repository> > </repositories> > > <pluginRepositories> >diff --git a/rdt/org.eclipse.ptp.rdt.core.remotejars/META-INF/MANIFEST.MF b/rdt/org.eclipse.ptp.rdt.core.remotejars/META-INF/MANIFEST.MF >index 9792515..9eaf524 100644 >--- a/rdt/org.eclipse.ptp.rdt.core.remotejars/META-INF/MANIFEST.MF >+++ b/rdt/org.eclipse.ptp.rdt.core.remotejars/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: Remotejars > Bundle-SymbolicName: org.eclipse.ptp.rdt.core.remotejars >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Require-Bundle: org.eclipse.ptp.rdt.core;bundle-version="1.1.0", > org.eclipse.ptp.rdt.make.ui;bundle-version="1.1.0", > org.eclipse.ptp.rdt.managedbuilder.xlc.ui;bundle-version="3.0.0", >diff --git a/rdt/org.eclipse.ptp.rdt.core.remotejars/pom.xml b/rdt/org.eclipse.ptp.rdt.core.remotejars/pom.xml >index f25dcd7..3750553 100644 >--- a/rdt/org.eclipse.ptp.rdt.core.remotejars/pom.xml >+++ b/rdt/org.eclipse.ptp.rdt.core.remotejars/pom.xml >@@ -10,7 +10,7 @@ > </parent> > > <artifactId>org.eclipse.ptp.rdt.core.remotejars</artifactId> >- <version>5.0.4-SNAPSHOT</version> >+ <version>5.0.5-SNAPSHOT</version> > <packaging>eclipse-plugin</packaging> > > <profiles> >diff --git a/releng/org.eclipse.ptp-feature/pom.xml b/releng/org.eclipse.ptp-feature/pom.xml >index 6c5b3b1..a603991 100644 >--- a/releng/org.eclipse.ptp-feature/pom.xml >+++ b/releng/org.eclipse.ptp-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >+ <groupId>org.eclipse.ptp.features</groupId> > <artifactId>org.eclipse.ptp</artifactId> > <version>5.0.5-SNAPSHOT</version> > <packaging>eclipse-feature</packaging> >- <groupId>org.eclipse.ptp.features</groupId> > </project> >diff --git a/releng/org.eclipse.ptp.aix.ppc/META-INF/MANIFEST.MF b/releng/org.eclipse.ptp.aix.ppc/META-INF/MANIFEST.MF >index 4f6a0dc..4add153 100644 >--- a/releng/org.eclipse.ptp.aix.ppc/META-INF/MANIFEST.MF >+++ b/releng/org.eclipse.ptp.aix.ppc/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %fragmentName.aix.ppc > Bundle-SymbolicName: org.eclipse.ptp.aix.ppc;singleton:=true >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Fragment-Host: org.eclipse.ptp.core;bundle-version="2.0.0" > Bundle-Localization: plugin > Bundle-Vendor: %pluginProvider >diff --git a/releng/org.eclipse.ptp.core-feature/pom.xml b/releng/org.eclipse.ptp.core-feature/pom.xml >index 7aad7be..ef22d9f 100644 >--- a/releng/org.eclipse.ptp.core-feature/pom.xml >+++ b/releng/org.eclipse.ptp.core-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.core</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.core</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.etfw-feature/pom.xml b/releng/org.eclipse.ptp.etfw-feature/pom.xml >index 9e94c08..1f32294 100644 >--- a/releng/org.eclipse.ptp.etfw-feature/pom.xml >+++ b/releng/org.eclipse.ptp.etfw-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.etfw</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.etfw</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.etfw.ppw-feature/pom.xml b/releng/org.eclipse.ptp.etfw.ppw-feature/pom.xml >index 618c440..497b051 100644 >--- a/releng/org.eclipse.ptp.etfw.ppw-feature/pom.xml >+++ b/releng/org.eclipse.ptp.etfw.ppw-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.etfw.ppw</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.etfw.ppw</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.etfw.tau-feature/pom.xml b/releng/org.eclipse.ptp.etfw.tau-feature/pom.xml >index 5633cab..be91ae9 100644 >--- a/releng/org.eclipse.ptp.etfw.tau-feature/pom.xml >+++ b/releng/org.eclipse.ptp.etfw.tau-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.etfw.tau</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.etfw.tau</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.etfw.tau.fortran-feature/pom.xml b/releng/org.eclipse.ptp.etfw.tau.fortran-feature/pom.xml >index ba8cd11..2255065 100644 >--- a/releng/org.eclipse.ptp.etfw.tau.fortran-feature/pom.xml >+++ b/releng/org.eclipse.ptp.etfw.tau.fortran-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.etfw.tau.fortran</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.etfw.tau.fortran</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.external-feature/pom.xml b/releng/org.eclipse.ptp.external-feature/pom.xml >index 8bc0328..6b49748 100644 >--- a/releng/org.eclipse.ptp.external-feature/pom.xml >+++ b/releng/org.eclipse.ptp.external-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.external</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.external</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.gem-feature/pom.xml b/releng/org.eclipse.ptp.gem-feature/pom.xml >index 3ee6258..a90177b 100644 >--- a/releng/org.eclipse.ptp.gem-feature/pom.xml >+++ b/releng/org.eclipse.ptp.gem-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.gem</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.gem</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.linux.ppc/META-INF/MANIFEST.MF b/releng/org.eclipse.ptp.linux.ppc/META-INF/MANIFEST.MF >index 893ec4d..3df9eab 100644 >--- a/releng/org.eclipse.ptp.linux.ppc/META-INF/MANIFEST.MF >+++ b/releng/org.eclipse.ptp.linux.ppc/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %fragmentName.linux.ppc > Bundle-SymbolicName: org.eclipse.ptp.linux.ppc;singleton:=true >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Fragment-Host: org.eclipse.ptp.core;bundle-version="2.0.0" > Bundle-Localization: plugin > Bundle-Vendor: %pluginProvider >diff --git a/releng/org.eclipse.ptp.linux.x86/META-INF/MANIFEST.MF b/releng/org.eclipse.ptp.linux.x86/META-INF/MANIFEST.MF >index 477b729..6fe4626 100644 >--- a/releng/org.eclipse.ptp.linux.x86/META-INF/MANIFEST.MF >+++ b/releng/org.eclipse.ptp.linux.x86/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %fragmentName.linux.x86 > Bundle-SymbolicName: org.eclipse.ptp.linux.x86;singleton:=true >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Fragment-Host: org.eclipse.ptp.core;bundle-version="2.0.0" > Bundle-Localization: plugin > Bundle-Vendor: %pluginProvider >diff --git a/releng/org.eclipse.ptp.linux.x86_64/META-INF/MANIFEST.MF b/releng/org.eclipse.ptp.linux.x86_64/META-INF/MANIFEST.MF >index b8b4a8f..d32e50b 100644 >--- a/releng/org.eclipse.ptp.linux.x86_64/META-INF/MANIFEST.MF >+++ b/releng/org.eclipse.ptp.linux.x86_64/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %fragmentName.linux.x86_64 > Bundle-SymbolicName: org.eclipse.ptp.linux.x86_64;singleton:=true >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Fragment-Host: org.eclipse.ptp.core;bundle-version="2.0.0" > Bundle-Localization: plugin > Bundle-Vendor: %pluginProvider >diff --git a/releng/org.eclipse.ptp.macosx.ppc/META-INF/MANIFEST.MF b/releng/org.eclipse.ptp.macosx.ppc/META-INF/MANIFEST.MF >index 6a26182..138dcaf 100644 >--- a/releng/org.eclipse.ptp.macosx.ppc/META-INF/MANIFEST.MF >+++ b/releng/org.eclipse.ptp.macosx.ppc/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %fragmentName.macosx.ppc > Bundle-SymbolicName: org.eclipse.ptp.macosx.ppc;singleton:=true >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Fragment-Host: org.eclipse.ptp.core;bundle-version="2.0.0" > Bundle-Localization: plugin > Bundle-Vendor: %pluginProvider >diff --git a/releng/org.eclipse.ptp.macosx.x86/META-INF/MANIFEST.MF b/releng/org.eclipse.ptp.macosx.x86/META-INF/MANIFEST.MF >index e589dec..c4d9355 100644 >--- a/releng/org.eclipse.ptp.macosx.x86/META-INF/MANIFEST.MF >+++ b/releng/org.eclipse.ptp.macosx.x86/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %fragmentName.macosx.x86 > Bundle-SymbolicName: org.eclipse.ptp.macosx.x86;singleton:=true >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Fragment-Host: org.eclipse.ptp.core;bundle-version="2.0.0" > Bundle-Localization: plugin > Bundle-Vendor: %pluginProvider >diff --git a/releng/org.eclipse.ptp.pldt-feature/pom.xml b/releng/org.eclipse.ptp.pldt-feature/pom.xml >index f6478fb..cf88a33 100644 >--- a/releng/org.eclipse.ptp.pldt-feature/pom.xml >+++ b/releng/org.eclipse.ptp.pldt-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.pldt</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.pldt</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.pldt.fortran-feature/pom.xml b/releng/org.eclipse.ptp.pldt.fortran-feature/pom.xml >index d3ae937..a8dfa7b 100644 >--- a/releng/org.eclipse.ptp.pldt.fortran-feature/pom.xml >+++ b/releng/org.eclipse.ptp.pldt.fortran-feature/pom.xml >@@ -10,8 +10,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.pldt.fortran</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.pldt.fortran</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.pldt.lapi-feature/pom.xml b/releng/org.eclipse.ptp.pldt.lapi-feature/pom.xml >index 85393a6..ea8f44a 100644 >--- a/releng/org.eclipse.ptp.pldt.lapi-feature/pom.xml >+++ b/releng/org.eclipse.ptp.pldt.lapi-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.pldt.lapi</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.pldt.lapi</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.pldt.upc-feature/pom.xml b/releng/org.eclipse.ptp.pldt.upc-feature/pom.xml >index 2041046..e4d32f4 100644 >--- a/releng/org.eclipse.ptp.pldt.upc-feature/pom.xml >+++ b/releng/org.eclipse.ptp.pldt.upc-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.pldt.upc</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.pldt.upc</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rdt-feature/pom.xml b/releng/org.eclipse.ptp.rdt-feature/pom.xml >index ce52c18..f0fac15 100644 >--- a/releng/org.eclipse.ptp.rdt-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rdt-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rdt</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rdt</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rdt.remotejars-feature/pom.xml b/releng/org.eclipse.ptp.rdt.remotejars-feature/pom.xml >index 07d942d..4dc979f 100644 >--- a/releng/org.eclipse.ptp.rdt.remotejars-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rdt.remotejars-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rdt.remotejars</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rdt.remotejars</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rdt.remotetools-feature/pom.xml b/releng/org.eclipse.ptp.rdt.remotetools-feature/pom.xml >index 1e8a263..0007c98 100644 >--- a/releng/org.eclipse.ptp.rdt.remotetools-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rdt.remotetools-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rdt.remotetools</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rdt.remotetools</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rdt.sync-feature/pom.xml b/releng/org.eclipse.ptp.rdt.sync-feature/pom.xml >index ad29b8a..9310580 100644 >--- a/releng/org.eclipse.ptp.rdt.sync-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rdt.sync-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rdt.sync</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rdt.sync</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rdt.sync.fortran-feature/pom.xml b/releng/org.eclipse.ptp.rdt.sync.fortran-feature/pom.xml >index 9a4434e..eab055f 100644 >--- a/releng/org.eclipse.ptp.rdt.sync.fortran-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rdt.sync.fortran-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rdt.sync.fortran</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rdt.sync.fortran</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rdt.xlc-feature/pom.xml b/releng/org.eclipse.ptp.rdt.xlc-feature/pom.xml >index c337cfd..d2934bc 100644 >--- a/releng/org.eclipse.ptp.rdt.xlc-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rdt.xlc-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rdt.xlc</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rdt.xlc</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.remote-feature/pom.xml b/releng/org.eclipse.ptp.remote-feature/pom.xml >index 23f8dfb..a0c9ce5 100644 >--- a/releng/org.eclipse.ptp.remote-feature/pom.xml >+++ b/releng/org.eclipse.ptp.remote-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.remote</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.remote</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.remote.remotetools-feature/pom.xml b/releng/org.eclipse.ptp.remote.remotetools-feature/pom.xml >index b168726..1c8be5f 100644 >--- a/releng/org.eclipse.ptp.remote.remotetools-feature/pom.xml >+++ b/releng/org.eclipse.ptp.remote.remotetools-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.remote.remotetools</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.remote.remotetools</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.remote.rse-feature/pom.xml b/releng/org.eclipse.ptp.remote.rse-feature/pom.xml >index d557033..9064f21 100644 >--- a/releng/org.eclipse.ptp.remote.rse-feature/pom.xml >+++ b/releng/org.eclipse.ptp.remote.rse-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.remote.rse</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.remote.rse</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.remotetools-feature/pom.xml b/releng/org.eclipse.ptp.remotetools-feature/pom.xml >index ebfacb2..08dded4 100644 >--- a/releng/org.eclipse.ptp.remotetools-feature/pom.xml >+++ b/releng/org.eclipse.ptp.remotetools-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.remotetools</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.remotetools</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.repo/fixPom.xsl b/releng/org.eclipse.ptp.repo/fixPom.xsl >index a1dd2e5..14a1cf0 100644 >--- a/releng/org.eclipse.ptp.repo/fixPom.xsl >+++ b/releng/org.eclipse.ptp.repo/fixPom.xsl >@@ -67,6 +67,9 @@ > <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp']"> > <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version> > </xsl:template> >+ <xsl:template match="p:version[preceding-sibling::p:artifactId='org.eclipse.ptp.rdt.remotejars']"> >+ <version><xsl:value-of select="$newVersion"/>-SNAPSHOT</version> >+ </xsl:template> > > <xsl:template match="@*|node()"> > <xsl:copy> >diff --git a/releng/org.eclipse.ptp.repo/update_versions b/releng/org.eclipse.ptp.repo/update_versions >index 4d4a577..e44bdf2 100644 >--- a/releng/org.eclipse.ptp.repo/update_versions >+++ b/releng/org.eclipse.ptp.repo/update_versions >@@ -57,16 +57,43 @@ > org.eclipse.ptp.services-feature \ > org.eclipse.ptp.utils-feature" > >+PTP_PLUGINS="\ >+ releng/org.eclipse.ptp.aix.ppc \ >+ releng/org.eclipse.ptp.linux.ppc \ >+ releng/org.eclipse.ptp.linux.x86 \ >+ releng/org.eclipse.ptp.linux.x86_64 \ >+ releng/org.eclipse.ptp.macosx.ppc \ >+ releng/org.eclipse.ptp.macosx.x86 \ >+ releng/org.eclipse.ptp \ >+ debug/org.eclipse.ptp.debug.sdm \ >+ core/org.eclipse.ptp.utils \ >+ core/org.eclipse.ptp.proxy \ >+ rms/org.eclipse.ptp.rm.ibm.pe.proxy \ >+ rms/org.eclipse.ptp.rm.ibm.ll.proxy \ >+ rms/org.eclipse.ptp.rm.slurm.proxy \ >+ tools/sci/org.eclipse.ptp.sci \ >+ rdt/org.eclipse.ptp.rdt.core.remotejars" >+ > update_feature() { > sed -e "s/^\([ \t]*\)version=\"[0-9]\.[0-9]\.[0-9]\.qualifier\"/\1version=\"$2\.qualifier\"/" < releng/$1/feature.xml > $TMP_DIR/${1}_feature.xml > mv $TMP_DIR/${1}_feature.xml releng/$1/feature.xml > } > >+update_manifest() { >+ sed -e "s/^Bundle-Version: *[0-9]\.[0-9]\.[0-9]\.qualifier/Bundle-Version: $2.qualifier/" < $1/META-INF/MANIFEST.MF > $TMP_DIR/${1}_MANIFEST.MF >+ mv $TMP_DIR/${1}_MANIFEST.MF $1/META-INF/MANIFEST.MF >+} >+ > for feature in $PTP_FEATURES; do > echo "Updating $feature..." > update_feature $feature $ptp_version > done > >+for plugin in $PTP_PLUGINS; do >+ echo "Updating $plugin..." >+ update_manifest $plugin $ptp_version >+done >+ > (cd releng/org.eclipse.ptp.repo && ant -DnewVersion="$ptp_version" -f fixModules.xml) > > exit 0 >diff --git a/releng/org.eclipse.ptp.rm.ibm.ll-feature/pom.xml b/releng/org.eclipse.ptp.rm.ibm.ll-feature/pom.xml >index 23c9798..2dbd384 100644 >--- a/releng/org.eclipse.ptp.rm.ibm.ll-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.ibm.ll-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.ibm.ll</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.ibm.ll</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.ibm.pe-feature/pom.xml b/releng/org.eclipse.ptp.rm.ibm.pe-feature/pom.xml >index 4f2577a..3895761 100644 >--- a/releng/org.eclipse.ptp.rm.ibm.pe-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.ibm.pe-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.ibm.pe</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.ibm.pe</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.jaxb-feature/pom.xml b/releng/org.eclipse.ptp.rm.jaxb-feature/pom.xml >index 822d00e..571dfed 100644 >--- a/releng/org.eclipse.ptp.rm.jaxb-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.jaxb-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.jaxb</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.jaxb</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.jaxb.contrib-feature/pom.xml b/releng/org.eclipse.ptp.rm.jaxb.contrib-feature/pom.xml >index d67649b..f7d1643 100644 >--- a/releng/org.eclipse.ptp.rm.jaxb.contrib-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.jaxb.contrib-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.jaxb.contrib</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.jaxb.contrib</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.jaxb.pbs-feature/pom.xml b/releng/org.eclipse.ptp.rm.jaxb.pbs-feature/pom.xml >index 2e3b544..7003c2e 100644 >--- a/releng/org.eclipse.ptp.rm.jaxb.pbs-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.jaxb.pbs-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.jaxb.pbs</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.jaxb.pbs</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.lml-feature/pom.xml b/releng/org.eclipse.ptp.rm.lml-feature/pom.xml >index 2ac98d9..9645c59 100644 >--- a/releng/org.eclipse.ptp.rm.lml-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.lml-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.lml</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.lml</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.lml_jaxb-feature/pom.xml b/releng/org.eclipse.ptp.rm.lml_jaxb-feature/pom.xml >index a4e6ca0..5985a73 100644 >--- a/releng/org.eclipse.ptp.rm.lml_jaxb-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.lml_jaxb-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.lml_jaxb</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.lml_jaxb</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.mpich2-feature/pom.xml b/releng/org.eclipse.ptp.rm.mpich2-feature/pom.xml >index ff22f64..4259679 100644 >--- a/releng/org.eclipse.ptp.rm.mpich2-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.mpich2-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.mpich2</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.mpich2</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.openmpi-feature/pom.xml b/releng/org.eclipse.ptp.rm.openmpi-feature/pom.xml >index ecee1f9..b519024 100644 >--- a/releng/org.eclipse.ptp.rm.openmpi-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.openmpi-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.openmpi</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.openmpi</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.rm.slurm-feature/pom.xml b/releng/org.eclipse.ptp.rm.slurm-feature/pom.xml >index a072f24..53c6f96 100644 >--- a/releng/org.eclipse.ptp.rm.slurm-feature/pom.xml >+++ b/releng/org.eclipse.ptp.rm.slurm-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.rm.slurm</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.rm.slurm</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.sci-feature/pom.xml b/releng/org.eclipse.ptp.sci-feature/pom.xml >index ee00eb9..cc9d5b7 100644 >--- a/releng/org.eclipse.ptp.sci-feature/pom.xml >+++ b/releng/org.eclipse.ptp.sci-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >+ <groupId>org.eclipse.ptp.features</groupId> > <artifactId>org.eclipse.ptp.sci</artifactId> > <version>5.0.5-SNAPSHOT</version> > <packaging>eclipse-feature</packaging> >- <groupId>org.eclipse.ptp.features</groupId> > </project> >diff --git a/releng/org.eclipse.ptp.sdk-feature/pom.xml b/releng/org.eclipse.ptp.sdk-feature/pom.xml >index 4207694..648a20e 100644 >--- a/releng/org.eclipse.ptp.sdk-feature/pom.xml >+++ b/releng/org.eclipse.ptp.sdk-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.sdk</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.sdk</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.sdm-feature/pom.xml b/releng/org.eclipse.ptp.sdm-feature/pom.xml >index eb887cd..ac92374 100644 >--- a/releng/org.eclipse.ptp.sdm-feature/pom.xml >+++ b/releng/org.eclipse.ptp.sdm-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >+ <groupId>org.eclipse.ptp.features</groupId> > <artifactId>org.eclipse.ptp.debug.sdm</artifactId> > <version>5.0.5-SNAPSHOT</version> > <packaging>eclipse-feature</packaging> >- <groupId>org.eclipse.ptp.features</groupId> > </project> >diff --git a/releng/org.eclipse.ptp.services-feature/pom.xml b/releng/org.eclipse.ptp.services-feature/pom.xml >index 01487ed..d9156fb 100644 >--- a/releng/org.eclipse.ptp.services-feature/pom.xml >+++ b/releng/org.eclipse.ptp.services-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >- <artifactId>org.eclipse.ptp.services</artifactId> >- <version>5.0.4-SNAPSHOT</version> >- <packaging>eclipse-feature</packaging> > <groupId>org.eclipse.ptp.features</groupId> >+ <artifactId>org.eclipse.ptp.services</artifactId> >+ <version>5.0.5-SNAPSHOT</version> >+ <packaging>eclipse-feature</packaging> > </project> >diff --git a/releng/org.eclipse.ptp.utils-feature/pom.xml b/releng/org.eclipse.ptp.utils-feature/pom.xml >index ed4746d..0a0387f 100644 >--- a/releng/org.eclipse.ptp.utils-feature/pom.xml >+++ b/releng/org.eclipse.ptp.utils-feature/pom.xml >@@ -9,8 +9,8 @@ > <relativePath>../../pom.xml</relativePath> > </parent> > >+ <groupId>org.eclipse.ptp.features</groupId> > <artifactId>org.eclipse.ptp.utils</artifactId> > <version>5.0.5-SNAPSHOT</version> > <packaging>eclipse-feature</packaging> >- <groupId>org.eclipse.ptp.features</groupId> > </project> >diff --git a/releng/org.eclipse.ptp/META-INF/MANIFEST.MF b/releng/org.eclipse.ptp/META-INF/MANIFEST.MF >index 68d99c6..b39e9ff 100644 >--- a/releng/org.eclipse.ptp/META-INF/MANIFEST.MF >+++ b/releng/org.eclipse.ptp/META-INF/MANIFEST.MF >@@ -2,6 +2,6 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ptp >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Vendor: %providerName > Bundle-Localization: plugin >diff --git a/rms/org.eclipse.ptp.rm.ibm.ll.proxy/META-INF/MANIFEST.MF b/rms/org.eclipse.ptp.rm.ibm.ll.proxy/META-INF/MANIFEST.MF >index 4f64bb0..613380f 100644 >--- a/rms/org.eclipse.ptp.rm.ibm.ll.proxy/META-INF/MANIFEST.MF >+++ b/rms/org.eclipse.ptp.rm.ibm.ll.proxy/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ptp.rm.ibm.ll.proxy >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Localization: plugin > Bundle-Vendor: %pluginProvider > Require-Bundle: org.eclipse.ptp.proxy, >diff --git a/rms/org.eclipse.ptp.rm.ibm.pe.proxy/META-INF/MANIFEST.MF b/rms/org.eclipse.ptp.rm.ibm.pe.proxy/META-INF/MANIFEST.MF >index ff35d9b..17eee32 100644 >--- a/rms/org.eclipse.ptp.rm.ibm.pe.proxy/META-INF/MANIFEST.MF >+++ b/rms/org.eclipse.ptp.rm.ibm.pe.proxy/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ptp.rm.ibm.pe.proxy >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Vendor: %pluginProvider > Bundle-Localization: plugin > Require-Bundle: org.eclipse.ptp.proxy, >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/ILMLCoreConstants.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/ILMLCoreConstants.java >index e91899d..6191413 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/ILMLCoreConstants.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/ILMLCoreConstants.java >@@ -18,10 +18,237 @@ > > public static final int UNDEFINED = -1; > >+ public static final int COPY_BUFFER_SIZE = 64 * 1024; >+ public static final int STREAM_BUFFER_SIZE = 8 * 1024; >+ public static final int EOF = -1; >+ public static final long MINUTE_IN_MS = 60 * 60 * 1000; >+ public static final long VALIDATE_TIMER = 500; >+ public static final long STANDARD_WAIT = 1000; >+ public static final int READY_FILE_BLOCK = 60; >+ >+ /* CHARACTERS */ >+ public static final String LEN = "N";//$NON-NLS-1$ >+ public static final String ZEROSTR = "";//$NON-NLS-1$ >+ public static final String TAB = "\t"; //$NON-NLS-1$ >+ public static final String SP = " ";//$NON-NLS-1$ >+ public static final String EQ = "=";//$NON-NLS-1$ >+ public static final String QT = "\"";//$NON-NLS-1$ >+ public static final String QM = "?";//$NON-NLS-1$ >+ public static final String PD = "#";//$NON-NLS-1$ >+ public static final String PDRX = "[#]";//$NON-NLS-1$ >+ public static final String CM = ",";//$NON-NLS-1$ >+ public static final String CO = ":";//$NON-NLS-1$ >+ public static final String SC = ";";//$NON-NLS-1$ >+ public static final String LT = "<"; //$NON-NLS-1$ >+ public static final String LTS = "</";//$NON-NLS-1$ >+ public static final String GT = ">";//$NON-NLS-1$ >+ public static final String GTLT = "><";//$NON-NLS-1$ >+ public static final String HYPH = "-";//$NON-NLS-1$ >+ public static final String AT = "@";//$NON-NLS-1$ >+ public static final String DOL = "$";//$NON-NLS-1$ >+ public static final String PIP = "|";//$NON-NLS-1$ >+ public static final String REGPIP = "[|]";//$NON-NLS-1$ >+ public static final String DOT = ".";//$NON-NLS-1$ >+ public static final String Z3 = "000";//$NON-NLS-1$ >+ public static final String OPENP = "(";//$NON-NLS-1$ >+ public static final String OPENSQ = "[";//$NON-NLS-1$ >+ public static final String OPENV = "${";//$NON-NLS-1$ >+ public static final String OPENVRM = "${rm:";//$NON-NLS-1$ >+ public static final String OPENVLT = "${lt:";//$NON-NLS-1$ >+ public static final String VRM = "rm:";//$NON-NLS-1$ >+ public static final String VLC = "lc:";//$NON-NLS-1$ >+ public static final String CLOSP = ")";//$NON-NLS-1$ >+ public static final String CLOSSQ = "]";//$NON-NLS-1$ >+ public static final String CLOSV = "}";//$NON-NLS-1$ >+ public static final String CLOSVAL = "#value}";//$NON-NLS-1$ >+ public static final String BKESC = "\\\\";//$NON-NLS-1$ >+ public static final String BKBKESC = "\\\\\\\\";//$NON-NLS-1$ >+ public static final String DLESC = "\\$";//$NON-NLS-1$ >+ public static final String DLESCESC = "\\\\\\$";//$NON-NLS-1$ >+ public static final String SPESC = "\\\\s";//$NON-NLS-1$ >+ public static final String LNSEPESC = "\\\\n";//$NON-NLS-1$ >+ public static final String TBESC = "\\t";//$NON-NLS-1$ >+ public static final String TBESCESC = "\\\\t";//$NON-NLS-1$ >+ public static final String LNESC = "\\n";//$NON-NLS-1$ >+ public static final String RTESC = "\\r";//$NON-NLS-1$ >+ public static final String LINE_SEP = System.getProperty("line.separator"); //$NON-NLS-1$ >+ public static final String REMOTE_LINE_SEP = "\n"; //$NON-NLS-1$ >+ public static final String REMOTE_PATH_SEP = "/"; //$NON-NLS-1$ >+ public static final String PATH_SEP = System.getProperty("file.separator"); //$NON-NLS-1$ >+ >+ /* KEY WORDS */ >+ public static final String TRUE = "true";//$NON-NLS-1$ >+ public static final String FALSE = "false";//$NON-NLS-1$ >+ public static final String YES = "yes";//$NON-NLS-1$ >+ public static final String NO = "no";//$NON-NLS-1$ >+ public static final String NOT = "not";//$NON-NLS-1$ >+ public static final String OR = "or";//$NON-NLS-1$ >+ public static final String AND = "and";//$NON-NLS-1$ >+ public static final String xEQ = "EQ";//$NON-NLS-1$ >+ public static final String xLT = "LT";//$NON-NLS-1$ >+ public static final String xGT = "GT";//$NON-NLS-1$ >+ public static final String xLE = "LE";//$NON-NLS-1$ >+ public static final String xGE = "GE";//$NON-NLS-1$ >+ public static final String GET = "get";//$NON-NLS-1$ >+ public static final String SET = "set";//$NON-NLS-1$ >+ public static final String IS = "is";//$NON-NLS-1$ >+ public static final String CLASS = "class";//$NON-NLS-1$ >+ public static final String STRING = "string";//$NON-NLS-1$ >+ public static final String NAME = "name";//$NON-NLS-1$ >+ public static final String VALUE = "value";//$NON-NLS-1$ >+ public static final String BASIC = "basic";//$NON-NLS-1$ >+ public static final String CHOICE = "choice";//$NON-NLS-1$ >+ public static final String sDEFAULT = "default";//$NON-NLS-1$ >+ public static final String DESC = "description";//$NON-NLS-1$ >+ public static final String MAX = "max";//$NON-NLS-1$ >+ public static final String MIN = "min";//$NON-NLS-1$ >+ public static final String READONLY = "readOnly";//$NON-NLS-1$ >+ public static final String STATUS = "status";//$NON-NLS-1$ >+ public static final String TOOLTIP = "tooltip";//$NON-NLS-1$ >+ public static final String TYPE = "type";//$NON-NLS-1$ >+ public static final String VALIDATOR = "validator";//$NON-NLS-1$ >+ public static final String SELECTED = "visible";//$NON-NLS-1$ >+ public static final String LOCAL = "local";//$NON-NLS-1$ >+ public static final String JOB_ID_TAG = "@jobId";//$NON-NLS-1$ >+ public static final String NAME_TAG = AT + NAME; >+ public static final String VALUE_TAG = AT + VALUE; >+ >+ /* TYPE MATCHING */ >+ public static final String NT = "nt";//$NON-NLS-1$ >+ public static final String BOOL = "bool";//$NON-NLS-1$ >+ public static final String ET = "et";//$NON-NLS-1$ >+ public static final String IST = "ist";//$NON-NLS-1$ >+ public static final String ECTOR = "ector";//$NON-NLS-1$ >+ >+ /* STANDARD PROPERTIES */ >+ public static final String ID = "id";//$NON-NLS-1$ >+ public static final String JAVA_USER_HOME = "user.home";//$NON-NLS-1$ >+ public static final String JAVA_TMP_DIR = "java.io.tmpdir";//$NON-NLS-1$ >+ public static final String FILE_SCHEME = "file";//$NON-NLS-1$ >+ public static final String XMLSchema = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$ >+ public static final String SCHEMA = "schema/"; //$NON-NLS-1$ >+ public static final String RM_XSD = SCHEMA + "lgui.xsd";//$NON-NLS-1$ >+ public static final String JAXB = "JAXB";//$NON-NLS-1$ >+ public static final String JAXB_CONTEXT = "org.eclipse.ptp.rm.jaxb.core.data";//$NON-NLS-1$ >+ public static final String RM_CONFIG_PROPS = "rm_configurations.properties";//$NON-NLS-1$ >+ public static final String RM_XSD_PATH = "rm_schema_path";//$NON-NLS-1$ >+ public static final String RM_XSD_URL = "rm_schema_url";//$NON-NLS-1$ >+ public static final String PREV_RM_XSD_PATH = "prev_rm_schema_path";//$NON-NLS-1$ >+ public static final String EXTERNAL_RM_XSD_PATHS = "external_rm_schema_paths";//$NON-NLS-1$ >+ public static final String CHECKED_ATTRIBUTES = "checked_attributes";//$NON-NLS-1$ >+ public static final String SHOW_ONLY_CHECKED = "show_only_checked";//$NON-NLS-1$ >+ public static final String IS_PRESET = "is_preset";//$NON-NLS-1$ >+ public static final String SCRIPT_PATH = "script_path";//$NON-NLS-1$ >+ public static final String SCRIPT = "script";//$NON-NLS-1$ >+ public static final String SCRIPT_FILE = "managed_file_for_script";//$NON-NLS-1$ >+ public static final String CSH = "csh";//$NON-NLS-1$ >+ public static final String SH = ".sh";//$NON-NLS-1$ >+ public static final String SETENV = "setenv";//$NON-NLS-1$ >+ public static final String EXPORT = "export";//$NON-NLS-1$ >+ public static final String DATE_FORMAT = "yyyy/MM/dd HH:mm:ss";//$NON-NLS-1$ >+ >+ public static final String RESOURCE_MANAGERS = "resourceManagers";//$NON-NLS-1$ >+ public static final String CUSTOM = "custom";//$NON-NLS-1$ >+ public static final String CONTROL_USER_NAME = "controlUserName";//$NON-NLS-1$ >+ public static final String MONITOR_USER_NAME = "monitorUserName";//$NON-NLS-1$ >+ public static final String CONTROL_CONNECTION_NAME = "controlConnectionName";//$NON-NLS-1$ >+ public static final String MONITOR_CONNECTION_NAME = "monitorConnectionName";//$NON-NLS-1$ >+ public static final String LOCALHOST = "localhost";//$NON-NLS-1$ >+ public static final String CONTROL_PATH = "controlPath"; //$NON-NLS-1$ >+ public static final String MONITOR_PATH = "monitorPath"; //$NON-NLS-1$ >+ public static final String CONTROL_OPTIONS = "controlOptions"; //$NON-NLS-1$ >+ public static final String MONITOR_OPTIONS = "monitorOptions"; //$NON-NLS-1$ >+ public static final String CONTROL_INVOCATION_OPTIONS = "controlInvocationOptions"; //$NON-NLS-1$ >+ public static final String MONITOR_INVOCATION_OPTIONS = "monitorInvocationOptions"; //$NON-NLS-1$ >+ public static final String CONTROL_ADDRESS = "controlAddress"; //$NON-NLS-1$ >+ public static final String LOCAL_ADDRESS = "localAddress"; //$NON-NLS-1$ >+ public static final String MONITOR_ADDRESS = "monitorAddress"; //$NON-NLS-1$ >+ public static final String CONTROL_USER_VAR = "control.user.name";//$NON-NLS-1$ >+ public static final String CONTROL_ADDRESS_VAR = "control.address";//$NON-NLS-1$ >+ public static final String MONITOR_USER_VAR = "monitor.user.name";//$NON-NLS-1$ >+ public static final String MONITOR_ADDRESS_VAR = "monitor.address";//$NON-NLS-1$ >+ public static final String ARPA = ".in-addr.arpa";//$NON-NLS-1$ >+ public static final String ECLIPSESETTINGS = ".eclipsesettings";//$NON-NLS-1$ >+ public static final String DEBUG_PACKAGE = "org.eclipse.debug";//$NON-NLS-1$ >+ public static final String PTP_PACKAGE = "org.eclipse.ptp";//$NON-NLS-1$ >+ >+ // public static final String STARTUP = "OnStartUp";//$NON-NLS-1$ >+ // public static final String SHUTDOWN = "OnShutDown";//$NON-NLS-1$ >+ // public static final String DISCATTR = "DiscoverAttributes";//$NON-NLS-1$ >+ // public static final String JOBSTATUS = "GetJobStatus";//$NON-NLS-1$ >+ // public static final String VALIDATE = "ValidateJob";//$NON-NLS-1$ >+ >+ public static final String JOB_ATTRIBUTE = "jobAttribute";//$NON-NLS-1$ >+ public static final String ATTRIBUTE = "attribute";//$NON-NLS-1$ >+ public static final String PROPERTY = "property";//$NON-NLS-1$ >+ public static final String QUEUES = "available_queues";//$NON-NLS-1$ >+ public static final String JOB_ID = "job_id";//$NON-NLS-1$ >+ public static final String RM_ID = "rm_id";//$NON-NLS-1$ >+ public static final String STDOUT_REMOTE_FILE = "stdout_remote_path";//$NON-NLS-1$ >+ public static final String STDERR_REMOTE_FILE = "stderr_remote_path";//$NON-NLS-1$ >+ public static final String EXEC_PATH = "executablePath";//$NON-NLS-1$ >+ public static final String PROG_ARGS = "progArgs";//$NON-NLS-1$ >+ public static final String DIRECTORY = "directory";//$NON-NLS-1$ >+ public static final String MPI_CMD = "mpiCommand";//$NON-NLS-1$ >+ public static final String MPI_ARGS = "mpiArgs";//$NON-NLS-1$ >+ >+ public static final String CASE_INSENSITIVE = "CASE_INSENSITIVE";//$NON-NLS-1$ >+ public static final String MULTILINE = "MULTILINE";//$NON-NLS-1$ >+ public static final String DOTALL = "DOTALL";//$NON-NLS-1$ >+ public static final String UNICODE_CASE = "UNICODE_CASE";//$NON-NLS-1$ >+ public static final String CANON_EQ = "CANON_EQ";//$NON-NLS-1$ >+ public static final String LITERAL = "LITERAL";//$NON-NLS-1$ >+ public static final String COMMENTS = "COMMENTS";//$NON-NLS-1$ >+ >+ public static final String DOT_XML = ".xml";//$NON-NLS-1$ >+ public static final String TOKENIZER_EXT_PT = "streamParserTokenizer";//$NON-NLS-1$ >+ public static final String TAIL = "tail";//$NON-NLS-1$ >+ public static final String MINUS_F = "-F";//$NON-NLS-1$ >+ public static final String CONFIGURATION_FILE_ATTRIBUTE = "configurationFile"; //$NON-NLS-1$ >+ public static final String RM_CONFIG_EXTENSION_POINT = "org.eclipse.ptp.rm.jaxb.core.JAXBResourceManagerConfigurations"; //$NON-NLS-1$ >+ public static final String IMPORTED_JAXB_CONFIG = "org.eclipse.ptp.rm.jaxb.ImportedConfigurations"; //$NON-NLS-1$ >+ /* >+ * EFS Attributes >+ */ >+ public static final String ATTRIBUTE_READ_ONLY = "ATTRIBUTE_READ_ONLY";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_IMMUTABLE = "ATTRIBUTE_IMMUTABLE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_OWNER_READ = "ATTRIBUTE_OWNER_READ";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_OWNER_WRITE = "ATTRIBUTE_OWNER_WRITE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_OWNER_EXECUTE = "ATTRIBUTE_OWNER_EXECUTE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_GROUP_READ = "ATTRIBUTE_GROUP_READ";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_GROUP_WRITE = "ATTRIBUTE_GROUP_WRITE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_GROUP_EXECUTE = "ATTRIBUTE_GROUP_EXECUTE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_OTHER_READ = "ATTRIBUTE_OTHER_READ";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_OTHER_WRITE = "ATTRIBUTE_OTHER_WRITE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_OTHER_EXECUTE = "ATTRIBUTE_OTHER_EXECUTE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_EXECUTABLE = "ATTRIBUTE_EXECUTABLE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_ARCHIVE = "ATTRIBUTE_ARCHIVE";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_HIDDEN = "ATTRIBUTE_HIDDEN";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_SYMLINK = "ATTRIBUTE_SYMLINK";//$NON-NLS-1$ >+ public static final String ATTRIBUTE_LINK_TARGET = "ATTRIBUTE_LINK_TARGET";//$NON-NLS-1$ >+ >+ /* >+ * IRemoteProcessBuilder >+ */ >+ public static final String TAG_NONE = "NONE";//$NON-NLS-1$ >+ public static final String TAG_ALLOCATE_PTY = "ALLOCATE_PTY";//$NON-NLS-1$ >+ public static final String TAG_FORWARD_X11 = "FORWARD_X11";//$NON-NLS-1$ >+ > /* > * Element keywords > */ > public static String INCLUDE_ELEMENT = "include"; //$NON-NLS-1$ > public static String TABLE_ELEMENT = "table"; //$NON-NLS-1$ >+ public static String USAGEBAR_ELEMENT = "usagebar"; //$NON-NLS-1$ >+ public static String TEXT_ELEMENT = "text"; //$NON-NLS-1$ >+ public static String INFOBOX_ELEMENT = "infobox"; //$NON-NLS-1$ >+ public static String CHART_ELEMENT = "chart"; //$NON-NLS-1$ >+ public static String CHARTGROUP_ELEMENT = "chartgroup"; //$NON-NLS-1$ >+ public static String NODEDISPLAY_ELEMENT = "nodedisplay"; //$NON-NLS-1$ >+ public static String ABSLAYOUT_ELEMENT = "abslayout"; //$NON-NLS-1$ >+ public static String SPLITLAYOUT_ELEMENT = "splitlayout"; //$NON-NLS-1$ >+ public static String TABLELAYOUT_ELEMENT = "tablelayout"; //$NON-NLS-1$ >+ public static String COMPONENTLAYOUT_ELEMENT = "componentlayout"; //$NON-NLS-1$ >+ public static String NODEDISPLAYLAYOUT_ELEMENT = "nodedisplaylayout"; //$NON-NLS-1$ > public static String TITLE_PREFIX = "title_"; //$NON-NLS-1$ > } >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLCorePlugin.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLCorePlugin.java >index b8b788b..85db9df 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLCorePlugin.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLCorePlugin.java >@@ -21,26 +21,21 @@ > *******************************************************************************/ > package org.eclipse.ptp.rm.lml.core; > >-import java.net.MalformedURLException; >+import java.io.File; >+import java.io.IOException; > import java.net.URL; > import java.util.MissingResourceException; > import java.util.ResourceBundle; > >-import javax.xml.XMLConstants; >-import javax.xml.bind.JAXBContext; >-import javax.xml.bind.JAXBException; >-import javax.xml.bind.Marshaller; >-import javax.xml.bind.Unmarshaller; >-import javax.xml.validation.Schema; >-import javax.xml.validation.SchemaFactory; >- >+import org.eclipse.core.runtime.FileLocator; > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Plugin; > import org.eclipse.core.runtime.Status; > import org.eclipse.ptp.rm.lml.core.messages.Messages; > import org.eclipse.ptp.rm.lml.core.util.DebugUtil; >+import org.osgi.framework.Bundle; > import org.osgi.framework.BundleContext; >-import org.xml.sax.SAXException; > > public class LMLCorePlugin extends Plugin { > public static final String PLUGIN_ID = "org.eclipse.ptp.rm.lml.core"; //$NON-NLS-1$ >@@ -48,21 +43,22 @@ > // The shared instance. > private static LMLCorePlugin fPlugin; > >- /* >- * Unmarshaller for JAXB-generator >- */ >- private static Unmarshaller unmarshaller; >- >- /* >- * Marshaller for JAXB-model >- */ >- private static Marshaller marshaller; >- > /** > * Returns the shared instance. > */ > public static LMLCorePlugin getDefault() { > return fPlugin; >+ } >+ >+ public static URL getResource(String resource) throws IOException { >+ URL url = null; >+ if (getDefault() != null) { >+ final Bundle bundle = getDefault().getBundle(); >+ url = FileLocator.find(bundle, new Path(ILMLCoreConstants.PATH_SEP + resource), null); >+ } else { >+ url = new File(resource).toURI().toURL(); >+ } >+ return url; > } > > /** >@@ -144,44 +140,10 @@ > } > > /** >- * Get the JAXB marshaller >- * >- * @return the JAXB marshaller >- */ >- public Marshaller getMarshaller() { >- if (marshaller == null) { >- try { >- createMarshaller(); >- } catch (final JAXBException e) { >- log(e); >- } >- } >- return marshaller; >- } >- >- /** > * Returns the plugin's resource bundle, > */ > public ResourceBundle getResourceBundle() { > return resourceBundle; >- } >- >- /** >- * Get the JAXB unmarshaller. >- * >- * @return the JAXB unmarshaller >- */ >- public Unmarshaller getUnmarshaller() { >- if (unmarshaller == null) { >- try { >- createUnmarshaller(); >- } catch (final JAXBException e) { >- log(e); >- } catch (final MalformedURLException e) { >- log(e); >- } >- } >- return unmarshaller; > } > > /** >@@ -190,7 +152,6 @@ > @Override > public void start(BundleContext context) throws Exception { > super.start(context); >- createUnmarshaller(); > DebugUtil.configurePluginDebugOptions(); > } > >@@ -204,49 +165,6 @@ > } finally { > super.stop(context); > fPlugin = null; >- } >- } >- >- private void createMarshaller() throws JAXBException { >- final JAXBContext jc = JAXBContext.newInstance("org.eclipse.ptp.rm.lml.internal.core.elements", //$NON-NLS-1$ >- LMLCorePlugin.class.getClassLoader()); >- marshaller = jc.createMarshaller(); >- } >- >- /** >- * For the generation of instances from classes by JAXB a unmarshaller is >- * needed. In the method the needed unmarshaller is created. It is said >- * where the classes for the instantiation are. >- * >- * @throws MalformedURLException >- * @throws JAXBException >- */ >- private void createUnmarshaller() throws MalformedURLException, JAXBException { >- final URL xsd = getBundle().getEntry("/schema/lgui.xsd"); //$NON-NLS-1$ >- >- final JAXBContext jc = JAXBContext.newInstance("org.eclipse.ptp.rm.lml.internal.core.elements", //$NON-NLS-1$ >- LMLCorePlugin.class.getClassLoader()); >- >- unmarshaller = jc.createUnmarshaller(); >- >- // if xsd is null => do not check for validity >- if (xsd != null) { >- >- Schema mySchema; >- final SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); >- >- try { >- >- mySchema = sf.newSchema(xsd); >- } catch (final SAXException saxe) { >- // ...(error handling) >- mySchema = null; >- >- } >- >- // Connect schema to unmarshaller >- unmarshaller.setSchema(mySchema); >- > } > } > >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java >index 70f5f29..31a4887 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/LMLManager.java >@@ -13,29 +13,29 @@ > import java.io.InputStream; > import java.io.OutputStream; > import java.util.HashMap; >+import java.util.List; > import java.util.Map; > >-import javax.xml.bind.JAXBException; >- > import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.ListenerList; >-import org.eclipse.core.runtime.Status; > import org.eclipse.ptp.rm.lml.core.events.ILguiAddedEvent; > import org.eclipse.ptp.rm.lml.core.events.ILguiRemovedEvent; > import org.eclipse.ptp.rm.lml.core.events.IMarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.ISelectObjectEvent; >+import org.eclipse.ptp.rm.lml.core.events.ITableFilterEvent; > import org.eclipse.ptp.rm.lml.core.events.ITableSortedEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnmarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnselectedObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.IViewUpdateEvent; > import org.eclipse.ptp.rm.lml.core.listeners.ILMLListener; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.core.model.IPattern; > import org.eclipse.ptp.rm.lml.internal.core.elements.RequestType; > import org.eclipse.ptp.rm.lml.internal.core.events.LguiAddedEvent; > import org.eclipse.ptp.rm.lml.internal.core.events.LguiRemovedEvent; > import org.eclipse.ptp.rm.lml.internal.core.events.MarkObjectEvent; > import org.eclipse.ptp.rm.lml.internal.core.events.SelectObjectEvent; >+import org.eclipse.ptp.rm.lml.internal.core.events.TableFilterEvent; > import org.eclipse.ptp.rm.lml.internal.core.events.TableSortedEvent; > import org.eclipse.ptp.rm.lml.internal.core.events.UnmarkObjectEvent; > import org.eclipse.ptp.rm.lml.internal.core.events.UnselectObjectEvent; >@@ -70,7 +70,7 @@ > /* > * A list of all listeners on the ILguiItem > */ >- private final ListenerList lmlListeners = new ListenerList(); >+ private final ListenerList viewListeners = new ListenerList(); > > /* > * An instance of this class. >@@ -84,7 +84,7 @@ > } > > public void addListener(ILMLListener listener, String view) { >- lmlListeners.add(listener); >+ viewListeners.add(listener); > } > > public void addUserJob(String name, String jobId, JobStatusData status) { >@@ -108,6 +108,10 @@ > > } > >+ public void filterLgui(String gid, List<IPattern> filterValues) { >+ fireFilterLgui(gid, filterValues); >+ } >+ > public String getCurrentLayout(String name) { > ILguiItem item = null; > synchronized (LGUIS) { >@@ -122,6 +126,18 @@ > return string; > } > return null; >+ } >+ >+ public Map<String, List<IPattern>> getCurrentPattern(String name) { >+ ILguiItem item = null; >+ synchronized (LGUIS) { >+ item = LGUIS.get(name); >+ } >+ if (item != null) { >+ final Map<String, List<IPattern>> map = item.getPattern(); >+ return map; >+ } >+ return new HashMap<String, List<IPattern>>(); > } > > public ILguiItem getSelectedLguiItem() { >@@ -162,12 +178,14 @@ > * Layout from an earlier Eclipse session > * @param jobs > * Array of earlier started jobs >+ * @param pattern > */ >- public void openLgui(String name, RequestType request, StringBuilder layout, JobStatusData[] jobs) { >+ public void openLgui(String name, String username, RequestType request, StringBuilder layout, JobStatusData[] jobs, >+ Map<String, List<IPattern>> pattern) { > synchronized (LGUIS) { > ILguiItem item = LGUIS.get(name); > if (item == null) { >- item = new LguiItem(name); >+ item = new LguiItem(name, username); > LGUIS.put(name, item); > } > fLguiItem = item; >@@ -175,6 +193,7 @@ > > fLguiItem.reloadLastLayout(layout); > fLguiItem.setRequest(request); >+ fLguiItem.setPattern(pattern); > restoreJobStatusData(fLguiItem, jobs); > > if (!fLguiItem.isEmpty()) { >@@ -183,7 +202,7 @@ > } > > public void removeListener(ILMLListener listener) { >- lmlListeners.remove(listener); >+ viewListeners.remove(listener); > } > > public void removeUserJob(String name, String jobId) { >@@ -238,18 +257,8 @@ > lguiItem = LGUIS.get(name); > } > if (lguiItem != null) { >- try { >- lguiItem.getCurrentLayout(output); >- } catch (final JAXBException e) { >- throw new CoreException(new Status(IStatus.ERROR, LMLCorePlugin.getUniqueIdentifier(), e.getCause() >- .getLocalizedMessage())); >- } >- try { >- lguiItem.update(input); >- } catch (final JAXBException e) { >- throw new CoreException(new Status(IStatus.ERROR, LMLCorePlugin.getUniqueIdentifier(), e.getCause() >- .getLocalizedMessage())); >- } >+ lguiItem.getCurrentLayout(output); >+ lguiItem.update(input); > > if (fLguiItem == lguiItem) { > if (!isDisplayed) { >@@ -273,14 +282,21 @@ > > private void fireChangeSelectedObject(String oid) { > final ISelectObjectEvent event = new SelectObjectEvent(oid); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { >+ ((ILMLListener) listener).handleEvent(event); >+ } >+ } >+ >+ private void fireFilterLgui(String gid, List<IPattern> filterValues) { >+ final ITableFilterEvent event = new TableFilterEvent(gid, filterValues); >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > } > > private void fireMarkObject(String oid) { > final IMarkObjectEvent event = new MarkObjectEvent(oid); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > } >@@ -290,7 +306,7 @@ > */ > private void fireNewLgui() { > final ILguiAddedEvent event = new LguiAddedEvent(); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > isDisplayed = true; >@@ -298,7 +314,7 @@ > > private void fireRemovedLgui(ILguiItem title) { > final ILguiRemovedEvent event = new LguiRemovedEvent(); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > isDisplayed = false; >@@ -309,28 +325,28 @@ > */ > private void fireSortedLgui() { > final ITableSortedEvent event = new TableSortedEvent(this, fLguiItem); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > } > > private void fireUnmarkObject(String oid) { > final IUnmarkObjectEvent event = new UnmarkObjectEvent(oid); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > } > > private void fireUnselectObject(String oid) { > final IUnselectedObjectEvent event = new UnselectObjectEvent(oid); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > } > > private void fireUpdatedLgui() { > final IViewUpdateEvent event = new ViewUpdateEvent(); >- for (final Object listener : lmlListeners.getListeners()) { >+ for (final Object listener : viewListeners.getListeners()) { > ((ILMLListener) listener).handleEvent(event); > } > } >@@ -348,17 +364,4 @@ > } > } > } >- >- // /** >- // * @param map >- // * @param memento >- // * guaranteed by caller to be non-<code>null</code> >- // */ >- // private void saveJobStatusData(ILguiItem item, IMemento memento) { >- // for (final JobStatusData status : item.getUserJobs()) { >- // if (!status.isRemoved()) { >- // status.save(memento); >- // } >- // } >- // } > } >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/events/ITableFilterEvent.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/events/ITableFilterEvent.java >new file mode 100644 >index 0000000..ca22439 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/events/ITableFilterEvent.java >@@ -0,0 +1,27 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - Initial API and implementation >+ * >+ * Modified by: >+ * Claudia Knobloch, Forschungszentrum Juelich GmbH >+ *******************************************************************************/ >+ >+package org.eclipse.ptp.rm.lml.core.events; >+ >+import java.util.List; >+ >+import org.eclipse.ptp.rm.lml.core.model.IPattern; >+ >+public interface ITableFilterEvent { >+ >+ public String getGid(); >+ >+ public List<IPattern> getPattern(); >+ >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/listeners/ILMLListener.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/listeners/ILMLListener.java >index 2c747eb..686ca9a 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/listeners/ILMLListener.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/listeners/ILMLListener.java >@@ -12,6 +12,7 @@ > import org.eclipse.ptp.rm.lml.core.events.ILguiRemovedEvent; > import org.eclipse.ptp.rm.lml.core.events.IMarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.ISelectObjectEvent; >+import org.eclipse.ptp.rm.lml.core.events.ITableFilterEvent; > import org.eclipse.ptp.rm.lml.core.events.ITableSortedEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnmarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnselectedObjectEvent; >@@ -30,13 +31,15 @@ > > public void handleEvent(ISelectObjectEvent event); > >+ public void handleEvent(ITableFilterEvent event); >+ > /** > * Handles an IJobListSortedEevnt. > * >- * @param e >+ * @param event > * an IJobListSortedEvent > */ >- public void handleEvent(ITableSortedEvent e); >+ public void handleEvent(ITableSortedEvent event); > > public void handleEvent(IUnmarkObjectEvent event); > >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiHandler.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiHandler.java >index 22dcb74..609cf90 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiHandler.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiHandler.java >@@ -12,4 +12,14 @@ > package org.eclipse.ptp.rm.lml.core.model; > > public interface ILguiHandler { >+ /* >+ * Mandatory table fields >+ */ >+ public static String JOB_ID = "step"; //$NON-NLS-1$ >+ public static String JOB_OWNER = "owner"; //$NON-NLS-1$ >+ public static String JOB_STATUS = "status"; //$NON-NLS-1$ >+ public static String JOB_QUEUE_NAME = "queue"; //$NON-NLS-1$ >+ >+ public static String ACTIVE_JOB_TABLE = "joblistrun"; //$NON-NLS-1$ >+ public static String INACTIVE_JOB_TABLE = "joblistwait"; //$NON-NLS-1$ > } >\ No newline at end of file >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java >index 424363e..fbc6092 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ILguiItem.java >@@ -12,6 +12,8 @@ > > import java.io.InputStream; > import java.io.OutputStream; >+import java.util.List; >+import java.util.Map; > > import javax.xml.bind.JAXBException; > >@@ -77,12 +79,14 @@ > */ > public void addUserJob(String jobId, JobStatusData status, boolean force); > >+ public String[] getColumnTitlePattern(String gid); >+ > /** > * The meth > * > * @param output > */ >- public void getCurrentLayout(OutputStream output) throws JAXBException; >+ public void getCurrentLayout(OutputStream output); > > /** > * @return >@@ -114,6 +118,10 @@ > */ > public OverviewAccess getOverviewAccess(); > >+ public Map<String, List<IPattern>> getPattern(); >+ >+ public List<IPattern> getPattern(String gid); >+ > /** > * @return > */ >@@ -129,6 +137,8 @@ > * @return > */ > public JobStatusData[] getUserJobs(); >+ >+ public String getUsername(); > > /** > * Getting the version of the LguiType: >@@ -157,15 +167,9 @@ > > /** > * >- * @param memento >+ * @param layout > */ > public void reloadLastLayout(StringBuilder layout); >- >- // /** >- // * >- // * @param memento >- // */ >- // public void reloadLastLayout(IMemento memento); > > /** > * @param name >@@ -179,15 +183,9 @@ > */ > public String saveCurrentLayout(); > >- // /** >- // * The Resource Manager is being closed. The current layout of the >- // different >- // * monitoring parts should be saved during the closing. >- // * >- // * @param memento >- // * Memento in which the current layout should be saved >- // */ >- // public void saveCurrentLayout(IMemento memento); >+ public void setPattern(Map<String, List<IPattern>> pattern); >+ >+ public void setPattern(String gid, List<IPattern> filterValues); > > public void setRequest(RequestType request); > >@@ -203,7 +201,7 @@ > * @param stream > * @throws JAXBException > */ >- public void update(InputStream stream) throws JAXBException; >+ public void update(InputStream stream); > > /** > * @param name >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/IPattern.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/IPattern.java >new file mode 100644 >index 0000000..9f52e1d >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/IPattern.java >@@ -0,0 +1,34 @@ >+/** >+ * Copyright (c) 2011 Forschungszentrum Juelich GmbH >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Claudia Knobloch, FZ Juelich >+ */ >+package org.eclipse.ptp.rm.lml.core.model; >+ >+public interface IPattern { >+ >+ public String getColumnTitle(); >+ >+ public String getMaxValueRange(); >+ >+ public String getMinValueRange(); >+ >+ public String getRelationOperator(); >+ >+ public String getType(); >+ >+ public String getRelationValue(); >+ >+ public boolean isRange(); >+ >+ public boolean isRelation(); >+ >+ public IPattern setRange(String minValueRange, String maxValueRange); >+ >+ public IPattern setRelation(String relationOperator, String valueRelation); >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ITableColumnLayout.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ITableColumnLayout.java >index 3914a6c..4cab4d8 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ITableColumnLayout.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/model/ITableColumnLayout.java >@@ -25,6 +25,8 @@ > public static String COLUMN_TYPE_MANDATORY = "mandatory"; //$NON-NLS-1$ > public static String COLUMN_TYPE_OPTIONAL = "optional"; //$NON-NLS-1$ > >+ public String getOrder(); >+ > /** > * Getting the style (LEFT or RIGHT) of the column. > * >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/util/JAXBUtil.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/util/JAXBUtil.java >new file mode 100644 >index 0000000..dbd6b38 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/core/util/JAXBUtil.java >@@ -0,0 +1,552 @@ >+package org.eclipse.ptp.rm.lml.core.util; >+ >+import java.io.IOException; >+import java.io.OutputStream; >+import java.io.StringReader; >+import java.io.StringWriter; >+import java.math.BigInteger; >+import java.net.URISyntaxException; >+import java.net.URL; >+import java.util.ArrayList; >+import java.util.HashSet; >+import java.util.List; >+ >+import javax.xml.bind.JAXBContext; >+import javax.xml.bind.JAXBElement; >+import javax.xml.bind.JAXBException; >+import javax.xml.bind.Marshaller; >+import javax.xml.bind.PropertyException; >+import javax.xml.bind.Unmarshaller; >+import javax.xml.namespace.QName; >+import javax.xml.transform.Source; >+import javax.xml.transform.stream.StreamSource; >+import javax.xml.validation.Schema; >+import javax.xml.validation.SchemaFactory; >+import javax.xml.validation.Validator; >+ >+import org.eclipse.ptp.rm.lml.core.ILMLCoreConstants; >+import org.eclipse.ptp.rm.lml.core.LMLCorePlugin; >+import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.internal.core.elements.AbslayoutType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.ChartType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.ChartgroupType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.ColumnType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.ComponentType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.ComponentlayoutType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.DataType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.GobjectType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.InfoboxType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.LayoutType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.LguiType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.Nodedisplay; >+import org.eclipse.ptp.rm.lml.internal.core.elements.NodedisplaylayoutType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.ObjectFactory; >+import org.eclipse.ptp.rm.lml.internal.core.elements.PaneType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.PatternMatchType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.PatternType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.SchemeType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.SplitlayoutType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.TableType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.TablelayoutType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.TextboxType; >+import org.eclipse.ptp.rm.lml.internal.core.elements.UsagebarType; >+import org.eclipse.ptp.rm.lml.internal.core.model.LguiItem; >+import org.xml.sax.SAXException; >+import org.xml.sax.SAXParseException; >+ >+public class JAXBUtil { >+ >+ private static JAXBUtil jaxbUtil; >+ >+ private static Unmarshaller unmarshaller; >+ >+ private static Marshaller marshaller; >+ >+ private static String JAXB_CLASSES = "org.eclipse.ptp.rm.lml.internal.core.elements";//$NON-NLS-1$ >+ >+ private static String SCHEMA_LOCATION = "jaxb.schemaLocation";//$NON-NLS-1$ >+ private static String SCHEMA_FILE = "lgui.xsd";//$NON-NLS-1$ >+ private static String SCHEMA_LGUI = "lgui";//$NON-NLS-1$ >+ private static String SCHEMA_LML = "lml";//$NON-NLS-1$ >+ private static String SCHEMA_DIRECTORY = "http://www.llview.de";//$NON-NLS-1$ >+ >+ private static Validator validator; >+ >+ public static JAXBUtil getInstance() { >+ if (jaxbUtil == null) { >+ jaxbUtil = new JAXBUtil(); >+ } >+ return jaxbUtil; >+ } >+ >+ /** >+ * Take a graphical object and minimize the data so that this instance is >+ * valid against the LML-Schema but at the same time as small as possible. >+ * >+ * @param gobject >+ * @return a copy of gobj with minimal size, only attributes in GobjectType >+ * are copied and lower special elements which are needed to make >+ * lml-model valid >+ */ >+ @SuppressWarnings("unchecked") >+ public static JAXBElement<GobjectType> minimizeGobjectType( >+ GobjectType gobject, ObjectFactory objectFactory) { >+ >+ String qName = null; >+ GobjectType value = null; >+ >+ if (gobject instanceof TableType) { >+ value = objectFactory.createTableType(); >+ final TableType origin = (TableType) gobject; >+ ((TableType) value).setContenttype(origin.getContenttype()); >+ // copy all columns with pattern to table >+ for (final ColumnType column : origin.getColumn()) { >+ if (column.getPattern() != null) { >+ ((TableType) value).getColumn().add(column); >+ } >+ } >+ >+ qName = ILMLCoreConstants.TABLE_ELEMENT; >+ } else if (gobject instanceof UsagebarType) { >+ value = objectFactory.createUsagebarType(); >+ >+ ((UsagebarType) value).setCpucount(BigInteger.valueOf(0)); >+ >+ qName = ILMLCoreConstants.USAGEBAR_ELEMENT; >+ } else if (gobject instanceof TextboxType) { >+ value = objectFactory.createTextboxType(); >+ ((TextboxType) value).setText(ILMLCoreConstants.ZEROSTR); >+ >+ qName = ILMLCoreConstants.TEXT_ELEMENT; >+ } else if (gobject instanceof InfoboxType) { >+ value = objectFactory.createInfoboxType(); >+ >+ qName = ILMLCoreConstants.INFOBOX_ELEMENT; >+ } else if (gobject instanceof Nodedisplay) { >+ value = objectFactory.createNodedisplay(); >+ final SchemeType scheme = objectFactory.createSchemeType(); >+ scheme.getEl1().add(objectFactory.createSchemeElement1()); >+ ((Nodedisplay) value).setScheme(scheme); >+ >+ final DataType dat = objectFactory.createDataType(); >+ dat.getEl1().add(objectFactory.createDataElement1()); >+ ((Nodedisplay) value).setData(dat); >+ >+ qName = ILMLCoreConstants.NODEDISPLAY_ELEMENT; >+ } else if (gobject instanceof ChartType) { >+ value = objectFactory.createChartType(); >+ >+ qName = ILMLCoreConstants.CHART_ELEMENT; >+ } else if (gobject instanceof ChartgroupType) { >+ final ChartgroupType chartgroupType = objectFactory >+ .createChartgroupType(); >+ // Add lower chart-elements to the minimized chart-group >+ // Go through all charts minimize them and add them to ut >+ for (final ChartType chart : ((ChartgroupType) gobject).getChart()) { >+ final ChartType minimal = (ChartType) (minimizeGobjectType( >+ chart, objectFactory).getValue()); >+ chartgroupType.getChart().add(minimal); >+ } >+ >+ value = chartgroupType; >+ >+ qName = ILMLCoreConstants.CHARTGROUP_ELEMENT; >+ } >+ >+ value.setDescription(gobject.getDescription()); >+ value.setId(gobject.getId()); >+ value.setTitle(gobject.getTitle()); >+ >+ return new JAXBElement<GobjectType>(new QName(qName), >+ (Class<GobjectType>) gobject.getClass(), value); >+ } >+ >+ /** >+ * Replace a global layout within the lml-model by a new one >+ * >+ * @param newLayout >+ * new layout, which replaces the old in model with the same id >+ * @param lgui >+ * lgui-instance, which is changed >+ */ >+ @SuppressWarnings("unchecked") >+ public static void replaceGlobalLayout(LguiType newLayout, LguiType lgui) { >+ >+ for (final JAXBElement<?> layout : newLayout >+ .getObjectsAndRelationsAndInformation()) { >+ if (layout.getValue() instanceof LayoutType) { >+ boolean replaced = false; >+ for (final JAXBElement<?> object : lgui >+ .getObjectsAndRelationsAndInformation()) { >+ if (object.getValue() instanceof LayoutType) { >+ if (((LayoutType) object.getValue()).getId().equals( >+ ((LayoutType) layout.getValue()).getId())) { >+ ((JAXBElement<LayoutType>) object) >+ .setValue((LayoutType) layout.getValue()); >+ replaced = true; >+ break; >+ } >+ } >+ } >+ if (!replaced) { >+ lgui.getObjectsAndRelationsAndInformation().add(layout); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Search for gid-attributes of a pane and put it into neededComponents >+ * Recursively search all graphical objects referenced by this pane >+ * >+ * @param pane >+ * part of SplitLayout, which is scanned for gid-attributes >+ * @param components >+ * resulting Hashset >+ */ >+ private static void collectComponents(PaneType pane, HashSet<String> components) { >+ >+ if (pane.getGid() != null) { >+ components.add(pane.getGid()); >+ } else { >+ // top and bottom components? >+ if (pane.getBottom() != null) { >+ collectComponents(pane.getBottom(), components); >+ collectComponents(pane.getTop(), components); >+ } else {// Left and right >+ collectComponents(pane.getLeft(), components); >+ collectComponents(pane.getRight(), components); >+ } >+ } >+ >+ } >+ >+ /** >+ * * Uses the ResourceManagerData schema. >+ * >+ * @return static singleton >+ * @throws IOException >+ * @throws SAXException >+ */ >+ @SuppressWarnings("unused") >+ private synchronized static Validator getValidator() throws IOException, SAXException { >+ if (validator == null) { >+ >+ final URL xsd = LMLCorePlugin.getResource(ILMLCoreConstants.RM_XSD); >+ final SchemaFactory factory = SchemaFactory.newInstance(ILMLCoreConstants.XMLSchema); >+ final Schema schema = factory.newSchema(xsd); >+ validator = schema.newValidator(); >+ } >+ return validator; >+ } >+ >+ private static void validate(Source source) throws SAXException, IOException, URISyntaxException { >+ try { >+ getValidator().validate(source); >+ } catch (final SAXParseException sax) { >+ throw sax; >+ } >+ } >+ >+ private JAXBUtil() { >+ jaxbUtil = this; >+ try { >+ final JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CLASSES); >+ marshaller = jaxbContext.createMarshaller(); >+ unmarshaller = jaxbContext.createUnmarshaller(); >+ >+ } catch (final JAXBException e) { >+ marshaller = null; >+ unmarshaller = null; >+ // TODO Error Message? >+ } >+ } >+ >+ public void addComponentLayoutElement(LguiType lgui, >+ ComponentlayoutType component) { >+ if (component instanceof TablelayoutType) { >+ lgui.getObjectsAndRelationsAndInformation() >+ .add(new JAXBElement<TablelayoutType>(new QName( >+ ILMLCoreConstants.TABLELAYOUT_ELEMENT), >+ TablelayoutType.class, (TablelayoutType) component)); >+ } else if (component instanceof NodedisplaylayoutType) { >+ lgui.getObjectsAndRelationsAndInformation().add( >+ new JAXBElement<NodedisplaylayoutType>(new QName( >+ ILMLCoreConstants.NODEDISPLAYLAYOUT_ELEMENT), >+ NodedisplaylayoutType.class, >+ (NodedisplaylayoutType) component)); >+ } else { >+ lgui.getObjectsAndRelationsAndInformation().add( >+ new JAXBElement<ComponentlayoutType>(new QName( >+ ILMLCoreConstants.COMPONENTLAYOUT_ELEMENT), >+ ComponentlayoutType.class, component)); >+ } >+ } >+ >+ public void addLayoutElement(LguiType lgui, Object object) { >+ if (object instanceof SplitlayoutType) { >+ lgui.getObjectsAndRelationsAndInformation().add( >+ new JAXBElement<SplitlayoutType>(new QName( >+ ILMLCoreConstants.SPLITLAYOUT_ELEMENT), >+ SplitlayoutType.class, (SplitlayoutType) object)); >+ } else if (object instanceof AbslayoutType) { >+ lgui.getObjectsAndRelationsAndInformation().add( >+ new JAXBElement<AbslayoutType>(new QName( >+ ILMLCoreConstants.ABSLAYOUT_ELEMENT), >+ AbslayoutType.class, (AbslayoutType) object)); >+ } >+ >+ } >+ >+ /** >+ * Add a new created layout to the model >+ * >+ * @param layout >+ * absolute or splitlayout >+ */ >+ public void addLayoutTag(LguiType lgui, ILguiItem lguiItem, >+ LayoutType layout) { >+ >+ if (layout.getId() == null) { >+ layout.setId(ILMLCoreConstants.ZEROSTR); >+ } >+ >+ JAXBElement<? extends LayoutType> jaxbElement = null; >+ // Create jaxbelement corresponding to the class-type >+ if (layout instanceof AbslayoutType) { >+ >+ final AbslayoutType absLayout = (AbslayoutType) layout; >+ >+ jaxbElement = new JAXBElement<AbslayoutType>(new QName( >+ ILMLCoreConstants.ABSLAYOUT_ELEMENT), AbslayoutType.class, >+ absLayout); >+ >+ } else if (layout instanceof SplitlayoutType) { >+ >+ final SplitlayoutType splitLayout = (SplitlayoutType) layout; >+ >+ jaxbElement = new JAXBElement<SplitlayoutType>(new QName( >+ ILMLCoreConstants.SPLITLAYOUT_ELEMENT), >+ SplitlayoutType.class, splitLayout); >+ >+ } else { >+ return; >+ } >+ >+ lgui.getObjectsAndRelationsAndInformation().add(jaxbElement); >+ >+ lguiItem.notifyListeners(); >+ >+ } >+ >+ public void addPatternInclude(PatternType pattern, >+ PatternMatchType patternMatch) { >+ pattern.getIncludeAndExclude().add( >+ new JAXBElement<PatternMatchType>(new QName( >+ ILMLCoreConstants.INCLUDE_ELEMENT), >+ PatternMatchType.class, patternMatch)); >+ } >+ >+ public void addTable(LguiType lgui, TableType table) { >+ lgui.getObjectsAndRelationsAndInformation().add( >+ new JAXBElement<TableType>(new QName( >+ ILMLCoreConstants.TABLE_ELEMENT), TableType.class, >+ table)); >+ } >+ >+ public void getLayoutComponents(LguiType result, LguiType lgui, HashSet<String> components) { >+ >+ for (final JAXBElement<?> element : lgui.getObjectsAndRelationsAndInformation()) { >+ >+ final Object object = element.getValue(); >+ >+ if (object instanceof LayoutType) { >+ if (object instanceof SplitlayoutType) { >+ lgui.getObjectsAndRelationsAndInformation().add(element); >+ } else if (object instanceof AbslayoutType) { >+ lgui.getObjectsAndRelationsAndInformation().add(element); >+ } >+ >+ if (object instanceof SplitlayoutType) { >+ if (((SplitlayoutType) object).getLeft() != null) { >+ collectComponents(((SplitlayoutType) object).getLeft(), components); >+ collectComponents(((SplitlayoutType) object).getRight(), components); >+ } >+ } else if (object instanceof AbslayoutType) { >+ for (final ComponentType component : ((AbslayoutType) object).getComp()) { >+ components.add(component.getGid()); >+ } >+ } >+ } else if (object instanceof ComponentlayoutType) { >+ if (((ComponentlayoutType) object).isActive()) { >+ addComponentLayoutElement(result, (ComponentlayoutType) object); >+ components.add(((ComponentlayoutType) object).getGid()); >+ } >+ } >+ } >+ } >+ >+ public ArrayList<Object> getObjects(LguiType lgui) { >+ final ArrayList<Object> list = new ArrayList<Object>(); >+ for (final JAXBElement<?> element : lgui >+ .getObjectsAndRelationsAndInformation()) { >+ list.add(element.getValue()); >+ } >+ return list; >+ } >+ >+ public void marshal(LguiType lgui, OutputStream output) { >+ try { >+ marshaller.setProperty(SCHEMA_LOCATION, SCHEMA_DIRECTORY + SCHEMA_FILE); >+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); >+ final QName tagname = new QName(SCHEMA_DIRECTORY, SCHEMA_LGUI, SCHEMA_LML); >+ >+ final JAXBElement<LguiType> rootElement = new JAXBElement<LguiType>( >+ tagname, LguiType.class, lgui); >+ /* >+ * Synchronize to avoid the dreaded >+ * "FWK005 parse may not be called while parsing" message >+ */ >+ synchronized (LguiItem.class) { >+ marshaller.marshal(rootElement, output); >+ } >+ output.close(); // Must close to flush stream >+ } catch (final PropertyException e) { >+ // TODO ErrorMessage >+ } catch (final IOException e) { >+ // TODO ErrorMessage >+ } catch (final JAXBException e) { >+ // TODO ErrorMessage >+ } >+ } >+ >+ public void marshal(LguiType lgui, StringWriter writer) { >+ try { >+ marshaller.setProperty(SCHEMA_LOCATION, SCHEMA_DIRECTORY + SCHEMA_FILE); >+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); >+ final QName tagname = new QName(SCHEMA_DIRECTORY, SCHEMA_LGUI, SCHEMA_LML); >+ >+ final JAXBElement<LguiType> rootElement = new JAXBElement<LguiType>( >+ tagname, LguiType.class, lgui); >+ /* >+ * Synchronize to avoid the dreaded >+ * "FWK005 parse may not be called while parsing" message >+ */ >+ synchronized (LguiItem.class) { >+ marshaller.marshal(rootElement, writer); >+ } >+ >+ } catch (final PropertyException e) { >+ // TODO ErrorMessage >+ } catch (final JAXBException e) { >+ // TODO ErrorMessage >+ } >+ } >+ >+ /** >+ * Replace all componentlayouts for a graphical object with given gid >+ * through newlayout.getGid() with newlayout >+ * >+ * @param newLayout >+ * new layout, which is placed into the positions of old layouts >+ */ >+ @SuppressWarnings("unchecked") >+ public void replaceComponentLayout(LguiType lgui, ILguiItem lguiItem, ComponentlayoutType newLayout) { >+ if (newLayout == null) { >+ return; >+ } >+ final List<JAXBElement<?>> objects = lgui.getObjectsAndRelationsAndInformation(); >+ >+ boolean replaced = false; >+ >+ // Over all objects in lml-file >+ for (int i = 0; i < objects.size(); i++) { >+ final JAXBElement<?> object = objects.get(i); >+ >+ // Over all Componentlayouts >+ if (object.getValue() instanceof ComponentlayoutType) { >+ >+ if (((ComponentlayoutType) object.getValue()).getGid() != null >+ && ((ComponentlayoutType) object.getValue()).getGid() >+ .equals(newLayout.getGid())) { >+ >+ if (!replaced) { >+ >+ ((JAXBElement<ComponentlayoutType>) object) >+ .setValue(newLayout); >+ lguiItem.notifyListeners(); >+ replaced = true; >+ } else {// Delete this object >+ objects.remove(object); >+ // One step back >+ i--; >+ } >+ } >+ >+ } >+ } >+ >+ if (!replaced) { >+ // Insert new layout, if there was nothing to replace >+ // Takes any componentlayout >+ JAXBElement<?> newElement = null; >+ >+ // Differ between several layouts, create different JAXBElements >+ if (newLayout instanceof TablelayoutType) { >+ newElement = new JAXBElement<TablelayoutType>(new QName( >+ ILMLCoreConstants.TABLELAYOUT_ELEMENT), >+ TablelayoutType.class, (TablelayoutType) newLayout); >+ } else if (newLayout instanceof NodedisplaylayoutType) { >+ newElement = new JAXBElement<NodedisplaylayoutType>(new QName( >+ ILMLCoreConstants.NODEDISPLAYLAYOUT_ELEMENT), >+ NodedisplaylayoutType.class, >+ (NodedisplaylayoutType) newLayout); >+ } >+ >+ if (newElement != null) { >+ lgui.getObjectsAndRelationsAndInformation().add(newElement); >+ lguiItem.notifyListeners(); >+ } >+ } >+ >+ } >+ >+ /** >+ * Parsing an XML file. The method generates from an XML file an instance of >+ * LguiType. >+ * >+ * @param string >+ * String containing the information from the server side >+ * @return the generated LguiType >+ */ >+ @SuppressWarnings("unchecked") >+ public LguiType unmarshal(String string) { >+ /* >+ * Synchronize to avoid the dreaded >+ * "FWK005 parse may not be called while parsing" message >+ */ >+ Source source = new StreamSource(new StringReader(string)); >+ try { >+ validate(source); >+ } catch (final SAXException e1) { >+ // TODO Auto-generated catch block >+ e1.printStackTrace(); >+ } catch (final IOException e1) { >+ // TODO Auto-generated catch block >+ e1.printStackTrace(); >+ } catch (final URISyntaxException e1) { >+ // TODO Auto-generated catch block >+ e1.printStackTrace(); >+ } >+ source = new StreamSource(new StringReader(string)); >+ JAXBElement<LguiType> jaxb = null; >+ try { >+ synchronized (LguiItem.class) { >+ jaxb = (JAXBElement<LguiType>) unmarshaller.unmarshal(source); >+ } >+ } catch (final JAXBException e) { >+ // TODO ErrorMessage >+ } >+ return jaxb.getValue(); >+ } >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/events/TableFilterEvent.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/events/TableFilterEvent.java >new file mode 100644 >index 0000000..7055c72 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/events/TableFilterEvent.java >@@ -0,0 +1,52 @@ >+/******************************************************************************* >+ * Copyright (c) 2005, 2006, 2007 Los Alamos National Security, LLC. >+ * This material was produced under U.S. Government contract DE-AC52-06NA25396 >+ * for Los Alamos National Laboratory (LANL), which is operated by the Los Alamos >+ * National Security, LLC (LANS) for the U.S. Department of Energy. The U.S. Government has >+ * rights to use, reproduce, and distribute this software. NEITHER THE >+ * GOVERNMENT NOR LANS MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR >+ * ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified >+ * to produce derivative works, such modified software should be clearly marked, >+ * so as not to confuse it with the version available from LANL. >+ * >+ * Additionally, this program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Modified by: >+ * Claudia Knobloch, Forschungszentrum Juelich GmbH >+ *******************************************************************************/ >+ >+package org.eclipse.ptp.rm.lml.internal.core.events; >+ >+import java.util.LinkedList; >+import java.util.List; >+ >+import org.eclipse.ptp.rm.lml.core.events.ITableFilterEvent; >+import org.eclipse.ptp.rm.lml.core.model.IPattern; >+ >+public class TableFilterEvent implements ITableFilterEvent { >+ >+ private List<IPattern> pattern; >+ >+ private final String gid; >+ >+ public TableFilterEvent(String gid, List<IPattern> pattern) { >+ this.gid = gid; >+ if (pattern == null) { >+ pattern = new LinkedList<IPattern>(); >+ } else { >+ this.pattern = pattern; >+ } >+ } >+ >+ public String getGid() { >+ return gid; >+ } >+ >+ public List<IPattern> getPattern() { >+ return pattern; >+ } >+ >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LayoutAccess.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LayoutAccess.java >index 2cc8203..2226ed2 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LayoutAccess.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LayoutAccess.java >@@ -11,7 +11,6 @@ > > package org.eclipse.ptp.rm.lml.internal.core.model; > >-import java.io.OutputStream; > import java.math.BigInteger; > import java.util.ArrayList; > import java.util.HashMap; >@@ -20,39 +19,23 @@ > import java.util.List; > import java.util.Map; > >-import javax.xml.bind.JAXBContext; >-import javax.xml.bind.JAXBElement; >-import javax.xml.bind.JAXBException; >-import javax.xml.bind.Marshaller; >-import javax.xml.namespace.QName; >- >+import org.eclipse.ptp.rm.lml.core.ILMLCoreConstants; > import org.eclipse.ptp.rm.lml.core.events.ILguiUpdatedEvent; > import org.eclipse.ptp.rm.lml.core.listeners.ILguiListener; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.core.util.JAXBUtil; > import org.eclipse.ptp.rm.lml.internal.core.elements.AbslayoutType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.ChartType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.ChartgroupType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ChartlayoutType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.ColumnType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ColumnlayoutType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ComponentType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ComponentlayoutType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.DataType; > import org.eclipse.ptp.rm.lml.internal.core.elements.GobjectType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.InfoboxType; > import org.eclipse.ptp.rm.lml.internal.core.elements.InfoboxlayoutType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.LayoutType; > import org.eclipse.ptp.rm.lml.internal.core.elements.LguiType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.Nodedisplay; > import org.eclipse.ptp.rm.lml.internal.core.elements.NodedisplaylayoutType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ObjectFactory; >-import org.eclipse.ptp.rm.lml.internal.core.elements.PaneType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.SchemeType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.SplitlayoutType; > import org.eclipse.ptp.rm.lml.internal.core.elements.TableType; > import org.eclipse.ptp.rm.lml.internal.core.elements.TablelayoutType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.TextboxType; >-import org.eclipse.ptp.rm.lml.internal.core.elements.UsagebarType; > import org.eclipse.ptp.rm.lml.internal.core.elements.UsagebarlayoutType; > > /** >@@ -64,6 +47,17 @@ > * functions, which allow to merge layouts to one lml-model > */ > public class LayoutAccess extends LguiHandler { >+ /* >+ * create an objectfactory for all functions in this class >+ */ >+ private static ObjectFactory objectFactory = new ObjectFactory(); >+ >+ private static final String LAYOUT_ENDING = "_layout";//$NON-NLS-1$ >+ >+ private static String DEAFULT_ABS = "abs_default";//$NON-NLS-1$ >+ >+ private static JAXBUtil jaxbUtil = JAXBUtil.getInstance(); >+ > /** > * This method merges the layout information given by the "layout"-instance > * with the layout, which is included in "data". Component-layouts in "data" >@@ -85,12 +79,11 @@ > if (data == null || layout == null) { > return data; > } >- final LguiItem lgui = new LguiItem(data); >- final LayoutAccess la = new LayoutAccess(lgui, lgui.getLguiType()); >+ final LguiItem lguiData = new LguiItem(data); > // Replace component-layouts >- for (final JAXBElement<?> el : layout.getObjectsAndRelationsAndInformation()) { >- if (el.getValue() instanceof ComponentlayoutType) { >- la.replaceComponentLayout((ComponentlayoutType) el.getValue()); >+ for (final Object object : jaxbUtil.getObjects(layout)) { >+ if (object instanceof ComponentlayoutType) { >+ jaxbUtil.replaceComponentLayout(data, lguiData, (ComponentlayoutType) object); > } > } > >@@ -115,208 +108,9 @@ > * } } > **/ > >- // Overwrite layouts with the same name >- for (final JAXBElement<?> el : layout.getObjectsAndRelationsAndInformation()) { >- if (el.getValue() instanceof LayoutType) { >- if (!replaceGlobalLayout((LayoutType) el.getValue(), data)) { >- // If not replaced, insert it >- data.getObjectsAndRelationsAndInformation().add(el); >- } >- } >- } >- >+ JAXBUtil.replaceGlobalLayout(layout, data); > return data; > } >- >- /** >- * Replace a global layout within the lml-model by a new one >- * >- * @param newlayout >- * new layout, which replaces the old in model with the same id >- * @param model >- * lgui-instance, which is changed >- */ >- @SuppressWarnings("unchecked") >- public static boolean replaceGlobalLayout(LayoutType newlayout, LguiType model) { >- >- final List<JAXBElement<?>> all = model.getObjectsAndRelationsAndInformation(); >- >- // Go through all objects, search for layouttypes with newlayout.getId >- // as id and replace them with this layout >- for (int i = 0; i < all.size(); i++) { >- final JAXBElement<?> aobj = all.get(i); >- if (aobj.getValue() instanceof LayoutType) { >- final LayoutType old = (LayoutType) aobj.getValue(); >- if (old.getId().equals(newlayout.getId())) { >- ((JAXBElement<LayoutType>) aobj).setValue(newlayout); >- return true; >- } >- } >- } >- >- return false; >- } >- >- /** >- * Search for gid-attributes of a pane and put it into neededComponents >- * Recursively search all graphical objects referenced by this pane >- * >- * @param p >- * part of SplitLayout, which is scanned for gid-attributes >- * @param neededComponents >- * resulting Hashset >- */ >- private static void collectComponents(PaneType p, HashSet<String> neededComponents) { >- >- if (p.getGid() != null) { >- neededComponents.add(p.getGid()); >- } else { >- // top and bottom components? >- if (p.getBottom() != null) { >- collectComponents(p.getBottom(), neededComponents); >- collectComponents(p.getTop(), neededComponents); >- } else {// Left and right >- collectComponents(p.getLeft(), neededComponents); >- collectComponents(p.getRight(), neededComponents); >- } >- } >- >- } >- >- /** >- * Take a graphical object and minimize the data so that this instance is >- * valid against the LML-Schema but at the same time as small as possible. >- * >- * @param gobj >- * @return a copy of gobj with minimal size, only attributes in GobjectType >- * are copied and lower special elements which are needed to make >- * lml-model valid >- */ >- @SuppressWarnings("unchecked") >- private static JAXBElement<GobjectType> minimizeGobjectType(GobjectType gobj) { >- >- String qname = "table"; //$NON-NLS-1$ >- final Class<GobjectType> c = (Class<GobjectType>) gobj.getClass(); >- >- GobjectType value = objectFactory.createGobjectType(); >- >- if (gobj instanceof TableType) { >- final TableType tt = objectFactory.createTableType(); >- final TableType orig = (TableType) gobj; >- tt.setContenttype(orig.getContenttype()); >- // copy all columns with pattern to table >- for (final ColumnType col : orig.getColumn()) { >- if (col.getPattern() != null) { >- tt.getColumn().add(col); >- } >- } >- >- value = tt; >- >- qname = "table"; //$NON-NLS-1$ >- } else if (gobj instanceof UsagebarType) { >- final UsagebarType ut = objectFactory.createUsagebarType(); >- >- ut.setCpucount(BigInteger.valueOf(0)); >- >- value = ut; >- >- qname = "usagebar"; //$NON-NLS-1$ >- } else if (gobj instanceof TextboxType) { >- final TextboxType ut = objectFactory.createTextboxType(); >- >- ut.setText(""); //$NON-NLS-1$ >- >- value = ut; >- >- qname = "text"; //$NON-NLS-1$ >- } else if (gobj instanceof InfoboxType) { >- final InfoboxType ut = objectFactory.createInfoboxType(); >- >- value = ut; >- >- qname = "infobox"; //$NON-NLS-1$ >- } else if (gobj instanceof Nodedisplay) {// Create minimal nodedisplay >- final Nodedisplay ut = objectFactory.createNodedisplay(); >- >- value = ut; >- final SchemeType scheme = objectFactory.createSchemeType(); >- scheme.getEl1().add(objectFactory.createSchemeElement1()); >- ut.setScheme(scheme); >- >- final DataType dat = objectFactory.createDataType(); >- dat.getEl1().add(objectFactory.createDataElement1()); >- ut.setData(dat); >- >- qname = "nodedisplay"; //$NON-NLS-1$ >- } else if (gobj instanceof ChartType) { >- final ChartType ut = objectFactory.createChartType(); >- >- value = ut; >- >- qname = "chart"; //$NON-NLS-1$ >- } else if (gobj instanceof ChartgroupType) { >- final ChartgroupType ut = objectFactory.createChartgroupType(); >- // Add lower chart-elements to the minimized chart-group >- final ChartgroupType orig = (ChartgroupType) gobj; >- // Go through all charts minimize them and add them to ut >- for (final ChartType chart : orig.getChart()) { >- final ChartType min = (ChartType) (minimizeGobjectType(chart).getValue()); >- ut.getChart().add(min); >- } >- >- value = ut; >- >- qname = "chartgroup"; //$NON-NLS-1$ >- } >- >- value.setDescription(gobj.getDescription()); >- value.setId(gobj.getId()); >- value.setTitle(gobj.getTitle()); >- >- final JAXBElement<GobjectType> res = new JAXBElement<GobjectType>(new QName(qname), c, value); >- >- return res; >- } >- >- /** >- * @param obj >- * LguiType-instance >- * @param output >- * OutputStream to save xml-representation of obj in >- * @throws JAXBException >- */ >- @SuppressWarnings("unused") >- private static void objToLML(LguiType obj, OutputStream output) throws JAXBException { >- >- final JAXBContext jc = JAXBContext.newInstance("lml"); //$NON-NLS-1$ >- >- final Marshaller mar = jc.createMarshaller(); >- >- mar.setProperty("jaxb.schemaLocation", "http://www.llview.de lgui.xsd"); //$NON-NLS-1$ //$NON-NLS-2$ >- >- final QName tagname = new QName("http://www.llview.de", "lgui", "lml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- >- final JAXBElement<LguiType> rootel = new JAXBElement<LguiType>(tagname, LguiType.class, obj); >- >- mar.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); >- >- mar.marshal(rootel, output); >- } >- >- // DefaultLayouts >- private final UsagebarlayoutType defaultUsagebar; >- >- private final ChartlayoutType defaultChart; >- >- private final TablelayoutType defaultTable; >- >- private final InfoboxlayoutType defaultInfobox; >- >- /* >- * create an objectfactory for all functions in this class >- */ >- private static ObjectFactory objectFactory = new ObjectFactory(); > > /** > * @param lguiItem >@@ -326,10 +120,6 @@ > */ > public LayoutAccess(ILguiItem lguiItem, LguiType lgui) { > super(lguiItem, lgui); >- defaultUsagebar = objectFactory.createUsagebarlayoutType(); >- defaultChart = objectFactory.createChartlayoutType(); >- defaultTable = objectFactory.createTablelayoutType(); >- defaultInfobox = objectFactory.createInfoboxlayoutType(); > > this.lguiItem.addListener(new ILguiListener() { > public void handleEvent(ILguiUpdatedEvent e) { >@@ -339,45 +129,8 @@ > } > > /** >- * Add a new created layout to the model >- * >- * @param layout >- * absolute or splitlayout >- */ >- public void addLayoutTag(LayoutType layout) { >- >- if (layout.getId() == null) { >- layout.setId(""); //$NON-NLS-1$ >- } >- >- JAXBElement<? extends LayoutType> jaxbel = null; >- // Create jaxbelement corresponding to the class-type >- if (layout instanceof AbslayoutType) { >- >- final AbslayoutType abslayout = (AbslayoutType) layout; >- >- jaxbel = new JAXBElement<AbslayoutType>(new QName("abslayout"), AbslayoutType.class, abslayout); //$NON-NLS-1$ >- >- } else if (layout instanceof SplitlayoutType) { >- >- final SplitlayoutType splitlayout = (SplitlayoutType) layout; >- >- jaxbel = new JAXBElement<SplitlayoutType>(new QName("splitlayout"), SplitlayoutType.class, splitlayout); //$NON-NLS-1$ >- >- } else { >- return; >- } >- >- lgui.getObjectsAndRelationsAndInformation().add(jaxbel); >- >- lguiItem.notifyListeners(); >- >- } >- >- /** >- * Generates an absolute layout without needing a layout tag. Active >- * components are placed in a grid on the screen. Use this function, if no >- * layout was specified by the lml-file. >+ * Generates an absolute layout without needing a layout tag. Active components are placed in a grid on the screen. Use this >+ * function, if no layout was specified by the lml-file. > * > * @param width > * width in pixels of the area, on which this layout is shown >@@ -387,126 +140,99 @@ > */ > public AbslayoutType generateDefaultAbsoluteLayout(int width, int height) { > >- // Collect active components >- final List<GobjectType> gobjects = lguiItem.getOverviewAccess().getGraphicalObjects(); >- >- final ArrayList<GobjectType> activeobjects = new ArrayList<GobjectType>(); >+ final ArrayList<GobjectType> activeObjects = new ArrayList<GobjectType>(); > // Go through all graphical objects >- for (final GobjectType gobj : gobjects) { >+ for (final GobjectType gobject : lguiItem.getOverviewAccess().getGraphicalObjects()) { > // Get layouts for this object, normally there is only one >- final List<ComponentlayoutType> layouts = getComponentLayoutByGID(gobj.getId()); >+ final List<ComponentlayoutType> layouts = getComponentLayoutByGid(gobject >+ .getId()); > >- if (layouts.size() == 0) {// assume gobj to be active if there is no >- // componentlayout >- activeobjects.add(gobj); >+ if (layouts.size() == 0) {// assume gobject to be active if there is >+ // no componentlayout >+ activeObjects.add(gobject); > } > >- // Search for a componentlayout which declares gobj to be active >- for (final ComponentlayoutType complayout : layouts) { >- if (complayout.isActive()) { >- activeobjects.add(gobj); >+ // Search for a componentlayout which declares gobject to be active >+ for (final ComponentlayoutType componentLayout : layouts) { >+ if (componentLayout.isActive()) { >+ activeObjects.add(gobject); > break; > } > } > } > >- // Now activeobjects contains all active graphical objects, which have >+ // Now activeObjects contains all active graphical objects, which have > // to be arranged on the screen > >- final AbslayoutType res = objectFactory.createAbslayoutType(); >+ final AbslayoutType result = objectFactory.createAbslayoutType(); > >- res.setId("abs_default"); //$NON-NLS-1$ >+ result.setId(DEAFULT_ABS); > > // Try to create as many columns as rows >- int columns = (int) Math.round(Math.sqrt(activeobjects.size())); >+ int columns = (int) Math.round(Math.sqrt(activeObjects.size())); > > if (columns == 0) { > columns = 1; > } > >- int rows = (int) Math.ceil((double) activeobjects.size() / columns); >+ int rows = (int) Math.ceil((double) activeObjects.size() / columns); > > if (rows == 0) { > rows = 1; > } > // Calculate width and height of graphical objects > int index = 0; >- final int rectwidth = width / columns; >- final int rectheight = height / rows; >+ final int rectWidth = width / columns; >+ final int rectHeight = height / rows; > >- for (final GobjectType gobj : activeobjects) { >+ for (final GobjectType gobject : activeObjects) { > >- final ComponentType pos = objectFactory.createComponentType(); >- pos.setGid(gobj.getId()); >+ final ComponentType component = objectFactory.createComponentType(); >+ component.setGid(gobject.getId()); > // Positioning the component >- pos.setW(BigInteger.valueOf(rectwidth)); >- pos.setH(BigInteger.valueOf(rectheight)); >+ component.setW(BigInteger.valueOf(rectWidth)); >+ component.setH(BigInteger.valueOf(rectHeight)); > >- pos.setX(BigInteger.valueOf((index % columns) * rectwidth)); >- pos.setY(BigInteger.valueOf((index / columns) * rectheight)); >+ component.setX(BigInteger.valueOf((index % columns) * rectWidth)); >+ component.setY(BigInteger.valueOf((index / columns) * rectHeight)); > > // Add this component position to the layout >- res.getComp().add(pos); >+ result.getComp().add(component); > > index++; > } > >- return res; >- } >- >- public String[] getActiveNodedisplayLayoutGid() { >- final ArrayList<String> nodedisplayID = new ArrayList<String>(); >- final List<NodedisplaylayoutType> nodedisplayLayouts = getNodedisplayLayouts(); >- for (final NodedisplaylayoutType nodedisplayLayout : nodedisplayLayouts) { >- if (nodedisplayLayout.isActive()) { >- nodedisplayID.add(nodedisplayLayout.getGid()); >- } >- } >- return nodedisplayID.toArray(new String[nodedisplayID.size()]); >- } >- >- public String[] getActiveTableLayoutsGid() { >- final ArrayList<String> tableLayoutsId = new ArrayList<String>(); >- final List<TablelayoutType> tableLayouts = getTableLayouts(); >- for (final TablelayoutType tableLayout : tableLayouts) { >- if (tableLayout.isActive()) { >- tableLayoutsId.add(tableLayout.getGid()); >- } >- } >- return tableLayoutsId.toArray(new String[tableLayoutsId.size()]); >+ return result; > } > > /** >- * Simply returns the first layout found for a chart with the given id or a >- * default-layout >+ * Simply returns the first layout found for a chart with the given id or a default-layout > * >- * @param chartID >+ * @param chartId > * @return defaultlayout for a chart or first layout for chart with id > * chartid given by lml-file > */ >- public ChartlayoutType getChartLayout(String chartID) { >- final List<ChartlayoutType> chartLayouts = getChartLayouts(); >- for (final ChartlayoutType chartLayout : chartLayouts) { >- if (chartLayout.getGid().equals(chartID)) { >+ public ChartlayoutType getChartLayout(String chartId) { >+ for (final ChartlayoutType chartLayout : getChartLayouts()) { >+ if (chartLayout.getGid().equals(chartId)) { > return chartLayout; > } > } >- return defaultChart; >+ return objectFactory.createChartlayoutType(); > } > > public List<ChartlayoutType> getChartLayouts() { > final List<ChartlayoutType> chartLayouts = new LinkedList<ChartlayoutType>(); >- for (final ComponentlayoutType tag : getComponentLayouts()) { >- if (tag instanceof ChartlayoutType) { >- chartLayouts.add((ChartlayoutType) tag); >+ for (final ComponentlayoutType layout : getComponentLayouts()) { >+ if (layout instanceof ChartlayoutType) { >+ chartLayouts.add((ChartlayoutType) layout); > } > } > return chartLayouts; > } > > /** >- * Search in component-layouts for layout for the graphical object with id >- * gid. >+ * Search in component-layouts for layout for the graphical object with gid. > * > * @param gid > * id of corresponding graphical object, for which layouts are >@@ -514,21 +240,14 @@ > * @return list of componentlayouts corresponding to the graphical object id > * gid > */ >- public List<ComponentlayoutType> getComponentLayoutByGID(String gid) { >- >- final List<ComponentlayoutType> complayouts = getComponentLayouts(); >- >- final ArrayList<ComponentlayoutType> res = new ArrayList<ComponentlayoutType>(); >- >- for (final ComponentlayoutType alayout : complayouts) { >- >- if (alayout.getGid() != null && alayout.getGid().equals(gid)) { >- >- res.add(alayout); >+ public List<ComponentlayoutType> getComponentLayoutByGid(String gid) { >+ final ArrayList<ComponentlayoutType> result = new ArrayList<ComponentlayoutType>(); >+ for (final ComponentlayoutType layout : getComponentLayouts()) { >+ if (layout.getGid() != null && layout.getGid().equals(gid)) { >+ result.add(layout); > } > } >- >- return res; >+ return result; > } > > /** >@@ -538,15 +257,15 @@ > */ > public List<ComponentlayoutType> getComponentLayouts() { > final List<ComponentlayoutType> layouts = new LinkedList<ComponentlayoutType>(); >- for (final JAXBElement<?> tag : lgui.getObjectsAndRelationsAndInformation()) { >- if (tag.getValue() instanceof ComponentlayoutType) { >- layouts.add((ComponentlayoutType) tag.getValue()); >+ for (final Object object : jaxbUtil.getObjects(lgui)) { >+ if (object instanceof ComponentlayoutType) { >+ layouts.add((ComponentlayoutType) object); > } > } > return layouts; > } > >- public TablelayoutType getDefaultTableLayout(String gid) { >+ public TablelayoutType getDefaultTableLayoutFromTable(String gid) { > TablelayoutType tableLayout = getTableLayout(gid); > if (tableLayout == null) { > tableLayout = new TablelayoutType(); >@@ -554,8 +273,7 @@ > getTableLayouts().add(tableLayout); > } > if (tableLayout.getColumn().size() <= 0) { >- tableLayout.setId(gid + "_layout"); //$NON-NLS-1$ >- tableLayout.setGid(gid); >+ tableLayout.setId(gid + LAYOUT_ENDING); > final TableType table = lguiItem.getTableHandler().getTable(gid); > if (table != null) { > for (int i = 0; i < table.getColumn().size(); i++) { >@@ -573,42 +291,37 @@ > } > > public Map<String, String> getInactiveComponents() { >- final List<ComponentlayoutType> objects = getComponentLayouts(); >- final ArrayList<String> inactive = new ArrayList<String>(); > final Map<String, String> inactiveMap = new HashMap<String, String>(); >- for (final ComponentlayoutType object : objects) { >+ for (final ComponentlayoutType object : getComponentLayouts()) { > if (!object.isActive()) { >- if (object.getClass().getSimpleName().equals("TablelayoutType")) { //$NON-NLS-1$ >+ if (object instanceof TablelayoutType) { > final TableType table = lguiItem.getTableHandler().getTable(object.getGid()); > if (table != null) { > inactiveMap.put(table.getTitle(), object.getGid()); > } >- } else if (object.getClass().getSimpleName().equals("NodedisplaylayoutType")) { //$NON-NLS-1$ >+ } else if (object instanceof NodedisplaylayoutType) { > inactiveMap > .put(lguiItem.getNodedisplayAccess().getNodedisplayById(object.getGid()).getTitle(), object.getGid()); > } >- inactive.add(object.getGid()); > } > } > return inactiveMap; > } > > /** >- * Simply returns the first layout found for a infobox with the given id or >- * a default-layout >+ * Simply returns the first layout found for a infobox with the given id or a default-layout > * > * @param infoID > * @return defaultlayout for a table or first layout for table with id > * tableid given by lml-file > */ >- public InfoboxlayoutType getInfoboxLayout(String infoID) { >- final List<InfoboxlayoutType> infoboxLayouts = getInfoboxLayout(); >- for (final InfoboxlayoutType infoboxLayout : infoboxLayouts) { >- if (infoboxLayout.getGid().equals(infoID)) { >+ public InfoboxlayoutType getInfoboxLayout(String infoId) { >+ for (final InfoboxlayoutType infoboxLayout : getInfoboxLayout()) { >+ if (infoboxLayout.getGid().equals(infoId)) { > return infoboxLayout; > } > } >- return defaultInfobox; >+ return objectFactory.createInfoboxlayoutType(); > } > > public ColumnlayoutType[] getLayoutColumsToCids(BigInteger[] cids, String gid) { >@@ -626,99 +339,39 @@ > } > > /** >- * Remove all real data from model return only layout-information and data, >- * which is needed to make lml-model valid >+ * Remove all real data from model return only layout-information and data, which is needed to make lml-model valid > * > * @param model > * lml-model with data and layout-information > * @return > */ > public LguiType getLayoutFromModel() { >+ final LguiType result = objectFactory.createLguiType(); > >- // This is gid for all nodedisplaylayouts in requests => id for all >- // nodedisplays >- final String dummystring = "__dummy_nd__";//$NON-NLS-1$ >+ final HashSet<String> components = new HashSet<String>(); > >- final LguiType res = objectFactory.createLguiType(); >+ jaxbUtil.getLayoutComponents(result, lgui, components); > >- final HashSet<String> neededComponents = new HashSet<String>(); >- >- for (final JAXBElement<?> tag : lgui.getObjectsAndRelationsAndInformation()) { >- >- final Object value = tag.getValue(); >- >- // add normal global layouts >- if (value instanceof LayoutType) { >- res.getObjectsAndRelationsAndInformation().add(tag); >- >- if (value instanceof SplitlayoutType) { >- final SplitlayoutType splitlayout = (SplitlayoutType) value; >- // Collect needed components from layout recursively >- if (splitlayout.getLeft() != null) { >- collectComponents(splitlayout.getLeft(), neededComponents); >- collectComponents(splitlayout.getRight(), neededComponents); >- } >- } else if (value instanceof AbslayoutType) { >- >- final AbslayoutType abslayout = (AbslayoutType) value; >- // Just traverse comp-list for gid-attributes >- for (final ComponentType comp : abslayout.getComp()) { >- neededComponents.add(comp.getGid()); >- } >- >- } >- >- } else if (value instanceof ComponentlayoutType) { >- if (((ComponentlayoutType) value).isActive()) { >- res.getObjectsAndRelationsAndInformation().add(tag); >- >- final ComponentlayoutType complayout = (ComponentlayoutType) value; >- neededComponents.add(complayout.getGid()); >- >- // Workaround for nodedisplay >- if (value instanceof NodedisplaylayoutType) { >- final NodedisplaylayoutType nlayout = (NodedisplaylayoutType) value; >- nlayout.setGid(dummystring); >- } >- >- } >- } >- >- } >- >- final HashMap<String, GobjectType> idtoGobject = new HashMap<String, GobjectType>(); >- // Search needed components in data-tag to discover, which type the >- // needed components have >- for (final JAXBElement<?> tag : lgui.getObjectsAndRelationsAndInformation()) { >- >- final Object value = tag.getValue(); >+ final List<GobjectType> gobjectList = new LinkedList<GobjectType>(); >+ for (final Object object : jaxbUtil.getObjects(lgui)) { > // is it a graphical object? >- if (value instanceof GobjectType) { >- final GobjectType gobj = (GobjectType) value; >- if (neededComponents.contains(gobj.getId())) { >- idtoGobject.put(gobj.getId(), gobj); >+ if (object instanceof GobjectType) { >+ if (components.contains(((GobjectType) object).getId())) { >+ gobjectList.add((GobjectType) object); > } > } > } > >- // Add all gobjects in idtoGobject to the result, so that lml-modell is >+ // Add all gobjects in idtoGobject to the result, so that lml-model is > // valid >- for (final GobjectType gobj : idtoGobject.values()) { >- final JAXBElement<GobjectType> min = minimizeGobjectType(gobj); >- >- // Workaround for nodedisplay >- final GobjectType newgobj = min.getValue(); >- if (newgobj instanceof Nodedisplay) { >- ((Nodedisplay) newgobj).setId(dummystring); >- } >- >- res.getObjectsAndRelationsAndInformation().add(min); >+ for (final GobjectType gobject : gobjectList) { >+ result.getObjectsAndRelationsAndInformation().add(JAXBUtil.minimizeGobjectType(gobject, objectFactory)); > } > > // Set layout-attribute >- res.setLayout(true); >+ result.setLayout(true); > >- return res; >+ return result; > } > > /** >@@ -728,29 +381,29 @@ > */ > public List<NodedisplaylayoutType> getNodedisplayLayouts() { > final List<NodedisplaylayoutType> nodedisplayLayouts = new LinkedList<NodedisplaylayoutType>(); >- for (final ComponentlayoutType tag : getComponentLayouts()) { >- if (tag instanceof NodedisplaylayoutType) { >- nodedisplayLayouts.add((NodedisplaylayoutType) tag); >+ for (final ComponentlayoutType layout : getComponentLayouts()) { >+ if (layout instanceof NodedisplaylayoutType) { >+ nodedisplayLayouts.add((NodedisplaylayoutType) layout); > } > } > return nodedisplayLayouts; >+ > } > > /** >- * Getting the layout of a given table, the identifier of the layout is the >- * shared ID of table and layout. >+ * Getting the layout of a given table, the identifier of the layout is the shared ID of table and layout. > * > * @param tablelayoutID > * ID of the desired tablelayout > * @return Corresponding layout of a table > */ >- public TablelayoutType getTableLayout(String tablelayoutID) { >- for (final TablelayoutType tag : getTableLayouts()) { >- if (tag.getGid().equals(tablelayoutID)) { >- return tag; >+ public TablelayoutType getTableLayout(String tablelayoutId) { >+ for (final TablelayoutType layout : getTableLayouts()) { >+ if (layout.getGid().equals(tablelayoutId)) { >+ return layout; > } > } >- return defaultTable; >+ return objectFactory.createTablelayoutType(); > } > > /** >@@ -760,126 +413,51 @@ > */ > public List<TablelayoutType> getTableLayouts() { > final List<TablelayoutType> tableLayouts = new LinkedList<TablelayoutType>(); >- for (final ComponentlayoutType tag : getComponentLayouts()) { >- if (tag instanceof TablelayoutType) { >- tableLayouts.add((TablelayoutType) tag); >+ for (final ComponentlayoutType layout : getComponentLayouts()) { >+ if (layout instanceof TablelayoutType) { >+ tableLayouts.add((TablelayoutType) layout); > } > } > return tableLayouts; > } > > /** >- * This function is only for easier understanding this class Textboxlayouts >- * are identical to infoboxlayouts, so you could call >+ * This function is only for easier understanding this class Textboxlayouts are identical to infoboxlayouts, so you could call > * getInfoboxLayout(textid) and would get the same result. > * > * @param textID > * id of a textbox > * @return layout for a textbox with an info-tag in it > */ >- public InfoboxlayoutType getTextboxLayout(String textID) { >- return getInfoboxLayout(textID); >+ public InfoboxlayoutType getTextboxLayout(String textId) { >+ return getInfoboxLayout(textId); > } > > /** >- * Simply returns the first layout found for a usagebar with the given id or >- * a default-layout >+ * Simply returns the first layout found for a usagebar with the given id or a default-layout > * >- * @param usagebarID >+ * @param usagebarId > * @return defaultlayout for a usagebar or first layout for usagebar with id > * usagebarid given by lml-file > */ >- public UsagebarlayoutType getUsagebarLayout(String usagebarID) { >- final List<UsagebarlayoutType> usagebarLayouts = getUsagebarLayouts(); >+ public UsagebarlayoutType getUsagebarLayout(String usagebarId) { > // Over all objects in lml-file >- for (final UsagebarlayoutType usagebarLayout : usagebarLayouts) { >- if (usagebarLayout.getGid().equals(usagebarID)) { >+ for (final UsagebarlayoutType usagebarLayout : getUsagebarLayouts()) { >+ if (usagebarLayout.getGid().equals(usagebarId)) { > return usagebarLayout; > } > } >- return defaultUsagebar; >+ return objectFactory.createUsagebarlayoutType(); > } > > public List<UsagebarlayoutType> getUsagebarLayouts() { > final List<UsagebarlayoutType> usagebarLayouts = new LinkedList<UsagebarlayoutType>(); >- for (final ComponentlayoutType tag : getComponentLayouts()) { >- if (tag instanceof UsagebarlayoutType) { >- usagebarLayouts.add((UsagebarlayoutType) tag); >+ for (final ComponentlayoutType layout : getComponentLayouts()) { >+ if (layout instanceof UsagebarlayoutType) { >+ usagebarLayouts.add((UsagebarlayoutType) layout); > } > } > return usagebarLayouts; >- } >- >- /** >- * Replace all componentlayouts for a graphical object with given gid >- * through newlayout.getGid() with newlayout >- * >- * @param newLayout >- * new layout, which is placed into the positions of old layouts >- */ >- @SuppressWarnings("unchecked") >- public void replaceComponentLayout(ComponentlayoutType newlayout) { >- if (newlayout == null) { >- return; >- } >- final String gid = newlayout.getGid(); >- >- final List<JAXBElement<?>> allobjects = lgui.getObjectsAndRelationsAndInformation(); >- >- boolean replaced = false; >- >- // Over all objects in lml-file >- for (int i = 0; i < allobjects.size(); i++) { >- final JAXBElement<?> aobj = allobjects.get(i); >- >- // Over all Componentlayouts >- if (aobj.getValue() instanceof ComponentlayoutType) { >- >- final ComponentlayoutType alayout = (ComponentlayoutType) aobj.getValue(); >- >- if (alayout.getGid() != null && alayout.getGid().equals(gid)) { >- >- if (!replaced) { >- >- ((JAXBElement<ComponentlayoutType>) aobj).setValue(newlayout); >- lguiItem.notifyListeners(); >- replaced = true; >- } else {// Delete this object >- allobjects.remove(aobj); >- // One step back >- i--; >- } >- } >- >- } >- } >- >- if (!replaced) {// Insert new layout, if there was nothing to replace >- // Takes any componentlayout >- JAXBElement<?> newel = null; >- >- // Differ between several layouts, create different JAXBElements >- if (newlayout instanceof TablelayoutType) { >- newel = new JAXBElement<TablelayoutType>(new QName("tablelayout"), TablelayoutType.class, //$NON-NLS-1$ >- (TablelayoutType) newlayout); >- } else if (newlayout instanceof NodedisplaylayoutType) { >- newel = new JAXBElement<NodedisplaylayoutType>(new QName("nodedisplaylayout"), NodedisplaylayoutType.class, //$NON-NLS-1$ >- (NodedisplaylayoutType) newlayout); >- } >- >- if (newel != null) { >- lgui.getObjectsAndRelationsAndInformation().add(newel); >- lguiItem.notifyListeners(); >- } >- } >- >- } >- >- /** >- * Setting Changes in the Layout. >- */ >- public void setChangesLayoutColumn() { >- > } > > public String setComponentActive(String gid, boolean active) { >@@ -887,9 +465,9 @@ > final ComponentlayoutType component = getComponent(gid); > if (component != null) { > if (component instanceof TablelayoutType) { >- type = "table"; //$NON-NLS-1$ >+ type = ILMLCoreConstants.TABLE_ELEMENT; > } else if (component instanceof NodedisplaylayoutType) { >- type = "nodedisplay"; //$NON-NLS-1$ >+ type = ILMLCoreConstants.NODEDISPLAY_ELEMENT; > } > component.setActive(active); > } >@@ -897,8 +475,7 @@ > } > > private ComponentlayoutType getComponent(String gid) { >- final List<ComponentlayoutType> objects = getComponentLayouts(); >- for (final ComponentlayoutType object : objects) { >+ for (final ComponentlayoutType object : getComponentLayouts()) { > if (object.getGid().equals(gid)) { > return object; > } >@@ -908,9 +485,9 @@ > > private List<InfoboxlayoutType> getInfoboxLayout() { > final List<InfoboxlayoutType> infoboxLayouts = new LinkedList<InfoboxlayoutType>(); >- for (final ComponentlayoutType tag : getComponentLayouts()) { >- if (tag instanceof InfoboxlayoutType) { >- infoboxLayouts.add((InfoboxlayoutType) tag); >+ for (final ComponentlayoutType layout : getComponentLayouts()) { >+ if (layout instanceof InfoboxlayoutType) { >+ infoboxLayouts.add((InfoboxlayoutType) layout); > } > } > return infoboxLayouts; >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiHandler.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiHandler.java >index c8f07bb..36a438b 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiHandler.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiHandler.java >@@ -13,6 +13,7 @@ > > import org.eclipse.ptp.rm.lml.core.model.ILguiHandler; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.core.util.JAXBUtil; > import org.eclipse.ptp.rm.lml.internal.core.elements.LguiType; > > /** >@@ -40,6 +41,8 @@ > */ > protected LguiType lgui; > >+ protected static final JAXBUtil jaxbUtil = JAXBUtil.getInstance(); >+ > /** > * @param lguiItem > * surrounding lml-manager needed to fire events, if this handler changed data >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java >index 0a59621..1b1bf88 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/LguiItem.java >@@ -15,7 +15,6 @@ > import java.io.InputStream; > import java.io.InputStreamReader; > import java.io.OutputStream; >-import java.io.StringReader; > import java.io.StringWriter; > import java.math.BigInteger; > import java.util.ArrayList; >@@ -29,19 +28,13 @@ > import java.util.TreeMap; > import java.util.UUID; > >-import javax.xml.bind.JAXBElement; >-import javax.xml.bind.JAXBException; >-import javax.xml.bind.Marshaller; >-import javax.xml.bind.PropertyException; >-import javax.xml.bind.Unmarshaller; >-import javax.xml.namespace.QName; >- > import org.eclipse.ptp.rm.lml.core.JobStatusData; >-import org.eclipse.ptp.rm.lml.core.LMLCorePlugin; > import org.eclipse.ptp.rm.lml.core.events.ILguiUpdatedEvent; > import org.eclipse.ptp.rm.lml.core.listeners.ILguiListener; > import org.eclipse.ptp.rm.lml.core.model.ILguiHandler; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.core.model.IPattern; >+import org.eclipse.ptp.rm.lml.core.util.JAXBUtil; > import org.eclipse.ptp.rm.lml.internal.core.elements.CellType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ColumnType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ComponentlayoutType; >@@ -75,6 +68,8 @@ > */ > private final List<ILguiListener> listeners = new LinkedList<ILguiListener>(); > >+ private Map<String, List<IPattern>> filters = new HashMap<String, List<IPattern>>(); >+ > /** > * List of encapsulated classes, which handle parts of the lml-hierarchy > */ >@@ -86,16 +81,15 @@ > */ > private final Map<String, JobStatusData> fJobMap = Collections.synchronizedMap(new TreeMap<String, JobStatusData>()); > >- private static String lmlNamespace = "http://www.llview.de"; //$NON-NLS-1$ >- >- // private static final String LAYOUT = "layout";//$NON-NLS-1$ >- >- // TODO Rewrite - Java Applet >- private final Marshaller marshaller = LMLCorePlugin.getDefault().getMarshaller(); >- >- private final Unmarshaller unmarshaller = LMLCorePlugin.getDefault().getUnmarshaller(); >+ private final JAXBUtil jaxbUtil = JAXBUtil.getInstance(); > > private RequestType request; >+ >+ private String username = null; >+ >+ private boolean lockUpdate = true; >+ >+ private boolean lockPattern = false; > > /** > * Constructor with LML-model as argument >@@ -105,15 +99,15 @@ > */ > public LguiItem(LguiType lgui) { > this.lgui = lgui; >- // TODO Give the LguiItem a name > createLguiHandlers(); > } > > /** > * > */ >- public LguiItem(String name) { >+ public LguiItem(String name, String username) { > this.name = name; >+ this.username = username; > } > > /** >@@ -144,7 +138,7 @@ > if (overview != null) { > String oid = overview.getOIDByJobId(jobId); > if (oid == null) { >- TableHandler handler = getTableHandler(); >+ final TableHandler handler = getTableHandler(); > if (handler != null) { > final TableType table = handler.getTable(getGidFromJobStatus(status.getState())); > if (table != null) { >@@ -160,12 +154,28 @@ > } > } > >+ public String[] getColumnTitlePattern(String gid) { >+ final List<String> titles = new ArrayList<String>(); >+ final List<IPattern> patternList = filters.get(gid); >+ if (patternList != null) { >+ for (final IPattern pattern : patternList) { >+ titles.add(pattern.getColumnTitle()); >+ } >+ } >+ return titles.toArray(new String[titles.size()]); >+ } >+ > /* > * (non-Javadoc) > * > * @see org.eclipse.ptp.rm.lml.core.model.ILguiItem#getCurrentLayout(java.io. OutputStream) > */ >- public void getCurrentLayout(OutputStream output) throws JAXBException { >+ public void getCurrentLayout(OutputStream output) { >+ while (lockPattern) { >+ // wait until the pattern have been set >+ >+ } >+ lockUpdate = true; > LguiType layoutLgui = null; > if (lgui == null) { > layoutLgui = firstRequest(); >@@ -173,24 +183,7 @@ > layoutLgui = getLayoutAccess().getLayoutFromModel(); > layoutLgui.setRequest(request); > } >- try { >- marshaller.setProperty("jaxb.schemaLocation", lmlNamespace + " lgui.xsd"); //$NON-NLS-1$ //$NON-NLS-2$ >- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); >- final QName tagname = new QName(lmlNamespace, "lgui", "lml"); //$NON-NLS-1$ //$NON-NLS-2$ >- >- final JAXBElement<LguiType> rootElement = new JAXBElement<LguiType>(tagname, LguiType.class, layoutLgui); >- /* >- * Synchronize to avoid the dreaded "FWK005 parse may not be called while parsing" message >- */ >- synchronized (LguiItem.class) { >- marshaller.marshal(rootElement, output); >- } >- output.close(); // Must close to flush stream >- } catch (final PropertyException e) { >- LMLCorePlugin.log(e); >- } catch (final IOException e) { >- LMLCorePlugin.log(e); >- } >+ jaxbUtil.marshal(layoutLgui, output); > } > > /** >@@ -256,6 +249,17 @@ > return (OverviewAccess) lguiHandlers.get(OverviewAccess.class); > } > >+ public Map<String, List<IPattern>> getPattern() { >+ return filters; >+ } >+ >+ public List<IPattern> getPattern(String gid) { >+ if (filters.containsKey(gid)) { >+ return filters.get(gid); >+ } >+ return new LinkedList<IPattern>(); >+ } >+ > public TableHandler getTableHandler() { > if (lguiHandlers.get(TableHandler.class) == null) { > return null; >@@ -285,6 +289,13 @@ > synchronized (fJobMap) { > return fJobMap.values().toArray(new JobStatusData[0]); > } >+ } >+ >+ public String getUsername() { >+ if (username == null) { >+ return new String(); >+ } >+ return username; > } > > /* >@@ -320,55 +331,24 @@ > */ > public void notifyListeners() { > final LguiUpdatedEvent event = new LguiUpdatedEvent(this, lgui); >- for (final ILguiListener l : listeners) { >- l.handleEvent(event); >+ for (final ILguiListener listener : listeners) { >+ listener.handleEvent(event); > } > } >- >- // public void reloadLastLayout(IMemento memento) { >- // final StringBuilder layout = new StringBuilder(); >- // >- // if (memento != null) { >- // final IMemento child = memento.getChild(LAYOUT); >- // layout.append(child.getID()); >- // } >- // LguiType lguiType = null; >- // if (layout.length() > 0) { >- // try { >- // lguiType = parseLML(layout.toString()); >- // } catch (final JAXBException e) { >- // LMLCorePlugin.log(e); >- // } >- // } >- // if (lguiType != null) { >- // for (final JAXBElement<?> tag : lguiType >- // .getObjectsAndRelationsAndInformation()) { >- // if (tag.getValue() instanceof ComponentlayoutType) { >- // lgui = lguiType; >- // if (listeners.isEmpty()) { >- // createLguiHandlers(); >- // } >- // } >- // } >- // } >- // } > > public void reloadLastLayout(StringBuilder layout) { > LguiType lguiType = null; > if (layout.length() > 0) { >- try { >- lguiType = parseLML(layout.toString()); >- } catch (final JAXBException e) { >- LMLCorePlugin.log(e); >- } >+ lguiType = jaxbUtil.unmarshal(layout.toString()); > } > if (lguiType != null) { >- for (final JAXBElement<?> tag : lguiType.getObjectsAndRelationsAndInformation()) { >- if (tag.getValue() instanceof ComponentlayoutType) { >+ for (final Object object : jaxbUtil.getObjects(lguiType)) { >+ if (object instanceof ComponentlayoutType) { > lgui = lguiType; > if (listeners.isEmpty()) { > createLguiHandlers(); > } >+ break; > } > } > } >@@ -423,62 +403,27 @@ > } else { > layoutLgui = getLayoutAccess().getLayoutFromModel(); > } >- try { >- marshaller.setProperty("jaxb.schemaLocation", lmlNamespace + " lgui.xsd"); //$NON-NLS-1$ //$NON-NLS-2$ >- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); >- final QName tagname = new QName(lmlNamespace, "lgui", "lml"); //$NON-NLS-1$ //$NON-NLS-2$ >- >- final JAXBElement<LguiType> rootElement = new JAXBElement<LguiType>(tagname, LguiType.class, layoutLgui); >- /* >- * Synchronize to avoid the dreaded "FWK005 parse may not be called while parsing" message >- */ >- synchronized (LguiItem.class) { >- marshaller.marshal(rootElement, writer); >- } >- } catch (final PropertyException e) { >- LMLCorePlugin.log(e); >- } catch (final JAXBException e) { >- LMLCorePlugin.log(e); >- } >+ jaxbUtil.marshal(layoutLgui, writer); > return writer.getBuffer().toString(); > } > >- // public void saveCurrentLayout(IMemento memento) { >- // if (memento == null) { >- // return; >- // } >- // final StringWriter writer = new StringWriter(); >- // LguiType layoutLgui = null; >- // if (lgui == null) { >- // layoutLgui = firstRequest(); >- // } else { >- // layoutLgui = getLayoutAccess().getLayoutFromModel(); >- // } >- // try { >- // marshaller.setProperty( >- // "jaxb.schemaLocation", lmlNamespace + " lgui.xsd"); //$NON-NLS-1$ //$NON-NLS-2$ >- // marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, >- // Boolean.TRUE); >- // final QName tagname = new QName(lmlNamespace, "lgui", "lml"); //$NON-NLS-1$ //$NON-NLS-2$ >- // >- // final JAXBElement<LguiType> rootElement = new JAXBElement<LguiType>( >- // tagname, LguiType.class, layoutLgui); >- // /* >- // * Synchronize to avoid the dreaded >- // * "FWK005 parse may not be called while parsing" message >- // */ >- // synchronized (LguiItem.class) { >- // marshaller.marshal(rootElement, writer); >- // >- // } >- // } catch (final PropertyException e) { >- // LMLCorePlugin.log(e); >- // } catch (final JAXBException e) { >- // LMLCorePlugin.log(e); >- // } >- // final IMemento layoutMemento = memento.createChild(LAYOUT, writer >- // .getBuffer().toString()); >- // } >+ public void setPattern(Map<String, List<IPattern>> pattern) { >+ if (pattern != null) { >+ filters = pattern; >+ } >+ } >+ >+ public void setPattern(String gid, List<IPattern> filterValues) { >+ while (lockUpdate) { >+ // wait until the update with the server is finished >+ } >+ lockPattern = true; >+ if (filters.containsKey(gid)) { >+ filters.remove(gid); >+ } >+ filters.put(gid, filterValues); >+ lockPattern = false; >+ } > > public void setRequest(RequestType request) { > this.request = request; >@@ -506,7 +451,7 @@ > * > * @see org.eclipse.ptp.rm.lml.core.model.ILguiItem#update(java.io.InputStream) > */ >- public void update(InputStream stream) throws JAXBException { >+ public void update(InputStream stream) { > > final BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); > StringBuilder xmlStream = new StringBuilder(); >@@ -527,7 +472,7 @@ > } > } > if (xmlStream.length() > 0) { >- lgui = parseLML(xmlStream.toString()); >+ lgui = jaxbUtil.unmarshal(xmlStream.toString()); > if (listeners.isEmpty()) { > createLguiHandlers(); > } >@@ -538,6 +483,7 @@ > } > updateJobData(); > } >+ lockUpdate = false; > } > > /* >@@ -685,7 +631,6 @@ > layoutLgui.setVersion("1"); //$NON-NLS-1$ > layoutLgui.setLayout(true); > >- // final RequestType request = objectFactory.createRequestType(); > final LayoutRequestType layoutReq = objectFactory.createLayoutRequestType(); > layoutReq.setGetDefaultData(true); > >@@ -705,26 +650,6 @@ > return ACTIVE_JOB_TABLE; > } > return INACTIVE_JOB_TABLE; >- } >- >- /** >- * Parsing an XML file. The method generates from an XML file an instance of LguiType. >- * >- * @param stream >- * the input stream of the XML file >- * @return the generated LguiType >- * @throws JAXBException >- */ >- @SuppressWarnings("unchecked") >- private LguiType parseLML(String string) throws JAXBException { >- /* >- * Synchronize to avoid the dreaded "FWK005 parse may not be called while parsing" message >- */ >- final JAXBElement<LguiType> doc; >- synchronized (LguiItem.class) { >- doc = (JAXBElement<LguiType>) unmarshaller.unmarshal(new StringReader(string)); >- } >- return doc.getValue(); > } > > private void setCid() { >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OIDToInformation.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OIDToInformation.java >index c59ffef..33a2d65 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OIDToInformation.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OIDToInformation.java >@@ -15,8 +15,6 @@ > import java.util.HashMap; > import java.util.List; > >-import javax.xml.bind.JAXBElement; >- > import org.eclipse.ptp.rm.lml.core.events.ILguiUpdatedEvent; > import org.eclipse.ptp.rm.lml.core.listeners.ILguiListener; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >@@ -28,9 +26,6 @@ > * This class provides access to information-objects within a lml-model. It can > * be used for fast and simple access to information filtered by the > * information-type or the object-id. >- * >- * @author karbach >- * > */ > public class OIDToInformation extends LguiHandler { > >@@ -198,18 +193,13 @@ > > oidtoinfo = new HashMap<String, List<InfoType>>(); > >- final List<JAXBElement<?>> alltags = lgui.getObjectsAndRelationsAndInformation(); >+ for (final Object object : jaxbUtil.getObjects(lgui)) { > >- for (final JAXBElement<?> jaxbtag : alltags) {// over all >- // information-tags >- >- final Object tag = jaxbtag.getValue(); >- >- if (!(tag instanceof InformationType)) { >+ if (!(object instanceof InformationType)) { > continue; > } > >- final InformationType ainfos = (InformationType) tag; >+ final InformationType ainfos = (InformationType) object; > > final List<InfoType> realinfos = ainfos.getInfo(); > >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OverviewAccess.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OverviewAccess.java >index 201cbf0..76de6fe 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OverviewAccess.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/OverviewAccess.java >@@ -14,8 +14,6 @@ > import java.util.LinkedList; > import java.util.List; > >-import javax.xml.bind.JAXBElement; >- > import org.eclipse.ptp.rm.lml.core.events.ILguiUpdatedEvent; > import org.eclipse.ptp.rm.lml.core.listeners.ILguiListener; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >@@ -63,9 +61,9 @@ > */ > public List<GobjectType> getGraphicalObjects() { > final List<GobjectType> objects = new LinkedList<GobjectType>(); >- for (final JAXBElement<?> tag : lgui.getObjectsAndRelationsAndInformation()) { >- if (tag.getValue() instanceof GobjectType) { >- objects.add((GobjectType) tag.getValue()); >+ for (final Object object : jaxbUtil.getObjects(lgui)) { >+ if (object instanceof GobjectType) { >+ objects.add((GobjectType) object); > } > } > return objects; >@@ -87,9 +85,9 @@ > */ > public List<InformationType> getInformations() { > final List<InformationType> informations = new LinkedList<InformationType>(); >- for (final JAXBElement<?> tag : lgui.getObjectsAndRelationsAndInformation()) { >- if (tag.getValue() instanceof InformationType) { >- informations.add((InformationType) tag.getValue()); >+ for (final Object object : jaxbUtil.getObjects(lgui)) { >+ if (object instanceof InformationType) { >+ informations.add((InformationType) object); > } > } > return informations; >@@ -102,9 +100,9 @@ > */ > public List<LayoutType> getLayouts() { > final List<LayoutType> layouts = new LinkedList<LayoutType>(); >- for (final JAXBElement<?> tag : lgui.getObjectsAndRelationsAndInformation()) { >- if (tag.getValue() instanceof LayoutType) { >- layouts.add((LayoutType) tag.getValue()); >+ for (final Object object : jaxbUtil.getObjects(lgui)) { >+ if (object instanceof LayoutType) { >+ layouts.add((LayoutType) object); > } > } > return layouts; >@@ -117,9 +115,9 @@ > */ > public List<ObjectsType> getObjects() { > final List<ObjectsType> objects = new LinkedList<ObjectsType>(); >- for (final JAXBElement<?> tag : lgui.getObjectsAndRelationsAndInformation()) { >- if (tag.getValue() instanceof ObjectsType) { >- objects.add((ObjectsType) tag.getValue()); >+ for (final Object object : jaxbUtil.getObjects(lgui)) { >+ if (object instanceof ObjectsType) { >+ objects.add((ObjectsType) object); > } > } > return objects; >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/Pattern.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/Pattern.java >new file mode 100644 >index 0000000..d56cba5 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/Pattern.java >@@ -0,0 +1,105 @@ >+/* Copyright (c) 2011 Forschungszentrum Juelich GmbH >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Claudia Knobloch, Carsten Karbach, FZ Juelich >+ */ >+package org.eclipse.ptp.rm.lml.internal.core.model; >+ >+import org.eclipse.ptp.rm.lml.core.model.IPattern; >+ >+public class Pattern implements IPattern { >+ >+ private String columntitle; >+ >+ private String type; >+ >+ private boolean relation; >+ >+ private boolean range; >+ >+ // Relation >+ private String valueRelation; >+ >+ private String relationOperator; >+ >+ // Range >+ private String minValueRange; >+ >+ private String maxValueRange; >+ >+ public Pattern(String title, String type) { >+ columntitle = title; >+ this.type = type; >+ if (columntitle == null) { >+ columntitle = new String(); >+ } >+ if (this.type == null) { >+ this.type = new String("alpha"); >+ } >+ } >+ >+ public String getColumnTitle() { >+ return columntitle; >+ } >+ >+ public String getMaxValueRange() { >+ return maxValueRange; >+ } >+ >+ public String getMinValueRange() { >+ return minValueRange; >+ } >+ >+ public String getRelationOperator() { >+ return relationOperator; >+ } >+ >+ public String getType() { >+ return type; >+ } >+ >+ public String getRelationValue() { >+ return valueRelation; >+ } >+ >+ public boolean isRange() { >+ return (range && !relation); >+ } >+ >+ public boolean isRelation() { >+ return (relation && !range); >+ } >+ >+ public IPattern setRange(String minValueRange, String maxValueRange) { >+ this.range = true; >+ this.relation = false; >+ this.minValueRange = minValueRange; >+ this.maxValueRange = maxValueRange; >+ if (minValueRange == null) { >+ this.minValueRange = new String(); >+ } >+ if (maxValueRange == null) { >+ this.maxValueRange = new String(); >+ } >+ return this; >+ } >+ >+ public IPattern setRelation(String relationOperator, String valueRelation) { >+ this.relation = true; >+ this.range = false; >+ this.relationOperator = relationOperator; >+ this.valueRelation = valueRelation; >+ if (relationOperator == null) { >+ this.relationOperator = new String("="); >+ } >+ if (valueRelation == null) { >+ this.valueRelation = new String(); >+ } >+ return this; >+ } >+ >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableColumnLayout.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableColumnLayout.java >index f156744..09d863e 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableColumnLayout.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableColumnLayout.java >@@ -38,6 +38,11 @@ > */ > private final boolean active; > >+ /* >+ * Order of the data. >+ */ >+ private String order; >+ > /** > * Constructor > * >@@ -50,12 +55,12 @@ > * @param activity > * of the column > */ >- public TableColumnLayout(String title, Double width, String style, >- boolean active) { >+ public TableColumnLayout(String title, Double width, String style, boolean active, String order) { > this.title = title; > this.width = width; > this.style = style; > this.active = active; >+ this.order = order; > if (title == null) { > this.title = new String(); > } >@@ -65,6 +70,13 @@ > if (style == null) { > this.style = ITableColumnLayout.COLUMN_STYLE_LEFT; > } >+ if (order == null) { >+ this.order = new String("alpha"); >+ } >+ } >+ >+ public String getOrder() { >+ return order; > } > > /* >diff --git a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableHandler.java b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableHandler.java >index 6df7b6c..ebe52a4 100644 >--- a/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableHandler.java >+++ b/rms/org.eclipse.ptp.rm.lml.core/src/org/eclipse/ptp/rm/lml/internal/core/model/TableHandler.java >@@ -14,11 +14,10 @@ > import java.math.BigInteger; > import java.util.ArrayList; > import java.util.Arrays; >+import java.util.HashMap; > import java.util.LinkedList; > import java.util.List; >- >-import javax.xml.bind.JAXBElement; >-import javax.xml.namespace.QName; >+import java.util.Map; > > import org.eclipse.ptp.rm.lml.core.ILMLCoreConstants; > import org.eclipse.ptp.rm.lml.core.JobStatusData; >@@ -27,6 +26,7 @@ > import org.eclipse.ptp.rm.lml.core.events.ILguiUpdatedEvent; > import org.eclipse.ptp.rm.lml.core.listeners.ILguiListener; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.core.model.IPattern; > import org.eclipse.ptp.rm.lml.core.model.ITableColumnLayout; > import org.eclipse.ptp.rm.lml.internal.core.elements.CellType; > import org.eclipse.ptp.rm.lml.internal.core.elements.ColumnType; >@@ -137,11 +137,19 @@ > table.getColumn().add(column); > } > } >- lgui.getObjectsAndRelationsAndInformation().add( >- new JAXBElement<TableType>(new QName( >- ILMLCoreConstants.TABLE_ELEMENT), TableType.class, >- table)); >+ jaxbUtil.addTable(lgui, table); > return table; >+ } >+ >+ public ITableColumnLayout[] getActiveTableColumnLayout(String gid) { >+ final ITableColumnLayout[] allColumns = getTableColumnLayout(gid); >+ final List<ITableColumnLayout> activeColumns = new ArrayList<ITableColumnLayout>(); >+ for (final ITableColumnLayout allColumn : allColumns) { >+ if (allColumn.isActive()) { >+ activeColumns.add(allColumn); >+ } >+ } >+ return activeColumns.toArray(new ITableColumnLayout[activeColumns.size()]); > } > > public String getCellValue(TableType table, RowType row, String colName) { >@@ -240,9 +248,16 @@ > * ID of the table layout > * @return column layout > */ >+ /** >+ * Get the column layout for the table >+ * >+ * @param gid >+ * ID of the table layout >+ * @return column layout >+ */ > public ITableColumnLayout[] getTableColumnLayout(String gid) { > if (lguiItem == null && lguiItem.getLayoutAccess() == null) { >- return null; >+ return new ITableColumnLayout[0]; > } > > final BigInteger[] cids = getCids(gid); >@@ -256,16 +271,18 @@ > final ColumnlayoutType column = layoutColumns[i]; > if (column != null) { > String style; >+ final String sort = getColumnSortProperty(getTable(gid), cids, >+ i); > // when there is a change >- if (column.getKey() != null >- && (column.getKey().equals(ILguiItem.JOB_WALL) || column >- .getKey().equals(ILguiItem.JOB_TOTAL_CORES))) { >+ if (column.getSorted() != null >+ && column.getSorted().value() != null && sort != null >+ && sort.equals("numeric")) { > style = ITableColumnLayout.COLUMN_STYLE_RIGHT; > } else { > style = ITableColumnLayout.COLUMN_STYLE_LEFT; > } > tableColumnLayouts[i] = new TableColumnLayout(column.getKey(), >- column.getWidth(), style, column.isActive()); >+ column.getWidth(), style, column.isActive(), sort); > } > } > return tableColumnLayouts; >@@ -286,6 +303,22 @@ > } > return tableColumnNonActive.toArray(new String[tableColumnNonActive > .size()]); >+ } >+ >+ public String[] getTableColumnTitles(String gid) { >+ if (lguiItem == null && lguiItem.getLayoutAccess() == null) { >+ return null; >+ } >+ final ColumnlayoutType[] layoutColumns = lguiItem.getLayoutAccess() >+ .getLayoutColumsToCids(getCidsActiveColumns(gid), gid); >+ final List<String> titles = new ArrayList<String>(); >+ for (final ColumnlayoutType layoutColumn : layoutColumns) { >+ if (layoutColumn.getKey() != null) { >+ titles.add(layoutColumn.getKey()); >+ } >+ } >+ >+ return titles.toArray(new String[titles.size()]); > } > > /** >@@ -346,6 +379,134 @@ > tableData[i].setCells(tableDataRow); > } > return tableData; >+ } >+ >+ public Row[] getTableDataWithColor(String gid, boolean addColor, List<IPattern> filterTitlesValues) { >+ final Row[] rows = getTableDataWithColor(gid, addColor); >+ if (rows.length == 0) { >+ return rows; >+ } >+ final BigInteger[] cids = getCids(gid); >+ final TableType table = getTable(gid); >+ >+ // Convert Map filterTitlesValues into Map filterPosValues >+ final Map<Integer, IPattern> filterPosValues = new HashMap<Integer, IPattern>(); >+ for (final IPattern pattern : filterTitlesValues) { >+ BigInteger cid = BigInteger.valueOf(-1); >+ for (final ColumnType column : table.getColumn()) { >+ if (column.getName().equals(pattern.getColumnTitle())) { >+ cid = column.getId(); >+ break; >+ } >+ } >+ if (cid.equals(BigInteger.valueOf(-1))) { >+ continue; >+ } >+ int position = -1; >+ for (int i = 0; i < cids.length; i++) { >+ if (cids[i].equals(cid)) { >+ position = i; >+ break; >+ } >+ } >+ if (position == -1) { >+ continue; >+ } >+ >+ filterPosValues.put(position, pattern); >+ } >+ >+ // Filter the rows >+ final List<Row> filterRows = new ArrayList<Row>(); >+ for (final Row row : rows) { >+ boolean allIncluded = true; >+ for (final int position : filterPosValues.keySet()) { >+ >+ if (row.cells[position] == null) { >+ continue; >+ } >+ final IPattern pattern = filterPosValues.get(position); >+ final String rowValue = row.cells[position].value; >+ >+ final String type = pattern.getType(); >+ >+ if (pattern.isRange()) { >+ // Range >+ final String minValue = pattern.getMinValueRange(); >+ final String maxValue = pattern.getMaxValueRange(); >+ if (type.equals("numeric")) { >+ if ((Integer.valueOf(rowValue) < Integer.valueOf(minValue)) >+ || (Integer.valueOf(maxValue) < Integer.valueOf(rowValue))) { >+ allIncluded = false; >+ break; >+ } >+ } else { >+ if (rowValue.compareTo(minValue) < 0 || maxValue.compareTo(rowValue) < 0) { >+ allIncluded = false; >+ break; >+ } >+ } >+ } else if (pattern.isRelation()) { >+ // Relation >+ final String compareValue = pattern.getRelationValue(); >+ final String compareOperator = pattern.getRelationOperator(); >+ if (type.equals("numeric")) { >+ final int rowValueInt = Integer.valueOf(rowValue); >+ final int compareValueInt = Integer.valueOf(compareValue); >+ if (compareOperator.equals("=") && rowValueInt != compareValueInt) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals("!=") && rowValueInt == compareValueInt) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals("<") && rowValueInt >= compareValueInt) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals("<=") && rowValueInt > compareValueInt) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals(">") && rowValueInt <= compareValueInt) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals(">=") && rowValueInt < compareValueInt) { >+ allIncluded = false; >+ break; >+ } >+ } else { >+ if ((compareOperator.equals("=") && !compareValue.equals(rowValue)) >+ || (compareOperator.equals("!=") && compareValue.equals(rowValue))) { >+ allIncluded = false; >+ break; >+ } else if (type.equals("alpha")) { >+ if ((compareOperator.equals("=~") && !rowValue.contains(compareValue)) >+ || (compareOperator.equals("!~") && rowValue.contains(compareValue))) { >+ allIncluded = false; >+ break; >+ } >+ } else if (type.equals("date")) { >+ if (compareOperator.equals("<") && rowValue.compareTo(compareValue) >= 0) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals("<=") && rowValue.compareTo(compareValue) > 0) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals(">") && rowValue.compareTo(compareValue) <= 0) { >+ allIncluded = false; >+ break; >+ } else if (compareOperator.equals(">=") && rowValue.compareTo(compareValue) < 0) { >+ allIncluded = false; >+ break; >+ } >+ } >+ } >+ } >+ } >+ if (allIncluded) { >+ filterRows.add(row); >+ } >+ } >+ >+ return filterRows.toArray(new Row[filterRows.size()]); > } > > /** >@@ -471,10 +632,7 @@ > final PatternType pattern = new PatternType(); > final PatternMatchType patternMatch = new PatternMatchType(); > patternMatch.setRegexp(regexp); >- pattern.getIncludeAndExclude().add( >- new JAXBElement<PatternMatchType>(new QName( >- ILMLCoreConstants.INCLUDE_ELEMENT), >- PatternMatchType.class, patternMatch)); >+ jaxbUtil.addPatternInclude(pattern, patternMatch); > column.setPattern(pattern); > } > >@@ -515,6 +673,29 @@ > return cids; > } > >+ /** >+ * Get column indexes of active columns for the table layout >+ * >+ * @param gid >+ * ID of the table layout >+ * @return array of column indexes >+ */ >+ private BigInteger[] getCidsActiveColumns(String gid) { >+ final TablelayoutType layout = lguiItem.getLayoutAccess() >+ .getTableLayout(gid); >+ final List<BigInteger> cids = new ArrayList<BigInteger>(); >+ for (int i = 0; i < layout.getColumn().size(); i++) { >+ for (final ColumnlayoutType column : layout.getColumn()) { >+ if (column.getPos() != null >+ && column.getPos().equals(BigInteger.valueOf(i)) >+ && column.isActive()) { >+ cids.add(column.getCid()); >+ } >+ } >+ } >+ return cids.toArray(new BigInteger[cids.size()]); >+ } >+ > private BigInteger getColumnIndex(TableType table, String colName) { > if (table != null) { > for (final ColumnType column : table.getColumn()) { >@@ -546,7 +727,7 @@ > } > } > } >- return null; >+ return "alpha"; > } > > /** >diff --git a/rms/org.eclipse.ptp.rm.lml.da.server/.gitignore b/rms/org.eclipse.ptp.rm.lml.da.server/.gitignore >new file mode 100644 >index 0000000..90cda1e >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.da.server/.gitignore >@@ -0,0 +1 @@ >+/lml-driver.tar >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay.pm b/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay.pm >index 3750907..73dace7 100644 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay.pm >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay.pm >@@ -83,6 +83,19 @@ > $self->_adjust_layout_bg(); > > >+ } elsif($self->{SYSTEMTYPE} eq "CRAYXT") { >+ my($maxpcol,$maxprow,$maxpcage,$maxpslot,$maxpnode)=$self->_get_system_size_crayxt(); >+ if(!$self->_init_trees_crayxt($maxpcol,$maxprow,$maxpcage,$maxpslot,$maxpnode)) { >+ print "ERROR: could not init internal data structures, system type: $self->{SYSTEMTYPE}, aborting ...\n"; >+ return(-1); >+ } >+ # init data tree with empty root nodes >+ $self->_add_empty_root_elements(); >+ >+ $self->_adjust_layout_crayxt(); >+ >+ >+ > } elsif($self->{SYSTEMTYPE} eq "Cluster") { > > # user define scheme given >@@ -165,10 +178,11 @@ > $inforef=$self->{LMLFH}->{DATA}->{INFODATA}->{$key}; > next if($inforef->{status} ne 'RUNNING'); > if(exists($inforef->{vnodelist})) { >- $nodelist=$self->_remap_nodes($inforef->{vnodelist}); >+ $nodelist=$self->_remap_nodes_vnode($inforef->{vnodelist}); > } else { > $nodelist=$self->_remap_nodes($inforef->{nodelist}); > } >+# print "_insert_run_jobs job $key nodelist $nodelist\n"; > $self->insert_job_into_nodedisplay($self->{SCHEMEROOT},$self->{DATAROOT},$nodelist,$key); > push(@idlist,$key); > $jcount++; >@@ -331,6 +345,41 @@ > } > $newnodelist.="," if($newnodelist); > $newnodelist.=sprintf("%s-c%02d",$newnode,$num); >+ } >+ return($newnodelist); >+} >+ >+sub _remap_nodes_vnode { >+ my($self) = shift; >+ my($nodelist)=shift; >+ my($newnodelist,$spec,$node,$num,$number,$newnode,$start); >+ if($self->{SYSTEMTYPE} eq "BG/P") { >+ return($nodelist); >+ } >+ foreach $spec (split(/\),?\(/,$nodelist)) { >+ # change form '(node,number tasks)' to (node-c<num>, ...) >+ if($spec=~/\(?([^,]+),(\d+)\)?/) { >+ $node=$1;$number=$2; >+ } elsif($spec=~/^([^,]+)$/) { >+ $node=$1;$number=0; >+ } else { >+ print "ERROR: _remap_nodes: unknown node in spec '$spec', skipping\n"; >+ } >+ >+ if(exists($self->{NODEMAPPING}->{$node})) { >+ $newnode=$self->{NODEMAPPING}->{$node}; >+ } else { >+ $newnode=$node; >+ } >+ >+ if(!exists($self->{NODELASTTASKNUMBER}->{$node})) { >+ $self->{NODELASTTASKNUMBER}->{$node}=-1; >+ } >+ $start=$self->{NODELASTTASKNUMBER}->{$node}+1; >+ for($num=$start;$num<$start+$number;$num++) { >+ $newnodelist.="," if($newnodelist); >+ $newnodelist.=sprintf("%s-c%02d",$newnode,$num); >+ } > } > return($newnodelist); > } >@@ -890,4 +939,298 @@ > } > > >+############################################### >+# Cray XT related >+############################################### >+sub _adjust_layout_crayxt { >+ my($self) = shift; >+ my($root_layout,$root_scheme,$treenode,$ltreenode,$streenode,$num,$min,$max,$lmin,$lmax); >+ my $rc=1; >+ my $maxlevel=6; >+ >+ $root_layout=$self->{LAYOUT}->{tree}; >+ $root_scheme=$self->{SCHEMEROOT}; >+ >+ # COLS >+ ###### >+ $streenode=$root_scheme->get_child({_name => "el1" }); >+ $ltreenode=$root_layout->get_child({_name => "el0" }); >+ >+ # get number of rows (in el1 of scheme) >+ if($streenode) { >+ $min=$streenode->{ATTR}->{min}; >+ $max=$streenode->{ATTR}->{max}; >+ $num=$max-$min+1; >+ >+ } else { >+ print STDERR "$0: ERROR: inconsistent scheme tree for Cray XT system (cols) ...\n";return(0); >+ } >+ >+ if(!$ltreenode) { >+ $ltreenode=$root_layout->new_child(); >+ } >+ # set size attributes >+ $ltreenode->{ATTR}->{rows}=1; >+ $ltreenode->{ATTR}->{cols}=$num; >+ >+ # set some default layout attributes >+# $ltreenode->{ATTR}->{maxlevel} = 6 if(!exists($ltreenode->{ATTR}->{maxlevel})); >+ $ltreenode->{ATTR}->{maxlevel} = 4 ; >+ $ltreenode->{ATTR}->{vgap} = 5 if(!exists($ltreenode->{ATTR}->{vgap})); >+ $ltreenode->{ATTR}->{hgap} = 0 if(!exists($ltreenode->{ATTR}->{hgap})); >+ $ltreenode->{ATTR}->{fontsize} = 10 if(!exists($ltreenode->{ATTR}->{fontsize})); >+ $ltreenode->{ATTR}->{border} = 0 if(!exists($ltreenode->{ATTR}->{border})); >+ $ltreenode->{ATTR}->{fontfamily} = "Monospaced" if(!exists($ltreenode->{ATTR}->{fontfamily})); >+ $ltreenode->{ATTR}->{showtitle} = "false" if(!exists($ltreenode->{ATTR}->{showtitle})); >+ $ltreenode->{ATTR}->{background} = "#777" if(!exists($ltreenode->{ATTR}->{background})); >+ $ltreenode->{ATTR}->{mouseborder}= 0 if(!exists($ltreenode->{ATTR}->{mouseborder})); >+ $ltreenode->{ATTR}->{transparent}= "false" if(!exists($ltreenode->{ATTR}->{transparent})); >+ $lmin=$min;$lmax=$max; >+ >+ # Rack >+ ###### >+ $streenode=$streenode->get_child({_name => "el2" }); >+ >+ # get number of rows (in el1 of scheme) >+ if($streenode) { >+ $min=$streenode->{ATTR}->{min}; >+ $max=$streenode->{ATTR}->{max}; >+ $num=$max-$min+1; >+ } else { >+ print STDERR "$0: ERROR: inconsistent scheme tree for Cray XT system (rows) ...\n";return(0); >+ } >+ >+ $treenode=$ltreenode->get_child({_name => "el1" }); >+ if(!$treenode) { >+ $treenode=$ltreenode->new_child(); >+ } >+ $ltreenode=$treenode; >+ >+ # set size attributes >+ $ltreenode->{ATTR}->{rows}=$num; >+ $ltreenode->{ATTR}->{cols}=1; >+ >+ # set some default layout attributes >+# $ltreenode->{ATTR}->{maxlevel} = 5 if(!exists($ltreenode->{ATTR}->{maxlevel})); >+ $ltreenode->{ATTR}->{maxlevel} = 5; >+ $ltreenode->{ATTR}->{vgap} = 5 if(!exists($ltreenode->{ATTR}->{vgap})); >+ $ltreenode->{ATTR}->{hgap} = 0 if(!exists($ltreenode->{ATTR}->{hgap})); >+# $ltreenode->{ATTR}->{fontsize} = 10 if(!exists($ltreenode->{ATTR}->{fontsize})); >+# $ltreenode->{ATTR}->{border} = 0 if(!exists($ltreenode->{ATTR}->{border})); >+# $ltreenode->{ATTR}->{fontfamily} = "Monospaced" if(!exists($ltreenode->{ATTR}->{fontfamily})); >+ $ltreenode->{ATTR}->{showtitle} = "true" if(!exists($ltreenode->{ATTR}->{showtitle})); >+# $ltreenode->{ATTR}->{background} = "#777" if(!exists($ltreenode->{ATTR}->{background})); >+# $ltreenode->{ATTR}->{mouseborder}= 0 if(!exists($ltreenode->{ATTR}->{mouseborder})); >+# $ltreenode->{ATTR}->{transparent}= "false" if(!exists($ltreenode->{ATTR}->{transparent})); >+ $lmin=$min;$lmax=$max; >+ >+ # Cage >+ ####### >+ $streenode=$streenode->get_child({_name => "el3" }); >+ >+ # get number of cages (in el2 of scheme) >+ if($streenode) { >+ $min=$streenode->{ATTR}->{min}; >+ $max=$streenode->{ATTR}->{max}; >+ $num=$max-$min+1; >+ } else { >+ print STDERR "$0: ERROR: inconsistent scheme tree for BG system (racks) ...\n";return(0); >+ } >+ >+ $treenode=$ltreenode->get_child({_name => "el2" }); >+ if(!$treenode) { >+ $treenode=$ltreenode->new_child(); >+ } >+ $ltreenode=$treenode; >+ >+ # set size attributes >+ $ltreenode->{ATTR}->{rows}=$num; $ltreenode->{ATTR}->{cols}=1; >+ $ltreenode->{ATTR}->{min}=$lmin; $ltreenode->{ATTR}->{max}=$lmax; >+ >+ # set some default layout attributes >+ $ltreenode->{ATTR}->{maxlevel} = 6 if(!exists($ltreenode->{ATTR}->{maxlevel})); >+ $ltreenode->{ATTR}->{showtitle} = "true" if(!exists($ltreenode->{ATTR}->{showtitle})); >+ $lmin=$min;$lmax=$max; >+ >+ # blade >+ ####### >+ $streenode=$streenode->get_child({_name => "el4" }); >+ >+ # get number of slots (in el3 of scheme) >+ if($streenode) { >+ $min=$streenode->{ATTR}->{min}; >+ $max=$streenode->{ATTR}->{max}; >+ $num=$max-$min+1; >+ } else { >+ print STDERR "$0: ERROR: inconsistent scheme tree for BG system (midplanes) ...\n";return(0); >+ } >+ >+ $treenode=$ltreenode->get_child({_name => "el3" }); >+ if(!$treenode) { >+ $treenode=$ltreenode->new_child(); >+ } >+ $ltreenode=$treenode; >+ >+ # set size attributes >+ $ltreenode->{ATTR}->{rows}=1; $ltreenode->{ATTR}->{cols}=$num; >+ $ltreenode->{ATTR}->{min}=$lmin; $ltreenode->{ATTR}->{max}=$lmax; >+ >+ # set some default layout attributes >+ $ltreenode->{ATTR}->{maxlevel} = 6 if(!exists($ltreenode->{ATTR}->{maxlevel})); >+ $ltreenode->{ATTR}->{showtitle} = "false" if(!exists($ltreenode->{ATTR}->{showtitle})); >+ $ltreenode->{ATTR}->{highestrowfirst} = "true" if(!exists($ltreenode->{ATTR}->{highestrowfirst})); >+ $ltreenode->{ATTR}->{showfulltitle} = "false" if(!exists($ltreenode->{ATTR}->{showfulltitle})); >+ $lmin=$min;$lmax=$max; >+ >+ >+ # Node >+ ###### >+ $streenode=$streenode->get_child({_name => "el5" }); >+ >+ # get number of midplanes (in el4 of scheme) >+ if($streenode) { >+ $min=$streenode->{ATTR}->{min}; >+ $max=$streenode->{ATTR}->{max}; >+ $num=$max-$min+1; >+ } else { >+ print STDERR "$0: ERROR: inconsistent scheme tree for BG system (nodeboards) ...\n";return(0); >+ } >+ >+ $treenode=$ltreenode->get_child({_name => "el4" }); >+ if(!$treenode) { >+ $treenode=$ltreenode->new_child(); >+ } >+ $ltreenode=$treenode; >+ >+ # set size attributes >+ $ltreenode->{ATTR}->{rows}=$num; $ltreenode->{ATTR}->{cols}=1; >+ $ltreenode->{ATTR}->{min}=$lmin; $ltreenode->{ATTR}->{max}=$lmax; >+ >+ # set some default layout attributes >+ $ltreenode->{ATTR}->{maxlevel} = $maxlevel if(!exists($ltreenode->{ATTR}->{maxlevel})); >+ $ltreenode->{ATTR}->{showtitle} = "false" if(!exists($ltreenode->{ATTR}->{showtitle})); >+ $ltreenode->{ATTR}->{fontsize} = 8 if(!exists($ltreenode->{ATTR}->{fontsize})); >+ $ltreenode->{ATTR}->{vgap} = 0 if(!exists($ltreenode->{ATTR}->{vgap})); >+ $ltreenode->{ATTR}->{hgap} = 0 if(!exists($ltreenode->{ATTR}->{hgap})); >+ $ltreenode->{ATTR}->{highestrowfirst} = "true" if(!exists($ltreenode->{ATTR}->{highestrowfirst})); >+ $ltreenode->{ATTR}->{showfulltitle} = "false" if(!exists($ltreenode->{ATTR}->{showfulltitle})); >+ $lmin=$min;$lmax=$max; >+ >+ # cores >+ ####### >+ $streenode=$streenode->get_child({_name => "el6" }); >+ >+ # get number of midplanes (in el6 of scheme) >+ if($streenode) { >+ $min=$streenode->{ATTR}->{min}; >+ $max=$streenode->{ATTR}->{max}; >+ $num=$max-$min+1; >+ } else { >+ print STDERR "$0: ERROR: inconsistent scheme tree for BG system (cores) ...\n";return(0); >+ } >+ >+ $treenode=$ltreenode->get_child({_name => "el5" }); >+ if(!$treenode) { >+ $treenode=$ltreenode->new_child(); >+ } >+ $ltreenode=$treenode; >+ >+ # set size attributes >+ $ltreenode->{ATTR}->{rows}=1; $ltreenode->{ATTR}->{cols}=12; >+ $ltreenode->{ATTR}->{min}=$lmin; $ltreenode->{ATTR}->{max}=$lmax; >+ >+ # set some default layout attributes >+ $ltreenode->{ATTR}->{maxlevel} = $maxlevel if(!exists($ltreenode->{ATTR}->{maxlevel})); >+ $lmin=$min;$lmax=$max; >+ >+ >+# print "$0: LAYOUT: ",Dumper($root_layout); >+# print "$0: SCHEME: ",Dumper($root_scheme); >+ >+ return($rc); >+} >+ >+ >+############################################### >+# Cray XT related >+############################################### >+sub _get_system_size_crayxt { >+ my($self) = shift; >+ my($indataref) = $self->{INDATA}; >+ my($nodename,$pcol,$prow,$pcage,$pslot,$pnode); >+ my($maxpcol,$maxprow,$maxpcage,$maxpslot,$maxpnode); >+ >+ my ($key,$ref); >+ >+ $maxpcol= $maxprow= $maxpcage= $maxpslot= $maxpnode= 0; >+ keys(%{$self->{LMLFH}->{DATA}->{OBJECT}}); # reset iterator >+ while(($key,$ref)=each(%{$self->{LMLFH}->{DATA}->{OBJECT}})) { >+ next if($ref->{type} ne 'node'); >+ $nodename=$self->{LMLFH}->{DATA}->{OBJECT}->{$key}->{name}; >+ if($nodename=~/^c(\d+)-(\d+)c(\d+)s(\d+)n(\d+)$/) { >+ ($pcol,$prow,$pcage,$pslot,$pnode)=($1,$2,$3,$4,$5); >+ } else { >+ print "_get_system_size_crayxt: node name could not be parsed: $nodename\n"; >+ } >+ $maxpcol=$pcol if($pcol>$maxpcol); >+ $maxprow=$prow if($prow>$maxprow); >+ $maxpcage=$pcage if($pcage>$maxpcage); >+ $maxpslot=$pslot if($pslot>$maxpslot); >+ $maxpnode=$pnode if($pnode>$maxpnode); >+ } >+ >+ printf("_get_system_size_crayxt: Cray XT system found of size: %dx%dx%d\n", >+ $maxpcol+1,$maxprow+1,$maxpcage+1,$maxpslot+1,$maxpnode+1 ) if($self->{VERBOSE}); >+ >+ return($maxpcol,$maxprow,$maxpcage,$maxpslot,$maxpnode); >+} >+ >+ >+sub _init_trees_crayxt { >+ my($self) = shift; >+ my($maxpcol,$maxprow,$maxpcage,$maxpslot,$maxpnode)=@_; >+ my($id,$subid,$treenode,$schemeroot,$bgsystem); >+ >+ $schemeroot=$self->{SCHEMEROOT}; >+ $treenode=$schemeroot; >+ $bgsystem=$treenode=$treenode->new_child(); >+ $treenode->add_attr({ tagname => 'col', >+ min => 0, >+ max => $maxpcol, >+ mask => 'c%d-' }); >+ >+ $treenode=$treenode->new_child(); >+ $treenode->add_attr({ tagname => 'rack', >+ min => 0, >+ max => $maxprow, >+ mask => '%01d' }); >+ >+ $treenode=$treenode->new_child(); >+ $treenode->add_attr({ tagname => 'cage', >+ min => 0, >+ max => $maxpcage, >+ mask => 'c%01d' }); >+ >+ $treenode=$treenode->new_child(); >+ $treenode->add_attr({ tagname => 'blade', >+ min => 0, >+ max => $maxpslot, >+ mask => 's%01d' }); >+ >+ $treenode=$treenode->new_child(); >+ $treenode->add_attr({ tagname => 'node', >+ min => 0, >+ max => $maxpnode, >+ mask => 'n%01d' }); >+ >+ $treenode=$treenode->new_child(); >+ $treenode->add_attr({ tagname => 'core', >+ min => 0, >+ max => 11, >+ mask => '-c%02d' }); >+ >+ return(1); >+} >+ >+ > 1; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay_insert_job.pm b/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay_insert_job.pm >index e4dfd86..3fc9983 100644 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay_insert_job.pm >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML2LML/LML_gen_nodedisplay_insert_job.pm >@@ -476,7 +476,7 @@ > $rg=$schemeref->{ATTR}->{_maskregall}; > > # ready if nodename matches to this level >-# print "get_numbers_from_name: check on level ",$schemeref->{_level}+1," $name -> $rg\n" if($debug>=2); >+# print "get_numbers_from_name: check on level ",$schemeref->{_level}+1," $name -> $rg subcheck ",$name=~/^$rg/,"\n" if($debug>=2); > if($name=~/^$rg$/) { > @list=$name=~/^$rg$/; > print "get_numbers_from_name: found on level ",$schemeref->{_level}+1," $name -> ",join(',',@list),"\n" if($debug>=2); >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_manager.pm b/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_manager.pm >index 6fa8b3e..eaa4c63 100644 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_manager.pm >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_manager.pm >@@ -515,7 +515,7 @@ > $color="red"; > } > if($self->{USEDCOLORS}[$cat]->{$color}) { >- printf( "llview_manage_color: warning color in use .. by: %10s %-15s -> %-20s #buffer=%3d\n", >+ printf( "llview_manage_color: warning color $color in use by: %10s %-15s -> %-20s #buffer=%3d\n", > $self->{USEDCOLORS}[$cat]->{$color},$id,$color,$#{$self->{BUFFER}[$cat]}); > } > $self->{KNOWNIDS}[$cat]->{$id}=$color; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_obj.pl b/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_obj.pl >old mode 100644 >new mode 100755 >index 599c5bf..42f2d62 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_obj.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML_color/LML_color_obj.pl >@@ -84,6 +84,7 @@ > { > my ($key,$type,$color); > foreach $key (keys(%{$filehandler->{DATA}->{OBJECT}})) { >+ next if(!exists($filehandler->{DATA}->{OBJECT}->{$key}->{type})); > $type=$filehandler->{DATA}->{OBJECT}->{$key}->{type}; > $color=$colormanager->get_color($type,$key); > if($color) { >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML_color/default.conf b/rms/org.eclipse.ptp.rm.lml.da/LML_color/default.conf >index 9fa26b4..11d183f 100644 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML_color/default.conf >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML_color/default.conf >@@ -10,7 +10,7 @@ > #*******************************************************************************/ > # color space definitions for different types of LML objects > class: type=class, colortype=gray,gray=1..200,buffer=2000 >-job: type=job, colortype=hsv,H=001..297, S=76, V=75,buffer=2000 >+job: type=job, colortype=hsv,H=001..297, S=76, V=75,buffer=3000 > node: type=node, colortype=hsv,H=297..076, S=80, V=75,buffer=5000 > partition: type=partition, colortype=hsv,H=010..100, S=90, V=75,buffer=200 > partmap: type=partmap, colortype=hsv,H=001..299, S=40, V=75,buffer=100 >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML_combiner/LML_combine_obj.pl b/rms/org.eclipse.ptp.rm.lml.da/LML_combiner/LML_combine_obj.pl >index 416b4f3..b838bfa 100755 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML_combiner/LML_combine_obj.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML_combiner/LML_combine_obj.pl >@@ -20,6 +20,7 @@ > use LML_combine_file_obj; > use LML_combine_obj_check; > use LML_combine_obj_bgp; >+use LML_combine_obj_xt; > > > my $patint="([\\+\\-\\d]+)"; # Pattern for Integer number >@@ -89,11 +90,16 @@ > } > } > >+print "system_type=$system_type\n"; > > if($system_type eq "BG/P") { > &LML_combine_obj_bgp::update($filehandler->get_data_ref(),$opt_dbdir); > } > >+if($system_type eq "CRAYXT") { >+ &LML_combine_obj_crayxt::update($filehandler->get_data_ref(),$opt_dbdir); >+} >+ > # check if Cluster is a PBS controlled Altix SMP Cluster > if($system_type eq "Cluster") { > keys(%{$filehandler->{DATA}->{OBJECT}}); # reset iterator >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML_combiner/LML_combine_obj_xt.pm b/rms/org.eclipse.ptp.rm.lml.da/LML_combiner/LML_combine_obj_xt.pm >new file mode 100644 >index 0000000..368c527 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML_combiner/LML_combine_obj_xt.pm >@@ -0,0 +1,203 @@ >+#******************************************************************************* >+#* Copyright (c) 2011 Forschungszentrum Juelich GmbH. >+#* All rights reserved. This program and the accompanying materials >+#* are made available under the terms of the Eclipse Public License v1.0 >+#* which accompanies this distribution, and is available at >+#* http://www.eclipse.org/legal/epl-v10.html >+#* >+#* Contributors: >+#* Wolfgang Frings (Forschungszentrum Juelich GmbH) >+#*******************************************************************************/ >+package LML_combine_obj_crayxt; >+use strict; >+use Data::Dumper; >+ >+my($debug)=0; >+ >+my $patint="([\\+\\-\\d]+)"; # Pattern for Integer number >+my $patfp ="([\\+\\-\\d.E]+)"; # Pattern for Floating Point number >+my $patwrd="([\^\\s]+)"; # Pattern for Work (all noblank characters) >+my $patbl ="\\s+"; # Pattern for blank space (variable length) >+ >+sub update { >+ my($dataptr) = shift; >+ my($dbdir) = shift; >+ >+ my $nodemapref=&get_mapping_info($dataptr); >+ >+ &update_node_info($dataptr,$nodemapref); >+ >+ my $appmapref=&get_app_mapping_info($dataptr,$nodemapref); >+ >+ &update_job_info($dataptr,$appmapref); >+ return(1); >+} >+ >+# returns hash: NID -> nodename >+sub get_mapping_info { >+ my($dataptr) = shift; >+ my($id,$nid,$nodename,%nodemap); >+ >+ # scan for partition names >+ foreach $id (keys(%{$dataptr->{OBJECT}})) { >+ if($dataptr->{OBJECT}->{$id}->{type} eq "nodemap") { >+ $nid=$dataptr->{OBJECT}->{$id}->{name}; >+ $nodename=$dataptr->{INFODATA}->{$id}->{name}; >+ $nodemap{$nid}=$nodename; >+ delete($dataptr->{OBJECT}->{$id}); >+ delete($dataptr->{INFO}->{$id}); >+ delete($dataptr->{INFODATA}->{$id}); >+ } >+ } >+ return(\%nodemap); >+} >+ >+# returns hash: apid-> vnodelist >+sub get_app_mapping_info { >+ my($dataptr) = shift; >+ my($nodemapref) = shift; >+ my($id,$apid,$nodename,%appmap,$numtasks); >+ >+ # scan for partition names >+ foreach $id (keys(%{$dataptr->{OBJECT}})) { >+ if($dataptr->{OBJECT}->{$id}->{type} eq "node") { >+ next if(!(exists($dataptr->{INFODATA}->{$id}->{Apids}))); >+ next if($dataptr->{INFODATA}->{$id}->{Apids} eq "-"); >+ $apid=$dataptr->{INFODATA}->{$id}->{Apids}; # todo: more apid's possible? >+ $numtasks=1; >+ if(exists($dataptr->{INFODATA}->{$id}->{Pl})) { >+ $numtasks=$dataptr->{INFODATA}->{$id}->{Pl}; >+ } >+ $appmap{$apid}.="(".$dataptr->{OBJECT}->{$id}->{name}.",$numtasks)"; >+ } >+ } >+ return(\%appmap); >+} >+ >+ >+sub update_node_info { >+ my($dataptr) = shift; >+ my($nodemapref) = shift; >+ my($id,$nid,$noderef); >+ >+ # update node info >+ foreach $id (keys(%{$dataptr->{OBJECT}})) { >+ if($dataptr->{OBJECT}->{$id}->{type} eq "node") { >+ $noderef=$dataptr->{INFODATA}->{$id}; >+ $nid=$dataptr->{OBJECT}->{$id}->{name}; >+ if(exists($nodemapref->{$nid})) { >+ $dataptr->{OBJECT}->{$id}->{name}=$nodemapref->{$nid}; >+ } else { >+ print "update_node_info(Cray XT): warning unknown nid: '$nid'\n"; >+ } >+ >+ # update attribute: memory >+ my $memfactor=1; >+ if(exists($noderef->{PgSz})) { >+ if($noderef->{PgSz}=~/$patint[K]/) { >+ $memfactor=$1 / 1024.0; # --> MB >+ } >+ delete($noderef->{PgSz}); >+ } >+ if(exists($noderef->{Conf})) { >+ $noderef->{physmem}=int($memfactor*$noderef->{Conf}); >+ delete($noderef->{Conf}); >+ }else { >+ $noderef->{physmem}="0"; >+ } >+ >+ if(exists($noderef->{Placed})) { >+ $noderef->{availmem}=$noderef->{physmem}-int($memfactor*$noderef->{Placed}); >+ $noderef->{availmem}=int($memfactor*$noderef->{Placed}); >+ delete($noderef->{Placed}); >+ } else { >+ $noderef->{availmem}="0"; >+ } >+ >+ if(exists($noderef->{State})) { >+ $noderef->{state}="Running" if ($noderef->{State} eq "UP"); >+ $noderef->{state}="Down" if ($noderef->{State} eq "DN"); >+ delete($noderef->{State}); >+ } else { >+ $noderef->{state}="Unknown"; >+ } >+ } >+ } >+ >+ return(1); >+} >+ >+ >+sub update_job_info { >+ my($dataptr) = shift; >+ my($appmapnodemapref) = shift; >+ my($id,$jobref,$apid,$batchid,%batchtoappid); >+ >+ # scan for app >+ foreach $id (keys(%{$dataptr->{OBJECT}})) { >+ if($dataptr->{OBJECT}->{$id}->{type} eq "app") { >+ $apid=$dataptr->{INFODATA}->{$id}->{apid}; >+ $batchid=$dataptr->{INFODATA}->{$id}->{batchid}; >+ $batchtoappid{$batchid}=$apid; >+ delete($dataptr->{OBJECT}->{$id}); >+ delete($dataptr->{INFO}->{$id}); >+ delete($dataptr->{INFODATA}->{$id}); >+ } >+ } >+ # update job info >+ foreach $id (keys(%{$dataptr->{OBJECT}})) { >+ if($dataptr->{OBJECT}->{$id}->{type} eq "job") { >+ $jobref=$dataptr->{INFODATA}->{$id}; >+ >+ # update nodelist >+ if($jobref->{state} ne "Running") { >+ if(!exists($jobref->{nodelist})) { >+ $jobref->{nodelist}="-"; >+ $jobref->{totaltasks}=0; >+ } >+ if(!exists($jobref->{vnodelist})) { >+ $jobref->{vnodelist}="-"; >+ } >+ } >+ # update totalcores >+ if(!exists($jobref->{totalcores})) { >+ print "update_job_info: could not find attributes for job $id to compute totalcores\n"; >+ } >+ >+ if($jobref->{state} eq "Running") { >+ $batchid=$dataptr->{OBJECT}->{$id}->{name}; >+ $batchid=~s/\..*$//gs; >+ if(exists($batchtoappid{$batchid})) { >+ $apid=$batchtoappid{$batchid}; >+ } else { >+ print "update_job_info: could not find apid for batch job '$batchid'\n"; >+ } >+ if(exists($appmapnodemapref->{$apid})) { >+ $jobref->{vnodelist}=$appmapnodemapref->{$apid}; >+ } else { >+ print "update_job_info: could not find nodelist for app '$apid' of batch job '$batchid'\n"; >+ } >+ } >+ } >+ } >+ return(1); >+} >+ >+sub update_class_info { >+ my($dataptr) = shift; >+ my($id,$class); >+ my(%classes); >+ >+ # get class info >+ foreach $id (keys(%{$dataptr->{OBJECT}})) { >+ if($dataptr->{OBJECT}->{$id}->{type} eq "class") { >+ $class=$dataptr->{INFODATA}->{$id}->{name}; >+ $classes{$class}{include}=$dataptr->{INFODATA}->{$id}->{crayxt_incl_bg}; >+ $classes{$class}{exclude}=$dataptr->{INFODATA}->{$id}->{crayxt_excl_bg}; >+ } >+ } >+ >+ return(1); >+} >+ >+1; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML_da_driver.pl b/rms/org.eclipse.ptp.rm.lml.da/LML_da_driver.pl >old mode 100644 >new mode 100755 >index a647f72..527a854 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML_da_driver.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML_da_driver.pl >@@ -26,7 +26,7 @@ > my $patwrd="([\^\\s]+)"; # Pattern for Work (all noblank characters) > my $patbl ="\\s+"; # Pattern for blank space (variable length) > >-my $version="1.12"; >+my $version="1.14"; > > my ($tstart,$tdiff,$rc); > >@@ -58,34 +58,69 @@ > # - return output file > > # option handling >-my $opt_rawfile=""; # unset >-my $opt_verbose=0; >-my $opt_quiet=0; > my $hostname = `hostname`;chomp($hostname); > my $ppid = $$; >-my $opt_tmpdir=sprintf("./tmp_%s_%d",$hostname,$ppid); >-my $opt_permdir=sprintf("./perm_%s",$hostname); >-my $opt_keeptmp=0; >-my $opt_keepperm=1; >-my $opt_dump=0; >-my $opt_demo=0; >+my %options = ( >+ "rawfile" => "", >+ "tmpdir" => "./tmp_".$hostname."_".$ppid, >+ "permdir" => "./perm_".$hostname, >+ "keeptmp" => 0, >+ "keepperm" => 1, >+ "verbose" => 0, >+ "quiet" => 0, >+ "nocheckrequest" => 0, >+ "rms" => "undef", >+ "dump" => 0, >+ "demo" => 0, >+ "test" => 0 >+); >+my @save_ARGV=(@ARGV); >+my @options_from_file_found; >+ > usage($0) if( ! GetOptions( >- 'verbose' => \$opt_verbose, >- 'quiet' => \$opt_quiet, >- 'rawfile=s' => \$opt_rawfile, >- 'tmpdir=s' => \$opt_tmpdir, >- 'permdir=s' => \$opt_permdir, >- 'keeptmp' => \$opt_keeptmp, >- 'demo' => \$opt_demo, >- 'dump' => \$opt_dump >- ) ); >+ 'verbose' => \$options{verbose}, >+ 'quiet' => \$options{quiet}, >+ 'rawfile=s' => \$options{rawfile}, >+ 'tmpdir=s' => \$options{tmpdir}, >+ 'permdir=s' => \$options{permdir}, >+ 'keeptmp' => \$options{keeptmp}, >+ 'rms=s' => \$options{rms}, >+ 'nocheckrequest' => \$options{nocheckrequest}, >+ 'demo' => \$options{demo}, >+ 'test' => \$options{test}, >+ 'dump' => \$options{dump} >+ ) ); > my $date=`date`; > chomp($date); > >+my $REPORT; >+ >+&open_report(); >+ >+my $options_file=".LML_da_options"; >+if (-f $options_file) { >+ my ($line); >+ open(IN,$options_file); >+ while($line=<IN>) { >+ if($line=~/$patwrd=\s*$patwrd\s*$/) { >+ my($opt_name,$opt_value)=($1,$2) ; >+ if(exists($options{$opt_name})) { >+ $options{$opt_name}=$opt_value; >+ push(@options_from_file_found,$opt_name); >+ } else { >+ &report_if_verbose("WARNING found unknown option (%s) in option file file %s\n",$opt_name,$options_file); >+ } >+ } >+ } >+ close(IN); >+} >+ > # print header >-print STDERR "-"x90,"\n" if($opt_verbose); >-print STDERR" LLVIEW Data Access Workflow Manager Driver $version, starting at ($date)\n" if(!$opt_quiet); >-print STDERR "-"x90,"\n" if($opt_verbose); >+&report_if_verbose("%s%s","-"x90,"\n"); >+&report("%s"," LLVIEW Data Access Workflow Manager Driver $version, starting at ($date)\n"); >+&report_if_verbose(" %s%s%s"," command line args: ",join(" ",@save_ARGV),"\n"); >+&report_if_verbose(" %s%s%s%s"," option file args: ",join(" ",@options_from_file_found)," (from file $options_file)","\n") if($#options_from_file_found>=0); >+&report_if_verbose("%s%s", "-"x90,"\n"); > > > # check positional parameters >@@ -105,70 +140,96 @@ > $outputfile = "-"; > } > >-my $tmpdir = $opt_tmpdir; >-my $permdir = $opt_permdir; >+my $tmpdir = $options{tmpdir}; >+my $permdir = $options{permdir}; > my $rawfile = undef; > my $removetmpdir = 0; # remove only if directory was create > >-# check temporary directory >+my $workflowxml = ""; >+my $laststep = ""; >+ >+# init global vars >+my $pwd=`pwd`; >+chomp($pwd); >+ >+if(! $options{test}) { >+ >+# check and/or create temporary directory > if(! -d $tmpdir) { >- printf(STDERR "$0: temporary directory not found, create new directory $tmpdir ...\n") if($opt_verbose); >+ &report_if_verbose("%s","$0: temporary directory not found, create new directory $tmpdir ...\n"); > if(!mkdir($tmpdir,0755)) { >- &exit_witherror($outputfile,"$0: could not create $tmpdir ...$!\n"); >+ &exit_witherror($outputfile,"$0: could not create $tmpdir ...$!\n"); > } else { >- print STDERR "$0: tmpdir created ($tmpdir)\n" if($opt_verbose); >+ &report_if_verbose("%s", "$0: tmpdir created ($tmpdir)\n"); > } > $removetmpdir=1; > } > > # check permanent directory > if(! -d $permdir) { >- printf(STDERR "$0: permanent directory not found, create new directory $permdir ...\n") if($opt_verbose); >+ &report_if_verbose("$0: permanent directory not found, create new directory $permdir ...\n"); > if(!mkdir($permdir,0755)) { >- &exit_witherror($outputfile,"$0: could not create $permdir ...$!\n"); >+ &exit_witherror($outputfile,"$0: could not create $permdir ...$!\n"); > } else { >- print STDERR "$0: permdir created ($permdir)\n" if($opt_verbose); >+ &report_if_verbose("%s", "$0: permdir created ($permdir)\n"); > } > } > > # check request input file > if ($requestfile ne "-") { > if(! -f $requestfile) { >- &exit_witherror($outputfile,"$0: requestfile $requestfile not found, exiting ...\n"); >+ &exit_witherror($outputfile,"$0: requestfile $requestfile not found, exiting ...\n"); > } > } > > # check rawfile >-if($opt_rawfile) { >- if(! -f $opt_rawfile) { >- &exit_witherror($outputfile,"$0: rawfile $rawfile specified but not found, exiting ...\n"); >+if($options{rawfile}) { >+ if(! -f $options{rawfile}) { >+ &exit_witherror($outputfile,"$0: rawfile $rawfile specified but not found, exiting ...\n"); > } >- $rawfile=$opt_rawfile; >+ $rawfile=$options{rawfile}; > } > >+ > # read config file >-print STDERR "$0: requestfile=$requestfile\n" if($opt_verbose); >+&report_if_verbose("%s", "$0: requestfile=$requestfile\n"); > $tstart=time; > >-my $filehandler_request = LML_file_obj->new($opt_verbose,1); >+# debug request file >+open(OUT,"> $options{tmpdir}/request.xml"); >+if ($requestfile eq "-") { >+ while(<>) { >+ print OUT $_; >+ } >+ $requestfile="$options{tmpdir}/request.xml"; >+} else { >+ open(IN,$requestfile); >+ while(<IN>) { >+ print OUT $_; >+ } >+ close(IN); >+} >+close(OUT); >+ >+my $filehandler_request = LML_file_obj->new($options{verbose},1); > $filehandler_request->read_lml_fast($requestfile); > $tdiff=time-$tstart; >-printf(STDERR "$0: parsing XML requestfile in %6.4f sec\n",$tdiff) if($opt_verbose); >+&report_if_verbose("$0: parsing XML requestfile in %6.4f sec\n",$tdiff); > if(!$filehandler_request) { > &exit_witherror($outputfile,"$0: could not parse requestfile $requestfile, exiting ...\n"); > } > >-# init global vars >-my $pwd=`pwd`; >-chomp($pwd); > > > ######################### > # create workflow > ######################### >-my $workflowxml=&create_workflow($tmpdir,$permdir); >-my $laststep = ""; >+$workflowxml=&create_workflow($tmpdir,$permdir); > my $step = ""; >+ >+# hashes containing function references to rms specific functions >+my $check_functions; >+my $generate_functions; > > > ######################### >@@ -178,66 +239,107 @@ > if($rawfile) { > $step="rawfilecp"; > if($rawfile=~/\.gz$/) { >- &add_exec_step_to_workflow($workflowxml,$step, $laststep, >- "gunzip -c $rawfile > \$stepoutfile"); >+ &add_exec_step_to_workflow($workflowxml,$step, $laststep, >+ "gunzip -c $rawfile > \$stepoutfile"); > } else { >- &add_exec_step_to_workflow($workflowxml,$step, $laststep, >- "cp $rawfile \$stepoutfile"); >+ &add_exec_step_to_workflow($workflowxml,$step, $laststep, >+ "cp $rawfile \$stepoutfile"); > } > $laststep=$step; > } else { > # get data from resource management system (RMS) > >- > # check for hints about queueing system > my $rms="undef"; >- my $r; > my %cmds=(); >- print STDERR "$0: check_for rms ...\n" if($opt_verbose); >- if(exists($filehandler_request->{DATA}->{REQUEST})) { >- if(exists($filehandler_request->{DATA}->{REQUEST}->{driver})) { >- my $driver_ref=$filehandler_request->{DATA}->{REQUEST}->{driver}; >- if(exists($driver_ref->{attr})) { >- if(exists($driver_ref->{attr}->{name})) { >- $rms=uc($driver_ref->{attr}->{name}); >- print STDERR "$0: check_for rms, got hint from request ... ($rms)\n" if($opt_verbose); >- } >- } >- >- if(exists($driver_ref->{command})) { >- my($key); >- foreach $key ( keys(%{$driver_ref->{command}}) ) { >- if(exists($driver_ref->{command}->{$key}->{exec})) { >- my $cmd_key="cmd_".$key; >- $cmds{$cmd_key}=$driver_ref->{command}->{$key}->{exec}; >- print STDERR "$0: check_for rms, got hint from for cmd $cmd_key ... ($cmds{$cmd_key})\n" if($opt_verbose); >- } >- } >- } >- } >- } >- if ($rms ne "undef") { >- do "rms/$rms/da_check_info_LML.pl" || &exit_witherror($outputfile,"$0: unable to locate rms\n"); >- &check_rms(\$rms,\%cmds,$opt_verbose) || &exit_witherror($outputfile,"$0: unable to locate rms\n"); >+ >+ if($options{rms} ne "undef") { >+ &report_if_verbose("$0: rms given by command line option: $options{rms} ...\n"); >+ $rms=$options{rms}; > } else { >- foreach $r (<rms/*>) { >- if (do "$r/da_check_info_LML.pl" && &check_rms(\$rms,\%cmds,$opt_verbose)) { >- $rms=substr($r, 4); >- last; >- } >- } >- if($rms eq "undef") { >- &exit_witherror($outputfile,"$0: could not determine rms, exiting ...\n"); >+ &report_if_verbose("$0: check request for rms hint ...\n"); >+ if(exists($filehandler_request->{DATA}->{REQUEST})) { >+ if(exists($filehandler_request->{DATA}->{REQUEST}->{driver})) { >+ my $driver_ref=$filehandler_request->{DATA}->{REQUEST}->{driver}; >+ if(!$options{nocheckrequest}) { >+ # check rms name >+ if(exists($driver_ref->{attr})) { >+ if(exists($driver_ref->{attr}->{name})) { >+ $rms=uc($driver_ref->{attr}->{name}); # upper case, except: >+ $rms="GridEngine" if ($rms=~/GRIDENGINE/); >+ &report_if_verbose("$0: check_for rms, got hint from request ... ($rms)\n"); >+ } >+ } > } >+ >+ if(!$options{nocheckrequest}) { >+ # check rms commands >+ if(exists($driver_ref->{command})) { >+ my($key); >+ foreach $key ( keys(%{$driver_ref->{command}}) ) { >+ if(exists($driver_ref->{command}->{$key}->{exec})) { >+ my $cmd_key="cmd_".$key; >+ $cmds{$cmd_key}=$driver_ref->{command}->{$key}->{exec}; >+ &report_if_verbose("$0: check_for rms, got hint from for cmd $cmd_key ... ($cmds{$cmd_key})\n"); >+ } >+ } >+ } >+ } >+ } >+ } > } > >- $laststep=&generate_step_rms($workflowxml, $laststep, \%cmds); >+ if ($rms ne "undef") { >+ if (do "rms/$rms/da_check_info_LML.pl") { >+ if (exists($main::check_functions->{$rms})) { >+ if ( &{$main::check_functions->{$rms}}(\$rms,\%cmds,$options{verbose})) { >+ &report_if_verbose("$0: rms/$rms/da_check_info_LML.pl --> rms=$rms\n"); >+ } else { >+ &report_if_verbose("$0: rms/$rms/da_check_info_LML.pl unable to locate rms $rms\n"); >+ $rms="undef"; >+ } >+ } else { >+ &report_if_verbose("$0: WARNING rms/$rms/da_check_info_LML.pl defines no check function\n"); >+ $rms="undef"; >+ } >+ } else { >+ &report_if_verbose("$0: ERROR could not run rms/$rms/da_check_info_LML.pl (perhaps missing return code of script)\n"); >+ $rms="undef"; >+ } >+ } else { >+ my ($r,$check_f,$generate_f,$test_rms); >+ foreach $r (<rms/*>) { >+ $test_rms=$r;$test_rms=~s/(.*\/)//s; >+ &report_if_verbose("$0: found rms/$r/da_check_info_LML.pl running test ...\n"); >+ if (do "$r/da_check_info_LML.pl") { >+ if (exists($main::check_functions->{$test_rms})) { >+ if ( &{$main::check_functions->{$test_rms}}(\$rms,\%cmds,$options{verbose})) { >+ $rms=$test_rms; >+ &report_if_verbose("$0: rms/$r/da_check_info_LML.pl --> rms=$rms\n"); >+ last; >+ } >+ } else { >+ &report_if_verbose("$0: WARNING rms/$r/da_check_info_LML.pl defines no check function\n"); >+ } >+ } else { >+ &report_if_verbose("$0: ERROR could not run rms/$r/da_check_info_LML.pl (perhaps missing return code of script)\n"); >+ } >+ } >+ } >+ >+ if($rms eq "undef") { >+ &exit_witherror($outputfile,"$0: could not determine rms, exiting ...\n"); >+ } >+ >+ if (exists($main::generate_functions->{$rms})) { >+ $laststep=&{$main::generate_functions->{$rms}}($workflowxml, $laststep, \%cmds); >+ } > > $step="addcolor"; > &add_exec_step_to_workflow($workflowxml,$step, $laststep, >- "$^X \$instdir/LML_color/LML_color_obj.pl -colordefs \$instdir/LML_color/default.conf " . >- "-dbdir \$permdir " . >- "-o \$stepoutfile \$stepinfile"); >+ "$^X \$instdir/LML_color/LML_color_obj.pl -colordefs \$instdir/LML_color/default.conf " . >+ "-dbdir \$permdir " . >+ "-o \$stepoutfile \$stepinfile"); > $laststep=$step; > > } >@@ -249,9 +351,9 @@ > my $usedefaultlayout=0; > if(exists($filehandler_request->{DATA}->{request})) { > if(exists($filehandler_request->{DATA}->{request}->[0]->{getDefaultData})) { >- if($filehandler_request->{DATA}->{request}->[0]->{getDefaultData}=~/^true$/i) { >- $usedefaultlayout=1; >- } >+ if($filehandler_request->{DATA}->{request}->[0]->{getDefaultData}=~/^true$/i) { >+ $usedefaultlayout=1; >+ } > } > } > #check if layout is given in request >@@ -259,11 +361,11 @@ > if(!$usedefaultlayout) { > my $key; > foreach $key (keys(%{$filehandler_request->{DATA}})) { >- $layoutfound=1 if ($key=~/LAYOUT$/); >+ $layoutfound=1 if ($key=~/LAYOUT$/); > } > $usedefaultlayout=1 if(!$layoutfound); > } >-print STDERR "$0: layoutfound=$layoutfound usedefaultlayout=$usedefaultlayout\n" if($opt_verbose); >+&report_if_verbose("$0: layoutfound=$layoutfound usedefaultlayout=$usedefaultlayout\n"); > > my $filehandler_layout; > if($usedefaultlayout) { >@@ -281,43 +383,60 @@ > ######################### > $step="LML2LML"; > my $demo=""; >-$demo="-demo" if $opt_demo; >+$demo="-demo" if $options{demo}; > &add_exec_step_to_workflow($workflowxml,$step, $laststep, >- "$^X LML2LML/LML2LML.pl -v $demo -layout \$tmpdir/layout.xml". >- " -output \$stepoutfile \$stepinfile"); >+ "$^X LML2LML/LML2LML.pl -v $demo -layout \$tmpdir/layout.xml". >+ " -output \$stepoutfile \$stepinfile"); > $laststep=$step; >+ > > ######################### > # Dump? > ######################### >-if($opt_dump) { >+if($options{dump}) { > print STDERR Dumper($filehandler_request->{DATA}); > print STDERR Dumper($workflowxml); > print STDERR Dumper($filehandler_layout->{DATA}); > exit(1); > } > >+} # ! $options{test} >+ > ######################### > # execute Workflow > ######################### >-# write workflow to tmpdir >- >-my $workflow_obj = LML_da_workflow_obj->new($opt_verbose,0); >-$workflow_obj->{DATA}=$workflowxml; >-$workflow_obj->write_xml("$tmpdir/workflow.xml"); >- >-my $cmd="$^X ./LML_da.pl"; >-$cmd .= " -v" if($opt_verbose); >-$cmd .= " -c $tmpdir/workflow.xml"; >-$cmd .= " > $tmpdir/LML_da.log"; >-$cmd .= " 2> $tmpdir/LML_da.errlog"; >-printf( STDERR "$0: executing: %s ...\n",$cmd) if($opt_verbose); >-$tstart=time; >-system($cmd);$rc=$?; >-$tdiff=time-$tstart; >-printf(STDERR "$0: %60s -> ready, time used %10.4ss\n","",$tdiff) if($opt_verbose); >-if($rc) { >- &exit_witherror($outputfile,"$0 failed executing: $cmd rc=$rc\n"); >+if(! $options{test}) { >+ my $workflow_obj = LML_da_workflow_obj->new($options{verbose},0); >+ $workflow_obj->{DATA}=$workflowxml; >+ $workflow_obj->write_xml("$tmpdir/workflow.xml"); >+ my $cmd="$^X ./LML_da.pl"; >+ $cmd .= " -v" if($options{verbose}); >+ $cmd .= " -c $tmpdir/workflow.xml"; >+ $cmd .= " > $tmpdir/LML_da.log"; >+ $cmd .= " 2> $tmpdir/LML_da.errlog"; >+ &report_if_verbose("$0: executing: %s ...\n",$cmd); >+ $tstart=time; >+ system($cmd);$rc=$?; >+ $tdiff=time-$tstart; >+ &report_if_verbose("$0: %60s -> ready, time used %10.4ss\n","",$tdiff); >+ if($rc) { >+ &exit_witherror($outputfile,"$0 failed executing: $cmd rc=$rc\n"); >+ } >+} else { >+ $laststep="LML2LML"; >+ my $cmd="( cd $tmpdir/..; $^X $pwd/LML_da.pl"; >+ $cmd .= " -v" if($options{verbose}); >+ $cmd .= " -c $tmpdir/workflow.xml"; >+ $cmd .= " > $tmpdir/LML_da.log"; >+ $cmd .= " 2> $tmpdir/LML_da.errlog )"; >+ &report_if_verbose("$0: executing: %s ...\n",$cmd); >+ $tstart=time; >+ system($cmd);$rc=$?; >+ $tdiff=time-$tstart; >+ &report_if_verbose("$0: %60s -> ready, time used %10.4ss\n","",$tdiff); >+ if($rc) { >+ &exit_witherror($outputfile,"$0 failed executing: $cmd rc=$rc\n"); >+ } > } > > ######################### >@@ -330,39 +449,42 @@ > if($outputfile eq "-") { > open(IN,$stepoutfile); > while(<IN>) { >- print $_; >+ print $_; > } > close(IN); > } else { > open(IN,$stepoutfile); > open(OUT," > $outputfile") || die "could not open for write '$outputfile'"; > while(<IN>) { >- print OUT $_; >+ print OUT $_; > } > close(OUT); > close(IN); > } > > # clean up >-if(($removetmpdir) && (!$opt_keeptmp)) { >+if(($removetmpdir) && (!$options{keeptmp})) { > my $file; > foreach $file (`ls $tmpdir`) { >- chomp($file); >-# print STDERR "unlink $tmpdir/$file\n"; >- unlink("$tmpdir/$file"); >+ chomp($file); >+# print STDERR "unlink $tmpdir/$file\n"; >+ unlink("$tmpdir/$file"); > } > if(!rmdir($tmpdir)) { >- printf(STDERR "$0: could not rmdir $tmpdir ...$!, exiting ...\n"); >+ &report("$0: could not rmdir $tmpdir ...$!, exiting ...\n"); > } else { >- print STDERR "$0: tmpdir removed ($tmpdir)\n" if($opt_verbose); >+ &report_if_verbose("$0: tmpdir removed ($tmpdir)\n"); > } > } > > >-print STDERR "-"x90,"\n" if($opt_verbose); >-print STDERR" LLVIEW Data Access Workflow Manager Driver $version, ending at ($date)\n" if(!$opt_quiet); >-print STDERR "-"x90,"\n" if($opt_verbose); >+&report_if_verbose("%s%s","-"x90,"\n"); >+&report(" LLVIEW Data Access Workflow Manager Driver $version, ending at ($date)\n"); >+&report_if_verbose("%s%s","-"x90,"\n"); > >+if(! (($removetmpdir) && (!$options{keeptmp}))) { >+ close_report("$tmpdir/report.log"); >+} > > sub usage { > die " >@@ -380,6 +502,10 @@ > -permdir <dir> : use this directory for permanent data > (e.g., databases, default: ./tmp) > -keeptmp : keep temporary directory >+ -test : use input files from temporary directory >+ -demo : generate anonymous data >+ -rms <rms> : check only for this rms >+ -nocheckrequest : don't check request for hints > -verbose : verbose mode > -quiet : prints no messages on stderr > >@@ -391,6 +517,7 @@ > my($outputfile,$errormsg)=@_; > my $xmlout=""; > >+ > $xmlout.="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; > $xmlout.="<lml:lgui xmlns:lml=\"http://www.llview.de\"\n"; > $xmlout.=" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"; >@@ -406,17 +533,19 @@ > $xmlout.="</information>\n"; > > $xmlout.="</lml:lgui>\n"; >- >- printf(STDERR "$errormsg\n"); > >+ &report("$0: ERROR $errormsg\n"); >+ > if($outputfile eq "-") { >- print $xmlout; >+ print $xmlout; > } else { >- open(OUT," > $outputfile") || die "could not open for write '$outputfile'"; >- print OUT $xmlout; >- close(OUT); >+ open(OUT," > $outputfile") || die "could not open for write '$outputfile'"; >+ print OUT $xmlout; >+ close(OUT); > } > >+ close_report("$tmpdir/report.log"); >+ > exit(1); > > } >@@ -448,9 +577,9 @@ > $stepref->{type} = "execute"; > > foreach $cmd (@cmds) { >- $cmdref={}; >- $cmdref->{exec} = $cmd; >- push(@{$stepref->{cmd}},$cmdref); >+ $cmdref={}; >+ $cmdref->{exec} = $cmd; >+ push(@{$stepref->{cmd}},$cmdref); > } > > $datastructref->{step}->{$id}=$stepref; >@@ -461,7 +590,7 @@ > sub create_default_layout { > my($filehandler_request)=@_; > >- my $filehandler_layout = LML_file_obj->new($opt_verbose,1); >+ my $filehandler_layout = LML_file_obj->new($options{verbose},1); > $filehandler_layout->read_lml_fast("$FindBin::RealBin/samples/layout_default.xml"); > $filehandler_layout->check_lml(); > return($filehandler_layout); >@@ -471,17 +600,48 @@ > my($filehandler_request)=@_; > my($key); > >- my $filehandler_layout = LML_file_obj->new($opt_verbose,1); >+ my $filehandler_layout = LML_file_obj->new($options{verbose},1); > $filehandler_layout -> init_file_obj(); > foreach $key ("TABLELAYOUT","TABLE","NODEDISPLAYLAYOUT","NODEDISPLAY","OBJECT") { >- if (exists($filehandler_request->{DATA}->{$key})) { >- $filehandler_layout->{DATA}->{$key}=dclone($filehandler_request->{DATA}->{$key}); >- } >+ if (exists($filehandler_request->{DATA}->{$key})) { >+ $filehandler_layout->{DATA}->{$key}=dclone($filehandler_request->{DATA}->{$key}); >+ } > } > $filehandler_layout->check_lml(); > return($filehandler_layout); > } > >+sub open_report { >+ $REPORT=""; >+} > > >+sub report { >+ my $format = shift; >+ # print to protocol file >+ $REPORT.=sprintf( $format, @_ ); > >+ if(!$options{quiet}) { >+ # print to stderr >+ printf(STDERR $format, @_); >+ } >+} >+ >+sub report_if_verbose { >+ my $format = shift; >+ # print to protocol file >+ $REPORT.=sprintf( $format, @_ ); >+ >+ if($options{verbose}) { >+ # print to stderr >+ printf(STDERR $format, @_); >+ } >+} >+ >+sub close_report { >+ my($reportfile)=@_; >+ if(open(REPORT,"> $reportfile")) { >+ print REPORT $REPORT; >+ close(REPORT); >+ } >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.da/LML_specs/LML_specs.pm b/rms/org.eclipse.ptp.rm.lml.da/LML_specs/LML_specs.pm >index 4e3910b..1a8e959 100644 >--- a/rms/org.eclipse.ptp.rm.lml.da/LML_specs/LML_specs.pm >+++ b/rms/org.eclipse.ptp.rm.lml.da/LML_specs/LML_specs.pm >@@ -71,7 +71,8 @@ > "comment" => ["s","O",undef, "comment" ], > "totalcores" => ["d","M",undef, "total number of machine cores requested"], > "totaltasks" => ["d","M",undef, "total number of (MPI) tasks"], >- "nodelist" => ["s","M",undef, "node on ehich a job is running" ], >+ "nodelist" => ["s","M",undef, "node on which a job is running" ], >+ "vnodelist" => ["s","M",undef, "virtual node list (PBS), used first" ], > "queue" => ["s","M",undef, "queue"], > "dependency" => ["s","O",undef, "dependency string"], > "executable" => ["s","O",undef, "path and name of executable"], >diff --git a/rms/org.eclipse.ptp.rm.lml.da/README.txt b/rms/org.eclipse.ptp.rm.lml.da/README.txt >index d000066..a462368 100644 >--- a/rms/org.eclipse.ptp.rm.lml.da/README.txt >+++ b/rms/org.eclipse.ptp.rm.lml.da/README.txt >@@ -410,3 +410,27 @@ > - persistent color management > - color db will be stored in a file in the perm-directory > - first driver for PBSpro controlled systems >+ >+1.10: >+ - bug fixes >+ >+1.11: >+ - bug fixes >+ >+1.12: >+ - bug fixes >+ >+1.13: >+ - improved reporting: option -verbose control debug output on stderr >+ full debugging report will written $tmpdir/report.log >+ - improved support for PBS (vnodes) >+ - bug fixes >+ >+1.14: >+ - Improvements for testing and demonstration purpose >+ - option -test: use existing workflow input in tmpdir >+ - options specification file .LML_da_options >+ - will be read if exists in current directory >+ - will overwrite command line option >+ - incoporated support for new RMS (GridEngine, PE) >+ (contributed by others) >diff --git a/rms/org.eclipse.ptp.rm.lml.da/lib/LML_file_obj.pm b/rms/org.eclipse.ptp.rm.lml.da/lib/LML_file_obj.pm >index f666c9c..891a72e 100644 >--- a/rms/org.eclipse.ptp.rm.lml.da/lib/LML_file_obj.pm >+++ b/rms/org.eclipse.ptp.rm.lml.da/lib/LML_file_obj.pm >@@ -555,7 +555,7 @@ > sub write_lml { > my($self) = shift; > my $outfile = shift; >- my($k,$rc,$id,$c,$key,$ref); >+ my($k,$rc,$id,$c,$key,$ref,$t); > my $tstart=time; > $rc=1; > >@@ -572,10 +572,12 @@ > printf(OUT "<objects>\n"); > foreach $id (sort keys %{$self->{DATA}->{OBJECT}}) { > printf(OUT "<object"); >+ $t=0; > foreach $k (sort keys %{$self->{DATA}->{OBJECT}->{$id}}) { >- printf(OUT " %s=\"%s\"",$k,$self->{DATA}->{OBJECT}->{$id}->{$k}); >+ printf(OUT " %s=\"%s\"",$k,$self->{DATA}->{OBJECT}->{$id}->{$k});$t=1; > } > printf(OUT "/>\n"); >+ print "write_lml: WARNING object with id '$id' has no attributes\n" if($t==0); > } > printf(OUT "</objects>\n"); > >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/GEHelper.pm b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/GEHelper.pm >new file mode 100644 >index 0000000..207e764 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/GEHelper.pm >@@ -0,0 +1,405 @@ >+#!/usr/bin/perl -w >+#******************************************************************************* >+#* Copyright (c) 2011 University of Illinois and others. All rights reserved. >+#* This program and the accompanying materials are made available under the >+#* terms of the Eclipse Public License v1.0 which accompanies this distribution, >+#* and is available at http://www.eclipse.org/legal/epl-v10.html >+#* >+#* Contributors: >+#* Jeff Overbey (Illinois/NCSA) - Design and implementation >+#******************************************************************************* >+ >+package GEHelper; >+ >+use strict; >+use warnings; >+ >+use POSIX qw(ceil floor); >+ >+use Exporter; >+our @ISA= qw( Exporter ); >+our @EXPORT_OK = qw( parsexml trimtext get_jobs get_job_nodes get_nodes should_group_nodes group_nodes MAX_CORES ); >+our @EXPORT = qw( get_jobs get_job_nodes get_nodes should_group_nodes group_nodes MAX_CORES ); >+ >+use constant { >+ MAX_NODES => 64, # If the system has more nodes than this, nodes will be >+ # grouped so that LML displays one node per box rather >+ # than one core per box >+ MAX_CORES => 64, # If nodes are not grouped, this is the maximum number >+ # of cores that will be displayed for a single node >+}; >+ >+# The return value of get_nodes() is cached here to avoid re-executing qhost >+my %cached_nodes = (); >+ >+my $cmd_jobinfo="/usr/bin/qstat"; >+$cmd_jobinfo=$ENV{"CMD_JOBINFO"} if($ENV{"CMD_JOBINFO"}); >+ >+my $cmd_nodeinfo="/usr/bin/qhost"; >+$cmd_nodeinfo=$ENV{"CMD_NODEINFO"} if($ENV{"CMD_NODEINFO"}); >+ >+ >+ >+############################################################################### >+# get_jobs - Returns a hash containing information about jobs (from qstat) >+############################################################################### >+# >+# The returned hash has job numbers as its keys and dictionaries of LML >+# attributes as its values. >+# >+sub get_jobs { >+ my %qstat_xml = parsexml("$cmd_jobinfo -u '*' -s prsz -r -xml |"); >+ trimtext(\%qstat_xml); >+ >+ my %jobs = (); >+ >+ my @jobs_in_queue = @{$qstat_xml{queue_info}[0]{job_list}}; >+ my @jobs_not_in_queue = @{$qstat_xml{job_info}[0]{job_list}}; >+ for my $job (@jobs_in_queue, @jobs_not_in_queue) { >+ # The hash referenced by $job corresponds to an XML element like this: >+ # <job_list state="running"> >+ # <JB_job_number>344911</JB_job_number> >+ # <JAT_prio>0.12923</JAT_prio> >+ # <JB_name>RF-38</JB_name> >+ # <JB_owner>tg458455</JB_owner> >+ # <state>r</state> >+ # <JAT_start_time>2011-11-29T03:21:14</JAT_start_time> >+ # <queue_name>normal@c327-104.ls4.tacc.utexas.edu</queue_name> >+ # <slots>24</slots> >+ # <full_job_name>RF-38</full_job_name> >+ # <requested_pe name="12way">24</requested_pe> >+ # <granted_pe name="12way">24</granted_pe> >+ # <hard_request name="h_rt" resource_contribution="0.000000">86400</hard_request> >+ # <hard_request name="mem_total" resource_contribution="0.000000">23.4G</hard_request> >+ # <hard_req_queue>normal</hard_req_queue> >+ # </job_list> >+ my $jobid = $job->{JB_job_number}[0]{_text}; >+ $jobs{$jobid}{step} = $jobid; >+ $jobs{$jobid}{name} = $jobid; #$job->{JB_name}[0]{_text}; >+ $jobs{$jobid}{owner} = $job->{JB_owner}[0]{_text}; >+ $jobs{$jobid}{state} = $job->{_attrs}{state}; >+ $jobs{$jobid}{totalcores} = $job->{slots}[0]{_text}; >+ $jobs{$jobid}{queue} = $job->{queue_name}[0]{_text}; >+ if ($job->{_attrs}{state} ne "running") { >+ $jobs{$jobid}{queuedate} = $job->{JB_submission_time}[0]{_text}; >+ } else { >+ $jobs{$jobid}{dispatchdate} = $job->{JAT_start_time}[0]{_text}; >+ } >+ $jobs{$jobid}{wall} = '-'; >+ if (defined ($job->{hard_request})) { >+ for my $request (@{$job->{hard_request}}) { >+ if ($request->{_attrs}{name} eq 'h_rt') { >+ $jobs{$jobid}{wall} = $request->{_text}; >+ } >+ } >+ } >+ } >+ >+ return %jobs; >+} >+ >+ >+ >+############################################################################### >+# get_job_nodes - Returns a hash containing information about what nodes each >+# job is running on (from qhost) >+############################################################################### >+# >+# The returned hash has job numbers as its keys and a comma-separated list of >+# node names as its values. Unfortunately, there is no information about what >+# cores a job is assigned to on nodes with multiple cores. >+# >+sub get_job_nodes { >+ my %qhost_xml = parsexml("$cmd_nodeinfo -j -xml |"); >+ trimtext(\%qhost_xml); >+ >+ my %job_hosts = (); >+ for my $host (@{$qhost_xml{host}}) { >+ # The hash referenced by $host corresponds to an XML element like >+ # <host name='c300-001.ls4.tacc.utexas.edu'> >+ # <hostvalue name='arch_string'>lx24-amd64</hostvalue> >+ # <hostvalue name='num_proc'>12</hostvalue> >+ # <hostvalue name='load_avg'>0.02</hostvalue> >+ # <hostvalue name='mem_total'>47.2G</hostvalue> >+ # <hostvalue name='mem_used'>892.5M</hostvalue> >+ # <hostvalue name='swap_total'>0.0</hostvalue> >+ # <hostvalue name='swap_used'>0.0</hostvalue> >+ # </host> >+ my $hostname = $host->{_attrs}{name}; >+ $hostname =~ s/\..*//; >+ if (defined($host->{job})) { >+ for my $jobelt (@{$host->{job}}) { >+ # The hash referenced by $jobelt corresponds to an XML element like >+ # <job name='353538'> >+ # <jobvalue jobid='353538' name='priority'>'0.005689'</jobvalue> >+ # <jobvalue jobid='353538' name='qinstance_name'>grace@c300-003.ls4.tacc.utexas.edu</jobvalue> >+ # <jobvalue jobid='353538' name='job_name'>acc+att.2008-01</jobvalue> >+ # <jobvalue jobid='353538' name='job_owner'>byaa705</jobvalue> >+ # <jobvalue jobid='353538' name='job_state'>r</jobvalue> >+ # <jobvalue jobid='353538' name='start_time'>1322585173</jobvalue> >+ # <jobvalue jobid='353538' name='queue_name'>grace@c300-003.ls4.tacc.utexas.edu</jobvalue> >+ # <jobvalue jobid='353538' name='pe_master'>SLAVE</jobvalue> >+ # </job> >+ my $jobid = $jobelt->{_attrs}{name}; >+ if (!defined($job_hosts{$jobid})) { >+ $job_hosts{$jobid} = {}; >+ } >+ $job_hosts{$jobid}->{$hostname} = 1; >+ } >+ } >+ } >+ >+ for my $jobid (keys %job_hosts) { >+ my $nodelist = ''; >+ for my $node (keys %{$job_hosts{$jobid}}) { >+ $nodelist .= "$node,"; >+ } >+ chop($nodelist); >+ $job_hosts{$jobid} = $nodelist; >+ } >+ >+ return %job_hosts; >+} >+ >+ >+ >+############################################################################### >+# get_nodes - Returns a hash containing information about nodes (from qhost) >+############################################################################### >+# >+# The returned hash has node names as its keys and dictionaries of LML >+# attributes as its values. >+# >+sub get_nodes { >+ if (scalar keys %cached_nodes > 0) { >+ return %cached_nodes; >+ } >+ >+ my %qhost_xml = parsexml("$cmd_nodeinfo -xml |"); >+ trimtext(\%qhost_xml); >+ >+ my %nodes = (); >+ for my $host (@{$qhost_xml{host}}) { >+ # The hash referenced by $host corresponds to an XML element like >+ # <host name='c300-001.ls4.tacc.utexas.edu'> >+ # <hostvalue name='arch_string'>lx24-amd64</hostvalue> >+ # <hostvalue name='num_proc'>12</hostvalue> >+ # <hostvalue name='load_avg'>0.02</hostvalue> >+ # <hostvalue name='mem_total'>47.2G</hostvalue> >+ # <hostvalue name='mem_used'>892.5M</hostvalue> >+ # <hostvalue name='swap_total'>0.0</hostvalue> >+ # <hostvalue name='swap_used'>0.0</hostvalue> >+ # </host> >+ >+ my $nodeid = $host->{_attrs}{name}; >+ $nodeid =~ s/\..*//; >+ >+ my %hostvalues = (); >+ for my $hostvalue (@{$host->{hostvalue}}) { >+ my $key = $hostvalue->{_attrs}{name}; >+ my $value = $hostvalue->{_text}; >+ $hostvalues{$key} = $value; >+ } >+ >+ $nodes{$nodeid}{id} = $nodeid; >+ >+ $nodes{$nodeid}{ntype} = $hostvalues{arch_string}; >+ >+ if (defined($hostvalues{num_proc})) { >+ my $ncores = $hostvalues{num_proc}; >+ if ($ncores =~ /^[0-9]+$/) { >+ if ($ncores > MAX_CORES) { >+ $ncores = MAX_CORES; >+ } else { >+ $nodes{$nodeid}{ncores} = $ncores; >+ } >+ } else { >+ $nodes{$nodeid}{ncores} = 1; >+ } >+ } >+ >+ $nodes{$nodeid}{physmem} = $hostvalues{mem_total}; >+ } >+ >+ %cached_nodes = %nodes; >+ return %nodes; >+} >+ >+ >+ >+############################################################################### >+# should_group_nodes - Returns true if nodes should be grouped in the LML >+# display (for performance reasons) >+############################################################################### >+sub should_group_nodes { >+ my %nodes = get_nodes(); >+ my $num_nodes = scalar keys %nodes; >+ return $num_nodes > MAX_NODES; >+} >+ >+ >+ >+############################################################################### >+# group_nodes - Places the system's nodes into groups such that there are no >+# more than MAX_NODES groups. >+############################################################################### >+# >+# Three values are returned: >+# - A reference to a hash mapping node names to group names >+# - A reference to a hash mapping node names to their 0-based indices in the group >+# - The (maximum) number of nodes in each group >+# >+sub group_nodes { >+ my %nodes = get_nodes(); >+ my @nodeids = sort(keys(%nodes)); >+ my $num_nodes = $#nodeids + 1; >+ >+ my %node_group = (); >+ my %node_index = (); >+ my $nodes_per_group = ceil($num_nodes / MAX_NODES); >+ if ($num_nodes <= MAX_NODES) { >+ %node_group = map { $_ => $_ } @nodeids; >+ %node_index = map { $_ => 0 } @nodeids; >+ } else { >+ my $nodenum = 0; >+ for my $nodeid (@nodeids) { >+ $node_group{$nodeid} = "Group" . floor($nodenum / $nodes_per_group); >+ $node_index{$nodeid} = $nodenum % $nodes_per_group; >+ $nodenum++; >+ } >+ } >+ return (\%node_group, \%node_index, $nodes_per_group); >+} >+ >+ >+ >+###### (PRIVATE) ############################################################## >+# parsexml - Parses the given XML file into a hash. >+############################################################################### >+# >+# The hash is keyed by the names of child elements. It also contains >+# the keys '_attrs' and '_text'. >+# >+# As an example, the XML file >+# <?xml version='1.0'?> >+# <aaa xxx="1"> >+# <bbb xxx="" yyy=" 2">This is child 1</bbb> >+# <bbb>This is child 2 >+# <ccc/> >+# </bbb> >+# </aaa> >+# is parsed into the hash >+# { '_text' => '\n\n\n', >+# '_attrs' => { 'xxx' => '1' }, >+# 'bbb' => [ { '_text' => 'This is child 1', >+# '_attrs' => { 'xxx' => '', >+# 'yyy' => ' 2' } >+# }, >+# { '_text' => 'This is child 2\n \n ', >+# '_attrs' => {}, >+# 'ccc' => [ { '_text' => '', >+# '_attrs' => {} } >+# ] >+# } >+# ] >+# }; >+# >+# This isn't fully general (e.g., it doesn't handle CDATA, >+# and it assumes there won't be any child elements with the >+# names '_attrs' or '_text') but it works for our purposes. >+# >+# Ideally, we could use XML::Simple and avoid this, except the >+# TACC machines only have the XML::Parser module available. >+sub parsexml { >+ my ($file) = @_; >+ >+ use XML::Parser; >+ >+ # When we encounter a start tag, we will push the hash >+ # for that XML element onto the stack. >+ my @stack = (); >+ >+ my $parser = new XML::Parser(ErrorContext => 2); >+ $parser->setHandlers( >+ Start => sub { >+ my ($parser, $elt, %attrs) = @_; >+ # When we encounter an XML start tag, create a hash >+ # for that XML element and push it onto the stack. >+ my %element = ( _attrs => \%attrs, _text => '' ); >+ push(@stack, \%element); >+ }, >+ Char => sub { >+ my ($parser, $text) = @_; >+ # When we encounter text, append it to the _text >+ # for the current XML element. >+ my $topref = $stack[-1]; >+ ${$topref}{_text} .= $text; >+ }, >+ End => sub { >+ my ($parser, $elt) = @_; >+ # When we encounter an XML end tag, pop that >+ # element's hash from the stack and mark it >+ # as a child of the parent element. >+ if ($#stack > 0) { >+ my $childref = pop(@stack); >+ my $parentref = $stack[-1]; >+ if (not exists ${$parentref}{$elt}) { >+ ${$parentref}{$elt} = []; >+ } >+ my $arrayref = @{$parentref}{$elt}; >+ push(@{$arrayref}, $childref); >+ } >+ }); >+ $parser->parsefile($file); >+ if ($#stack == -1) { >+ return undef; >+ } else { >+ return %{$stack[-1]}; >+ } >+} >+ >+ >+ >+###### (PRIVATE) ############################################################## >+# trimtext - Traverses the a tree returned by parsexml, removing leading and >+# trailing whitespace from all '_text' values. >+############################################################################### >+# >+# As an example, when trimtext is applied to the example for parsexml above, >+# the hash becomes the following: >+# { '_text' => '', >+# '_attrs' => { 'xxx' => '1' }, >+# 'bbb' => [ { '_text' => 'This is child 1', >+# '_attrs' => { 'xxx' => '', >+# 'yyy' => ' 2' } >+# }, >+# { '_text' => 'This is child 2', >+# '_attrs' => {}, >+# 'ccc' => [ { '_text' => '', >+# '_attrs' => {} } >+# ] >+# } >+# ] >+# }; >+# >+# Note that only the '_text' values are trimmed. The attribute values (e.g., >+# for 'yyy') are not trimmed. >+# >+sub trimtext { >+ my ($xml) = @_; >+ for my $key (keys %{$xml}) { >+ my $val = $xml->{$key}; >+ if ($key eq '_text') { >+ $xml->{_text} =~ s/^\s+//; >+ $xml->{_text} =~ s/\s+$//; >+ } elsif (ref($val) eq "ARRAY") { >+ for my $elt (@{$val}) { >+ trimtext($elt); >+ } >+ } elsif (ref($val) eq "HASH") { >+ trimtext($val); >+ } >+ } >+ return $xml; >+} >+ >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_check_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_check_info_LML.pl >new file mode 100644 >index 0000000..888eb05 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_check_info_LML.pl >@@ -0,0 +1,96 @@ >+#!/usr/bin/perl -w >+#******************************************************************************* >+#* Copyright (c) 2011 Forschungszentrum Juelich GmbH. >+#* All rights reserved. This program and the accompanying materials >+#* are made available under the terms of the Eclipse Public License v1.0 >+#* which accompanies this distribution, and is available at >+#* http://www.eclipse.org/legal/epl-v10.html >+#* >+#* Contributors: >+#* Jeff Overbey (Illinois/NCSA) - Sun Grid Engine support >+#* Wolfgang Frings (Forschungszentrum Juelich GmbH) >+#*******************************************************************************/ >+use strict; >+ >+############################# >+# rms: Sun/Oracle Grid Engine >+############################# >+sub check_rms_GridEngine { >+ my($rmsref,$cmdsref)=@_; >+ my($key,$cmd); >+ my $rc=1; >+ >+ my %cmdname=( >+ "job" => "qstat", >+ "node" => "qhost", >+ ); >+ my %cmdpath=( >+ "job" => "/usr/bin/qstat", >+ "node" => "/usr/bin/qhost", >+ ); >+ >+ foreach $key (keys(%cmdname)) { >+ # check for job query cmd >+ if(exists($cmdsref->{"cmd_${key}info"})) { >+ $cmd=$cmdsref->{"cmd_${key}info"}; >+ } else { >+ $cmd=$cmdpath{$key}; >+ } >+ if(! -f $cmd) { >+ my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >+ if(!$?) { >+ chomp($cmdpath); >+ $cmd=$cmdpath; >+ &report_if_verbose("%s","$0: check_rms_GridEngine: found $cmdname{$key} by which ($cmd)\n"); >+ } >+ } >+ if(-f $cmd) { >+ $cmdsref->{"cmd_${key}info"}=$cmd; >+ } else { >+ &report_if_verbose("%s","$0: check_rms_GridEngine: no cmd found for $cmdname{$key}\n"); >+ $rc=0; >+ } >+ } >+ >+ if($rc==1) { >+ $$rmsref="GridEngine"; >+ &report_if_verbose("%s%s%s", "$0: check_rms_GridEngine: found Grid Engine commands (", >+ join(",",(values(%{$cmdsref}))), >+ ")\n"); >+ } else { >+ &report_if_verbose("%s","$0: check_rms_GridEngine: seems not to be a Grid Engine system\n"); >+ } >+ >+ return($rc); >+} >+ >+ >+sub generate_step_rms_GridEngine { >+ my($workflowxml, $laststep, $cmdsref)=@_; >+ my($step,$envs,$key,$ukey); >+ >+ $envs=""; >+ foreach $key (keys(%{$cmdsref})) { >+ $ukey=uc($key); >+ $envs.="$ukey=$cmdsref->{$key} "; >+ } >+ $step="getdata"; >+ &add_exec_step_to_workflow($workflowxml,$step, $laststep, >+ "$envs $^X rms/GridEngine/da_system_info_LML.pl \$tmpdir/sysinfo_LML.xml", >+ "$envs $^X rms/GridEngine/da_nodes_info_LML.pl \$tmpdir/nodes_LML.xml", >+ "$envs $^X rms/GridEngine/da_jobs_info_LML.pl \$tmpdir/jobs_LML.xml"); >+ $laststep=$step; >+ >+ $step="combineLML"; >+ &add_exec_step_to_workflow($workflowxml,$step, $laststep, >+ "$^X \$instdir/LML_combiner/LML_combine_obj.pl -v -o \$stepoutfile ". >+ "\$tmpdir/sysinfo_LML.xml \$tmpdir/jobs_LML.xml \$tmpdir/nodes_LML.xml"); >+ $laststep=$step; >+ >+ return($laststep); >+} >+ >+$main::check_functions->{GridEngine} =\&check_rms_GridEngine; >+$main::generate_functions->{GridEngine}=\&generate_step_rms_GridEngine; >+ >+1; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_jobs_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_jobs_info_LML.pl >new file mode 100644 >index 0000000..29810b8 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_jobs_info_LML.pl >@@ -0,0 +1,181 @@ >+#!/usr/bin/perl -w >+#******************************************************************************* >+#* Copyright (c) 2011 Forschungszentrum Juelich GmbH and others. >+#* All rights reserved. This program and the accompanying materials >+#* are made available under the terms of the Eclipse Public License v1.0 >+#* which accompanies this distribution, and is available at >+#* http://www.eclipse.org/legal/epl-v10.html >+#* >+#* Contributors: >+#* Wolfgang Frings (Forschungszentrum Juelich GmbH) >+#* Jeff Overbey (Illinois/NCSA) - Grid Engine support >+#*******************************************************************************/ >+use strict; >+ >+use FindBin; # Find the directory containing this script >+use lib "$FindBin::Bin"; # Search for modules in this script's directory >+use GEHelper; # Now look for our GEHelper module >+ >+my $patint="([\\+\\-\\d]+)"; # Pattern for Integer number >+my ($line,%jobs,%jobnr,$key,$value,$count,%notmappedkeys,%notfoundkeys); >+ >+if ($#ARGV != 0) { >+ die " Usage: $0 <filename> $#ARGV\n"; >+} >+my $filename = $ARGV[0]; >+ >+my $system_sysprio=-1; >+my $maxtopdogs=-1; >+ >+my %mapping = map { $_ => $_ } ( >+ "name", >+ "owner", >+ "restart", >+ "dependency", >+ "totalcores", >+ "wall", >+ "nodelist", >+ "vnodelist", >+ "state", >+ "queuedate", >+ "queue", >+ "dispatchdate", >+ "step", >+ "totaltasks", >+ "spec", >+ "status", >+ "detailedstatus", >+ "group" >+ ); >+ >+%jobs = get_jobs(); >+ >+my %nodes = get_nodes(); >+my ($node_groups, $node_index, $nodes_per_group) = group_nodes(); >+my %job_nodes = get_job_nodes(); >+for my $jobid (keys %job_nodes) { >+ my $nodelist = $job_nodes{$jobid}; >+ if (should_group_nodes()) { >+ # Determine what groups this >+ my %groups = (); >+ for my $nodeid (split(/,/, $nodelist)) { >+ my $groupid = $node_groups->{$nodeid}; >+ my $groupidx = $node_index->{$nodeid}; >+ $groups{"($groupid,$groupidx)"} = 1; >+ } >+ $nodelist = join("", sort(keys(%groups))); >+ } else { >+ my @nodes_in_list = split(/,/, $nodelist); >+ $nodelist = ''; >+ for my $nd (@nodes_in_list) { >+ if (defined($nodes{$nd}{ncores}) && $nodes{$nd}{ncores} =~ /[0-9]+/) { >+ my $ncores = $nodes{$nd}{ncores}; >+ for (my $i = 0; $i < $ncores; $i++) { >+ $nodelist .= "($nd,$i)"; >+ } >+ } else { >+ $nodelist .= "($nd,0)"; >+ } >+ } >+ } >+ >+ $jobs{$jobid}{nodelist} = $nodelist; >+} >+ >+# add unknown but manatory attributes to jobs >+for my $jobid (sort(keys(%jobs))) { >+ $jobs{$jobid}{group} = "unknown" if(!exists($jobs{$jobid}{group})); >+ $jobs{$jobid}{nodelist} = "-" if(!exists($jobs{$jobid}{nodelist})); >+ $jobs{$jobid}{totaltasks} = $jobs{$jobid}{totalcores} if(!exists($jobs{$jobid}{totaltasks})); >+ $jobs{$jobid}{spec} = $jobs{$jobid}{totalcores} if(!exists($jobs{$jobid}{spec})); >+ # check state >+ ($jobs{$jobid}{status},$jobs{$jobid}{detailedstatus}) = &get_state($jobs{$jobid}{state}); >+} >+ >+open(OUT,"> $filename") || die "cannot open file $filename"; >+printf(OUT "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); >+printf(OUT "<lml:lgui xmlns:lml=\"http://www.llview.de\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"); >+printf(OUT " xsi:schemaLocation=\"http://www.llview.de lgui.xsd\"\n"); >+printf(OUT " version=\"0.7\"\>\n"); >+printf(OUT "<objects>\n"); >+$count=0; >+for my $jobid (sort(keys(%jobs))) { >+ $count++;$jobnr{$jobid}=$count; >+ printf(OUT "<object id=\"j%06d\" name=\"%s\" type=\"job\"/>\n",$count,$jobid); >+} >+printf(OUT "</objects>\n"); >+printf(OUT "<information>\n"); >+for my $jobid (sort(keys(%jobs))) { >+ printf(OUT "<info oid=\"j%06d\" type=\"short\">\n",$jobnr{$jobid}); >+ foreach $key (sort(keys(%{$jobs{$jobid}}))) { >+ if(exists($mapping{$key})) { >+ if($mapping{$key} ne "") { >+ $value=&modify($key,$mapping{$key},$jobs{$jobid}{$key}); >+ if($value) { >+ printf(OUT " <data %-20s value=\"%s\"/>\n","key=\"".$mapping{$key}."\"",$value); >+ } >+ } else { >+ $notmappedkeys{$key}++; >+ } >+ } else { >+ $notfoundkeys{$key}++; >+ } >+ } >+ printf(OUT "</info>\n"); >+} >+printf(OUT "</information>\n"); >+printf(OUT "</lml:lgui>\n"); >+close(OUT); >+ >+foreach $key (sort(keys(%notfoundkeys))) { >+ printf("%-40s => \"\",\n","\"".$key."\"",$notfoundkeys{$key}); >+} >+ >+ >+sub get_state { >+ my($job_state)=@_; >+ my($state,$detailed_state); >+ >+ $state="UNDETERMINED";$detailed_state=""; >+ >+ if($job_state eq "zombie") { >+ $state="COMPLETED";$detailed_state="JOB_OUTERR_READY"; >+ } >+ if($job_state eq "pending") { >+ $state="SUBMITTED"; >+ $detailed_state=""; >+ } >+ if($job_state eq "running") { >+ $state="RUNNING";$detailed_state=""; >+ } >+ >+ return($state,$detailed_state); >+} >+ >+sub modify { >+ my($key,$mkey,$value)=@_; >+ my $ret=$value; >+ >+ if(!$ret) { >+ return(undef); >+ } >+ >+ if($mkey eq "state") { >+ $ret="Completed" if ($value eq "zombie"); >+ $ret="Idle" if ($value eq "pending"); >+ $ret="Running" if ($value eq "running"); >+ } >+ >+ if(($mkey eq "wall") || ($mkey eq "wallsoft")) { >+ if($value=~/^$patint[:]$patint[:]$patint$/) { >+ $ret=$1*60*60+$2*60+$3; >+ } >+ } >+ >+ # mask & in user input >+ if($ret=~/\&/) { >+ $ret=~s/\&/\&\;/gs; >+ } >+ >+ return($ret); >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_nodes_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_nodes_info_LML.pl >new file mode 100644 >index 0000000..4d54397 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_nodes_info_LML.pl >@@ -0,0 +1,129 @@ >+#!/usr/bin/perl -w >+#******************************************************************************* >+#* Copyright (c) 2011 Forschungszentrum Juelich GmbH and others. >+#* All rights reserved. This program and the accompanying materials >+#* are made available under the terms of the Eclipse Public License v1.0 >+#* which accompanies this distribution, and is available at >+#* http://www.eclipse.org/legal/epl-v10.html >+#* >+#* Contributors: >+#* Wolfgang Frings (Forschungszentrum Juelich GmbH) >+#* Jeff Overbey (Illinois/NCSA) - Grid Engine support >+#*******************************************************************************/ >+use strict; >+ >+use FindBin; # Find the directory containing this script >+use lib "$FindBin::Bin"; # Search for modules in this script's directory >+use GEHelper; # Now look for our GEHelper module >+ >+my $patint="([\\+\\-\\d]+)"; # Pattern for Integer number >+my ($line,%nodes,%nodenr,$key,$value,$count,%notmappedkeys,%notfoundkeys); >+ >+if ($#ARGV != 0) { >+ die " Usage: $0 <filename> $#ARGV\n"; >+} >+my $filename = $ARGV[0]; >+ >+my $system_sysprio=-1; >+my $maxtopdogs=-1; >+ >+my %mapping = map { $_ => $_ } ( >+ "availmem", >+ "id", >+ "ncores", >+ "physmem", >+ "ntype", >+ "state" >+ ); >+ >+ >+%nodes = get_nodes(); >+ >+if (should_group_nodes()) { >+ my ($node_groups, $node_index, $nodes_per_group) = group_nodes(); >+ my %groups = (); >+ for my $nodeid (keys %nodes) { >+ my $groupid = $node_groups->{$nodeid}; >+ if (!defined($groups{$groupid})) { >+ $groups{$groupid}{id} = $groupid; #$nodes{$nodeid}{id}; >+ $groups{$groupid}{ntype} = $nodes{$nodeid}{ntype}; >+ $groups{$groupid}{ncores} = 1; >+ } else { >+ # $groups{$groupid}{id} .= "," . $nodes{$nodeid}{id}; >+ if ($nodes{$nodeid}{ntype} ne '-' && $nodes{$nodeid}{ntype} ne $groups{$groupid}{ntype}) { >+ $groups{$groupid}{ntype} = "(mixed)"; >+ } >+ $groups{$groupid}{ncores} = $nodes_per_group; >+ } >+ } >+ %nodes = %groups; >+} >+ >+# add unknown but manatory attributes to nodes >+for my $nodeid (keys(%nodes)) { >+ my($key,$value,$pair); >+ if(exists($nodes{$nodeid}{status})) { >+ foreach $pair (split(/,/,$nodes{$nodeid}{status})) { >+ ($key,$value)=split(/=/,$pair); >+ $nodes{$nodeid}{$key}=$value; >+ } >+ } >+ >+} >+ >+open(OUT,"> $filename") || die "cannot open file $filename"; >+ >+printf(OUT "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); >+printf(OUT "<lml:lgui xmlns:lml=\"http://www.llview.de\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"); >+printf(OUT " xsi:schemaLocation=\"http://www.llview.de lgui.xsd\"\n"); >+printf(OUT " version=\"0.7\"\>\n"); >+printf(OUT "<objects>\n"); >+$count=0; >+for my $nodeid (sort(keys(%nodes))) { >+ $count++;$nodenr{$nodeid}=$count; >+ printf(OUT "<object id=\"nd%06d\" name=\"%s\" type=\"node\"/>\n",$count,$nodeid); >+} >+printf(OUT "</objects>\n"); >+printf(OUT "<information>\n"); >+for my $nodeid (sort(keys(%nodes))) { >+ printf(OUT "<info oid=\"nd%06d\" type=\"short\">\n",$nodenr{$nodeid}); >+ foreach $key (sort(keys(%{$nodes{$nodeid}}))) { >+ if(exists($mapping{$key})) { >+ if($mapping{$key} ne "") { >+ $value=&modify($key,$mapping{$key},$nodes{$nodeid}{$key}); >+ if($value) { >+ printf(OUT " <data %-20s value=\"%s\"/>\n","key=\"".$mapping{$key}."\"",$value); >+ } >+ } else { >+ $notmappedkeys{$key}++; >+ } >+ } else { >+ $notfoundkeys{$key}++; >+ } >+ } >+ printf(OUT "</info>\n"); >+} >+printf(OUT "</information>\n"); >+printf(OUT "</lml:lgui>\n"); >+ >+close(OUT); >+ >+foreach $key (sort(keys(%notfoundkeys))) { >+ printf("%-40s => \"\",\n","\"".$key."\"",$notfoundkeys{$key}); >+} >+ >+sub modify { >+ my($key,$mkey,$value)=@_; >+ my $ret=$value; >+ >+ if(!$ret) { >+ return(undef); >+ } >+ >+ # mask & in user input >+ if($ret=~/\&/) { >+ $ret=~s/\&/\&\;/gs; >+ } >+ >+ return($ret); >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_system_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_system_info_LML.pl >new file mode 100644 >index 0000000..6b49550 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/GridEngine/da_system_info_LML.pl >@@ -0,0 +1,49 @@ >+#!/usr/bin/perl -w >+#******************************************************************************* >+#* Copyright (c) 2011 Forschungszentrum Juelich GmbH and others. >+#* All rights reserved. This program and the accompanying materials >+#* are made available under the terms of the Eclipse Public License v1.0 >+#* which accompanies this distribution, and is available at >+#* http://www.eclipse.org/legal/epl-v10.html >+#* >+#* Contributors: >+#* Wolfgang Frings (Forschungszentrum Juelich GmbH) >+#* Jeff Overbey (Illinois/NCSA) - Grid Engine support >+#*******************************************************************************/ >+use strict; >+ >+if ($#ARGV != 0) { >+ die " Usage: $0 <filename> $#ARGV\n"; >+} >+my $filename = $ARGV[0]; >+ >+my $system_time = &get_current_date(); >+my $hostname = `hostname`; chomp($hostname); >+ >+open(OUT,"> $filename") || die "cannot open file $filename"; >+printf OUT <<EOF; >+<?xml version="1.0" encoding="UTF-8"?> >+<lml:lgui xmlns:lml="http://www.llview.de" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://www.llview.de/lgui.xsd" >+ version="0.7"> >+ <objects> >+ <object id="sys000001" name="cluster" type="system"/> >+ </objects> >+ <information> >+ <info oid="sys000001" type="short"> >+ <data key="system_time" value="$system_time"/> >+ <data key="hostname" value="$hostname"/> >+ <data key="type" value="Cluster"/> >+ </info> >+ </information> >+</lml:lgui> >+EOF >+close(OUT); >+ >+sub get_current_date { >+ my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$idst)=localtime(time()); >+ my($date); >+ $year=substr($year,1,2); >+ $date=sprintf("%02d/%02d/%02d-%02d:%02d:%02d",$mon+1,$mday,$year,$hour,$min,$sec); >+ return($date); >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/LL/da_check_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/LL/da_check_info_LML.pl >old mode 100755 >new mode 100644 >index 615f265..418fc7f >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/LL/da_check_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/LL/da_check_info_LML.pl >@@ -11,76 +11,83 @@ > #*******************************************************************************/ > use strict; > >-sub check_rms { >+sub check_rms_LL { > my($rmsref,$cmdsref,$verbose)=@_; > my($key,$cmd); >- my $rc=0; >- >+ my $rc=1; >+ > my %cmdname=( >- "job" => "llq", >- "node" => "llstatus", >+ "job" => "llq", >+ "node" => "llstatus", > ); > my %cmdpath=( >- "job" => "/usr/bin/llq", >- "node" => "/usr/bin/llstatus", >+ "job" => "/usr/bin/llq", >+ "node" => "/usr/bin/llstatus", > ); >- >+ > foreach $key (keys(%cmdname)) { > # check for job query cmd >- if (exists($cmdsref->{"cmd_${key}info"})) { >- $cmd=$cmdsref->{"cmd_${key}info"}; >- } else { >- $cmd=$cmdpath{$key}; >- } >- if (!-f $cmd) { >- my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >- if (!$?) { >- chomp($cmdpath); >- $cmd=$cmdpath; >- print STDERR "$0: check_rms: found $cmdname{$key} by which ($cmd)\n" if ($verbose); >- } else { >- last; >- } >- } >- if (-f $cmd) { >- $cmdsref->{"cmd_${key}info"}=$cmd; >- $rc=1; >- } >- } >- >- if ($rc) { >- $$rmsref="LL"; >+ if (exists($cmdsref->{"cmd_${key}info"})) { >+ $cmd=$cmdsref->{"cmd_${key}info"}; > } else { >- print STDERR "$0: check_rms: seems not to be a LL system\n" if ($verbose); >- } >+ $cmd=$cmdpath{$key}; >+ } >+ if (!-f $cmd) { >+ my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >+ if (!$?) { >+ chomp($cmdpath); >+ $cmd=$cmdpath; >+ &report_if_verbose("%s","$0: check_rms_LL: found $cmdname{$key} by which ($cmd)\n"); >+ } >+ } >+ if (-f $cmd) { >+ $cmdsref->{"cmd_${key}info"}=$cmd; >+ } else { >+ &report_if_verbose("%s","$0: check_rms_LL: no cmd found for $cmdname{$key}\n"); >+ $rc=0; >+ } > >+ } >+ >+ if ($rc==1) { >+ $$rmsref="LL"; >+ &report_if_verbose("%s%s%s", "$0: check_rms_LL: found LL commands (", >+ join(",",(values(%{$cmdsref}))), >+ ")\n"); >+ } else { >+ &report_if_verbose("%s","$0: check_rms_LL: seems not to be a LL system\n"); >+ } >+ > return $rc; > } > >-sub generate_step_rms { >+sub generate_step_rms_LL { > my($workflowxml, $laststep, $cmdsref)=@_; > my($step,$envs,$key,$ukey); >- >+ > $envs=""; > foreach $key (keys(%{$cmdsref})) { >- $ukey=uc($key); >- $envs.="$ukey=$cmdsref->{$key} "; >+ $ukey=uc($key); >+ $envs.="$ukey=$cmdsref->{$key} "; > } >- >+ > $step="getdata"; > &add_exec_step_to_workflow($workflowxml,$step, $laststep, > "$envs $^X rms/LL/da_system_info_LML.pl \$tmpdir/sysinfo_LML.xml", > "$envs $^X rms/LL/da_nodes_info_LML.pl \$tmpdir/nodes_LML.xml", > "$envs $^X rms/LL/da_jobs_info_LML.pl \$tmpdir/jobs_LML.xml"); > $laststep=$step; >- >+ > $step="combineLML"; > &add_exec_step_to_workflow($workflowxml,$step, $laststep, > "$^X \$instdir/LML_combiner/LML_combine_obj.pl -v -o \$stepoutfile ". > "\$tmpdir/sysinfo_LML.xml \$tmpdir/jobs_LML.xml \$tmpdir/nodes_LML.xml"); > $laststep=$step; >- >+ > return($laststep); > } > >-1; >\ No newline at end of file >+$main::check_functions->{LL} =\&check_rms_LL; >+$main::generate_functions->{LL}=\&generate_step_rms_LL; >+ >+1; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_check_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_check_info_LML.pl >old mode 100755 >new mode 100644 >index 2c7f4a4..058bc5a >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_check_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_check_info_LML.pl >@@ -11,10 +11,10 @@ > #*******************************************************************************/ > use strict; > >-sub check_rms { >+sub check_rms_OPENMPI { > my($rmsref,$cmdsref,$verbose)=@_; > my($key,$infocmd,$cmd); >- my $rc=0; >+ my $rc=1; > > my %cmdname=( > "job" => "orte-ps", >@@ -32,72 +32,75 @@ > > # first: check if ompi_info is given by request info > if (exists($cmdsref->{"cmd_sysinfo"})) { >- if (-f $cmdsref->{"cmd_sysinfo"}) { >- $infocmd=$cmdsref->{"cmd_sysinfo"}." --path bindir"; >- } >- } >+ if (-f $cmdsref->{"cmd_sysinfo"}) { >+ $infocmd=$cmdsref->{"cmd_sysinfo"}." --path bindir"; >+ } >+ } > > # second: check if ompi_info is given in PATH > if (!$infocmd) { >- my $cmdpath=`which $cmdname{sys} 2>/dev/null`; >- if(!$?) { >- chomp($cmdpath); >- $infocmd=$cmdpath." --path bindir"; >- } >+ my $cmdpath=`which $cmdname{sys} 2>/dev/null`; >+ if(!$?) { >+ chomp($cmdpath); >+ $infocmd=$cmdpath." --path bindir"; >+ } > } >- >+ > # second: check if ompi_info is given in default path > if (!$infocmd) { >- my $cmdpath=$cmdpath{sys}; >- if (!-f $cmdpath) { >- $infocmd=$cmdpath." --path bindir"; >- } >+ my $cmdpath=$cmdpath{sys}; >+ if (!-f $cmdpath) { >+ $infocmd=$cmdpath." --path bindir"; >+ } > } >- >+ > # return if no ompi_info found > if (!$infocmd) { >- return($rc); >+ return($rc); > } >- >+ > # get openmpi bindir > my $bindir=`$infocmd`; > chomp($bindir); > $bindir=~s/^Bindir:\s*//gs; >- >+ > foreach $key (keys(%cmdname)) { >- $cmdpath{$key}=$bindir."/".$cmdname{$key}; >+ $cmdpath{$key}=$bindir."/".$cmdname{$key}; > >- if (exists($cmdsref->{"cmd_${key}info"})) { >- $cmd=$cmdsref->{"cmd_${key}info"}; >- } else { >- $cmd=$cmdpath{$key}; >- } >- if (! -f $cmd) { >- my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >- if(!$?) { >- chomp($cmdpath); >- $cmd=$cmdpath; >- print STDERR "$0: check_rms: found $cmdname{$key} by which ($cmd)\n" if($verbose); >- } else { >- last; >- } >- } >- if (-f $cmd) { >- $cmdsref->{"cmd_${key}info"}=$cmd; >- $rc=1; >- } >+ if (exists($cmdsref->{"cmd_${key}info"})) { >+ $cmd=$cmdsref->{"cmd_${key}info"}; >+ } else { >+ $cmd=$cmdpath{$key}; >+ } >+ if (! -f $cmd) { >+ my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >+ if(!$?) { >+ chomp($cmdpath); >+ $cmd=$cmdpath; >+ &report_if_verbose("%s","$0: check_rms_OPENMPI: found $cmdname{$key} by which ($cmd)\n"); >+ } >+ } >+ if (-f $cmd) { >+ $cmdsref->{"cmd_${key}info"}=$cmd; >+ } else { >+ &report_if_verbose("%s","$0: check_rms_OPENMPI: no cmd found for $cmdname{$key}\n"); >+ $rc=0; >+ } > } >- if ($rc) { >- $$rmsref="OPENMPI"; >+ if ($rc) { >+ $$rmsref="OPENMPI"; >+ &report_if_verbose("%s%s%s", "$0: check_rms_OPENMPI: found OPENMPI commands (", >+ join(",",(values(%{$cmdsref}))), >+ ")\n"); > } else { >- print STDERR "$0: check_rms: seems not to be a OpenMPI system\n" if($verbose); >+ &report_if_verbose("%s","$0: check_rms_OPENMPI: seems not to be a OPENMPI system\n"); > } >- >+ > return($rc); > } > > >-sub generate_step_rms { >+sub generate_step_rms_OPENMPI { > my($workflowxml, $laststep, $cmdsref)=@_; > my($step,$envs,$key,$ukey); > >@@ -122,4 +125,8 @@ > return($laststep); > } > >-1; >\ No newline at end of file >+$main::check_functions->{OPENMPI} =\&check_rms_OPENMPI; >+$main::generate_functions->{OPENMPI}=\&generate_step_rms_OPENMPI; >+ >+ >+1; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_jobs_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_jobs_info_LML.pl >old mode 100644 >new mode 100755 >index 3f1ccf6..cc1ddb5 >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_jobs_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/OPENMPI/da_jobs_info_LML.pl >@@ -73,24 +73,16 @@ > my $cmd="orte-ps"; > $cmd=$ENV{"CMD_JOBINFO"} if($ENV{"CMD_JOBINFO"}); > >-if(open(IN,"$cmd -n -v 2>&1 |")) { >+if(open(IN,"$cmd -n |")) { > my $firstrankpid=undef; > $jobid="-"; > while($line=<IN>) { > chomp($line); >- if ($line=~/Gathering Information for HNP: \[\[$patint,$patint\],$patint\]:$patint/) { >- my($vpid,$pid)=($1,$4); >- $jobid=$pid; >+ if($line=~/Information from $patwrd \[$patint,$patint\]$/) { >+ my($call,$pid,$num)=($1,$2,$3); >+ print "found job $pid\n"; >+ $jobid=$pid; > $jobs{$jobid}{step}=$jobid; >- print "found job $pid with vpid $vpid\n"; >-# >-# Disable until ompi-ps is fixed >-# >-# } elsif($line=~/Information from $patwrd \[$patint,$patint\]$/) { >-# my($call,$vpid,$num)=($1,$2,$3); >-# print "found vpid $vpid\n"; >-# $jobid=$pid; >-# $jobs{$jobid}{step}=$jobid; > } elsif($line=~/^\s*Node Name \|/) { > # scan node table > print "line 1: $line\n"; >@@ -121,8 +113,7 @@ > if($line=~/^\s*\[$patint,$patint\]\s*\|\s*$patwrd\s*\|\s*$patwrd\s*\|\s*$patwrd\s*\|/) { > my($ppid,$num,$state,$slots,$numproc)=($1,$2,$3,$4,$5); > print "found joblist $ppid,$num,$state,$slots,$numproc\n"; >-# $jobs{$jobid}{id} = $ppid; >- $jobs{$jobid}{id} = $jobid; >+ $jobs{$jobid}{id} = $ppid; > $jobs{$jobid}{totaltasks} = $numproc; > $jobs{$jobid}{job_state} = $state; > $line=<IN>; >@@ -174,9 +165,7 @@ > $nodes{$nodeid}{id} = $nodeid; > $nodes{$nodeid}{arch} = `uname -p`; > $nodes{$nodeid}{state} = "Up"; >- if (-e '/proc/cpuinfo') { >- $nodes{$nodeid}{slots} = `grep family /proc/cpuinfo | wc -l`; >- } >+ $nodes{$nodeid}{slots} = `grep family /proc/cpuinfo | wc -l`; > foreach $key (keys(%{$nodes{$nodeid}})) { > chomp($nodes{$nodeid}{$key}); > } >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_check_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_check_info_LML.pl >old mode 100755 >new mode 100644 >index 3cc59c8..bb45b86 >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_check_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_check_info_LML.pl >@@ -11,10 +11,10 @@ > #*******************************************************************************/ > use strict; > >-sub check_rms { >+sub check_rms_PBS { > my($rmsref,$cmdsref,$verbose)=@_; > my($key, $cmd); >- my $rc=0; >+ my $rc=1; > > my %cmdname=( > "job" => "qstat", >@@ -25,55 +25,58 @@ > "job" => "/usr/bin/qstat", > "node" => "/usr/bin/pbsnodes", > ); >- >+ > foreach $key (keys(%cmdname)) { >- # check for job query cmd >- if (exists($cmdsref->{"cmd_${key}info"})) { >- $cmd=$cmdsref->{"cmd_${key}info"}; >- } else { >- $cmd=$cmdpath{$key}; >- } >- if (! -f $cmd) { >- my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >- if (!$?) { >- chomp($cmdpath); >- $cmd=$cmdpath; >- print STDERR "$0: check_rms: found $cmdname{$key} by which ($cmd)\n" if($verbose); >- } else { >- last; >- } >- } >- if (-f $cmd) { >- $cmdsref->{"cmd_${key}info"}=$cmd; >- $rc=1; >- } >+ # check for job query cmd >+ if (exists($cmdsref->{"cmd_${key}info"})) { >+ $cmd=$cmdsref->{"cmd_${key}info"}; >+ } else { >+ $cmd=$cmdpath{$key}; >+ } >+ if (! -f $cmd) { >+ my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >+ if (!$?) { >+ chomp($cmdpath); >+ $cmd=$cmdpath; >+ &report_if_verbose("%s","$0: check_rms_PBS: found $cmdname{$key} by which ($cmd)\n"); >+ } >+ } >+ if (-f $cmd) { >+ $cmdsref->{"cmd_${key}info"}=$cmd; >+ } else { >+ &report_if_verbose("%s","$0: check_rms_PBS: no cmd found for $cmdname{$key}\n"); >+ $rc=0; >+ } > } > > # Ensure it is a PBSpro system >- if (exists($cmdsref->{"cmd_jobinfo"})) { >- $cmd=$cmdsref->{"cmd_jobinfo"}." --version"; >+ if (exists($cmdsref->{"cmd_jobinfo"})) { >+ $cmd=$cmdsref->{"cmd_jobinfo"}." --version"; > my $cmdversion=`$cmd 2>/dev/null`; >- chomp($cmdversion); >- if ($cmdversion=~/version/) { >- if ($cmdversion=~/PBSPro/) { >- print STDERR "$0: check_rms: PBSpro found\n" if($verbose); >- } >- } else { >- print STDERR "$0: check_rms: could not obtain version info from command $cmd\n" if($verbose); >- $rc=0; >+ chomp($cmdversion); >+ if ($cmdversion=~/version/) { >+ if ($cmdversion=~/PBSPro/) { >+ print STDERR "$0: check_rms: PBSpro found\n" if($verbose); > } >+ } else { >+ &report_if_verbose("%s","$0: check_rms_PBS: could not obtain version info from command $cmd\n"); >+ $rc=0; >+ } > } >- >- if ($rc) { >+ >+ if ($rc==1) { > $$rmsref = "PBS"; >+ &report_if_verbose("%s%s%s", "$0: check_rms_PBS: found PBS commands (", >+ join(",",(values(%{$cmdsref}))), >+ ")\n"); > } else { >- print STDERR "$0: check_rms: seems not to be a pbs system\n" if($verbose); >+ &report_if_verbose("%s","$0: check_rms_PBS: seems not to be a PBS system\n"); > } > > return($rc); > } > >-sub generate_step_rms { >+sub generate_step_rms_PBS { > my($workflowxml, $laststep, $cmdsref)=@_; > my($step,$envs,$key,$ukey); > >@@ -98,4 +101,7 @@ > return($laststep); > } > >-1; >\ No newline at end of file >+$main::check_functions->{PBS} =\&check_rms_PBS; >+$main::generate_functions->{PBS}=\&generate_step_rms_PBS; >+ >+1; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_jobs_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_jobs_info_LML.pl >index 38b9634..5be785d 100755 >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_jobs_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_jobs_info_LML.pl >@@ -56,7 +56,6 @@ > "Resource_List.depend" => "dependency", > "Resource_List.mem" => "", > "Resource_List.nodect" => "", >- "Resource_List.nodes" => "totalcores", > "Resource_List.pmem" => "", > "Resource_List.walltime" => "wall", > "Shell_Path_List" => "", >@@ -71,7 +70,7 @@ > "fault_tolerant" => "", > "interactive" => "", > "job_state" => "state", >- "mtime" => "", >+ "mtime" => "dispatchdate", > "qtime" => "queuedate", > "queue" => "queue", > "resources_used.cput" => "", >@@ -81,11 +80,12 @@ > "server" => "", > "session_id" => "", > "start_count" => "", >- "start_time" => "dispatchdate", >+ "start_time" => "", > "submit_args" => "", > > "step" => "step", > "totaltasks" => "totaltasks", >+ "totalcores" => "totalcores", > "spec" => "spec", > > "status" => "status", >@@ -110,9 +110,23 @@ > "resources_used.ncpus" => "", > "stime" => "", > "substate" => "", >- >+ > # unknown attributes > "group" => "group", >+ "Account_Name" => "", >+ "Exit_status" => "", >+ "Resource_List.Qlist" => "", >+ "estimated.exec_vnode" => "", >+ "estimated.start_time" => "", >+ "Resource_List.nodes" => "", >+ "argument_list" => "", >+ "array" => "", >+ "array_indices_remaining" => "", >+ "array_indices_submitted" => "", >+ "array_state_count" => "", >+ "executable" => "", >+ "group_list" => "", >+ "umask" => "", > ); > > my $cmd="/usr/bin/qstat"; >@@ -121,7 +135,6 @@ > open(IN,"$cmd -f |"); > my $jobid="-"; > my $lastkey="-"; >- > > while($line=<IN>) { > chomp($line); >@@ -145,11 +158,19 @@ > foreach $jobid (sort(keys(%jobs))) { > $jobs{$jobid}{group} = "unknown" if(!exists($jobs{$jobid}{group})); > $jobs{$jobid}{exec_host} = "-" if(!exists($jobs{$jobid}{exec_host})); >- $jobs{$jobid}{totaltasks} = $jobs{$jobid}{"Resource_List.nodes"} if(!exists($jobs{$jobid}{totaltasks})); >- $jobs{$jobid}{spec} = $jobs{$jobid}{"Resource_List.nodes"} if(!exists($jobs{$jobid}{spec})); >+ if(!exists($jobs{$jobid}{totaltasks})) { >+ $jobs{$jobid}{totaltasks} = $jobs{$jobid}{"Resource_List.nodes"} if(exists($jobs{$jobid}{"Resource_List.nodes"})); >+ $jobs{$jobid}{totaltasks} = $jobs{$jobid}{"Resource_List.ncpus"} if(exists($jobs{$jobid}{"Resource_List.ncpus"})); >+ } >+ if(!exists($jobs{$jobid}{spec})) { >+ $jobs{$jobid}{spec} = $jobs{$jobid}{"Resource_List.nodes"} if(!exists($jobs{$jobid}{"Resource_List.nodes"})); >+ $jobs{$jobid}{spec} = $jobs{$jobid}{"Resource_List.ncpus"} if(!exists($jobs{$jobid}{"Resource_List.ncpus"})); >+ >+ } > # check state > ($jobs{$jobid}{status},$jobs{$jobid}{detailedstatus}) = &get_state($jobs{$jobid}{job_state}, > $jobs{$jobid}{Hold_Types}); >+ $jobs{$jobid}{"totalcores"}=$jobs{$jobid}{"totaltasks"} if(!exists($jobs{$jobid}{"totalcores"})); > } > > open(OUT,"> $filename") || die "cannot open file $filename"; >@@ -274,23 +295,35 @@ > > if($mkey eq "vnodelist") { > if($ret ne "-") { >+# my $save=$ret; >+ $ret=~s/\(//gs;$ret=~s/\)//gs; > my @nodes = split(/\+/,$ret); >- my ($c,$nd,$num); >- for($c=0;$c<$#nodes;$c++) { >- if($nodes[$c]=~/([^\(\)\:]+)\:.*ncpus=(\d+)/s) { >- $nd=$1;$num=$2; >+ my ($c,$nd,$num,$rest); >+ for($c=0;$c<=$#nodes;$c++) { >+ # get nodename >+ if($nodes[$c]=~/^([^\:]+)\:(.*)$/s) { >+ ($nd,$rest)=($1,$2); >+ # get number of procs >+ if($rest=~/ncpus=(\d+)/) { >+ $num=$1; >+ } elsif($rest=~/mpiprocs=(\d+)/) { >+ $num=$1; >+ } else { >+ # default: 1 core >+ $num=1; >+ } > $nodes[$c]="$nd,$num"; >- } elsif($nodes[$c]=~/([^\(\)\:]+)\:.*mpiprocs=(\d+)/s) { >- $nd=$1;$num=$2; >- $nodes[$c]="$nd,$num"; >- } elsif($nodes[$c]=~/([^\(\)\:]+)/s) { >- $nd=$1;$num=1; >+ } elsif($nodes[$c]=~/^([^\:]+)$/s) { >+ $nd=$1; >+ $num=1; > $nodes[$c]="$nd,$num"; > } else { > print STDERR "Error in job node list: $nodes[$c]\n"; >+ $nodes[$c]="unknown,0"; > } > } > $ret="(".join(')(',@nodes).")"; >+# print "$save -> $ret\n"; > } > } > >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_nodes_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_nodes_info_LML.pl >index b78f72b..c4e62aa 100755 >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_nodes_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/PBS/da_nodes_info_LML.pl >@@ -86,6 +86,14 @@ > "resv_enable" => "", > "sharing" => "", > # unknown attributes >+ "resources_available.Cluster" => "", >+ "resources_available.IB" => "", >+ "resources_available.NodeInfo" => "", >+ "resources_available.Qlist" => "", >+ "resources_available.Rack" => "", >+ "resources_available.groupn" => "", >+ "resources_available.nodemem" => "", >+ > ); > > >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/PE/da_check_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/PE/da_check_info_LML.pl >old mode 100755 >new mode 100644 >index b2b4262..ceffec5 >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/PE/da_check_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/PE/da_check_info_LML.pl >@@ -11,51 +11,54 @@ > #*******************************************************************************/ > use strict; > >-sub check_rms { >+sub check_rms_PE { > my($rmsref,$cmdsref,$verbose)=@_; > my($key,$cmd); >- my $rc=0; >- >+ my $rc=1; >+ > my %cmdname=( > "job" => "poe", > ); >- >+ > my %cmdpath=( >- "job" => "/usr/bin/poe", >+ "job" => "/usr/bin/poe", > ); >- >+ > foreach $key (keys(%cmdname)) { >- if (exists($cmdsref->{"cmd_${key}info"})) { >- $cmd=$cmdsref->{"cmd_${key}info"}; >- } else { >- $cmd=$cmdpath{$key}; >- } >- if (! -f $cmd) { >- my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >- if(!$?) { >- chomp($cmdpath); >- $cmd=$cmdpath; >- print STDERR "$0: check_rms: found $cmdname{$key} by which ($cmd)\n" if($verbose); >- } else { >- last; >- } >- } >- if (-f $cmd) { >- $cmdsref->{"cmd_${key}info"}=$cmd; >- $rc=1; >- } >+ if (exists($cmdsref->{"cmd_${key}info"})) { >+ $cmd=$cmdsref->{"cmd_${key}info"}; >+ } else { >+ $cmd=$cmdpath{$key}; >+ } >+ if (! -f $cmd) { >+ my $cmdpath=`which $cmdname{$key} 2>/dev/null`; # last try: which >+ if(!$?) { >+ chomp($cmdpath); >+ $cmd=$cmdpath; >+ &report_if_verbose("%s","$0: check_rms_PE: found $cmdname{$key} by which ($cmd)\n"); >+ } >+ } >+ if (-f $cmd) { >+ $cmdsref->{"cmd_${key}info"}=$cmd; >+ } else { >+ &report_if_verbose("%s","$0: check_rms_PE: no cmd found for $cmdname{$key}\n"); >+ $rc=0; >+ } > } >- if ($rc) { >- $$rmsref="PE"; >+ if ($rc==1) { >+ $$rmsref="PE"; >+ &report_if_verbose("%s%s%s", "$0: check_rms_PE: found PE commands (", >+ join(",",(values(%{$cmdsref}))), >+ ")\n"); > } else { >- print STDERR "$0: check_rms: seems not to be a OpenMPI system\n" if($verbose); >+ &report_if_verbose("%s","$0: check_rms_PE: seems not to be a PE system\n"); > } >- >+ > return($rc); > } > > >-sub generate_step_rms { >+sub generate_step_rms_PE { > my($workflowxml, $laststep, $cmdsref)=@_; > my($step,$envs,$key,$ukey); > >@@ -79,4 +82,7 @@ > return($laststep); > } > >-1; >\ No newline at end of file >+$main::check_functions->{PE} =\&check_rms_PE; >+$main::generate_functions->{PE}=\&generate_step_rms_PE; >+ >+1; >diff --git a/rms/org.eclipse.ptp.rm.lml.da/rms/TORQUE/da_check_info_LML.pl b/rms/org.eclipse.ptp.rm.lml.da/rms/TORQUE/da_check_info_LML.pl >old mode 100755 >new mode 100644 >index 21c3658..af225dd >--- a/rms/org.eclipse.ptp.rm.lml.da/rms/TORQUE/da_check_info_LML.pl >+++ b/rms/org.eclipse.ptp.rm.lml.da/rms/TORQUE/da_check_info_LML.pl >@@ -11,10 +11,10 @@ > #*******************************************************************************/ > use strict; > >-sub check_rms { >+sub check_rms_TORQUE { > my($rmsref,$cmdsref,$verbose)=@_; > my($key, $cmd); >- my $rc=0; >+ my $rc=1; > > my %cmdname=( > "job" => "qstat", >@@ -38,14 +38,14 @@ > if (!$?) { > chomp($cmdpath); > $cmd=$cmdpath; >- print STDERR "$0: check_rms: found $cmdname{$key} by which ($cmd)\n" if($verbose); >- } else { >- last; >- } >+ &report_if_verbose("%s","$0: check_rms_TORQUE: found $cmdname{$key} by which ($cmd)\n"); >+ } > } > if (-f $cmd) { > $cmdsref->{"cmd_${key}info"}=$cmd; >- $rc=1; >+ } else { >+ &report_if_verbose("%s","$0: check_rms_TORQUE: no cmd found for $cmdname{$key}\n"); >+ $rc=0; > } > } > >@@ -55,25 +55,28 @@ > my $cmdversion=`$cmd 2>/dev/null`; > chomp($cmdversion); > if ($cmdversion=~/version/) { >- if ($cmdversion=~/PBSPro/) { >- print STDERR "$0: check_rms: PBSpro found\n" if($verbose); >- $rc=0; >+ if ($cmdversion=~/PBSPro/) { >+ &report_if_verbose("%s","$0: check_rms_TORQUE: PBSpro found\n"); >+ $rc=0; > } > } else { >- print STDERR "$0: check_rms: could not obtain version info from command $cmd\n" if($verbose); >+ &report_if_verbose("%s","$0: check_rms_TORQUE: could not obtain version info from command $cmd\n"); > } > } > >- if ($rc) { >+ if ($rc==1) { > $$rmsref = "TORQUE"; >+ &report_if_verbose("%s%s%s", "$0: check_rms_TORQUE: found TORQUE commands (", >+ join(",",(values(%{$cmdsref}))), >+ ")\n"); > } else { >- print STDERR "$0: check_rms: seems not to be a torque system\n" if($verbose); >+ &report_if_verbose("%s","$0: check_rms_TORQUE: seems not to be a TORQUE system\n"); > } > > return($rc); > } > >-sub generate_step_rms_torque { >+sub generate_step_rms_TORQUE { > my($workflowxml, $laststep, $cmdsref)=@_; > my($step,$envs,$key,$ukey); > >@@ -99,4 +102,7 @@ > > } > >-1; >\ No newline at end of file >+$main::check_functions->{TORQUE} =\&check_rms_TORQUE; >+$main::generate_functions->{TORQUE}=\&generate_step_rms_TORQUE; >+ >+1; >diff --git a/rms/org.eclipse.ptp.rm.lml.monitor.core/src/org/eclipse/ptp/rm/lml/monitor/core/LMLResourceManagerMonitor.java b/rms/org.eclipse.ptp.rm.lml.monitor.core/src/org/eclipse/ptp/rm/lml/monitor/core/LMLResourceManagerMonitor.java >index ffec672..14e68b5 100644 >--- a/rms/org.eclipse.ptp.rm.lml.monitor.core/src/org/eclipse/ptp/rm/lml/monitor/core/LMLResourceManagerMonitor.java >+++ b/rms/org.eclipse.ptp.rm.lml.monitor.core/src/org/eclipse/ptp/rm/lml/monitor/core/LMLResourceManagerMonitor.java >@@ -13,7 +13,11 @@ > import java.io.StringReader; > import java.io.StringWriter; > import java.util.ArrayList; >+import java.util.HashMap; >+import java.util.LinkedList; > import java.util.List; >+import java.util.Map; >+import java.util.Map.Entry; > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >@@ -41,10 +45,12 @@ > import org.eclipse.ptp.rm.jaxb.core.data.SimpleCommandType; > import org.eclipse.ptp.rm.lml.core.JobStatusData; > import org.eclipse.ptp.rm.lml.core.LMLManager; >+import org.eclipse.ptp.rm.lml.core.model.IPattern; > import org.eclipse.ptp.rm.lml.da.server.core.LMLDAServer; > import org.eclipse.ptp.rm.lml.internal.core.elements.CommandType; > import org.eclipse.ptp.rm.lml.internal.core.elements.DriverType; > import org.eclipse.ptp.rm.lml.internal.core.elements.RequestType; >+import org.eclipse.ptp.rm.lml.internal.core.model.Pattern; > import org.eclipse.ptp.rm.lml.monitor.LMLMonitorCorePlugin; > import org.eclipse.ptp.rm.lml.monitor.core.messages.Messages; > import org.eclipse.ptp.rmsystem.AbstractResourceManagerConfiguration; >@@ -166,6 +172,15 @@ > > private static final String LAYOUT = "layout";//$NON-NLS-1$ > private static final String LAYOUT_STRING = "layoutString";//$NON-NLS-1$ >+ private static final String PATTERN_GID_ATTR = "gid";//$NON-NLS-1$ >+ private static final String FILTER_TITLE_ATTR = "columnTitle";//$NON-NLS-1$ >+ private static final String FILTER_TYPE_ATTR = "type";//$NON-NLS-1$ >+ private static final String FILTER_RANGE_ATTR = "range";//$NON-NLS-1$ >+ private static final String FILTER_RELATION_ATTR = "relation";//$NON-NLS-1$ >+ private static final String FILTER_MAX_VALUE_RANGE_ATTR = "maxValueRange";//$NON-NLS-1$ >+ private static final String FILTER_MIN_VALUE_RANGE_ATTR = "minValueRange";//$NON-NLS-1$ >+ private static final String FILTER_RELATION_OPERATOR_ATTR = "relationOperartor";//$NON-NLS-1$ >+ private static final String FILTER_RELATION_VALUE_ATTR = "relationValue";//$NON-NLS-1$ > private static final String JOB_ID_ATTR = "job_id";//$NON-NLS-1$ > private static final String RM_ID_ATTR = "rm_id";//$NON-NLS-1$ > private static final String STDOUT_REMOTE_FILE_ATTR = "stdout_remote_path";//$NON-NLS-1$ >@@ -243,7 +258,7 @@ > return null; > } > >- private JobStatusData[] reload(IMemento memento) { >+ private JobStatusData[] reloadJobs(IMemento memento) { > final List<JobStatusData> jobs = new ArrayList<JobStatusData>(); > if (memento != null) { > final IMemento[] children = memento.getChildren(JOB_ID_ATTR); >@@ -257,7 +272,34 @@ > return jobs.toArray(new JobStatusData[jobs.size()]); > } > >- private void save(JobStatusData job, XMLMemento memento) { >+ private Map<String, List<IPattern>> reloadPattern(IMemento memento) { >+ final Map<String, List<IPattern>> pattern = new HashMap<String, List<IPattern>>(); >+ if (memento != null) { >+ final IMemento[] childrenPattern = memento.getChildren(PATTERN_GID_ATTR); >+ for (final IMemento childPattern : childrenPattern) { >+ final List<IPattern> filters = new LinkedList<IPattern>(); >+ final IMemento[] childrenFilter = childPattern.getChildren(FILTER_TITLE_ATTR); >+ for (final IMemento childFilter : childrenFilter) { >+ final IPattern filter = new Pattern(childFilter.getID(), childFilter.getString(FILTER_TYPE_ATTR)); >+ if (childFilter.getBoolean(FILTER_RANGE_ATTR)) { >+ filter.setRange(childFilter.getString(FILTER_MIN_VALUE_RANGE_ATTR), >+ childFilter.getString(FILTER_MAX_VALUE_RANGE_ATTR)); >+ } else if (childFilter.getBoolean(FILTER_RELATION_ATTR)) { >+ filter.setRelation(childFilter.getString(FILTER_RELATION_OPERATOR_ATTR), >+ childFilter.getString(FILTER_RELATION_VALUE_ATTR)); >+ } >+ filters.add(filter); >+ } >+ >+ if (filters.size() > 0) { >+ pattern.put(childPattern.getID(), filters); >+ } >+ } >+ } >+ return pattern; >+ } >+ >+ private void saveJob(JobStatusData job, XMLMemento memento) { > final IMemento jobMemento = memento.createChild(JOB_ID_ATTR, job.getJobId()); > jobMemento.putString(RM_ID_ATTR, job.getRmId()); > jobMemento.putString(STATE_ATTR, job.getState()); >@@ -269,6 +311,23 @@ > jobMemento.putString(OWNER_ATTR, job.getOwner()); > jobMemento.putString(OID_ATTR, job.getOid()); > >+ } >+ >+ private void savePattern(String key, List<IPattern> value, IMemento memento) { >+ final IMemento patternMemento = memento.createChild(PATTERN_GID_ATTR, key); >+ for (final IPattern filterValue : value) { >+ final IMemento filterMemento = patternMemento.createChild(FILTER_TITLE_ATTR, filterValue.getColumnTitle()); >+ filterMemento.putString(FILTER_TYPE_ATTR, filterValue.getType()); >+ filterMemento.putBoolean(FILTER_RANGE_ATTR, filterValue.isRange()); >+ filterMemento.putBoolean(FILTER_RELATION_ATTR, filterValue.isRelation()); >+ if (filterValue.isRange()) { >+ filterMemento.putString(FILTER_MIN_VALUE_RANGE_ATTR, filterValue.getMinValueRange()); >+ filterMemento.putString(FILTER_MAX_VALUE_RANGE_ATTR, filterValue.getMaxValueRange()); >+ } else if (filterValue.isRelation()) { >+ filterMemento.putString(FILTER_RELATION_OPERATOR_ATTR, filterValue.getRelationOperator()); >+ filterMemento.putString(FILTER_RELATION_VALUE_ATTR, filterValue.getRelationValue()); >+ } >+ } > } > > @Override >@@ -301,6 +360,7 @@ > if (memento != null) { > final String layout = fLMLManager.getCurrentLayout(getResourceManager().getUniqueName()); > final JobStatusData[] jobs = fLMLManager.getUserJobs(getResourceManager().getUniqueName()); >+ final Map<String, List<IPattern>> patternMap = fLMLManager.getCurrentPattern(getResourceManager().getUniqueName()); > > if (layout != null) { > final IMemento layoutMemento = memento.createChild(LAYOUT); >@@ -310,8 +370,14 @@ > if (jobs != null && jobs.length > 0) { > for (final JobStatusData status : jobs) { > if (!status.isRemoved()) { >- save(status, memento); >+ saveJob(status, memento); > } >+ } >+ } >+ >+ if (patternMap != null && patternMap.keySet().size() > 0) { >+ for (final Entry<String, List<IPattern>> pattern : patternMap.entrySet()) { >+ savePattern(pattern.getKey(), pattern.getValue(), memento); > } > } > } >@@ -354,42 +420,50 @@ > > final StringBuilder layout = new StringBuilder(); > JobStatusData[] jobs = null; >+ Map<String, List<IPattern>> pattern = null; > > if (memento != null) { >- final IMemento child = memento.getChild(LAYOUT); >- if (child != null) { >- final String childString = child.getString(LAYOUT_STRING); >- layout.append(childString); >+ final IMemento childLayout = memento.getChild(LAYOUT); >+ if (childLayout != null) { >+ final String childLayoutString = childLayout.getString(LAYOUT_STRING); >+ layout.append(childLayoutString); > } > >- jobs = reload(memento); >+ pattern = reloadPattern(memento); >+ jobs = reloadJobs(memento); > } >- /* >- * Initialize LML classes >- */ >- fLMLManager.openLgui(getResourceManager().getUniqueName(), getMonitorConfigurationRequestType(), layout, jobs); >- /* >- * Open connection and launch periodic job >- */ > final IRemoteConnection conn = getRemoteConnection(monitor); >- if (conn != null) { >- if (!conn.isOpen()) { >- try { >- conn.open(monitor); >- } catch (final RemoteConnectionException e) { >- throw new CoreException(new Status(IStatus.ERROR, LMLMonitorCorePlugin.getUniqueIdentifier(), e.getMessage())); >- } >+ if (conn == null) { >+ throw new CoreException(new Status(IStatus.ERROR, LMLMonitorCorePlugin.getUniqueIdentifier(), >+ Messages.LMLResourceManagerMonitor_unableToOpenConnection)); >+ } >+ >+ if (!conn.isOpen()) { >+ try { >+ conn.open(monitor); >+ } catch (final RemoteConnectionException e) { >+ throw new CoreException(new Status(IStatus.ERROR, LMLMonitorCorePlugin.getUniqueIdentifier(), e.getMessage())); > } > if (!conn.isOpen()) { > throw new CoreException(new Status(IStatus.ERROR, LMLMonitorCorePlugin.getUniqueIdentifier(), > Messages.LMLResourceManagerMonitor_unableToOpenConnection)); > } >- synchronized (this) { >- if (fMonitorJob == null) { >- fMonitorJob = new MonitorJob(Messages.LMLResourceManagerMonitor_LMLMonitorJob, conn); >- } >- fMonitorJob.schedule(); >+ } >+ >+ /* >+ * Initialize LML classes >+ */ >+ fLMLManager.openLgui(getResourceManager().getUniqueName(), conn.getUsername(), getMonitorConfigurationRequestType(), >+ layout, jobs, pattern); >+ >+ /* >+ * Start monitoring job >+ */ >+ synchronized (this) { >+ if (fMonitorJob == null) { >+ fMonitorJob = new MonitorJob(Messages.LMLResourceManagerMonitor_LMLMonitorJob, conn); > } >+ fMonitorJob.schedule(); > } > > /* >diff --git a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/ILMLUIConstants.java b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/ILMLUIConstants.java >index 2276730..3c8d23b 100644 >--- a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/ILMLUIConstants.java >+++ b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/ILMLUIConstants.java >@@ -32,4 +32,5 @@ > public static final String VIEW_TABLE_2 = "joblistwait"; //$NON-NLS-1$ > > public static final int INTERNAL_ERROR = 150; >+ public static final String COLUMN_STATUS = "status";//$NON-NLS-1$ > } >diff --git a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/providers/FilterDataRow.java b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/providers/FilterDataRow.java >new file mode 100644 >index 0000000..55cb3c0 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/providers/FilterDataRow.java >@@ -0,0 +1,300 @@ >+package org.eclipse.ptp.rm.lml.ui.providers; >+ >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Combo; >+import org.eclipse.swt.widgets.Text; >+ >+/** >+ * This class contains all the information about a row in the FilterDialog. >+ * >+ * For every active column (with exception) in a table one object of this class >+ * should be generated. >+ */ >+public class FilterDataRow { >+ >+ // Type of the data displayed in the column >+ private String type; >+ >+ // To activate the filter function for this row >+ private final Button checkbox; >+ >+ // To active a relation; only for the types numeric and date >+ private Button radioButoonRelation; >+ >+ // To active a range; only for the types numeric and date >+ private Button radioButtonRange; >+ >+ // The value for comparison, only for type alpha >+ private Text valueAlpha; >+ >+ // The operator how to compare a value of the input with an given value; only for the type numeric and date >+ private Combo relationComboNumericDate; >+ >+ // The value for comparison; only for the type numeric >+ private Text valueNumeric; >+ >+ // The value for comparison; only for the type date >+ private Button valueDate; >+ >+ // The minimal value in a range; only for the type numeric >+ private Text minValueNumeric; >+ >+ // The maximal value in a range; only for the type numeric >+ private Text maxValueNumeric; >+ >+ // The minimal value in a range; only for the type date >+ private Button minValueDate; >+ >+ // The maximal value in a range; only for the type date >+ private Button maxValueDate; >+ >+ // The value for comparison; only for the type alpha >+ private Combo relationComboAlpha; >+ >+ /** >+ * Constructor. >+ * >+ * @param type >+ * @param checkbox >+ */ >+ public FilterDataRow(String type, Button checkbox) { >+ this.type = type; >+ this.checkbox = checkbox; >+ if (type == null) { >+ this.type = "alpha"; >+ } >+ } >+ >+ /** >+ * Adding a input button for the maximal value (date). >+ * >+ * @param value >+ */ >+ public void addMaxValueDate(Button value) { >+ maxValueDate = value; >+ } >+ >+ /** >+ * Adding a input text for the maximal value (numeric). >+ * >+ * @param value >+ */ >+ public void addMaxValueNumeric(Text value) { >+ maxValueNumeric = value; >+ } >+ >+ /** >+ * Adding a input button for the minimal value (date). >+ * >+ * @param value >+ */ >+ public void addMinValueDate(Button value) { >+ minValueDate = value; >+ } >+ >+ /** >+ * Adding a input text for the minimal value (numeric). >+ * >+ * @param value >+ */ >+ public void addMinValueNumeric(Text value) { >+ minValueNumeric = value; >+ } >+ >+ /** >+ * Adding a radio button for range. >+ * >+ * @param button >+ */ >+ public void addRadioRange(Button button) { >+ radioButtonRange = button; >+ } >+ >+ /** >+ * Adding a radio button for relation. >+ * >+ * @param button >+ */ >+ public void addRadioRelation(Button button) { >+ radioButoonRelation = button; >+ } >+ >+ /** >+ * Adding a combo box which includes all possible relation operators for alpha. >+ * >+ * @param relation >+ */ >+ public void addRelationComboAlpha(Combo relation) { >+ relationComboAlpha = relation; >+ } >+ >+ /** >+ * Adding a combo box which includes all possible relation operators for numeric and date. >+ * >+ * @param relation >+ */ >+ public void addRelationComboNumericDate(Combo relation) { >+ relationComboNumericDate = relation; >+ } >+ >+ /** >+ * Adding a input text for the comparison value (alpha). >+ * >+ * @param value >+ */ >+ public void addRelationValueAlpha(Text value) { >+ valueAlpha = value; >+ } >+ >+ /** >+ * Adding a input button for the comparison value (date). >+ * >+ * @param value >+ */ >+ public void addRelationValueDate(Button value) { >+ valueDate = value; >+ } >+ >+ /** >+ * Adding a input text for comparison value (numeric). >+ * >+ * @param value >+ */ >+ public void addRelationValueNumeric(Text value) { >+ valueNumeric = value; >+ } >+ >+ public Button getCheckbox() { >+ return checkbox; >+ } >+ >+ /** >+ * Getting the button with the maximal value (date). >+ * >+ * @return button >+ */ >+ public Button getMaxValueButtonDate() { >+ return maxValueDate; >+ } >+ >+ /** >+ * Getting the text with the maximal value (numeric). >+ * >+ * @return text >+ */ >+ public Text getMaxValueTextNumeric() { >+ return maxValueNumeric; >+ } >+ >+ /** >+ * Getting the button with the minimal value (date). >+ * >+ * @return button >+ */ >+ public Button getMinValueButtonDate() { >+ return minValueDate; >+ } >+ >+ /** >+ * Getting the text with the minimal value (numeric). >+ * >+ * @return text >+ */ >+ public Text getMinValueTextNumeric() { >+ return minValueNumeric; >+ } >+ >+ /** >+ * Getting the button for range. >+ * >+ * @return button for range >+ */ >+ public Button getRadioButtonRange() { >+ return radioButtonRange; >+ } >+ >+ /** >+ * Getting the button for relation. >+ * >+ * @return button for relation. >+ */ >+ public Button getRadioButtonRelation() { >+ return radioButoonRelation; >+ } >+ >+ /** >+ * Getting the combo box including all comparison operators (alpha). >+ * >+ * @return combo box >+ */ >+ public Combo getRelationComboAlpha() { >+ return relationComboAlpha; >+ } >+ >+ /** >+ * Getting the combo box including all comparison operators (numeric and date). >+ * >+ * @return combo box >+ */ >+ public Combo getRelationComboNumericDate() { >+ return relationComboNumericDate; >+ } >+ >+ /** >+ * Getting the button with the comparison value (date). >+ * >+ * @return button >+ */ >+ public Button getRelationValueButtonDate() { >+ return valueDate; >+ } >+ >+ /** >+ * Getting the text with the comparison value (alpha). >+ * >+ * @return text >+ */ >+ public Text getRelationValueTextAlpha() { >+ return valueAlpha; >+ } >+ >+ /** >+ * Getting the text with the comparison value (numeric). >+ * >+ * @return >+ */ >+ public Text getRelationValueTextNumeric() { >+ return valueNumeric; >+ } >+ >+ /** >+ * Getting the title of the row >+ * >+ * @return title >+ */ >+ public String getTitle() { >+ return checkbox.getText(); >+ } >+ >+ /** >+ * Getting the sort type of the row. >+ * >+ * @return type >+ */ >+ public String getType() { >+ return type; >+ } >+ >+ /** >+ * Checks if the checkbox is set. >+ * >+ * @return >+ */ >+ public boolean isCheckboxSet() { >+ return checkbox.getSelection(); >+ } >+ >+ public void setCheckbox(boolean value) { >+ checkbox.setSelection(value); >+ } >+} >\ No newline at end of file >diff --git a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/providers/FilterDialog.java b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/providers/FilterDialog.java >new file mode 100644 >index 0000000..f0ff742 >--- /dev/null >+++ b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/providers/FilterDialog.java >@@ -0,0 +1,613 @@ >+package org.eclipse.ptp.rm.lml.ui.providers; >+ >+import java.text.DecimalFormat; >+import java.text.NumberFormat; >+import java.util.LinkedList; >+import java.util.List; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.dialogs.ErrorDialog; >+import org.eclipse.jface.dialogs.IDialogConstants; >+import org.eclipse.jface.layout.GridDataFactory; >+import org.eclipse.ptp.rm.lml.core.LMLManager; >+import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.core.model.IPattern; >+import org.eclipse.ptp.rm.lml.core.model.ITableColumnLayout; >+import org.eclipse.ptp.rm.lml.internal.core.model.Pattern; >+import org.eclipse.ptp.rm.lml.ui.ILMLUIConstants; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.ScrolledComposite; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.events.VerifyEvent; >+import org.eclipse.swt.events.VerifyListener; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Combo; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.DateTime; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.swt.widgets.Text; >+ >+public class FilterDialog extends Dialog { >+ >+ public class SelectDateAdpater extends SelectionAdapter { >+ >+ private final Button button; >+ >+ private String date; >+ >+ private Button comparisonButton = null; >+ >+ public SelectDateAdpater(Button button) { >+ super(); >+ this.button = button; >+ if (button.getText() == null) { >+ date = new String(); >+ } else { >+ date = button.getText(); >+ } >+ } >+ >+ public SelectDateAdpater(Button button, Button comparisonButton) { >+ super(); >+ this.button = button; >+ this.comparisonButton = comparisonButton; >+ date = comparisonButton.getText(); >+ } >+ >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ final Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); >+ dialog.setLayout(new GridLayout(5, false)); >+ >+ if (button.getText().length() == 0 && comparisonButton != null && comparisonButton.getText().length() > 0) { >+ date = comparisonButton.getText(); >+ } >+ >+ final DateTime calendar = new DateTime(dialog, SWT.CALENDAR | SWT.BORDER); >+ final DateTime time = new DateTime(dialog, SWT.TIME); >+ >+ calendar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 5, 1)); >+ time.setLayoutData(new GridData()); >+ >+ final Button ok = new Button(dialog, SWT.PUSH); >+ ok.setText("OK"); >+ ok.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ ok.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ final NumberFormat formatter = new DecimalFormat("00"); >+ button.setText(calendar.getYear() + "-" + formatter.format(calendar.getMonth() + 1) + "-" >+ + formatter.format(calendar.getDay()) + " " + formatter.format(time.getHours()) + ":" >+ + formatter.format(time.getMinutes()) + ":" + formatter.format(time.getSeconds())); >+ date = button.getText(); >+ dialog.close(); >+ } >+ }); >+ >+ final Button delete = new Button(dialog, SWT.PUSH); >+ delete.setText("Delete"); >+ delete.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ delete.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ button.setText(""); >+ date = new String(); >+ dialog.close(); >+ } >+ }); >+ >+ final Button cancel = new Button(dialog, SWT.PUSH); >+ cancel.setText("Cancel"); >+ cancel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ cancel.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ dialog.close(); >+ } >+ }); >+ >+ if (!date.isEmpty()) { >+ calendar.setDate(Integer.valueOf(date.substring(0, 4)), Integer.valueOf(date.substring(5, 7)) - 1, >+ Integer.valueOf(date.substring(8, 10))); >+ time.setTime(Integer.valueOf(date.substring(11, 13)), Integer.valueOf(date.substring(14, 16)), >+ Integer.valueOf(date.substring(17))); >+ } >+ >+ dialog.setDefaultButton(ok); >+ dialog.pack(); >+ dialog.open(); >+ } >+ >+ } >+ >+ private FilterDataRow[] filterData; >+ >+ private final ILguiItem lguiItem; >+ private final String gid; >+ >+ private final Shell shell; >+ >+ private final List<IPattern> filterOld; >+ >+ public FilterDialog(Shell parentShell, String gid) { >+ super(parentShell); >+ lguiItem = LMLManager.getInstance().getSelectedLguiItem(); >+ this.gid = gid; >+ filterOld = lguiItem.getPattern(gid); >+ setShellStyle(SWT.RESIZE | SWT.APPLICATION_MODAL); >+ this.shell = parentShell; >+ } >+ >+ private boolean includeStatus(ITableColumnLayout[] columnLayouts) { >+ for (final ITableColumnLayout columnLayout : columnLayouts) { >+ if (columnLayout.getTitle().equals(ILMLUIConstants.COLUMN_STATUS)) { >+ return true; >+ } >+ } >+ return false; >+ } >+ >+ @Override >+ protected void buttonPressed(int buttonId) { >+ >+ if (buttonId == IDialogConstants.CANCEL_ID) { >+ // Cancel Button >+ LMLManager.getInstance().filterLgui(gid, filterOld); >+ lguiItem.setPattern(gid, filterOld); >+ close(); >+ return; >+ } >+ >+ boolean error = false; >+ for (final FilterDataRow row : filterData) { >+ >+ if (!row.isCheckboxSet()) { >+ continue; >+ } >+ if (row.getType().equals("alpha")) { >+ if (row.getRelationValueTextAlpha().getText().equals("")) { >+ error = true; >+ break; >+ } >+ } else { >+ if (row.getRadioButtonRelation().getSelection()) { >+ if (row.getType().equals("numeric")) { >+ if (row.getRelationValueTextNumeric().getText().equals("")) { >+ error = true; >+ break; >+ } >+ } else if (row.getType().equals("date")) { >+ if (row.getRelationValueButtonDate().getText().equals("")) { >+ error = true; >+ break; >+ } >+ } >+ } else if (row.getRadioButtonRange().getSelection()) { >+ if (row.getType().equals("numeric")) { >+ if (row.getMinValueTextNumeric().getText().equals("") >+ || row.getMaxValueTextNumeric().equals("") >+ || (Integer.parseInt(row.getMinValueTextNumeric().getText()) >= Integer.parseInt(row >+ .getMaxValueTextNumeric().getText()))) { >+ error = true; >+ break; >+ } >+ } else if (row.getType().equals("date")) { >+ if (row.getMinValueButtonDate().getText().equals("") || row.getMaxValueButtonDate().equals("") >+ || (row.getMinValueButtonDate().getText().compareTo(row.getMaxValueButtonDate().getText()) >= 0)) { >+ error = true; >+ break; >+ } >+ } >+ } >+ } >+ } >+ >+ if (error) { >+ final Status status = new Status( >+ IStatus.ERROR, >+ "Missing/wrong arguments", >+ 0, >+ "- there is/are one/more requested value(s) missing\n- or the minimal value of a range is bigger than the maximal value.", >+ null); >+ final ErrorDialog dialog = new ErrorDialog( >+ shell, >+ "Missing/wrong arguments", >+ "An error occured!", >+ status, IStatus.ERROR); >+ dialog.open(); >+ return; >+ } >+ >+ final List<IPattern> filterValues = new LinkedList<IPattern>(); >+ // Apply and Okay Button >+ for (final FilterDataRow row : filterData) { >+ boolean complete = false; >+ if (!row.isCheckboxSet()) { >+ continue; >+ } >+ final IPattern pattern = new Pattern(row.getTitle(), row.getType()); >+ if (row.getType().equals("alpha")) { >+ pattern.setRelation(row.getRelationComboAlpha().getText(), row.getRelationValueTextAlpha().getText()); >+ complete = true; >+ } else { >+ if (row.getRadioButtonRelation().getSelection()) { >+ if (row.getType().equals("numeric")) { >+ pattern.setRelation(row.getRelationComboNumericDate().getText(), row.getRelationValueTextNumeric() >+ .getText()); >+ complete = true; >+ } else if (row.getType().equals("date")) { >+ pattern.setRelation(row.getRelationComboNumericDate().getText(), row.getRelationValueButtonDate().getText()); >+ complete = true; >+ } >+ } else if (row.getRadioButtonRange().getSelection()) { >+ if (row.getType().equals("numeric")) { >+ pattern.setRange(row.getMinValueTextNumeric().getText(), row.getMaxValueTextNumeric().getText()); >+ complete = true; >+ } else if (row.getType().equals("date")) { >+ pattern.setRange(row.getMinValueButtonDate().getText(), row.getMaxValueButtonDate().getText()); >+ complete = true; >+ } >+ } >+ } >+ if (complete) { >+ filterValues.add(pattern); >+ } >+ } >+ >+ lguiItem.setPattern(gid, filterValues); >+ LMLManager.getInstance().filterLgui(gid, filterValues); >+ >+ if (buttonId == IDialogConstants.OK_ID) { >+ // Okay Button >+ close(); >+ } >+ >+ } >+ >+ @Override >+ protected void configureShell(Shell shell) { >+ super.configureShell(shell); >+ shell.setText("Filters"); >+ >+ } >+ >+ @Override >+ protected void createButtonsForButtonBar(Composite parent) { >+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); >+ createButton(parent, 5, "Apply", false); >+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); >+ } >+ >+ @Override >+ protected Control createDialogArea(Composite parent) { >+ >+ final ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); >+ GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).hint(SWT.DEFAULT, SWT.DEFAULT).grab(true, true) >+ .applyTo(scrolledComposite); >+ final Composite composite = new Composite(scrolledComposite, SWT.NONE); >+ boolean error = false; >+ if (lguiItem == null || lguiItem.getTableHandler() == null) { >+ error = true; >+ } >+ ITableColumnLayout[] columnLayouts = new ITableColumnLayout[0]; >+ if (!error) { >+ columnLayouts = lguiItem.getTableHandler().getActiveTableColumnLayout(gid); >+ } >+ if (columnLayouts.length == 0) { >+ error = true; >+ } >+ if (error) { >+ final Label errorLabel = new Label(composite, SWT.NONE); >+ errorLabel.setText("An error occured!"); >+ filterData = new FilterDataRow[0]; >+ return composite; >+ } >+ >+ int length = columnLayouts.length; >+ if (gid.equals(ILMLUIConstants.VIEW_TABLE_1) >+ && includeStatus(columnLayouts)) { >+ length = length - 1; >+ } >+ >+ filterData = new FilterDataRow[length]; >+ >+ final VerifyListener numericListener = new VerifyListener() { >+ >+ public void verifyText(VerifyEvent e) { >+ final String s = ((Text) e.widget).getText() + e.text; >+ e.doit = s.matches("0|([1-9][0-9]*)"); >+ } >+ }; >+ >+ final VerifyListener alphaListener = new VerifyListener() { >+ >+ public void verifyText(VerifyEvent e) { >+ final String s = ((Text) e.widget).getText() + e.text; >+ e.doit = s.matches(".+"); >+ } >+ }; >+ >+ composite.setLayout(new GridLayout(2, false)); >+ >+ int dif = 0; >+ for (int i = 0; i < columnLayouts.length; i++) { >+ if (gid.equals(ILMLUIConstants.VIEW_TABLE_1) && columnLayouts[i].getTitle().equals(ILMLUIConstants.COLUMN_STATUS)) { >+ dif = 1; >+ continue; >+ } >+ >+ final String type = columnLayouts[i].getOrder(); >+ >+ final Button checkbox = new Button(composite, SWT.CHECK); >+ >+ checkbox.setText(columnLayouts[i].getTitle()); >+ checkbox.setLayoutData(new GridData()); >+ >+ final FilterDataRow row = new FilterDataRow(type, checkbox); >+ >+ if (type == "alpha") { >+ // Input in text elements with choosing a relation operator before >+ final Composite compositeText = new Composite(composite, SWT.NONE); >+ compositeText.setLayout(new GridLayout(2, false)); >+ final Combo relationCombo = new Combo(compositeText, SWT.READ_ONLY); >+ relationCombo.setItems(new String[] { "=", "!=", "=~", "!~" }); >+ relationCombo.select(0); >+ relationCombo.setLayoutData(new GridData()); >+ relationCombo.setEnabled(false); >+ row.addRelationComboAlpha(relationCombo); >+ >+ final Text relationValue = new Text(compositeText, SWT.LEAD | SWT.SINGLE); >+ relationValue.setEnabled(false); >+ relationValue.addVerifyListener(alphaListener); >+ relationValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ row.addRelationValueAlpha(relationValue); >+ >+ compositeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ } else { >+ // Choose between 2 different kinds of input >+ final Composite compositeRadio = new Composite(composite, SWT.NONE); >+ compositeRadio.setLayout(new GridLayout(2, false)); >+ // 1. A relation to one number >+ final Button radioButtonRelation = new Button(compositeRadio, SWT.RADIO); >+ radioButtonRelation.setLayoutData(new GridData()); >+ radioButtonRelation.setSelection(true); >+ radioButtonRelation.setEnabled(false); >+ >+ row.addRadioRelation(radioButtonRelation); >+ >+ final Composite compositeRelation = new Composite(compositeRadio, SWT.NONE); >+ compositeRelation.setLayout(new GridLayout(2, false)); >+ final Combo relations = new Combo(compositeRelation, SWT.READ_ONLY); >+ relations.setItems(new String[] { "=", "<", "<=", ">", ">=", >+ "!=" }); >+ relations.select(0); >+ >+ relations.setEnabled(false); >+ relations.setLayoutData(new GridData(GridData.FILL)); >+ row.addRelationComboNumericDate(relations); >+ >+ if (type == "numeric") { >+ final Text relationValueText = new Text(compositeRelation, SWT.SINGLE | SWT.TRAIL); >+ relationValueText.addVerifyListener(numericListener); >+ relationValueText.setEnabled(false); >+ relationValueText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ row.addRelationValueNumeric(relationValueText); >+ } else { >+ final Button relationValueButton = new Button(compositeRelation, SWT.NONE); >+ relationValueButton.setEnabled(false); >+ relationValueButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ relationValueButton.addSelectionListener(new SelectDateAdpater(relationValueButton)); >+ row.addRelationValueDate(relationValueButton); >+ } >+ >+ radioButtonRelation.addSelectionListener(new SelectionListener() { >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ final boolean selected = radioButtonRelation.getSelection(); >+ if (row.getRelationComboNumericDate() != null) { >+ row.getRelationComboNumericDate().setEnabled(selected); >+ } >+ if (row.getRelationValueTextNumeric() != null) { >+ row.getRelationValueTextNumeric().setEnabled(selected); >+ } >+ if (row.getRelationValueButtonDate() != null) { >+ row.getRelationValueButtonDate().setEnabled(selected); >+ } >+ } >+ }); >+ >+ compositeRelation.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ // 2. A range between two numbers >+ final Button radioButtonRange = new Button(compositeRadio, SWT.RADIO); >+ radioButtonRange.setEnabled(false); >+ radioButtonRange.setLayoutData(new GridData()); >+ >+ row.addRadioRange(radioButtonRange); >+ >+ final Composite compositeRange = new Composite(compositeRadio, SWT.NONE); >+ compositeRange.setLayout(new GridLayout(3, false)); >+ if (type == "numeric") { >+ final Text textValueMin = new Text(compositeRange, SWT.SINGLE | SWT.TRAIL); >+ textValueMin.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ textValueMin.setEnabled(false); >+ textValueMin.addVerifyListener(numericListener); >+ >+ // TODO replace with another combo box >+ final Label labelMinus = new Label(compositeRange, SWT.NONE); >+ labelMinus.setText(" - "); >+ labelMinus.setLayoutData(new GridData(GridData.FILL)); >+ >+ final Text textValueMax = new Text(compositeRange, SWT.SINGLE | SWT.TRAIL); >+ textValueMax.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ textValueMax.setEnabled(false); >+ textValueMax.addVerifyListener(numericListener); >+ >+ row.addMinValueNumeric(textValueMin); >+ row.addMaxValueNumeric(textValueMax); >+ } else { >+ final Button buttonValueMin = new Button(compositeRange, SWT.NONE); >+ buttonValueMin.setEnabled(false); >+ buttonValueMin.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ final Label labelMinus = new Label(compositeRange, SWT.NONE); >+ labelMinus.setText(" - "); >+ labelMinus.setLayoutData(new GridData(GridData.FILL)); >+ >+ final Button buttonValueMax = new Button(compositeRange, SWT.NONE); >+ buttonValueMax.setEnabled(false); >+ buttonValueMax.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ buttonValueMin.addSelectionListener(new SelectDateAdpater(buttonValueMin, buttonValueMax)); >+ buttonValueMax.addSelectionListener(new SelectDateAdpater(buttonValueMax, buttonValueMin)); >+ >+ row.addMinValueDate(buttonValueMin); >+ row.addMaxValueDate(buttonValueMax); >+ } >+ >+ radioButtonRange.addSelectionListener(new SelectionListener() { >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ final boolean selected = radioButtonRange.getSelection(); >+ if (row.getMinValueTextNumeric() != null >+ && row.getMaxValueTextNumeric() != null) { >+ row.getMinValueTextNumeric().setEnabled(selected); >+ row.getMaxValueTextNumeric().setEnabled(selected); >+ } >+ if (row.getMinValueButtonDate() != null >+ && row.getMaxValueButtonDate() != null) { >+ row.getMinValueButtonDate().setEnabled(selected); >+ row.getMaxValueButtonDate().setEnabled(selected); >+ } >+ } >+ }); >+ >+ compositeRange.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ compositeRadio.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ } >+ >+ checkbox.addSelectionListener(new SelectionListener() { >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ final boolean selected = checkbox.getSelection(); >+ if (row.getRelationValueTextAlpha() != null) { >+ row.getRelationValueTextAlpha().setEnabled(selected); >+ } >+ if (row.getRelationComboAlpha() != null) { >+ row.getRelationComboAlpha().setEnabled(selected); >+ } >+ if (row.getRadioButtonRelation() != null && row.getRadioButtonRange() != null) { >+ row.getRadioButtonRelation().setEnabled(selected); >+ row.getRadioButtonRange().setEnabled(checkbox.getSelection()); >+ if (row.getRadioButtonRelation().getSelection()) { >+ if (row.getRelationComboNumericDate() != null) { >+ row.getRelationComboNumericDate().setEnabled(selected); >+ } >+ if (row.getRelationValueTextNumeric() != null) { >+ row.getRelationValueTextNumeric().setEnabled(selected); >+ } >+ if (row.getRelationValueButtonDate() != null) { >+ row.getRelationValueButtonDate().setEnabled( >+ selected); >+ } >+ } else { >+ if (row.getMinValueTextNumeric() != null && row.getMaxValueTextNumeric() != null) { >+ row.getMinValueTextNumeric().setEnabled(selected); >+ row.getMaxValueTextNumeric().setEnabled(selected); >+ } >+ if (row.getMinValueButtonDate() != null && row.getMaxValueButtonDate() != null) { >+ row.getMinValueButtonDate().setEnabled(selected); >+ row.getMaxValueButtonDate().setEnabled(selected); >+ } >+ } >+ } >+ } >+ }); >+ >+ final List<IPattern> oldFilters = lguiItem.getPattern(gid); >+ if (oldFilters.size() > 0) { >+ for (final IPattern filter : oldFilters) { >+ if (!filter.getColumnTitle().equals(row.getTitle())) { >+ continue; >+ } >+ row.getCheckbox().setSelection(true); >+ if (filter.getType().equals("alpha")) { >+ row.getRelationValueTextAlpha().setText(filter.getRelationValue()); >+ row.getRelationValueTextAlpha().setEnabled(true); >+ final String[] items = row.getRelationComboAlpha().getItems(); >+ row.getRelationComboAlpha().setEnabled(true); >+ for (int j = 0; j < items.length; j++) { >+ if (filter.getRelationOperator().equals(items[j])) { >+ row.getRelationComboAlpha().select(j); >+ } >+ } >+ } else { >+ row.getRadioButtonRange().setEnabled(true); >+ row.getRadioButtonRelation().setEnabled(true); >+ if (filter.isRange()) { >+ row.getRadioButtonRange().setSelection(true); >+ row.getRadioButtonRelation().setSelection(false); >+ if (filter.getType().equals("numeric")) { >+ row.getMinValueTextNumeric().setText(filter.getMinValueRange()); >+ row.getMaxValueTextNumeric().setText(filter.getMaxValueRange()); >+ row.getMinValueTextNumeric().setEnabled(true); >+ row.getMaxValueTextNumeric().setEnabled(true); >+ } else { >+ row.getMinValueButtonDate().setText(filter.getMinValueRange()); >+ row.getMaxValueButtonDate().setText(filter.getMaxValueRange()); >+ row.getMinValueButtonDate().setEnabled(true); >+ row.getMaxValueButtonDate().setEnabled(true); >+ } >+ } else if (filter.isRelation()) { >+ row.getRadioButtonRelation().setSelection(true); >+ row.getRelationComboNumericDate().setEnabled(true); >+ final String[] items = row.getRelationComboNumericDate().getItems(); >+ for (int j = 0; j < items.length; j++) { >+ if (filter.getRelationOperator().equals(items[j])) { >+ row.getRelationComboNumericDate().select(j); >+ } >+ } >+ if (filter.getType().equals("numeric")) { >+ row.getRelationValueTextNumeric().setText(filter.getRelationValue()); >+ row.getRelationValueTextNumeric().setEnabled(true); >+ } else { >+ row.getRelationValueButtonDate().setText(filter.getRelationValue()); >+ row.getRelationValueButtonDate().setEnabled(true); >+ } >+ } >+ } >+ } >+ } >+ >+ filterData[i - dif] = row; >+ } >+ >+ scrolledComposite.setContent(composite); >+ >+ scrolledComposite.setExpandHorizontal(true); >+ scrolledComposite.setExpandVertical(true); >+ >+ scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); >+ scrolledComposite.setSize(100, 400); >+ >+ return scrolledComposite; >+ } >+} >diff --git a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/NodesView.java b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/NodesView.java >index 891472b..911bd62 100644 >--- a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/NodesView.java >+++ b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/NodesView.java >@@ -18,6 +18,7 @@ > import org.eclipse.ptp.rm.lml.core.events.ILguiRemovedEvent; > import org.eclipse.ptp.rm.lml.core.events.IMarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.ISelectObjectEvent; >+import org.eclipse.ptp.rm.lml.core.events.ITableFilterEvent; > import org.eclipse.ptp.rm.lml.core.events.ITableSortedEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnmarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnselectedObjectEvent; >@@ -80,6 +81,11 @@ > } > } > >+ public void handleEvent(ITableFilterEvent event) { >+ // TODO Auto-generated method stub >+ >+ } >+ > public void handleEvent(ITableSortedEvent e) { > } > >diff --git a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/TableView.java b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/TableView.java >index 410511a..eb100b6 100644 >--- a/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/TableView.java >+++ b/rms/org.eclipse.ptp.rm.lml.ui/src/org/eclipse/ptp/rm/lml/ui/views/TableView.java >@@ -12,12 +12,18 @@ > package org.eclipse.ptp.rm.lml.ui.views; > > import java.util.ArrayList; >+import java.util.LinkedList; > import java.util.List; > > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; >+import org.eclipse.jface.action.Action; >+import org.eclipse.jface.action.ActionContributionItem; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.MenuManager; >+import org.eclipse.jface.action.Separator; > import org.eclipse.jface.layout.TreeColumnLayout; > import org.eclipse.jface.util.SafeRunnable; > import org.eclipse.jface.viewers.CellLabelProvider; >@@ -35,19 +41,23 @@ > import org.eclipse.ptp.rm.lml.core.events.ILguiRemovedEvent; > import org.eclipse.ptp.rm.lml.core.events.IMarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.ISelectObjectEvent; >+import org.eclipse.ptp.rm.lml.core.events.ITableFilterEvent; > import org.eclipse.ptp.rm.lml.core.events.ITableSortedEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnmarkObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.IUnselectedObjectEvent; > import org.eclipse.ptp.rm.lml.core.events.IViewUpdateEvent; > import org.eclipse.ptp.rm.lml.core.listeners.ILMLListener; > import org.eclipse.ptp.rm.lml.core.model.ILguiItem; >+import org.eclipse.ptp.rm.lml.core.model.IPattern; > import org.eclipse.ptp.rm.lml.core.model.ITableColumnLayout; > import org.eclipse.ptp.rm.lml.internal.core.model.Cell; > import org.eclipse.ptp.rm.lml.internal.core.model.LMLColor; >+import org.eclipse.ptp.rm.lml.internal.core.model.Pattern; > import org.eclipse.ptp.rm.lml.internal.core.model.Row; > import org.eclipse.ptp.rm.lml.ui.UIUtils; > import org.eclipse.ptp.rm.lml.ui.messages.Messages; > import org.eclipse.ptp.rm.lml.ui.providers.EventForwarder; >+import org.eclipse.ptp.rm.lml.ui.providers.FilterDialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ControlAdapter; > import org.eclipse.swt.events.ControlEvent; >@@ -67,6 +77,7 @@ > import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Menu; > import org.eclipse.swt.widgets.MenuItem; >+import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Tree; > import org.eclipse.swt.widgets.TreeColumn; > import org.eclipse.swt.widgets.TreeItem; >@@ -198,6 +209,35 @@ > > } > >+ public void handleEvent(final ITableFilterEvent event) { >+ if (event.getGid().equals(gid)) { >+ UIUtils.safeRunSyncInUIThread(new SafeRunnable() { >+ public void run() throws Exception { >+ if (composite != null && fLguiItem != null && viewCreated) { >+ if (componentAdded) { >+ fLguiItem.getObjectStatus().removeComponent(eventForwarder); >+ componentAdded = false; >+ } >+ saveColumnLayout(); >+ disposeTable(); >+ viewCreated = false; >+ } >+ if (composite != null && !viewCreated) { >+ fLguiItem = lmlManager.getSelectedLguiItem(); >+ if (fLguiItem != null) { >+ createTable(); >+ viewCreated = true; >+ if (fLguiItem.getObjectStatus() != null) { >+ fLguiItem.getObjectStatus().addComponent(eventForwarder); >+ componentAdded = true; >+ } >+ } >+ } >+ } >+ }); >+ } >+ } >+ > /* > * (non-Javadoc) > * >@@ -210,7 +250,11 @@ > && tree.getSortColumn() != null) { > fLguiItem.getTableHandler().sort(gid, SWT.UP, getSortIndex(), tree.getSortDirection()); > } >- setViewerInput(); >+ if (fLguiItem.getPattern(gid).size() > 0) { >+ setViewerInput(fLguiItem.getPattern(gid)); >+ } else { >+ setViewerInput(); >+ } > } > }); > >@@ -276,7 +320,11 @@ > fLguiItem.getTableHandler().getSortProperties(gid); > fLguiItem.getTableHandler().sort(gid, SWT.UP, getSortIndex(), tree.getSortDirection()); > } >- setViewerInput(); >+ if (fLguiItem.getPattern(gid).size() > 0) { >+ setViewerInput(fLguiItem.getPattern(gid)); >+ } else { >+ setViewerInput(); >+ } > if (fLguiItem != null && fLguiItem.getTableHandler() != null) { > fLguiItem.getObjectStatus().addComponent(eventForwarder); > componentAdded = true; >@@ -300,10 +348,14 @@ > private String gid = null; > private final ILMLListener lmlListener = new LMLTableListListener(); > private final LMLManager lmlManager = LMLManager.getInstance(); >+ private IMenuManager viewMenuManager; >+ private ActionContributionItem filterActionItem; >+ private ActionContributionItem filterOwnJobsActionItem; > private TreeItem selectedItem = null; > private String selectedOid = null; > private boolean componentAdded = false; > private boolean viewCreated = false; >+ private IViewSite viewSite = null; > > private boolean isMouseDown = false; > private final EventForwarder eventForwarder = new EventForwarder(); >@@ -383,7 +435,42 @@ > */ > fLguiItem = lmlManager.getSelectedLguiItem(); > >+ // ViewMenuManager >+ viewMenuManager = getViewSite().getActionBars().getMenuManager(); >+ final IAction filterOwnJobsAction = new Action("Show only my jobs", IAction.AS_CHECK_BOX) { >+ >+ @Override >+ public void run() { >+ final List<IPattern> filterValues = new LinkedList<IPattern>(); >+ if (isChecked()) { >+ filterValues.add((new Pattern("owner", "alpha")).setRelation("=", fLguiItem.getUsername())); >+ } >+ // TODO After decision about new structure of LML and server side >+ fLguiItem.setPattern(gid, filterValues); >+ setViewerInput(filterValues); >+ } >+ >+ }; >+ final IAction filterAction = new Action("Filters...") { >+ >+ @Override >+ public void run() { >+ final FilterDialog dialog = new FilterDialog(new Shell( >+ viewSite.getShell()), gid); >+ dialog.open(); >+ } >+ }; >+ >+ filterOwnJobsActionItem = new ActionContributionItem(filterOwnJobsAction); >+ filterActionItem = new ActionContributionItem(filterAction); >+ viewMenuManager.add(filterOwnJobsActionItem); >+ viewMenuManager.add(new Separator()); >+ viewMenuManager.add(filterActionItem); >+ filterOwnJobsActionItem.getAction().setEnabled(false); >+ filterActionItem.getAction().setEnabled(false); >+ > createTable(); >+ > tree.addDisposeListener(new DisposeListener() { > public void widgetDisposed(DisposeEvent e) { > if (fLguiItem != null) { >@@ -406,6 +493,7 @@ > e.printStackTrace(); > } > lmlManager.addListener(lmlListener, this.getClass().getName()); >+ viewSite = site; > } > > /** >@@ -416,7 +504,11 @@ > @Override > public IStatus runInUIThread(IProgressMonitor monitor) { > if (viewer != null) { >- setViewerInput(); >+ if (fLguiItem.getPattern(gid).size() > 0) { >+ setViewerInput(fLguiItem.getPattern(gid)); >+ } else { >+ setViewerInput(); >+ } > viewer.refresh(); > } > return Status.OK_STATUS; >@@ -440,12 +532,14 @@ > } > > final ITableColumnLayout[] tableColumnLayouts = fLguiItem.getTableHandler().getTableColumnLayout(gid); >- if (tableColumnLayouts == null) { >+ if (tableColumnLayouts.length == 0) { > return; > } > > treeColumns = new TreeColumn[tableColumnLayouts.length]; > savedColumnWidths = new int[tableColumnLayouts.length + 1]; >+ >+ final String[] columnTitlesPattern = fLguiItem.getColumnTitlePattern(gid); > > // first column with color rectangle > TreeViewerColumn treeViewerColumn = new TreeViewerColumn(viewer, SWT.NONE); >@@ -514,7 +608,18 @@ > }); > treeColumn = treeViewerColumn.getColumn(); > treeColumn.setMoveable(true); >- treeColumn.setText(tableColumnLayouts[i].getTitle()); >+ boolean isFiltered = false; >+ for (final String title : columnTitlesPattern) { >+ if (title.equals(tableColumnLayouts[i].getTitle())) { >+ isFiltered = true; >+ } >+ } >+ if (isFiltered) { >+ treeColumn.setText(tableColumnLayouts[i].getTitle() + " #"); >+ } else { >+ treeColumn.setText(tableColumnLayouts[i].getTitle()); >+ } >+ > treeColumn.setAlignment(getColumnAlignment(tableColumnLayouts[i].getStyle())); > > if (tableColumnLayouts[i].isActive()) { >@@ -674,11 +779,19 @@ > tree.setSortColumn(getSortColumn((Integer) sortProperties[0])); > fLguiItem.getTableHandler().sort(gid, SWT.UP, getSortIndex(), tree.getSortDirection()); > } >- } >- } > >- // Insert the input >- setViewerInput(); >+ filterOwnJobsActionItem.getAction().setEnabled(true); >+ filterActionItem.getAction().setEnabled(true); >+ } >+ >+ // Insert the input >+ if (fLguiItem.getPattern(gid).size() > 0) { >+ setViewerInput(fLguiItem.getPattern(gid)); >+ } else { >+ setViewerInput(); >+ } >+ >+ } > composite.layout(); > } > >@@ -691,6 +804,10 @@ > private void disposeTable() { > tree.setSortColumn(null); > tree.setSortDirection(0); >+ >+ filterOwnJobsActionItem.getAction().setEnabled(false); >+ filterActionItem.getAction().setEnabled(false); >+ > /* > * Remove columns > */ >@@ -710,7 +827,6 @@ > for (final MenuItem item : headerMenu.getItems()) { > item.dispose(); > } >- getViewSite().getActionBars().getMenuManager().removeAll(); > } > > private int getColumnAlignment(String alignment) { >@@ -861,4 +977,24 @@ > } > } > } >+ >+ /** >+ * >+ */ >+ private void setViewerInput(List<IPattern> filterValues) { >+ /* >+ * Don't change input if mouse is down as this causes a SIGSEGV in SWT! >+ */ >+ if (!isMouseDown) { >+ Row[] input = new Row[0]; >+ if (fLguiItem != null && fLguiItem.getTableHandler() != null) { >+ input = fLguiItem.getTableHandler() >+ .getTableDataWithColor(gid, gid.equals(ILguiItem.ACTIVE_JOB_TABLE), filterValues); >+ } >+ if (!composite.isDisposed()) { >+ viewer.setInput(input); >+ viewer.setChildCount(input, input.length); >+ } >+ } >+ } > } >diff --git a/rms/org.eclipse.ptp.rm.slurm.proxy/META-INF/MANIFEST.MF b/rms/org.eclipse.ptp.rm.slurm.proxy/META-INF/MANIFEST.MF >index 6be080e..f6a80e4 100644 >--- a/rms/org.eclipse.ptp.rm.slurm.proxy/META-INF/MANIFEST.MF >+++ b/rms/org.eclipse.ptp.rm.slurm.proxy/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-SymbolicName: org.eclipse.ptp.rm.slurm.proxy > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Vendor: %pluginProvider > Bundle-Localization: plugin > Require-Bundle: org.eclipse.ptp.utils,org.eclipse.ptp.proxy >diff --git a/tools/sci/org.eclipse.ptp.sci/META-INF/MANIFEST.MF b/tools/sci/org.eclipse.ptp.sci/META-INF/MANIFEST.MF >index 053028d..300ea4a 100644 >--- a/tools/sci/org.eclipse.ptp.sci/META-INF/MANIFEST.MF >+++ b/tools/sci/org.eclipse.ptp.sci/META-INF/MANIFEST.MF >@@ -2,6 +2,6 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.ptp.sci >-Bundle-Version: 5.0.4.qualifier >+Bundle-Version: 5.0.5.qualifier > Bundle-Vendor: %pluginProvider > Bundle-Localization: plugin
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
g.watson
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 368356
: 209317