modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveException.java
| 40 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java
| 56 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerHelper.java
| 42 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerLocal.java
| 16
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginManager.java
| 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/perspective/metadata/PerspectivePluginMetadataManager.java
| 8
modules/enterprise/server/xml-schemas/src/main/resources/rhq-serverplugin-perspective.xsd
| 378 +++++-----
7 files changed, 370 insertions(+), 179 deletions(-)
New commits:
commit 2ce39c2280d2a87a3d70a229883d68a086f896bb
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 25 13:55:33 2009 -0500
Work to expose coreMenu extension point via perspective manager
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveException.java
new file mode 100644
index 0000000..b238b44
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveException.java
@@ -0,0 +1,40 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.server.perspective;
+
+public class PerspectiveException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public PerspectiveException() {
+ }
+
+ public PerspectiveException(String message) {
+ super(message);
+ }
+
+ public PerspectiveException(Throwable cause) {
+ super(cause);
+ }
+
+ public PerspectiveException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java
index 0dce72a..c33120b 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java
@@ -18,9 +18,65 @@
*/
package org.rhq.enterprise.server.perspective;
+import java.util.List;
+
+import javax.ejb.EJB;
import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.enterprise.server.RHQConstants;
+import org.rhq.enterprise.server.auth.SubjectManagerLocal;
@Stateless
// @WebService(endpointInterface =
"org.rhq.enterprise.server.perspective.PerspectiveManagerRemote")
public class PerspectiveManagerBean implements PerspectiveManagerLocal,
PerspectiveManagerRemote {
+
+ private final Log log = LogFactory.getLog(PerspectiveManagerBean.class);
+
+ @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
+ private EntityManager entityManager;
+
+ @EJB
+ private SubjectManagerLocal subjectManager;
+
+ /* (non-Javadoc)
+ * @see
org.rhq.enterprise.server.perspective.PerspectiveManagerLocal#getCoreMenu(org.rhq.core.domain.auth.Subject)
+ */
+ @Override
+ public List<MenuItem> getCoreMenu(Subject subject) throws PerspectiveException
{
+ List<MenuItem> coreMenu = null;
+
+ try {
+ coreMenu =
PerspectiveManagerHelper.getPluginMetadataManager().getCoreMenu();
+ } catch (Exception e) {
+ throw new PerspectiveException("Failed to get Core Menu.", e);
+ }
+
+ // TODO: Apply Activators here
+
+ // TODO: Cache session:menu map here
+
+ // TODO: remove this debug code
+ // printMenu(coreMenu, "");
+
+ return coreMenu;
+ }
+
+ // TODO: remove this debug code
+ @SuppressWarnings("unused")
+ private void printMenu(List<MenuItem> menu, String indent) {
+ if (null == menu)
+ return;
+
+ for (MenuItem menuItem : menu) {
+ System.out.println(indent + menuItem.getItem().getName());
+ printMenu(menuItem.getChildren(), indent + "..");
+ }
+ }
+
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerHelper.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerHelper.java
new file mode 100644
index 0000000..94c2d19
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerHelper.java
@@ -0,0 +1,42 @@
+package org.rhq.enterprise.server.perspective;
+
+import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
+import org.rhq.enterprise.server.plugin.pc.perspective.PerspectiveServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.perspective.PerspectiveServerPluginManager;
+import
org.rhq.enterprise.server.plugin.pc.perspective.metadata.PerspectivePluginMetadataManager;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+public class PerspectiveManagerHelper {
+
+ public static PerspectiveServerPluginContainer getPluginContainer() throws Exception
{
+ PerspectiveServerPluginContainer pc = null;
+
+ try {
+ ServerPluginServiceManagement mbean = LookupUtil.getServerPluginService();
+ if (!mbean.isMasterPluginContainerStarted()) {
+ throw new IllegalStateException("The master plugin container is not
started!");
+ }
+
+ MasterServerPluginContainer master = mbean.getMasterPluginContainer();
+ pc = master.getPluginContainer(PerspectiveServerPluginContainer.class);
+ } catch (IllegalStateException ise) {
+ throw ise;
+ } catch (Exception e) {
+ throw new Exception("Cannot obtain the Perspective plugin
container", e);
+ }
+
+ if (pc == null) {
+ throw new Exception("Perspective plugin container is null!");
+ }
+
+ return pc;
+ }
+
+ public static PerspectivePluginMetadataManager getPluginMetadataManager() throws
Exception {
+ PerspectiveServerPluginManager manager = (PerspectiveServerPluginManager)
getPluginContainer()
+ .getPluginManager();
+ return manager.getMetadataManager();
+ }
+
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerLocal.java
index 139ac77..18d46b4 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerLocal.java
@@ -18,8 +18,24 @@
*/
package org.rhq.enterprise.server.perspective;
+import java.util.List;
+
import javax.ejb.Local;
+import org.rhq.core.domain.auth.Subject;
+
@Local
public interface PerspectiveManagerLocal {
+
+ /**
+ * Return the core menu for the specified subject. Depending on their inventory and
roles the
+ * core menu for one subject1 could differ from that of subject2.
+ *
+ * Subsequent calls will return the same core menu for the same Subject. In other
words, it does
+ * not change during a user session.
+ *
+ * @param subject
+ * @return
+ */
+ List<MenuItem> getCoreMenu(Subject subject) throws PerspectiveException;
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/perspective/metadata/PerspectivePluginMetadataManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/perspective/metadata/PerspectivePluginMetadataManager.java
index 9e86e6d..099e9fe 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/perspective/metadata/PerspectivePluginMetadataManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/perspective/metadata/PerspectivePluginMetadataManager.java
@@ -186,4 +186,12 @@ public class PerspectivePluginMetadataManager {
}
return result;
}
+
+ /**
+ * @return the coreMenu
+ */
+ public List<MenuItem> getCoreMenu() {
+ return coreMenu;
+ }
+
}
commit 314f6a3b66b4d4f6120bfc5685670be7f91d8cdc
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 25 13:54:39 2009 -0500
Add more activator elements, reviewed optional/required settings,
beefed up doc annotations. Worked on tab extensions.
diff --git
a/modules/enterprise/server/xml-schemas/src/main/resources/rhq-serverplugin-perspective.xsd
b/modules/enterprise/server/xml-schemas/src/main/resources/rhq-serverplugin-perspective.xsd
index 5093db1..9223e1b 100644
---
a/modules/enterprise/server/xml-schemas/src/main/resources/rhq-serverplugin-perspective.xsd
+++
b/modules/enterprise/server/xml-schemas/src/main/resources/rhq-serverplugin-perspective.xsd
@@ -89,6 +89,9 @@
name="globalTask"
type="perspective:TaskType">
<xs:annotation>
+ <xs:documentation>
+ Add a Global Task extension.
+ </xs:documentation>
<xs:appinfo>
<jaxb:class
name="PerspectiveGlobalTaskElement" />
@@ -100,6 +103,9 @@
name="resourceTask"
type="perspective:TaskType">
<xs:annotation>
+ <xs:documentation>
+ Add a Resource Task extension.
+ </xs:documentation>
<xs:appinfo>
<jaxb:class
name="PerspectiveResourceTaskElement" />
@@ -126,12 +132,15 @@
maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
- Activate task only if the user has resources of the specified type in
inventory.
+ Activate the extension only if the user has resources of the specified
type in
+ inventory.
Activated
only if the user has the required permissions. At least one resource
- activator required for
- resource tasks. Activated for resources only if specified trait
- conditions are also met.
+ activator
+ required for
+ resource task extensions. Activated for resources only if specified
trait
+ conditions are
+ also met.
</xs:documentation>
</xs:annotation>
</xs:element>
@@ -141,7 +150,7 @@
maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
- Activate task only if the user has the required global permissions.
+ Activate the extension only if the user has the required global
permissions.
</xs:documentation>
</xs:annotation>
</xs:element>
@@ -150,7 +159,8 @@
minOccurs="0"
maxOccurs="1">
<xs:annotation>
- <xs:documentation>Optional additional help text for the
task.</xs:documentation>
+ <xs:documentation>Verbose display help text for the task extension.
Displayed on request.
+ </xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
@@ -160,20 +170,19 @@
use="required">
<xs:annotation>
<xs:documentation>
- The task name. Unique within names defined by the perspective. Used for
- display if
- displayName not provided.
- </xs:documentation>
+ Internal name for the task extension. Unique within extension names
defined by the
+ perspective.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
name="displayName"
type="perspective:DisplayNameType"
- use="optional">
+ use="required">
<xs:annotation>
<xs:documentation>
- The name used for display, if provided.
- </xs:documentation>
+ The display name for the task extension.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -182,17 +191,17 @@
use="required">
<xs:annotation>
<xs:documentation>
- The task description displayed for the task.
- </xs:documentation>
+ The display description for the task extension.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
name="url"
type="xs:anyURI"
- use="optional">
+ use="required">
<xs:annotation>
<xs:documentation>
- The request URL for the task. Typically kicks off a wizard or similar
workflow.
+ The request URL for the task extension. Typically kicks off a wizard or
similar workflow.
</xs:documentation>
</xs:annotation>
</xs:attribute>
@@ -202,9 +211,9 @@
use="optional">
<xs:annotation>
<xs:documentation>
- Optional task category. Tasks for the same category will be grouped
together.
- Categories
- are not predefined.
+ The display category for the task extension (optional). Tasks with the
same category will
+ be grouped
+ together in the task pane.
</xs:documentation>
</xs:annotation>
</xs:attribute>
@@ -225,9 +234,7 @@
type="perspective:MenuItemType">
<xs:annotation>
<xs:documentation>
- Add or Remove a menu item in an existing menu extension point. Additions can
specify
- positioning as
- well as a recursive structure, defineing a tree of MenuItems.
+ Add, Replace or Remove a menuItem extension for an existing menu extension
point.
</xs:documentation>
<xs:appinfo>
<jaxb:class
@@ -241,14 +248,37 @@
<xs:sequence>
<xs:element
ref="perspective:position"
- minOccurs="0"
+ minOccurs="1"
maxOccurs="1">
<xs:annotation>
<xs:documentation>
- Required for root menuItem additions. Position of children is implicit
given the
- XML
- structure.
- </xs:documentation>
+ Required positioning element for the menuItem extension.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element
+ ref="perspective:inventoryActivator"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ Activate the extension only if the user has resources of the specified
type in
+ inventory.
+ Activated only if the user has the required permissions. Activated for
+ resources only if
+ specified trait
+ conditions are also met.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element
+ ref="perspective:permissionActivator"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ Activate the extension only if the user has the required global
permissions.
+ </xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
@@ -259,10 +289,10 @@
default="add">
<xs:annotation>
<xs:documentation>
- Add or remove the menu entry. For removal all but the name attribute are
ignored.
- Default
- is add.
- </xs:documentation>
+ Add, Replace or Remove the menuItem extension. For removal all but the
name attribute are
+ ignored.
+ Default is add.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -271,10 +301,9 @@
use="required">
<xs:annotation>
<xs:documentation>
- ExtensionPoint name used for reference by other defined extension points.
- Unique within
+ Internal name for the menuItem extension. Unique within extension names
defined by the
perspective.
- </xs:documentation>
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -283,8 +312,7 @@
use="optional">
<xs:annotation>
<xs:documentation>
- The displayed menu item name. Required for add actions. If empty an icon
must be
- defined.
+ The display name for the menuItem extension. If omitted an icon is
required.
</xs:documentation>
</xs:annotation>
</xs:attribute>
@@ -294,8 +322,8 @@
use="optional">
<xs:annotation>
<xs:documentation>
- Certain menu items utilize special built-in rendering features.
- </xs:documentation>
+ Certain menuItem extensions utilize special built-in rendering features.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -304,9 +332,11 @@
use="optional">
<xs:annotation>
<xs:documentation>
- The request URL for the menu entry. If not provided the entry is just a
placeholder for
- MenuItems.
- </xs:documentation>
+ The request URL for the menuItem extension. If omitted it is assumed
+ the menuItem
+ exists as
+ a navigation element to child menuItems.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -315,9 +345,9 @@
use="optional">
<xs:annotation>
<xs:documentation>
- The request URL for the icon image for this menu item. If not provided
then no image is
- used.
- </xs:documentation>
+ The request URL for the icon displayed for this menuItem extension. If
omitted no image is
+ displayed. Required if displayName if omitted.
+ </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -333,135 +363,145 @@
</xs:complexType>
<xs:element
- name="resourceTab">
+ name="resourceTab"
+ type="perspective:TabType">
<xs:annotation>
+ <xs:documentation>
+ Add, Replace or Remove a resourceTab extension for a ResourceTab extension
point.
+ </xs:documentation>
<xs:appinfo>
<jaxb:class
name="PerspectiveResourceTabElement" />
</xs:appinfo>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element
- ref="perspective:position"
- minOccurs="0"
- maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Required for root menuItem additions. Position of children is
implicit given the
- XML
- structure.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute
- name="name"
- type="perspective:NameType"
- use="required">
- <xs:annotation>
- <xs:documentation>
- The menu entry name. Unique within menu items defined for the
perspective. Displayed
- on
- screen.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute
- name="action"
- type="perspective:ActionType"
- use="optional"
- default="add">
- <xs:annotation>
- <xs:documentation>
- Add or remove the menu entry. Add is the default.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute
- name="url"
- type="xs:anyURI"
- use="optional">
- <xs:annotation>
- <xs:documentation>
- The request URL for the menu entry. If not provided the entry is just a
placeholder for
- MenuItems.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
</xs:element>
<xs:element
- name="resourceSubTab">
+ name="resourceSubTab"
+ type="perspective:TabType">
<xs:annotation>
+ <xs:documentation>
+ Add, Replace or Remove a resourceSubTab extension for a ResourceTab extension
point.
+ </xs:documentation>
<xs:appinfo>
<jaxb:class
name="PerspectiveResourceSubTabElement" />
</xs:appinfo>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element
- ref="perspective:position"
- minOccurs="0"
- maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Required for root menuItem additions. Position of children is
implicit given the
- XML
- structure.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute
- name="name"
- type="perspective:NameType"
- use="required">
+ </xs:element>
+
+ <xs:complexType
+ name="TabType">
+ <xs:sequence>
+ <xs:element
+ ref="perspective:position"
+ minOccurs="1"
+ maxOccurs="1">
<xs:annotation>
<xs:documentation>
- The menu entry name. Unique within menu items defined for the
perspective. Displayed
- on
- screen.
+ Required positioning element for the Tab or SubTab extension.
</xs:documentation>
</xs:annotation>
- </xs:attribute>
- <xs:attribute
- name="action"
- type="perspective:ActionType"
- use="optional"
- default="add">
+ </xs:element>
+ <xs:element
+ ref="perspective:inventoryActivator"
+ minOccurs="0"
+ maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
- Add or remove the menu entry. Add is the default.
+ Activate the extension only if the user has resources of the specified
type in
+ inventory.
+ Activated only if the user has the required permissions. Activated for
+ resources only if
+ specified trait
+ conditions are also met.
</xs:documentation>
</xs:annotation>
- </xs:attribute>
- <xs:attribute
- name="url"
- type="xs:anyURI"
- use="optional">
+ </xs:element>
+ <xs:element
+ ref="perspective:permissionActivator"
+ minOccurs="0"
+ maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
- The request URL for the menu entry. If not provided the entry is just a
placeholder for
- MenuItems.
+ Activate task only if the user has the required global permissions.
</xs:documentation>
</xs:annotation>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute
+ name="action"
+ type="perspective:ActionType"
+ use="optional"
+ default="add">
+ <xs:annotation>
+ <xs:documentation>
+ Add, Replace or Remove the tab extension. For removal all but the name
attribute are
+ ignored. Default is add.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute
+ name="name"
+ type="perspective:NameType"
+ use="required">
+ <xs:annotation>
+ <xs:documentation>
+ Internal name for the tab extension. Unique within extension names defined
by the
+ perspective.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute
+ name="displayName"
+ type="perspective:DisplayNameType"
+ use="required">
+ <xs:annotation>
+ <xs:documentation>
+ The display name for the tab extension.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute
+ name="url"
+ type="xs:anyURI"
+ use="required">
+ <xs:annotation>
+ <xs:documentation>
+ The request URL for the tab extension.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute
+ name="iconUrl"
+ type="xs:anyURI"
+ use="optional">
+ <xs:annotation>
+ <xs:documentation>
+ The request URL for the icon displayed for this tab extension. If omitted
no image is
+ displayed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute
+ name="iconWidth"
+ type="xs:int"
+ use="optional">
+ </xs:attribute>
+ <xs:attribute
+ name="iconHeight"
+ type="xs:int"
+ use="optional">
+ </xs:attribute>
+ </xs:complexType>
<xs:element
name="inventoryActivator">
<xs:annotation>
+ <xs:documentation>An activator specifying inventory conditions that must
be satisfied in order for the
+ extension to be active.</xs:documentation>
<xs:appinfo>
<jaxb:class
name="InventoryActivatorElement" />
</xs:appinfo>
- <xs:documentation>
- Activators must be satisfied for the extension point to be active.
- </xs:documentation>
</xs:annotation>
<xs:complexType>
@@ -482,9 +522,7 @@
type="xs:string"
use="required">
<xs:annotation>
- <xs:documentation>
- Plugin for the specified resource type.
- </xs:documentation>
+ <xs:documentation>Plugin for the specified resource
type.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -492,8 +530,7 @@
type="xs:string"
use="required">
<xs:annotation>
- <xs:documentation>
- Resource Type that must be in inventory to activate the extension
point.
+ <xs:documentation>Resource Type that must be in inventory to
activate the extension point.
</xs:documentation>
</xs:annotation>
</xs:attribute>
@@ -504,11 +541,8 @@
name="permissionActivator"
type="perspective:PermissionType">
<xs:annotation>
- <xs:documentation>
- Activators must be satisfied for the extension point to be active.
- The specified permission
- must be available to the current user session.
- </xs:documentation>
+ <xs:documentation>An activator specifying a permission condition that must
be satisfied in order for the
+ extension to be active.</xs:documentation>
</xs:annotation>
</xs:element>
@@ -516,11 +550,8 @@
name="traitActivator"
type="perspective:TraitActivatorType">
<xs:annotation>
- <xs:documentation>
- Activators must be satisfied for the extension point to be active.
- The specified permission
- must be available to the current user session.
- </xs:documentation>
+ <xs:documentation>An activator specifying a resource trait conditions that
must be satisfied in order for the
+ extension to be active.</xs:documentation>
</xs:annotation>
</xs:element>
@@ -531,9 +562,7 @@
type="xs:string"
use="required">
<xs:annotation>
- <xs:documentation>
- The trait being tested for activation.
- </xs:documentation>
+ <xs:documentation>The trait being tested for
activation.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -541,10 +570,7 @@
type="xs:string"
use="required">
<xs:annotation>
- <xs:documentation>
- The value of the trait. By default this is a 'contains' test. For
equality, set strict to
- true.
- </xs:documentation>
+ <xs:documentation>The value of the trait. By default, a case
insensitive 'contains' test.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -553,8 +579,7 @@
use="optional"
default="false">
<xs:annotation>
- <xs:documentation>
- If true perform equality test. If false (default) perform a contains
test.
+ <xs:documentation>If true perform equality test. If false (default)
perform a contains test.
</xs:documentation>
</xs:annotation>
</xs:attribute>
@@ -564,8 +589,7 @@
use="optional"
default="false">
<xs:annotation>
- <xs:documentation>
- If true perform a case sensitive test. If false (default) test is sase
insensitive.
+ <xs:documentation>If true perform a case sensitive test. If false
(default) test is case insensitive.
</xs:documentation>
</xs:annotation>
</xs:attribute>
@@ -575,6 +599,8 @@
name="position"
type="perspective:PositionType">
<xs:annotation>
+ <xs:documentation>Specifies positioning for an extension. Often relative
to an existing extension.
+ </xs:documentation>
<xs:appinfo>
<jaxb:class
name="PerspectivePositionElement" />
@@ -589,9 +615,7 @@
type="perspective:ExtensionPointNameType"
use="required">
<xs:annotation>
- <xs:documentation>
- The extension point (a menu, resource tab bar, etc) where the insertion is
occuring.
- </xs:documentation>
+ <xs:documentation>The extension point for which the extension is being
positioned.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -599,12 +623,8 @@
type="perspective:NameType"
use="optional">
<xs:annotation>
- <xs:documentation>
- Position relatively against this name. Required for before/after
positioning.
- The name is
- context specific, it could be a
- menu entry name, a menu item name, tab name, subTab name, etc.
- </xs:documentation>
+ <xs:documentation>Position relatively against this extension name.
Required for all placement relative to
+ another extension.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute
@@ -617,6 +637,10 @@
type="xs:boolean"
use="optional"
default="false">
+ <xs:annotation>
+ <xs:documentation>If true generate a break prior to this extension.
Typically used for menuItem extensions,
+ ignored when breaks are nonsensical.</xs:documentation>
+ </xs:annotation>
</xs:attribute>
</xs:complexType>
@@ -624,8 +648,9 @@
name="ActionType">
<xs:annotation>
<xs:documentation>
- Add : Add new or Replaces existing
+ Add : Add new
Remove : Removes existing
+ Replace : Replace existing
</xs:documentation>
</xs:annotation>
<xs:restriction
@@ -634,6 +659,8 @@
value="add"></xs:enumeration>
<xs:enumeration
value="remove"></xs:enumeration>
+ <xs:enumeration
+ value="replace"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
@@ -764,5 +791,4 @@
</xs:restriction>
</xs:simpleType>
-
</xs:schema>
commit 94a2f33e543fed0ce161d65dcb09c00e10519810
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 25 13:51:22 2009 -0500
NullPointer protection
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginManager.java
index 8eb7c70..c747814 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginManager.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginManager.java
@@ -284,14 +284,17 @@ public class ServerPluginManager {
MasterServerPluginContainerConfiguration masterConfig =
masterPC.getConfiguration();
File dataDir = new File(masterConfig.getDataDirectory(), pluginName);
File tmpDir = masterConfig.getTemporaryDirectory();
- Configuration plugnConfig;
+ Configuration pluginConfig = null;
List<ScheduledJobDefinition> schedules;
try {
// TODO: today we have no way in the UI to customize the plugin config
values
// for now, just use the defaults as defined in the descriptor
ConfigurationDefinition configDef = ServerPluginDescriptorMetadataParser
.getPluginConfigurationDefinition(pluginDescriptor);
- plugnConfig = configDef.getDefaultTemplate().createConfiguration();
+ // It is not required that a server plugin define plugin configuration
+ if (null != configDef) {
+ pluginConfig = configDef.getDefaultTemplate().createConfiguration();
+ }
// TODO: today we have no way in the UI to customize the schedules
// for now, just use the defaults as defined in the descriptor
@@ -301,7 +304,7 @@ public class ServerPluginManager {
throw new RuntimeException(e);
}
- context = new ServerPluginContext(env, dataDir, tmpDir, plugnConfig, schedules);
+ context = new ServerPluginContext(env, dataDir, tmpDir, pluginConfig,
schedules);
this.pluginContextCache.put(pluginName, context);
return context;
}