[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 2 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java | 6 ++++--
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java | 4 ++--
3 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 3430c161285812e9c8435ca1bd1e33f7ccb636a5
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Feb 9 16:56:43 2011 -0500
changed portal.war access requests to use HTTP Post instead of GET to prevent credentials or session id logging via apache/etc.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index 2240f77..79b8a88 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -516,7 +516,7 @@ public class LoginView extends LocatableCanvas {
loginButton.setDisabled(true);
try {
- RequestBuilder b = new RequestBuilder(RequestBuilder.GET, "/j_security_check.do?j_username=" + user
+ RequestBuilder b = new RequestBuilder(RequestBuilder.POST, "/j_security_check.do?j_username=" + user
+ "&j_password=" + password);
b.setCallback(new RequestCallback() {
public void onResponseReceived(Request request, Response response) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
index 4da58e2..4b63608 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
@@ -121,7 +121,7 @@ public class UserSessionManager {
BrowserUtility.forceIe6Hacks();
//initiate request to portal.war(SessionAccessServlet) to retrieve existing session info if exists
//session has valid user then <subjectId>:<sessionId>:<lastAccess> else ""
- final RequestBuilder b = new RequestBuilder(RequestBuilder.GET, "/sessionAccess");
+ final RequestBuilder b = new RequestBuilder(RequestBuilder.POST, "/sessionAccess");
try {
b.setCallback(new RequestCallback() {
public void onResponseReceived(final Request request, final Response response) {
@@ -363,11 +363,13 @@ public class UserSessionManager {
/** Takes an updated Subject and signals SessionAccessServlet in portal.war to update the associated WebUser
* because for this specific authenticated user. Currently assumes Subject instances returned from SubjectManagerBean.processSubjectForLdap.
+ * This should only ever be called by UI logic in LDAP logins(case insensitive/new registration) after RHQ sessions have been renewed server side
+ * correctly.
*
* @param loggedInSubject Subject with updated session
*/
private static void scheduleWebUserUpdate(final Subject loggedInSubject) {
- final RequestBuilder b = new RequestBuilder(RequestBuilder.GET, "/sessionAccess");
+ final RequestBuilder b = new RequestBuilder(RequestBuilder.POST, "/sessionAccess");
//add header to signal SessionAccessServlet to update the WebUser for the successfully logged in user
b.setHeader(WEB_USER_UPDATE, String.valueOf(loggedInSubject.getSessionId()));
try {
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
index 7c388b1..e07dc39 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java
@@ -48,7 +48,7 @@ public class SessionAccessServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
HttpServletResponse response = (HttpServletResponse) resp;
HttpServletRequest request = (HttpServletRequest) req;
@@ -63,7 +63,7 @@ public class SessionAccessServlet extends HttpServlet {
//if a session does not already exist this call will create one
HttpSession session = request.getSession();
- //check for web user update request from coregui
+ //check for web user update request from coregui. This is usually only set during ldap logins(case insensitive or registration.)
String sessionWebUserUpdate = request.getHeader("rhq_webuser_update");
/*
13 years, 3 months
[rhq] 2 commits - etc/eclipse-tools modules/enterprise
by mazz
etc/eclipse-tools/maven/RHQ | 4 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java | 26 ++++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java | 5 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java | 15 +++--
4 files changed, 33 insertions(+), 17 deletions(-)
New commits:
commit e9a07825e51f6683ed86b9da61d61277da9174a0
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Feb 9 13:42:11 2011 -0500
fix configuration compare feature - this is working again
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
index 4615b4d..f9e4970 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationComparisonView.java
@@ -24,6 +24,8 @@ import java.util.EnumSet;
import java.util.List;
import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.layout.VLayout;
@@ -44,6 +46,7 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
/**
* @author Greg Hinkle
@@ -79,7 +82,7 @@ public class ConfigurationComparisonView extends VLayout {
nameField.setFrozen(true);
nameField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- if (listGridRecord.getAttributeAsBoolean("consistent")) {
+ if (listGridRecord == null || listGridRecord.getAttributeAsBoolean("consistent")) {
return String.valueOf(o);
} else {
return "<span style=\"color: red;\">" + String.valueOf(o) + "</span>";
@@ -194,15 +197,26 @@ public class ConfigurationComparisonView extends VLayout {
ArrayList<Configuration> configurations, ArrayList<String> titles) {
ConfigurationComparisonView view = new ConfigurationComparisonView(definition, configurations, titles);
- Window dialog = new Window();
+ final Window dialog = new LocatableWindow("configCompare");
dialog.setTitle(MSG.view_configCompare_comparingConfigs());
- dialog.setWidth(800);
- dialog.setHeight(800);
+ dialog.setShowMinimizeButton(true);
+ dialog.setShowMaximizeButton(true);
+ dialog.setWidth(700);
+ dialog.setHeight(500);
dialog.setIsModal(true);
dialog.setShowModalMask(true);
+ dialog.setShowResizer(true);
+ dialog.setShowFooter(true);
dialog.setCanDragResize(true);
+ dialog.setAutoCenter(true);
dialog.centerInPage();
dialog.addItem(view);
+ dialog.addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClientEvent event) {
+ dialog.markForDestroy();
+ }
+ });
dialog.show();
}
@@ -239,8 +253,4 @@ public class ConfigurationComparisonView extends VLayout {
}
}
}
-
- private static class ColoredTreeGrid extends TreeGrid {
-
- }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
index 5f4c167..034a133 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java
@@ -55,6 +55,7 @@ public class ConfigurationHistoryDataSource extends RPCDataSource<ResourceConfig
public static final String DURATION = "duration";
public static final String ERROR_MESSAGE = "errorMessage";
public static final String MODIFIED_TIME = "modifiedTime";
+ public static final String OBJECT = "object"; // the full entity object is stored in this attribute
}
public static abstract class CriteriaField {
@@ -131,7 +132,7 @@ public class ConfigurationHistoryDataSource extends RPCDataSource<ResourceConfig
@Override
public ResourceConfigurationUpdate copyValues(Record from) {
- throw new UnsupportedOperationException("Updates are not supported.");
+ return (ResourceConfigurationUpdate) from.getAttributeAsObject(Field.OBJECT);
}
@Override
@@ -147,7 +148,7 @@ public class ConfigurationHistoryDataSource extends RPCDataSource<ResourceConfig
record.setAttribute(Field.ERROR_MESSAGE, from.getErrorMessage());
record.setAttribute(Field.MODIFIED_TIME, new Date(from.getModifiedTime()));
record.setAttribute(Field.STATUS, from.getStatus().name());
-
+ record.setAttribute(Field.OBJECT, from);
return record;
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
index 19994ec..c23056b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
@@ -32,6 +32,7 @@ import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
import org.rhq.core.domain.resource.Resource;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationComparisonView;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
@@ -42,8 +43,8 @@ import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
* @author Greg Hinkle
*/
public class ConfigurationHistoryView extends TableSection {
- public static final ViewName VIEW_ID = new ViewName("RecentConfigurationChanges",
- MSG.view_configurationHistoryList_title());
+ public static final ViewName VIEW_ID = new ViewName("RecentConfigurationChanges", MSG
+ .view_configurationHistoryList_title());
private Integer resourceId;
@@ -88,8 +89,12 @@ public class ConfigurationHistoryView extends TableSection {
ListGridField resourceField = new ListGridField(ConfigurationHistoryDataSource.Field.RESOURCE);
resourceField.setCellFormatter(new CellFormatter() {
public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- Resource res = (Resource) o;
- return "<a href=\"#Resource/" + res.getId() + "\">" + res.getName() + "</a>";
+ if (listGridRecord == null) {
+ return "unknown";
+ }
+ Resource res = (Resource) listGridRecord
+ .getAttributeAsObject(ConfigurationHistoryDataSource.Field.RESOURCE);
+ return "<a href=\"" + LinkManager.getResourceLink(res.getId()) + "\">" + res.getName() + "</a>";
}
});
fields.add(resourceField);
@@ -124,7 +129,7 @@ public class ConfigurationHistoryView extends TableSection {
ArrayList<ResourceConfigurationUpdate> configs = new ArrayList<ResourceConfigurationUpdate>();
for (ListGridRecord record : selection) {
ResourceConfigurationUpdate update = (ResourceConfigurationUpdate) record
- .getAttributeAsObject("entity");
+ .getAttributeAsObject(ConfigurationHistoryDataSource.Field.OBJECT);
configs.add(update);
}
ConfigurationComparisonView.displayComparisonDialog(configs);
commit 6cc2484f375dabece1e6b1a4495d76e218911a10
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Feb 9 13:39:24 2011 -0500
when running gwt dev mode, have it go to #Reports to avoid going to the slower dashboards page first
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA-Params.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA-Params.launch
index 9791adc..0d61259 100644
--- a/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA-Params.launch
+++ b/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA-Params.launch
@@ -6,6 +6,6 @@
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true gwt:debug -DcoreGuiParams=?enableLocators=true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true gwt:debug -DcoreGuiParams=?enableLocators=true#Reports"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/enterprise/gui/coregui}"/>
</launchConfiguration>
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA.launch
index 6f5b7c2..959f956 100644
--- a/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA.launch
+++ b/etc/eclipse-tools/maven/RHQ Maven Build - Run GWT DevMode-JPDA.launch
@@ -6,6 +6,6 @@
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${env_var:M2_HOME}/bin/${MAVEN_EXE}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true gwt:debug"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-o -Dmaven.test.skip=true gwt:debug -DcoreGuiParams=#Reports"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/rhq/modules/enterprise/gui/coregui}"/>
</launchConfiguration>
13 years, 3 months
[rhq] modules/enterprise
by Heiko W. Rupp
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties | 18 +++++-----
1 file changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 5c29b7ec7607ac896793ce0581cc981d73e0e423
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed Feb 9 16:05:35 2011 +0100
Tiny little changes.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties
index f864527..a1a4b07 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties
@@ -1,5 +1,5 @@
#
-# RHQ GUI i18n Message Constants - English
+# RHQ GUI i18n Message Constants - German
# This is used specifically for properties needing lookup by name, at runtime. These
# constant properties can be localized but can not have arguments.
###################################
@@ -22,7 +22,7 @@
# M = 1..numSectionItems
#
# view_help_section_N_propTitle_M = localized title for the help (required)
-# view_help_section_N_propIcon_M = icon path (optional, defaults to document icon)
+# view_help_section_N_propIcon_M = icon path (optional, defaults to document icon)
# view_help_section_N_propUrl_M = url for the help (required)
#
view_help_section_count = 2
@@ -30,11 +30,11 @@ view_help_section_count = 2
view_help_section_1_title = Dokumentation
view_help_section_1_item_count = 3
-view_help_section_1_propTitle_1 = Frequently Asked Questions (FAQ)
+view_help_section_1_propTitle_1 = Frequently Asked Questions (FAQ)
view_help_section_1_propUrl_1 = http://www.rhq-project.org/display/JOPR2/FAQ
-view_help_section_1_propTitle_2 = Dokumentation
+view_help_section_1_propTitle_2 = Dokumentation
view_help_section_1_propUrl_2 = http://www.rhq-project.org/display/JOPR2/Home
-view_help_section_1_propTitle_3 = API Javadoc
+view_help_section_1_propTitle_3 = API Javadoc
view_help_section_1_propUrl_3 = http://www.rhq-project.org/display/JOPR2/API+Documentation
view_help_section_2_title = Tutorium
@@ -42,11 +42,11 @@ view_help_section_2_item_count = 4
view_help_section_2_propTitle_1 = Demo: Alles
view_help_section_2_propUrl_1 = http://www.rhq-project.org/display/JOPR2/Demos
-view_help_section_2_propTitle_2 = Demo: Bundles Installieren
-view_help_section_2_propUrl_2 = http://management-platform.blogspot.com/2011/01/bundle-provisioning-via-r...
-view_help_section_2_propTitle_3 = Wie erstellt man Gruppen-Definitionen
+view_help_section_2_propTitle_2 = Demo: Bundles installieren
+view_help_section_2_propUrl_2 = http://management-platform.blogspot.com/2011/01/bundle-provisioning-via-r...
+view_help_section_2_propTitle_3 = Wie erstellt man Gruppen-Definitionen
view_help_section_2_propIcon_3 = [SKIN]/../actions/help.png
view_help_section_2_propUrl_3 = http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/2.4/html/Basic...
-view_help_section_2_propTitle_4 = Wie benutzt man die Suchleiste
+view_help_section_2_propTitle_4 = Wie benutzt man die Suchleiste
view_help_section_2_propIcon_4 = [SKIN]/../actions/help.png
view_help_section_2_propUrl_4 = http://www.rhq-project.org/display/JOPR2/Search
13 years, 3 months
[rhq] 2 commits - modules/core modules/enterprise
by mazz
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java | 58 -
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java | 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.java | 45
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.java | 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java | 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java | 30
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java | 35
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java | 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java | 518 ----------
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java | 35
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.java | 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java | 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.java | 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java | 44
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java | 62 -
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java | 27
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java | 35
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.java | 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java | 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java | 11
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 1
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java | 99 -
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java | 57 -
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java | 123 --
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java | 117 --
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java | 17
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java | 10
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java | 23
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java | 9
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java | 14
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java | 8
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java | 15
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java | 52 -
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java | 5
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java | 5
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java | 24
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java | 4
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml | 42
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml | 8
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml | 8
modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp | 5
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp | 8
modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp | 94 -
modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp | 60 -
modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp | 1
modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp | 7
modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp | 7
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp | 6
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp | 4
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp | 4
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml | 5
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml | 6
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml | 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml | 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml | 4
modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml | 6
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml | 10
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml | 4
modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml | 5
modules/enterprise/server/ear/pom.xml | 21
modules/enterprise/server/ear/src/main/license/license.xml | 26
modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml | 1
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java | 20
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java | 43
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java | 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java | 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.java | 120 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java | 42
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java | 245 ----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java | 340 ------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java | 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java | 313 ------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java | 55 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java | 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java | 214 ----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java | 108 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java | 84 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java | 103 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java | 34
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java | 81 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java | 70 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java | 90 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java | 76 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java | 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.java | 36
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java | 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.java | 36
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java | 126 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java | 13
modules/enterprise/server/license-gen/jar/pom.xml | 88 -
modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java | 267 -----
modules/enterprise/server/license-gen/maven-plugin/pom.xml | 77 -
modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml | 73 -
modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml | 32
modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml | 12
modules/enterprise/server/pom.xml | 2
99 files changed, 51 insertions(+), 5088 deletions(-)
New commits:
commit ec5b64e1cd0c61f616f10b807362e2da7cbdf423
Merge: fbde2b7... 069a61c...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 8 23:35:18 2011 -0500
Merge branch 'no-license'
commit 069a61cde25d8dd80182c20547e510d7dcfd7823
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 8 23:34:18 2011 -0500
BZ 676060 - remove all licensing code so RHQ no longer uses or requires the license file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java
deleted file mode 100644
index adacf8b..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java
+++ /dev/null
@@ -1,58 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A class which defines an attribute and the conditions on which it is valid.
- */
-public class XmlAttr {
- public static final int REQUIRED = 0;
- public static final int OPTIONAL = 1;
-
- private String name;
- private int type;
-
- /**
- * Create a new XmlAttr attribute with the given name, and type.
- *
- * @param name The name of the XML tag attribute
- * @param type One of REQUIRED or OPTIONAL, indicating that the attribute is required for the tag to be valid, or
- * optional, meaning it is allowed but not required.
- */
- public XmlAttr(String name, int type) {
- this.name = name;
- this.type = type;
-
- if ((type != REQUIRED) && (type != OPTIONAL)) {
- throw new IllegalArgumentException("Invalid type: " + type);
- }
- }
-
- public String getName() {
- return this.name;
- }
-
- public int getType() {
- return this.type;
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java
deleted file mode 100644
index 4c15d5a..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A base-class for other attribute based exceptions.
- */
-
-public class XmlAttrException extends XmlParseException {
- public XmlAttrException(String s) {
- super(s);
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.java
deleted file mode 100644
index 8011b17..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * An interface which classes much implement in order to have their attributes handled. If this interface is not
- * implemented, then all attributes for a tag are considered to be 'unknown', and the object must implement the
- * XmlUnAttrHandler to process them.
- */
-
-public interface XmlAttrHandler {
- /**
- * Get a list of attributes which the handler knows about.
- */
- public XmlAttr[] getAttributes();
-
- /**
- * Called when XmlParser finds a known attributes (as returned by getAttributes()).
- *
- * @param attrNumber An index into the array which was returned from getAttributes. The index represents the found
- * attribute
- * @param value The value of the attribute
- */
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException;
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.java
deleted file mode 100644
index 17918a2..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * An object should implement this interface when it wishes to be notified then the parser is done handling all of the
- * attributes for the associated tag.
- */
-
-public interface XmlEndAttrHandler {
- public void endAttributes() throws XmlAttrException;
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java
deleted file mode 100644
index 2b9904a..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * Before an objects XmlAttrHandler is called, this method will be invoked with the tag which is holding the attribute,
- * the name of the attribute, and the value given for it. The handler should filter this (do replacement, etc.) and
- * return the value that XmlParser should use to call into the attribute handler routine.
- */
-
-public interface XmlFilterHandler {
- public String filterAttrValue(XmlTagHandler tag, String attrName, String attrValue);
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java
deleted file mode 100644
index 16e65d1..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A convenience interface for tags wishing to support the full suite of XmlParser interfaces.
- */
-public interface XmlFullHandler extends XmlAttrHandler, XmlEndAttrHandler, XmlTagHandler, XmlUnAttrHandler,
- XmlTagEntryHandler, XmlTagExitHandler {
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java
deleted file mode 100644
index 9df3ca5..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * An exception which is thrown when a tag does not have a required child tag. This exception can be thrown when a tag
- * is required and is missing, or has a ONE_OR_MORE and is missing.
- */
-public class XmlMissingTagException extends XmlTagException {
- XmlMissingTagException(Element e, String reqTag) {
- super("Tag <" + e.getName() + "> requires child tag '" + reqTag + "'");
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java
deleted file mode 100644
index cf95256..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * The superclass to all XmlParser parse exceptions.
- */
-
-public class XmlParseException extends Exception {
- XmlParseException(String s) {
- super(s);
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java
deleted file mode 100644
index 6987cf5..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java
+++ /dev/null
@@ -1,518 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.jdom.Attribute;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.input.SAXBuilder;
-import org.xml.sax.EntityResolver;
-import org.rhq.core.clientapi.util.StringUtil;
-
-/**
- * The main entry point && bulk of XmlParser. The parsing routine takes an entry-point tag, which provides information
- * about subtags, attributes it takes, etc. Tags can implement various interfaces to tell the parser to call back when
- * certain conditions are met. This class takes the role of both a minimal validator as well as a traversal mechanism
- * for building data objects out of XML.
- *
- * @deprecated see http://jira.jboss.com/jira/browse/JBNADM-2932
- */
-@Deprecated
-public class XmlParser {
- private XmlParser() {
- }
-
- private static void checkAttributes(Element elem, XmlTagHandler tag, XmlFilterHandler filter)
- throws XmlAttrException {
- boolean handlesAttrs = tag instanceof XmlAttrHandler;
- XmlAttr[] attrs;
-
- if (handlesAttrs) {
- attrs = ((XmlAttrHandler) tag).getAttributes();
- } else {
- attrs = new XmlAttr[0];
- }
-
- // Ensure out all the required && optional attributes
- for (int i = 0; i < attrs.length; i++) {
- Attribute a = null;
- boolean found = false;
-
- for (Iterator j = elem.getAttributes().iterator(); j.hasNext();) {
- a = (Attribute) j.next();
-
- if (a.getName().equalsIgnoreCase(attrs[i].getName())) {
- found = true;
- break;
- }
- }
-
- if (!found && (attrs[i].getType() == XmlAttr.REQUIRED)) {
- throw new XmlRequiredAttrException(elem, attrs[i].getName());
- }
-
- if (found && handlesAttrs) {
- String val;
-
- val = filter.filterAttrValue(tag, a.getName(), a.getValue());
-
- ((XmlAttrHandler) tag).handleAttribute(i, val);
- }
- }
-
- // Second loop to handle unknown attributes
- for (Iterator i = elem.getAttributes().iterator(); i.hasNext();) {
- Attribute a = (Attribute) i.next();
- boolean found = false;
-
- for (int j = 0; j < attrs.length; j++) {
- if (a.getName().equalsIgnoreCase(attrs[j].getName())) {
- found = true;
- break;
- }
- }
-
- if (found) {
- continue;
- }
-
- if (tag instanceof XmlUnAttrHandler) {
- XmlUnAttrHandler handler;
- String val;
-
- val = filter.filterAttrValue(tag, a.getName(), a.getValue());
-
- handler = (XmlUnAttrHandler) tag;
- handler.handleUnknownAttribute(a.getName(), val);
- } else {
- throw new XmlUnknownAttrException(elem, a.getName());
- }
- }
-
- if (tag instanceof XmlEndAttrHandler) {
- ((XmlEndAttrHandler) tag).endAttributes();
- }
- }
-
- private static void checkSubNodes(Element elem, XmlTagHandler tag, XmlFilterHandler filter)
- throws XmlAttrException, XmlTagException {
- XmlTagInfo[] subTags = tag.getSubTags();
- Map hash;
-
- hash = new HashMap();
-
- // First, count how many times each sub-tag is referenced
- for (Iterator i = elem.getChildren().iterator(); i.hasNext();) {
- Element e = (Element) i.next();
- String name;
- Integer val;
-
- name = e.getName().toLowerCase();
- if ((val = (Integer) hash.get(name)) == null) {
- val = new Integer(0);
- }
-
- val = new Integer(val.intValue() + 1);
- hash.put(name, val);
- }
-
- for (int i = 0; i < subTags.length; i++) {
- String name = subTags[i].getTag().getName().toLowerCase();
- Integer iVal = (Integer) hash.get(name);
- int threshold = 0;
- int val;
-
- val = (iVal == null) ? 0 : iVal.intValue();
-
- switch (subTags[i].getType()) {
- case XmlTagInfo.REQUIRED: {
- if (val == 0) {
- throw new XmlMissingTagException(elem, name);
- } else if (val != 1) {
- throw new XmlTooManyTagException(elem, name);
- }
-
- break;
- }
-
- case XmlTagInfo.OPTIONAL: {
- if (val > 1) {
- throw new XmlTooManyTagException(elem, name);
- }
-
- break;
- }
-
- case XmlTagInfo.ONE_OR_MORE: {
- threshold++;
- }
-
- case XmlTagInfo.ZERO_OR_MORE: {
- if (val < threshold) {
- throw new XmlMissingTagException(elem, name);
- }
-
- break;
- }
- }
-
- hash.remove(name);
- }
-
- // Now check for excess sub-tags
- if (hash.size() != 0) {
- Set keys = hash.keySet();
-
- throw new XmlTooManyTagException(elem, (String) keys.iterator().next());
- }
-
- // Recurse to all sub-tags
- for (Iterator i = elem.getChildren().iterator(); i.hasNext();) {
- Element child = (Element) i.next();
-
- for (int j = 0; j < subTags.length; j++) {
- XmlTagHandler subTag = subTags[j].getTag();
- String subName = subTag.getName();
-
- if (child.getName().equalsIgnoreCase(subName)) {
- XmlParser.processNode(child, subTag, filter);
- break;
- }
- }
- }
- }
-
- private static void processNode(Element elem, XmlTagHandler tag, XmlFilterHandler filter) throws XmlAttrException,
- XmlTagException {
- if (tag instanceof XmlTagEntryHandler) {
- ((XmlTagEntryHandler) tag).enter();
- }
-
- if (tag instanceof XmlFilterHandler) {
- filter = (XmlFilterHandler) tag;
- }
-
- XmlParser.checkAttributes(elem, tag, filter);
- if (tag instanceof XmlTextHandler) {
- ((XmlTextHandler) tag).handleText(elem.getText());
- }
-
- XmlParser.checkSubNodes(elem, tag, filter);
-
- if (tag instanceof XmlTagExitHandler) {
- ((XmlTagExitHandler) tag).exit();
- }
- }
-
- private static class DummyFilter implements XmlFilterHandler {
- public String filterAttrValue(XmlTagHandler tag, String attrName, String attrValue) {
- return attrValue;
- }
- }
-
- /**
- * Parse an input stream, otherwise the same as parsing a file
- */
- public static void parse(InputStream is, XmlTagHandler tag) throws XmlParseException {
- parse(is, tag, null);
- }
-
- public static void parse(InputStream is, XmlTagHandler tag, EntityResolver resolver) throws XmlParseException {
- SAXBuilder builder;
- Document doc;
-
- builder = new SAXBuilder();
-
- if (resolver != null) {
- builder.setEntityResolver(resolver);
- }
-
- try {
- if (resolver != null) {
- //WTF? seems relative entity URIs are allowed
- //by certain xerces impls. but fully qualified
- //file://... URLs trigger a NullPointerException
- //in others. setting base here worksaround
- doc = builder.build(is, "");
- } else {
- doc = builder.build(is);
- }
- } catch (Exception e) {
- throw new XmlParseException(e.getMessage());
- }
-
- generalParse(tag, doc);
- }
-
- /**
- * Parse a file, which should have a root which is the associated tag.
- *
- * @param in File to parse
- * @param tag Root tag which the parsed file should contain
- */
- public static void parse(File in, XmlTagHandler tag) throws XmlParseException {
- // JON: JDOM has a problem passing in a File that has spaces in dir name
- // (it escapes " " with "%20" and bombs out.
- // let's get the input stream ourselves and pass it to our parse() method that takes a stream
- try {
- InputStream is = new java.io.BufferedInputStream(new java.io.FileInputStream(in));
- parse(is, tag);
- } catch (java.io.FileNotFoundException exc) {
- throw new XmlParseException(exc.getMessage());
- }
- }
-
- /**
- * General parsing used by both parse methods above
- */
- private static void generalParse(XmlTagHandler tag, Document doc) throws XmlParseException {
- Element root = doc.getRootElement();
- if (!root.getName().equalsIgnoreCase(tag.getName())) {
- throw new XmlParseException("Incorrect root tag. Expected <" + tag.getName() + "> but got <"
- + root.getName() + ">");
- }
-
- XmlParser.processNode(root, tag, new DummyFilter());
- }
-
- private static void dumpAttrs(XmlAttr[] attrs, String typeName, int type, PrintStream out, int indent) {
- String printMsg;
- boolean printed = false;
- int lineBase;
- int lineLen;
-
- if (attrs.length == 0) {
- return;
- }
-
- lineLen = 0;
- printMsg = "- Has " + typeName + " attributes: ";
- lineBase = indent + printMsg.length();
-
- // Required attributes
- for (int i = 0; i < attrs.length; i++) {
- String toPrint;
-
- if (attrs[i].getType() != type) {
- continue;
- }
-
- if (!printed) {
- toPrint = StringUtil.repeatChars(' ', indent) + "- Has " + typeName + " attributes: ";
- out.print(toPrint);
- lineLen = toPrint.length();
- printed = true;
- }
-
- toPrint = attrs[i].getName() + ", ";
- lineLen += toPrint.length();
- out.print(toPrint);
- if (lineLen > 70) {
- out.println();
- out.print(StringUtil.repeatChars(' ', lineBase));
- lineLen = lineBase;
- }
- }
-
- if (printed) {
- out.println();
- }
- }
-
- private static void dumpNode(XmlTagHandler tag, PrintStream out, int indent) throws XmlTagException {
- out.println(StringUtil.repeatChars(' ', indent) + "Tag <" + tag.getName() + ">:");
- if (tag instanceof XmlAttrHandler) {
- XmlAttr[] attrs;
-
- attrs = ((XmlAttrHandler) tag).getAttributes();
- if (attrs.length == 0) {
- out.println(StringUtil.repeatChars(' ', indent) + "- has no required or optional attributes");
- }
-
- XmlParser.dumpAttrs(attrs, "REQUIRED", XmlAttr.REQUIRED, out, indent);
- XmlParser.dumpAttrs(attrs, "OPTIONAL", XmlAttr.OPTIONAL, out, indent);
- } else {
- out.println(StringUtil.repeatChars(' ', indent) + "- has no required or optional attributes");
- }
-
- if (tag instanceof XmlUnAttrHandler) {
- out.println(StringUtil.repeatChars(' ', indent) + "- handles arbitrary attributes");
- }
-
- XmlTagInfo[] subTags = tag.getSubTags();
- if (subTags.length == 0) {
- out.println(StringUtil.repeatChars(' ', indent) + "- has no subtags");
- } else {
- for (int i = 0; i < subTags.length; i++) {
- String name = subTags[i].getTag().getName();
- int type = subTags[i].getType();
-
- out.print(StringUtil.repeatChars(' ', indent) + "- has subtag <" + name + ">, which ");
- switch (type) {
- case XmlTagInfo.REQUIRED: {
- out.println("is REQUIRED");
- break;
- }
-
- case XmlTagInfo.OPTIONAL: {
- out.println("is OPTIONAL");
- break;
- }
-
- case XmlTagInfo.ONE_OR_MORE: {
- out.println("is REQUIRED at least ONCE");
- break;
- }
-
- case XmlTagInfo.ZERO_OR_MORE: {
- out.println("can be specified any # of times");
- break;
- }
- }
-
- XmlParser.dumpNode(subTags[i].getTag(), out, indent + 4);
- }
- }
- }
-
- public static void dump(XmlTagHandler root, PrintStream out) {
- try {
- XmlParser.dumpNode(root, out, 0);
- } catch (XmlTagException exc) {
- out.println("Error traversing tags: " + exc.getMessage());
- }
- }
-
- private static String bold(String text) {
- return "<emphasis role=\"bold\">" + text + "</emphasis>";
- }
-
- private static String tag(String name) {
- return bold("<" + name + ">");
- }
-
- private static String listitem(String name, String desc) {
- String item = "<listitem><para>" + name + "</para>";
- if (desc != null) {
- item += "<para>" + desc + "</para>";
- }
-
- return item;
- }
-
- private static void dumpAttrsSGML(XmlAttr[] attrs, String typeName, int type, PrintStream out, int indent) {
- boolean printed = false;
- if (attrs.length == 0) {
- return;
- }
-
- // Required attributes
- for (int i = 0; i < attrs.length; i++) {
- if (attrs[i].getType() != type) {
- continue;
- }
-
- if (!printed) {
- out.println(StringUtil.repeatChars(' ', indent) + "<itemizedlist><listitem><para>" + typeName
- + " attributes: </para>\n" + StringUtil.repeatChars(' ', indent) + "<itemizedlist>");
- printed = true;
- }
-
- out.println(StringUtil.repeatChars(' ', indent) + listitem(bold(attrs[i].getName()), null) + "</listitem>");
- }
-
- if (printed) {
- out.println(StringUtil.repeatChars(' ', indent) + "</itemizedlist></listitem></itemizedlist>");
- }
- }
-
- private static void dumpNodeSGML(XmlTagHandler tag, PrintStream out, int indent) throws XmlTagException {
- if (indent == 0) {
- out.println(StringUtil.repeatChars(' ', indent) + "<para>Tag " + tag(tag.getName()) + ":</para>");
- }
-
- if (tag instanceof XmlAttrHandler) {
- XmlAttr[] attrs;
-
- attrs = ((XmlAttrHandler) tag).getAttributes();
-
- dumpAttrsSGML(attrs, bold("REQUIRED"), XmlAttr.REQUIRED, out, indent);
- dumpAttrsSGML(attrs, bold("OPTIONAL"), XmlAttr.OPTIONAL, out, indent);
- }
-
- XmlTagInfo[] subTags = tag.getSubTags();
- if (subTags.length != 0) {
- out.println(StringUtil.repeatChars(' ', indent) + "<itemizedlist>");
-
- for (int i = 0; i < subTags.length; i++) {
- String name = subTags[i].getTag().getName();
- int type = subTags[i].getType();
- String desc = "";
-
- switch (type) {
- case XmlTagInfo.REQUIRED: {
- desc = "REQUIRED";
- break;
- }
-
- case XmlTagInfo.OPTIONAL: {
- desc = "OPTIONAL";
- break;
- }
-
- case XmlTagInfo.ONE_OR_MORE: {
- desc = "REQUIRED at least ONCE";
- break;
- }
-
- case XmlTagInfo.ZERO_OR_MORE: {
- desc = "can be specified any # of times";
- break;
- }
- }
-
- out.print(StringUtil.repeatChars(' ', indent) + listitem("Sub Tag " + tag(name) + " " + desc, null));
-
- dumpNodeSGML(subTags[i].getTag(), out, indent + 4);
- out.println(StringUtil.repeatChars(' ', indent) + "</listitem>");
- }
-
- out.println(StringUtil.repeatChars(' ', indent) + "</itemizedlist>");
- }
- }
-
- public static void dumpSGML(XmlTagHandler root, PrintStream out) {
- try {
- dumpNodeSGML(root, out, 0);
- } catch (XmlTagException exc) {
- out.println("Error traversing tags: " + exc.getMessage());
- }
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java
deleted file mode 100644
index b4b2205..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * This exception is thrown when a tag is missing a required attribute.
- */
-
-public class XmlRequiredAttrException extends XmlAttrException {
- XmlRequiredAttrException(Element e, String reqAttr) {
- super("Tag <" + e.getName() + "> requires attribute '" + reqAttr + "'");
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.java
deleted file mode 100644
index fc19a85..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * Classes which wish to be notified when the parser has entered the parsing of the tag should implement this interface.
- * Enter is called prior to any validation of attributes or subtags.
- */
-
-public interface XmlTagEntryHandler {
- public void enter();
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java
deleted file mode 100644
index 0160677..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A base-class for other tag based exceptions.
- */
-
-public class XmlTagException extends XmlParseException {
- public XmlTagException(String s) {
- super(s);
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.java
deleted file mode 100644
index dea7e37..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * Classes which wish to be notified when the parser has exited the parsing of the tag should implement this interface.
- * Exit is called after all attributes and subtags have been processed.
- */
-
-public interface XmlTagExitHandler {
- public void exit() throws XmlTagException;
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java
deleted file mode 100644
index c1ee9fd..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java
+++ /dev/null
@@ -1,44 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * The major interface which all objects wishing to use XmlParser must implement. The TagHander provides information
- * about the tags name, and which subtags are valid.
- */
-public interface XmlTagHandler {
- /**
- * Retrieve the name of the tag, without angled brackets. (i.e. "foo" for tags named <foo>)
- *
- * @return The name of the tag
- */
- public String getName();
-
- /**
- * Retrieve information about which subtags are valid within the given tag. This method will only be called once for
- * each object.
- *
- * @return An array of tag information objects, indicating which subtags are valid.
- */
- public XmlTagInfo[] getSubTags();
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java
deleted file mode 100644
index cb6b494..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java
+++ /dev/null
@@ -1,62 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * This class is used to describe which subtags a given tag supports. The object has a 'tag', which will be traversed
- * to, and a validity requirement, indicating if the subtag must exist in the tag, is optional, is valid one or more
- * times, or is valid zero or more times.
- */
-
-public class XmlTagInfo {
- public static final int REQUIRED = 0;
- public static final int OPTIONAL = 1;
- public static final int ONE_OR_MORE = 2;
- public static final int ZERO_OR_MORE = 3;
-
- private XmlTagHandler tag;
- private int type;
-
- /**
- * Create a new tag info object with the specified tag and type.
- *
- * @param tag The sub tag which will be traversed to
- * @param type One of REQUIRED, OPTIONAL, ONE_OR_MORE, ZERO_OR_MORE
- */
- public XmlTagInfo(XmlTagHandler tag, int type) {
- this.tag = tag;
- this.type = type;
-
- if ((type < REQUIRED) || (type > ZERO_OR_MORE)) {
- throw new IllegalArgumentException("Unknown type: " + type);
- }
- }
-
- XmlTagHandler getTag() {
- return this.tag;
- }
-
- int getType() {
- return this.type;
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java
deleted file mode 100644
index 6c0e4fd..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java
+++ /dev/null
@@ -1,27 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-public interface XmlTextHandler {
- public void handleText(String text);
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java
deleted file mode 100644
index 6cafff5..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * This exception is thrown if a subtag is found too many times within a tag. It can be thrown if an unknown subtag was
- * found, or if the requirement of the subtag was exceeded.
- */
-public class XmlTooManyTagException extends XmlTagException {
- XmlTooManyTagException(Element e, String reqTag) {
- super("<" + e.getName() + "> tag contains too many <" + reqTag + "> subtags");
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.java
deleted file mode 100644
index 5185176..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * This interface must be implemented for a class to handle unknown attributes (i.e attributes not declared in the
- * AttrHandler)
- */
-
-public interface XmlUnAttrHandler {
- public void handleUnknownAttribute(String name, String value);
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java
deleted file mode 100644
index 91d8135..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * This exception is thrown when an unknown attribute is encountered.
- */
-
-public class XmlUnknownAttrException extends XmlAttrException {
- XmlUnknownAttrException(Element e, String attr) {
- super("<" + e.getName() + "> contains an unknown attribute, '" + attr + "'");
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index ff43a66..f0ef562 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -330,14 +330,6 @@ public class LinkManager {
return "/rhq/admin/downloads.xhtml";
}
- public static String getAdminLicenseLink() {
- if (GWT) {
- return "#Administration/Configuration/License";
- } else {
- return "/admin/license/LicenseAdmin.do?mode=view";
- }
- }
-
public static String getDebugSqlLink() {
return "/admin/test/sql.jsp";
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index 6e8da99..57bcb1c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -67,7 +67,6 @@ public class AdministrationView extends AbstractSectionedLeftNavigationView {
.view_adminConfig_systemSettings());
public static final ViewName PAGE_TEMPLATES_VIEW_ID = new ViewName("Templates", MSG.view_adminConfig_templates());
private static final ViewName PAGE_DOWNLOADS_VIEW_ID = new ViewName("Downloads", MSG.view_adminConfig_downloads());
- private static final ViewName PAGE_LICENSE_VIEW_ID = new ViewName("License", MSG.view_adminConfig_license());
private static final ViewName PAGE_PLUGINS_VIEW_ID = new ViewName("Plugins", MSG.view_adminConfig_plugins());
// TODO these iframe page view ids should go away in favor of the gwt view page view_id, when available
@@ -199,14 +198,6 @@ public class AdministrationView extends AbstractSectionedLeftNavigationView {
}
});
- NavigationItem licenseItem = new NavigationItem(PAGE_LICENSE_VIEW_ID, "subsystems/bundle/Details_11.png",
- new ViewFactory() {
- public Canvas createView() {
- return new FullHTMLPane(extendLocatorId(PAGE_LICENSE_VIEW_ID.getName()),
- "/admin/license/LicenseAdmin.do?mode=view&nomenu=true");
- }
- });
-
NavigationItem pluginsItem = new NavigationItem(PAGE_PLUGINS_VIEW_ID, "global/Plugin_16.png",
new ViewFactory() {
public Canvas createView() {
@@ -216,7 +207,7 @@ public class AdministrationView extends AbstractSectionedLeftNavigationView {
});
return new NavigationSection(SECTION_CONFIGURATION_VIEW_ID, systemSettingsItem, templatesItem, downloadsItem,
- licenseItem, pluginsItem);
+ pluginsItem);
}
private NavigationSection buildContentSection() {
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index ff8d7bd..6ab3ce6 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -525,7 +525,6 @@ view_adminTopology_remoteAgentInstall = Remote Agent Install
view_adminTopology_servers = Servers
view_adminConfig_downloads = Downloads
-view_adminConfig_license = License
view_adminConfig_plugins = Plugins
view_adminConfig_systemSettings = System Settings
view_adminConfig_templates = Templates
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java
deleted file mode 100644
index fd2c7f9..0000000
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.gui.action.license;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-import org.apache.struts.tiles.ComponentContext;
-import org.apache.struts.tiles.actions.TilesAction;
-
-import org.rhq.enterprise.gui.legacy.WebUser;
-import org.rhq.enterprise.gui.legacy.util.RequestUtils;
-import org.rhq.enterprise.gui.legacy.util.SessionUtils;
-import org.rhq.enterprise.server.license.License;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Created by IntelliJ IDEA. User: ghinkle Date: Aug 5, 2005 Time: 9:41:08 AM To change this template use File |
- * Settings | File Templates.
- */
-public class LicenseController extends TilesAction {
- private static final Log log = LogFactory.getLog(org.rhq.enterprise.gui.action.license.LicenseController.class
- .getName());
-
- public static final String LICENSE = "license";
-
- @Override
- public ActionForward execute(ComponentContext context, ActionMapping mapping, ActionForm form,
- HttpServletRequest request, HttpServletResponse response) throws Exception {
- ServletContext ctx = getServlet().getServletContext();
-
- HttpSession session = request.getSession();
-
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
-
- WebUser user = SessionUtils.getWebUser(session);
- request.setAttribute("userId", user.getId());
-
- License license = null;
- /*try
- *{*/
- license = systemManager.getLicense();
-
- // no license exists
- if (license == null) {
- RequestUtils.setError(request, "admin.license.LicenseNotLoaded");
-
- // license exists, but is expired
- } else if (license.getLicenseExpiration() < System.currentTimeMillis()) {
- RequestUtils.setError(request, "admin.license.LicenseExpired");
- }
-
- if (request.getParameter("update") != null) {
- RequestUtils.setConfirmation(request, "admin.license.confirm.LicenseUpdated");
- }
-
- request.setAttribute(LICENSE, license);
-
- // TODO GH: Fix the rest of this
- /*}
- * catch (UpdateTrialLicenseException tlue) {
- */
- /*
- * can't perform an update with trial licenses unless you're reinstalling, using the same one, and the trial
- * hasn't expired yet; thus, don't set the request attribute here
- */
- /*
- * RequestUtils.setError(request, "admin.license.error.TrialLicenseNotUpdated"); } catch
- * (CorruptLicenseException cle) { RequestUtils.setError(request, "admin.license.error.LicenseCorrupt"); } catch
- * (UnavailableLicenseException ule) { // the backing store was unavailable, let them use it, set the license
- * attrib request.setAttribute(LICENSE, license);} */
-
- return null;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java
deleted file mode 100644
index bf860db..0000000
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.gui.action.license;
-
-import org.apache.struts.upload.FormFile;
-import org.rhq.enterprise.gui.legacy.action.BaseValidatorForm;
-
-/**
- * Created by IntelliJ IDEA. User: ghinkle Date: Aug 15, 2005 Time: 2:25:26 PM To change this template use File |
- * Settings | File Templates.
- */
-public class LicenseForm extends BaseValidatorForm {
- FormFile licenseFile;
-
- String portalUsername;
- String portalPassword;
-
- public FormFile getLicenseFile() {
- return licenseFile;
- }
-
- public void setLicenseFile(FormFile licenseFile) {
- this.licenseFile = licenseFile;
- }
-
- public String getPortalUsername() {
- return portalUsername;
- }
-
- public void setPortalUsername(String portalUsername) {
- this.portalUsername = portalUsername;
- }
-
- public String getPortalPassword() {
- return portalPassword;
- }
-
- public void setPortalPassword(String portalPassword) {
- this.portalPassword = portalPassword;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java
deleted file mode 100644
index d0d40d5..0000000
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.gui.action.license;
-
-import java.util.HashMap;
-import java.util.Properties;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-
-import org.rhq.core.domain.authz.Permission;
-import org.rhq.enterprise.gui.legacy.Constants;
-import org.rhq.enterprise.gui.legacy.Portal;
-import org.rhq.enterprise.gui.legacy.action.BaseDispatchAction;
-import org.rhq.enterprise.gui.legacy.exception.ParameterNotFoundException;
-import org.rhq.enterprise.gui.legacy.util.ActionUtils;
-import org.rhq.enterprise.gui.legacy.util.BizappUtils;
-import org.rhq.enterprise.gui.legacy.util.RequestUtils;
-import org.rhq.enterprise.gui.legacy.util.SessionUtils;
-import org.rhq.enterprise.server.authz.PermissionException;
-
-/**
- * Created by IntelliJ IDEA. User: ghinkle Date: Aug 8, 2005 Time: 10:34:55 AM To change this template use File |
- * Settings | File Templates.
- */
-public class LicensePortalAction extends BaseDispatchAction {
- private static final String TITLE_VIEW = "admin.license.ViewLicenseTitle";
- private static final String PORTLET_VIEW = ".admin.license.View";
-
- private static final String TITLE_EDIT = "admin.license.EditLicenseTitle";
- private static final String PORTLET_EDIT = ".admin.license.Edit";
-
- protected static Log log = LogFactory.getLog(LicensePortalAction.class.getName());
-
- private static Properties keyMethodMap = new Properties();
-
- static {
- keyMethodMap.setProperty(Constants.MODE_VIEW, "viewLicense");
- keyMethodMap.setProperty(Constants.MODE_EDIT, "editLicense");
- }
-
- @Override
- protected Properties getKeyMethodMap() {
- return keyMethodMap;
- }
-
- public ActionForward viewLicense(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws Exception {
-
- setReturnPath(request, mapping, Constants.MODE_VIEW);
-
- Portal portal = Portal.createPortal(TITLE_VIEW, PORTLET_VIEW);
- portal.setWorkflowPortal(false);
- request.setAttribute(Constants.PORTAL_KEY, portal);
-
- return null;
- }
-
- public ActionForward editLicense(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- if (!BizappUtils.hasPermission(request, Permission.MANAGE_SETTINGS)) {
- throw new PermissionException("User not authorized to update the license");
- }
-
- setReturnPath(request, mapping, Constants.MODE_VIEW);
-
- Portal portal = Portal.createPortal(TITLE_EDIT, PORTLET_EDIT);
- portal.setWorkflowPortal(false);
- request.setAttribute(Constants.PORTAL_KEY, portal);
-
- if (request.getParameter("error") != null) {
- RequestUtils.setError(request, "admin.license.error.NotUpdated");
- }
-
- return null;
- }
-
- /**
- * Set the return path for the current action, including the mode and (if necessary) user id request parameters.
- *
- * @param request The request to get the session to store the return path into.
- * @param mapping The ActionMapping to get the return path from.
- * @param mode The name of the current display mode.
- */
- protected void setReturnPath(HttpServletRequest request, ActionMapping mapping, String mode) throws Exception {
- HashMap params = new HashMap();
- params.put(Constants.MODE_PARAM, mode);
- try {
- params.put(Constants.USER_PARAM, RequestUtils.getUserId(request));
- } catch (ParameterNotFoundException e) {
- ; // not in a specific user's context
- }
-
- String returnPath = ActionUtils.findReturnPath(mapping, params);
- if (log.isTraceEnabled()) {
- log.trace("setting return path: " + returnPath);
- }
-
- SessionUtils.setReturnPath(request.getSession(), returnPath);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java
deleted file mode 100644
index f57f7e4..0000000
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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.gui.action.license;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.authz.Permission;
-import org.rhq.enterprise.gui.legacy.action.BaseAction;
-import org.rhq.enterprise.gui.legacy.util.ContextUtils;
-import org.rhq.enterprise.gui.legacy.util.RequestUtils;
-import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
-import org.rhq.enterprise.server.license.CorruptLicenseException;
-import org.rhq.enterprise.server.license.LicenseManager;
-import org.rhq.enterprise.server.license.UnavailableLicenseException;
-import org.rhq.enterprise.server.license.UpdateTrialLicenseException;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * This action receives an updated license file through form submission and saves it out to the appropriate places in
- * the filesystem and then reloads the license manager system. License updates take force immediately.
- *
- * @author Greg Hinkle
- */
-public class LicenseUpdateAction extends BaseAction {
- static Log log = LogFactory.getLog(LicenseUpdateAction.class.getName());
-
- // ---------------------------------------------------- Public Methods
-
- /**
- * Updates the installed license files on disk and invokes the LicenseManager's initialization routines to immediate
- * provide workable access to the application.
- */
- @Override
- public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- LicenseForm licenseForm = (LicenseForm) form;
-
- if (licenseForm.isCancelClicked()) {
- return returnCancelled(request, mapping);
- } else if (licenseForm.isResetClicked()) {
- return returnReset(request, mapping);
- } else if (licenseForm.isOkClicked()) {
- Subject subject = RequestUtils.getSubject(request);
- AuthorizationManagerLocal authzManager = LookupUtil.getAuthorizationManager();
- if (!authzManager.hasGlobalPermission(subject, Permission.MANAGE_SETTINGS)) {
- log.error("License file can only be updated by users who have permission to manage server settings");
- return returnFailure(request, mapping);
- }
-
- if ((licenseForm.licenseFile.getFileData() == null) || (licenseForm.licenseFile.getFileData().length == 0)) {
- return returnFailure(request, mapping);
- }
-
- log.debug("Updating license with uploaded file.");
-
- /*
- * Check to see if the license is valid, which means also checking whether it's valid with respect to any
- * license that may already be in the backing store.
- */
- InputStream is = new ByteArrayInputStream(licenseForm.licenseFile.getFileData());
- try {
- LicenseManager.checkLicense(is);
- } catch (CorruptLicenseException cle) {
- log.error("License file is corrupt or not in sync with previous records");
- return returnFailure(request, mapping);
- } catch (UpdateTrialLicenseException tlue) {
- log.error("Licenses can not be updated by trial licenses");
- return returnFailure(request, mapping);
- } catch (UnavailableLicenseException ule) {
- log.error("Backing store unavailable, allowing license to be written to disk unconditionally");
- } catch (Exception e) {
- log.error("Unable to update license file", e);
- return returnFailure(request, mapping);
- }
-
- log.debug("Uploaded license file validated");
-
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
-
- systemManager.updateLicense(subject, licenseForm.licenseFile.getFileData());
-
- RequestUtils.setConfirmation(request, "admin.license.confirm.LicenseUpdated");
-
- ContextUtils.updateMonitoringEnabled(getServlet().getServletContext());
- }
-
- return returnSuccess(request, mapping);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
index 19d7bd3..ce44bb3 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
@@ -38,7 +38,6 @@ import org.apache.struts.tiles.actions.TilesAction;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.enterprise.gui.legacy.AttrConstants;
import org.rhq.enterprise.gui.legacy.Constants;
import org.rhq.enterprise.gui.legacy.WebUser;
import org.rhq.enterprise.gui.legacy.util.SessionUtils;
@@ -157,8 +156,6 @@ public class AuthenticateUserAction extends TilesAction {
session.setAttribute(Constants.PASSWORD_SES_ATTR, logonForm.getJ_password());
}
- updateMonitoringEnabled(ctx);
-
return af;
}
@@ -215,18 +212,4 @@ public class AuthenticateUserAction extends TilesAction {
return (provider != null) && provider.equals(RHQConstants.LDAPJAASProvider);
}
-
- /**
- * Returns <code>true</code> if the RHQ Server's monitoring capabilities has been enabled. A servlet context
- * attribute "monitorEnabled" is also set to this method's return value.
- *
- * @param context
- *
- * @return <code>true</code> if all monitoring capabilities are allowed
- */
- public static boolean updateMonitoringEnabled(ServletContext context) {
- boolean enabled = LookupUtil.getSystemManager().isMonitoringEnabled();
- context.setAttribute(AttrConstants.MONITOR_ENABLED, Boolean.valueOf(enabled));
- return enabled;
- }
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
index 6c87a4f..3303617 100755
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
@@ -792,16 +792,6 @@ public interface AttrConstants {
public static final String MONITOR_CONFIG_OPTIONS = "monitorConfigOptions";
/**
- * Servlet context attribute indicating whether the installed RHQ license enables monitoring features.
- */
- public static final String MONITOR_ENABLED = "monitorEnabled";
-
- /**
- * Request attribute indicating whether monitoring is enabled for a resource.
- */
- public static final String MONITOR_ENABLED_ATTR = "monitorEnabledAttr";
-
- /**
* Request attribute to hold monitoring help text
*/
public static final String MONITOR_HELP = "monitorHelp";
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
index c30f7ce..8743a33 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
@@ -38,10 +38,6 @@ import org.rhq.enterprise.gui.legacy.util.SessionUtils;
import org.rhq.enterprise.server.auth.SessionManager;
import org.rhq.enterprise.server.auth.SessionNotFoundException;
import org.rhq.enterprise.server.auth.SessionTimeoutException;
-import org.rhq.enterprise.server.license.License;
-import org.rhq.enterprise.server.system.LicenseException;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
public final class AuthenticationFilter extends BaseFilter {
@@ -106,25 +102,6 @@ public final class AuthenticationFilter extends BaseFilter {
response.sendRedirect(request.getContextPath() + "/Login.do");
}
} else {
- // Now check if the license is up and running
- if (request.getRequestURI().indexOf("/admin/license") < 0) {
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- License license = null;
- try {
- license = systemManager.getLicense();
- } catch (LicenseException le) {
- /*
- * license will still be null because the exception is thrown out of azboss.getLicense()
- * LicenseAdmin.do will take care of showing the appropriate exception by delegating to
- * LicenseController
- */
- }
-
- if ((license == null) || (license.getLicenseExpiration() < System.currentTimeMillis())) {
- response.sendRedirect(request.getContextPath() + "/admin/license/LicenseAdmin.do?mode=view");
- }
- }
-
try {
chain.doFilter(request, response);
} catch (IOException e) {
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
index 3cb6ae7..73da3d7 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
@@ -20,14 +20,15 @@ package org.rhq.enterprise.gui.legacy.action.resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
+
import org.rhq.enterprise.gui.legacy.ParamConstants;
import org.rhq.enterprise.gui.legacy.action.BaseAction;
import org.rhq.enterprise.gui.legacy.util.RequestUtils;
import org.rhq.enterprise.gui.util.WebUtility;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* An <code>Action</code> that forwards a request to view a resource or group on to the appropriate default action.
@@ -66,9 +67,9 @@ public class DetermineLocationAction extends BaseAction {
throw new IllegalArgumentException("Unknown type '" + type + "' was passed to DetermineLocationAction");
}
- if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
- forwardConfigName += "-inventory";
- }
+ // if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ // forwardConfigName += "-inventory";
+ // }
return mapping.findForward(forwardConfigName);
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
index 823a2a8..37d2046 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
@@ -33,7 +33,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionRedirect;
import org.rhq.enterprise.gui.legacy.AttrConstants;
import org.rhq.enterprise.gui.legacy.KeyConstants;
@@ -46,7 +45,6 @@ import org.rhq.enterprise.gui.legacy.exception.ParameterNotFoundException;
import org.rhq.enterprise.gui.legacy.util.ActionUtils;
import org.rhq.enterprise.gui.legacy.util.SessionUtils;
import org.rhq.enterprise.gui.util.WebUtility;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* A <code>BaseDispatchAction</code> that sets up common monitor portals.
@@ -116,12 +114,12 @@ public class VisibilityPortalAction extends ResourceVisibilityPortalAction {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
ActionForward fwd = super.execute(mapping, form, request, response);
- if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
- ActionRedirect redirect = new ActionRedirect(mapping.findForward("inventory-jsf"));
- redirect.addParameter("id", request.getParameter("id"));
- redirect.setRedirect(false);
- fwd = redirect;
- }
+ // if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ // ActionRedirect redirect = new ActionRedirect(mapping.findForward("inventory-jsf"));
+ // redirect.addParameter("id", request.getParameter("id"));
+ // redirect.setRedirect(false);
+ // fwd = redirect;
+ // }
return fwd;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
index 18183ac..0a5c133 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
@@ -107,7 +107,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
}
measurementSchedules = new PageList<MeasurementScheduleComposite>(composites, definitions.size(),
pageControl);
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, Boolean.FALSE);
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, Boolean.FALSE);
ResourceType rType = rtManager.getResourceTypeById(subject, resourceTypeId);
request.setAttribute(AttrConstants.RESOURCE_TYPE_ATTR, rType);
@@ -115,7 +115,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
} else {
int resourceId = WebUtility.getOptionalIntRequestParameter(request, "id", -1);
if ((parent > 0) && (type > 0)) {
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true);
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true);
measurementSchedules = scheduleManager.getMeasurementScheduleCompositesByContext(subject, EntityContext
.forAutoGroup(parent, type), pageControl);
@@ -126,7 +126,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
request.setAttribute("parentName", parentRes.getName());
} else if (resourceId > 0) {
boolean monitoringConfigured = isMonitoringConfigured(resourceId);
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, monitoringConfigured);
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, monitoringConfigured);
if (monitoringConfigured) {
log.debug("Obtaining metric schedules for resource " + resourceId + "...");
measurementSchedules = scheduleManager.getMeasurementScheduleCompositesByContext(subject,
@@ -134,7 +134,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
}
} else if (groupId > 0) {
boolean monitoringConfigured = true; // isMonitoringConfiguredForGroup(groupId); // TODO implement the method, see below
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true); // TODO change true -> monitoringConfigured
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true); // TODO change true -> monitoringConfigured
if (monitoringConfigured) {
log.debug("Obtaining metric schedules for comp group " + groupId + "...");
measurementSchedules = scheduleManager.getMeasurementScheduleCompositesByContext(subject,
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
index fad2f78..57b55f5 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
@@ -28,7 +28,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionRedirect;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.composite.ResourceWithAvailability;
@@ -94,13 +93,13 @@ public class GroupVisibilityPortalAction extends GroupController {
HttpServletResponse response) throws Exception {
ActionForward fwd = super.execute(mapping, form, request, response);
- if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
- ActionRedirect redirect = new ActionRedirect(mapping.findForward("inventory-jsf"));
- redirect.addParameter("groupId", request.getParameter("groupId"));
- redirect.addParameter("category", request.getParameter("category"));
- redirect.setRedirect(false);
- fwd = redirect;
- }
+ // if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ // ActionRedirect redirect = new ActionRedirect(mapping.findForward("inventory-jsf"));
+ // redirect.addParameter("groupId", request.getParameter("groupId"));
+ // redirect.addParameter("category", request.getParameter("category"));
+ // redirect.setRedirect(false);
+ // fwd = redirect;
+ // }
return fwd;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
index aaa7aae..fd42a3c 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
@@ -18,66 +18,16 @@
*/
package org.rhq.enterprise.gui.legacy.taglib;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
+@Deprecated
public class LicenseExpirationTag extends TagSupport {
- private static long lastRead = 0;
- private static String expiration = null;
-
- public static final long MILLIS_IN_DAY = 1000 * 60 * 60 * 24;
- public static final long WARN_EXPIRE_DAYS = 30;
- public static final long REFRESH_MILLIS = 1000 * 60 * 60;
-
- public static final SimpleDateFormat DFORMAT = new SimpleDateFormat("MMMM dd, yyyy");
-
- public static final String PREFIX = "<tr>" + "\n <td colspan=\"9\" class=\"FooterRegular\">";
- public static final String SUFFIX = " <a href=\"http://www.jboss.com\">Contact "
- + "JBoss</a> to renew your license!</td>\n</tr>";
-
public LicenseExpirationTag() {
super();
}
- private String loadExpiration() {
- long now = System.currentTimeMillis();
- if ((expiration != null) && ((now - lastRead) < REFRESH_MILLIS)) {
- return expiration;
- }
-
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- Date expiresDate = systemManager.getExpiration();
-
- if (expiresDate == null) {
- // No expiration
- return "";
- }
-
- long numDays = (expiresDate.getTime() - now) / MILLIS_IN_DAY;
- if (numDays > WARN_EXPIRE_DAYS) {
- return "";
- }
-
- if (numDays <= 0) {
- return PREFIX + "LICENSE EXPIRES TODAY!" + SUFFIX;
- } else {
- return PREFIX + "LICENSE EXPIRES IN " + numDays + " DAYS (on " + DFORMAT.format(expiresDate) + ")" + SUFFIX;
- }
- }
-
public final int doStartTag() throws JspException {
- try {
- pageContext.getOut().write(loadExpiration());
- } catch (IOException e) {
- throw new JspTagException(e.toString());
- }
-
return SKIP_BODY;
}
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
index db96f03..56080ff 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
@@ -31,7 +31,6 @@ import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
import org.rhq.core.gui.util.UrlUtility;
import org.rhq.enterprise.gui.legacy.HubConstants;
import org.rhq.enterprise.server.resource.ResourceFacetsCache;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* A {@link QuicknavDecorator} for {@link ResourceGroup}s.
@@ -127,7 +126,7 @@ public class GroupQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isMonitorAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; // LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
@@ -152,7 +151,7 @@ public class GroupQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isAlertAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; //LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
index 93e4d2e..ba7e44e 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
@@ -26,7 +26,6 @@ import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceFacets;
import org.rhq.enterprise.gui.legacy.ParamConstants;
import org.rhq.enterprise.server.resource.ResourceFacetsCache;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* A {@link QuicknavDecorator} for {@link Resource}s.
@@ -110,7 +109,7 @@ public class ResourceQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isMonitorAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; // LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
@@ -135,7 +134,7 @@ public class ResourceQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isAlertAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; //LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
index 2c355bf..31d5fc4 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
@@ -24,8 +24,9 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+
import javax.servlet.ServletContext;
-import org.rhq.enterprise.gui.legacy.AttrConstants;
+
import org.rhq.enterprise.gui.legacy.Constants;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -254,25 +255,4 @@ public class ContextUtils {
return (provider != null) && provider.equals(RHQConstants.LDAPJAASProvider);
}
-
- public static boolean updateMonitoringEnabled(ServletContext context) {
- boolean enabled;
- try {
- enabled = LookupUtil.getSystemManager().isMonitoringEnabled();
- } catch (Exception e) {
- enabled = false;
- }
-
- context.setAttribute(AttrConstants.MONITOR_ENABLED, Boolean.valueOf(enabled));
- return enabled;
- }
-
- public static boolean monitoringEnabled(ServletContext context) {
- Boolean enabled = (Boolean) context.getAttribute(AttrConstants.MONITOR_ENABLED);
- if (enabled == null) {
- return updateMonitoringEnabled(context);
- } else {
- return enabled;
- }
- }
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
index fcbc61b..46e5043 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
@@ -107,7 +107,7 @@ public abstract class TreeContextMenuBase {
HtmlOutputLink link;
HtmlGraphicImage image;
- if (descriptor.getMonitoringUrl() != null && LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ if (descriptor.getMonitoringUrl() != null /* && LookupUtil.getSystemManager().isMonitoringEnabled()*/) {
link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getMonitoringUrl());
image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Monitor_grey_16.png", "Monitor");
image.setStyle(STYLE_QUICK_LINKS_ICON);
@@ -120,7 +120,7 @@ public abstract class TreeContextMenuBase {
image.setStyle(STYLE_QUICK_LINKS_ICON);
}
- if (descriptor.getAlertsUrl() != null && LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ if (descriptor.getAlertsUrl() != null /*&& LookupUtil.getSystemManager().isMonitoringEnabled()*/) {
link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getAlertsUrl());
image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Alert_grey_16.png", "Alerts");
image.setStyle(STYLE_QUICK_LINKS_ICON);
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
index 61a14fe..e98cc1e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
@@ -1880,48 +1880,6 @@
<set-property property="title" value="Start"/>
</action>
- <action path="/admin/license/LicenseAdmin"
- forward=".admin.license.layout">
- </action>
-
- <action path="/admin/license/View"
- type="org.rhq.enterprise.gui.action.license.LicenseController">
- <set-property property="title" value="License"/>
- </action>
-
- <action path="/admin/license/LicensePortal"
- parameter="mode"
- input="/admin/license/LicenseAdmin.do"
- type="org.rhq.enterprise.gui.action.license.LicensePortalAction">
- <set-property property="title" value="License"/>
- </action>
-
- <action path="/admin/license/UpdateLicense"
- name="LicenseAdminForm"
- scope="request"
- parameter="mode"
- type="org.rhq.enterprise.gui.action.license.LicenseUpdateAction"
- input="/admin/license/LicenseAdmin.do?mode=edit">
- <set-property property="title" value="License"/>
- <forward name="cancel" path="/admin/license/LicenseAdmin.do?mode=view" redirect="true"/>
- <forward name="reset" path="/admin/license/LicenseAdmin.do?mode=edit" redirect="true"/>
- <forward name="failure" path="/admin/license/LicenseAdmin.do?mode=edit&error=true" redirect="true"/>
- <forward name="success" path="/admin/license/LicenseAdmin.do?mode=view&update=true" redirect="true"/>
- </action>
-
- <action path="/admin/license/UpdateLicenseNoMenu"
- name="LicenseAdminForm"
- scope="request"
- parameter="mode"
- type="org.rhq.enterprise.gui.action.license.LicenseUpdateAction"
- input="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true">
- <set-property property="title" value="License"/>
- <forward name="cancel" path="/admin/license/LicenseAdmin.do?mode=view&nomenu=true" redirect="true"/>
- <forward name="reset" path="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true" redirect="true"/>
- <forward name="failure" path="/admin/license/LicenseAdmin.do?mode=edit&error=true&nomenu=true" redirect="true"/>
- <forward name="success" path="/admin/license/LicenseAdmin.do?mode=view&update=true&nomenu=true" redirect="true"/>
- </action>
-
<action path="/dashboard/Admin"
forward=".dashboard.admin.layout">
</action>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
index 0559198..640a4a3 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
@@ -36,14 +36,6 @@
<definition name=".admin.home"
path="/admin/AdminHome.jsp"/>
- <!-- license manager -->
- <definition name=".admin.license.View"
- controllerUrl="/admin/license/View.do"
- path="/admin/license/License.jsp"/>
-
- <definition name=".admin.license.Edit"
- path="/admin/license/LicenseEdit.jsp"/>
-
<!-- admin role portlets -->
<definition name=".admin.role.List"
controllerUrl="/admin/role/List.do"
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
index 1af3acc..269a255 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
@@ -38,14 +38,6 @@
<put name="breadcrumb" value="/admin/AdminHeader.jsp" />
</definition>
- <!-- JBMAN License Manager -->
- <definition name=".admin.license.layout"
- extends=".admin.home.layout"
- controllerUrl="/admin/license/LicensePortal.do">
- <put name="location" value="header.license" />
- </definition>
-
-
<definition name=".admin.role.layout"
extends=".admin.home.layout"
controllerUrl="/admin/role/RoleAdminPortal.do">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
index 3256a75..f727698 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
@@ -65,11 +65,6 @@
</td>
</tr>
<tr>
- <td width="20%" class="BlockLabel"><fmt:message key="admin.home.License"/></td>
- <td width="30%" class="BlockContent"><html:link page="/admin/license/LicenseAdmin.do?mode=view"><fmt:message key="admin.home.LicenseManager"/></html:link></td>
- </tr>
-
- <tr>
<td width="20%" class="BlockLabel"><fmt:message key="admin.home.Plugins"/></td>
<td width="30%" class="BlockContent"><html:link page="/rhq/admin/plugin/plugin-list.xhtml"><fmt:message key="admin.home.PluginsLink"/></html:link></td>
</tr>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
index 0ec1a85..937f006 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
@@ -31,7 +31,6 @@
<tr class="ListRowSelected">
<td class="ListCellPrimary"><c:out value="${entry.type.name}"/> <c:out value="${entry.pluginInfo}"/></td>
<td class="ListCell" align="left" nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<c:if test="${not empty param.nomenu}">
<html:link page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${entry.type.id}&type=${entry.type.id}" styleClass="buttonsmall">
Edit Metric Template
@@ -47,10 +46,8 @@
(<c:out value="${entry.enabledMetricCount}" /> | <c:out value="${entry.disabledMetricCount}" />)
</span>
</c:if>
- </c:if>
</td>
<td class="ListCell" align="left" nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<html:link page="/rhq/admin/listAlertTemplates.xhtml?type=${entry.type.id}" styleClass="buttonsmall">
Edit Alert Templates
</html:link>
@@ -59,7 +56,6 @@
(<c:out value="${entry.enabledAlertCount}" /> | <c:out value="${entry.disabledAlertCount}" />)
</span>
</c:if>
- </c:if>
</td>
</tr>
@@ -105,7 +101,6 @@
<tr class="ListRowSelected">
<td class="ListCellPrimary"><c:out value="${entry.type.name}"/> <c:out value="${entry.pluginInfo}"/></td>
<td class="ListCell" align="left">
- <c:if test="${monitorEnabled}">
<c:if test="${not empty param.nomenu}">
<html:link page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&type=${entry.type.id}" styleClass="buttonsmall">
Edit Metric Template
@@ -121,10 +116,8 @@
(<c:out value="${entry.enabledMetricCount}" /> | <c:out value="${entry.disabledMetricCount}" />)
</span>
</c:if>
- </c:if>
</td>
<td class="ListCell" align="left">
- <c:if test="${monitorEnabled}">
<html:link page="/rhq/admin/listAlertTemplates.xhtml?type=${entry.type.id}" styleClass="buttonsmall">
Edit Alert Templates
</html:link>
@@ -133,7 +126,6 @@
(<c:out value="${entry.enabledAlertCount}" /> | <c:out value="${entry.disabledAlertCount}" />)
</span>
</c:if>
- </c:if>
</td>
</tr>
<tiles:insert definition=".resource.common.monitor.config.ShowOneResourceType">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
deleted file mode 100644
index 4c7d47a..0000000
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
+++ /dev/null
@@ -1,94 +0,0 @@
-<%@ page import="org.rhq.enterprise.server.license.License" %>
-<%@ page import="java.util.Date" %>
-<%@ page language="java" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
-
-
-<tiles:insert definition=".portlet.confirm" flush="true"/>
-<tiles:insert definition=".portlet.error" flush="true"/>
-
-
-<table width="100%" cellpadding="0" cellspacing="0" border="0">
-
- <tr>
- <td colspan="4" class="BlockHeader">
- <tiles:insert definition=".header.tab">
- <tiles:put name="tabKey" value="admin.license.LicenseInfoTab"/>
- </tiles:insert>
- </td>
- </tr>
- <!-- / -->
-
- <c:choose>
- <c:when test="${license != null}">
- <!-- EMAIL CONFIG CONTENTS -->
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.LicenseeUser"/></td>
- <td class="BlockContent"><c:out value="${license.licenseeName}"/></td>
- <td class="BlockContent" colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.LicenseeEmail"/></td>
- <td class="BlockContent"><c:out value="${license.licenseeEmail}"/></td>
- <td class="BlockContent" colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.LicenseePhone"/></td>
- <td class="BlockContent"><c:out value="${license.licenseePhone}"/></td>
- <td class="BlockContent" colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.LicenseExpiration"/></td>
- <td class="BlockContent">
- <c:choose>
- <c:when test="${license.isPerpetualLicense}">Never</c:when>
- <c:otherwise>
- <% pageContext.setAttribute("expirationDate", new Date(((License)pageContext.findAttribute("license")).getLicenseExpiration()));%>
- <fmt:formatDate value="${expirationDate}" dateStyle="full"/>
- </c:otherwise>
- </c:choose>
- </td>
- <td class="BlockContent" colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.PlatformLimit"/></td>
- <td class="BlockContent">
- <c:choose>
- <c:when test="${license.platformsUnlimited}">unlimited</c:when>
- <c:otherwise><c:out value="${license.platformLimit}"/></c:otherwise>
- </c:choose>
- </td>
- <td class="BlockContent" colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.MonitoringEnabled"/></td>
- <td class="BlockContent">
- <c:choose>
- <c:when test="${license.supportLevel == 3}">Enabled</c:when>
- <c:otherwise>Disabled</c:otherwise>
- </c:choose>
- </td>
- <td class="BlockContent" colspan="2"></td>
- </tr>
- </c:when>
- <c:otherwise>
- <tr>
- <td class="BlockContent" colspan="4" align="center">No license file loaded</td>
- </tr>
- </c:otherwise>
- </c:choose>
-
- <hq:authorization permission="MANAGE_SETTINGS">
- <tr>
- <td class="BlockContent" colspan="4" align="center"><html:link action="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true">Update License</html:link>
- </td>
- </tr>
- </hq:authorization>
-
- </table>
-
-
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
deleted file mode 100644
index f49a8bf..0000000
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
+++ /dev/null
@@ -1,60 +0,0 @@
-
-<%@ page language="java" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-
-<tiles:insert definition=".portlet.confirm" flush="true"/>
-<tiles:insert definition=".portlet.error" flush="true"/>
-
-<table width="100%" cellpadding="0" cellspacing="0" border="0">
-
- <c:if test="${not empty param.nomenu}">
- <html:form action="/admin/license/UpdateLicenseNoMenu" enctype="multipart/form-data" method="POST">
- <tr>
- <td colspan="4" class="BlockHeader">
- <tiles:insert definition=".header.tab">
- <tiles:put name="tabKey" value="admin.license.UpdateLicenseTab"/>
- </tiles:insert>
- </td>
- </tr>
- <tr>
- <td colspan="4">An up to date license file can be downloaded from the
- <a href="https://network.jboss.com/jbossnetwork/restricted/listSoftware.html">
- JBoss Network Customer Service Portal</a>.</td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.LicenseFile"/></td>
- <td class="BlockContent"><html:file property="licenseFile"/></td>
- <td colspan="2" class="BlockContent"> </td>
- </tr>
-
- <tiles:insert definition=".form.buttons"/>
- </html:form>
- </c:if>
-
- <c:if test="${empty param.nomenu}">
- <html:form action="/admin/license/UpdateLicense" enctype="multipart/form-data" method="POST">
- <tr>
- <td colspan="4" class="BlockHeader">
- <tiles:insert definition=".header.tab">
- <tiles:put name="tabKey" value="admin.license.UpdateLicenseTab"/>
- </tiles:insert>
- </td>
- </tr>
- <tr>
- <td colspan="4">An up to date license file can be downloaded from the
- <a href="https://network.jboss.com/jbossnetwork/restricted/listSoftware.html">
- JBoss Network Customer Service Portal</a>.</td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.license.LicenseFile"/></td>
- <td class="BlockContent"><html:file property="licenseFile"/></td>
- <td colspan="2" class="BlockContent"> </td>
- </tr>
-
- <tiles:insert definition=".form.buttons"/>
- </html:form>
- </c:if>
-</table>
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
index 308da9c..3087cb4 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
@@ -40,7 +40,6 @@
<li class="first"><html:link href="/rhq/admin/downloads.xhtml">Agent Installs</html:link></li>
<li><html:link action="admin/config/Config.do?mode=edit"><fmt:message key="start.category.AdminTools.item.EditConfig"/></html:link></li>
<li><html:link action="admin/config/EditDefaults.do?mode=monitor&viewMode=all"><fmt:message key="start.category.AdminTools.item.ViewMonitoring"/></html:link></li>
- <li><html:link action="admin/license/LicenseAdmin.do?mode=view"><fmt:message key="start.category.AdminTools.item.ManageLicense"/></html:link></li>
</ul>
</li>
</c:if>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
index cff479a..468808e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
@@ -24,13 +24,6 @@
</tiles:insert>
<c:choose >
- <c:when test="${not monitorEnabled}">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr class="ListRow">
- <td class="ListCell"><fmt:message key="common.marketing.FeatureDisabled"/></td>
- </tr>
- </table>
- </c:when>
<c:when test="${not empty criticalAlerts}">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
index 7dffbd2..5c2678f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
@@ -23,13 +23,6 @@
</tiles:insert>
<c:choose>
- <c:when test="${not monitorEnabled}">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr class="ListRow">
- <td class="ListCell"><fmt:message key="common.marketing.FeatureDisabled"/></td>
- </tr>
- </table>
- </c:when>
<c:when test="${not empty problemResources}">
<display:table cellspacing="0" cellpadding="0" width="100%" action="/Dashboard.do"
var="obj" items="${problemResources}" >
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
index 605c77b..88de16c 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
@@ -53,12 +53,6 @@
border="0"/>
</td>
</c:when>
- <c:when test="${not monitorEnabled && (tab.value eq 'Monitor' || tab.value eq 'Alert')}">
- <%--<td>--%>
- <%--<html:img page="/images/tab_${tab.value}_off.gif" width="${tab.width}" height="${tab.height}" alt=""--%>
- <%--border="0"/>--%>
- <%--</td>--%>
- </c:when>
<c:otherwise>
<c:url var="tabLink" value="${tab.link}">
<c:choose>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
index 26b0682..ea3ec82 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
@@ -124,10 +124,8 @@
<tiles:insert definition=".portlet.error"/>
<tiles:insert definition=".portlet.confirm"/>
-<hq:constant symbol="MONITOR_ENABLED_ATTR" var="CONST_ENABLED"/>
-
<c:choose>
- <c:when test="${requestScope[CONST_ENABLED]}">
+ <c:when test="true">
<br/>
<tiles:insert definition=".resource.common.monitor.config.editConfigMetricsVisibility">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
index 9165090..e3ccae9 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
@@ -49,7 +49,6 @@
<c:out value="${serviceType.type.name}" />
</td>
<td class="ListCell" align="left" nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<c:if test="${not empty param.nomenu}">
<html:link page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}" styleClass="buttonsmall">
Edit Metric Template
@@ -65,10 +64,8 @@
(<c:out value="${serviceType.enabledMetricCount}" /> | <c:out value="${serviceType.disabledMetricCount}" />)
</span>
</c:if>
- </c:if>
</td>
<td class="ListCell" align="left" nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<html:link page="/rhq/admin/listAlertTemplates.xhtml?type=${serviceType.type.id}" styleClass="buttonsmall">
Edit Alert Templates
</html:link>
@@ -77,7 +74,6 @@
(<c:out value="${serviceType.enabledAlertCount}" /> | <c:out value="${serviceType.disabledAlertCount}" />)
</span>
</c:if>
- </c:if>
</td>
</tr>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
index d331d51..c855e67 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
@@ -393,11 +393,6 @@
</rich:menuItem>
- <rich:menuItem submitMode="none"
- onclick="window.location = '/admin/license/LicenseAdmin.do?mode=view'"
- rendered="#{GlobalPermissionsUIBean.settings}">
- <h:outputText value="License"/>
- </rich:menuItem>
</rich:dropDownMenu>
<ui:remove>===== DEBUG =====</ui:remove>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
index 986c01d..3655063 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
@@ -187,8 +187,7 @@
<onc:icon name="Monitor"
url="/rhq/resource/monitor/graphs.xhtml"
- alt="Monitor"
- visible="#{monitorEnabled}">
+ alt="Monitor">
</onc:icon>
<onc:icon name="Inventory"
@@ -197,8 +196,7 @@
<onc:icon name="Alert"
url="/rhq/resource/alert/listAlertDefinitions.xhtml"
- alt="Alerts"
- visible="#{monitorEnabled}"/>
+ alt="Alerts"/>
<onc:icon name="Configure"
url="/rhq/resource/configuration/view.xhtml"
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
index 5faaa7c..04c265b 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
@@ -38,7 +38,7 @@
</onc:tab>
<onc:tab name="Alert" image="/images/icons/Alert_grey_16.png"
- rendered="#{monitorEnabled and ResourceGroupUIBean.compatible}">
+ rendered="#{ResourceGroupUIBean.compatible}">
<onc:subtab name="Definitions" url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" />
<onc:subtab name="History" url="/rhq/group/alert/listGroupAlertHistory.xhtml" />
</onc:tab>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
index 08b9d77..1eea5bf 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
@@ -71,7 +71,7 @@ THIS TEXT WILL BE REMOVED AS WELL.
</onc:tab>
<onc:tab name="Alert" image="/images/icons/Alert_grey_16.png"
- rendered="#{monitorEnabled and ResourceGroupUIBean.compatible}">
+ rendered="#{ResourceGroupUIBean.compatible}">
<onc:subtab name="Definitions" url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" />
<onc:subtab name="History" url="/rhq/group/alert/listGroupAlertHistory.xhtml" />
</onc:tab>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index 52245bf..3533512 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -118,7 +118,7 @@
</ui:remove>
<onc:icon name="Monitor" url="/rhq/group/monitor/graphs.xhtml" alt="Monitor"
- visible="#{monitorEnabled and item.category.name eq 'COMPATIBLE'}">
+ visible="#{item.category.name eq 'COMPATIBLE'}">
<f:param name="category" value="#{item.category.name}"/>
</onc:icon>
@@ -127,7 +127,7 @@
</onc:icon>
<onc:icon name="Alert" url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" alt="Alert"
- visible="#{monitorEnabled and item.category.name eq 'COMPATIBLE'}"/>
+ visible="#{item.category.name eq 'COMPATIBLE'}"/>
<onc:icon name="Configure" url="/rhq/group/configuration/viewCurrent.xhtml" alt="Configure"
visible="#{item.category.name eq 'COMPATIBLE' and
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
index dacc5cb..3c60aee 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
@@ -113,8 +113,7 @@
<onc:icon name="Monitor"
url="/rhq/resource/monitor/graphs.xhtml"
- alt="Monitor"
- visible="#{monitorEnabled}">
+ alt="Monitor">
</onc:icon>
<onc:icon name="Inventory"
@@ -123,8 +122,7 @@
<onc:icon name="Alert"
url="/rhq/resource/alert/listAlertDefinitions.xhtml"
- alt="Alerts"
- visible="#{monitorEnabled}"/>
+ alt="Alerts"/>
<onc:icon name="Configure"
url="/rhq/resource/configuration/view.xhtml"
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
index 9598bfc..52d6446 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
@@ -177,8 +177,7 @@
<onc:icon name="Monitor"
url="/rhq/resource/monitor/graphs.xhtml"
- alt="Monitor"
- visible="#{monitorEnabled}">
+ alt="Monitor">
</onc:icon>
<onc:icon name="Inventory"
@@ -187,8 +186,7 @@
<onc:icon name="Alert"
url="/rhq/resource/alert/listAlertDefinitions.xhtml"
- alt="Alerts"
- visible="#{monitorEnabled}"/>
+ alt="Alerts"/>
<onc:icon name="Configure"
url="/rhq/resource/configuration/view.xhtml"
@@ -655,7 +653,7 @@
</ui:remove>
<onc:icon name="Monitor" url="/rhq/group/monitor/graphs.xhtml" alt="Monitor"
- visible="#{monitorEnabled and resourceGroupComposite.category.name eq 'COMPATIBLE'}">
+ visible="#{resourceGroupComposite.category.name eq 'COMPATIBLE'}">
<f:param name="category" value="#{resourceGroupComposite.category.name}"/>
</onc:icon>
@@ -664,7 +662,7 @@
</onc:icon>
<onc:icon name="Alert" url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" alt="Alert"
- visible="#{monitorEnabled and resourceGroupComposite.category.name eq 'COMPATIBLE'}"/>
+ visible="#{resourceGroupComposite.category.name eq 'COMPATIBLE'}"/>
<onc:icon name="Configure" url="/rhq/group/configuration/viewCurrent.xhtml" alt="Configure"
visible="#{resourceGroupComposite.category.name eq 'COMPATIBLE' and
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
index 6cf4efb..17aac38 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
@@ -72,7 +72,7 @@ REQUEST PARAMETERS:
<onc:subtab name="Timeline" url="/rhq/resource/summary/timeline.xhtml" />
</onc:tab>
- <onc:tab name="Monitor" image="/images/icons/Monitor_grey_16.png" rendered="#{monitorEnabled}">
+ <onc:tab name="Monitor" image="/images/icons/Monitor_grey_16.png">
<onc:subtab name="Graphs" url="/rhq/resource/monitor/graphs.xhtml" />
<onc:subtab name="Tables" url="/rhq/resource/monitor/tables.xhtml" />
<onc:subtab name="Traits" url="/rhq/resource/monitor/traits.xhtml" />
@@ -91,7 +91,7 @@ REQUEST PARAMETERS:
<onc:subtab name="Agent" url="/rhq/resource/inventory/view-agent.xhtml" />
</onc:tab>
- <onc:tab name="Alert" image="/images/icons/Alert_grey_16.png" rendered="#{monitorEnabled}">
+ <onc:tab name="Alert" image="/images/icons/Alert_grey_16.png">
<onc:subtab name="Definitions" url="/rhq/resource/alert/listAlertDefinitions.xhtml" />
<onc:subtab name="History" url="/rhq/resource/alert/listAlertHistory.xhtml" />
</onc:tab>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
index e32815a..43b4718 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
@@ -89,11 +89,6 @@
</h:outputLink>
</rich:menuItem>
- <rich:menuItem submitMode="none">
- <h:outputLink value="/admin/license/LicenseAdmin.do?mode=view">
- <h:outputText value="License" />
- </h:outputLink>
- </rich:menuItem>
</rich:menuGroup>
<rich:menuGroup value="Users">
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 64c3a6c..878484d 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -120,25 +120,6 @@
<plugins>
<plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <mkdir dir="${earDirectory}/license" />
- <copy todir="${earDirectory}/license" file="${basedir}/src/main/license/license.xml" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<displayName>RHQ</displayName>
@@ -736,8 +717,6 @@
<phase>package</phase>
<configuration>
<tasks>
- <mkdir dir="${earDirectory}/license" />
- <copy todir="${earDirectory}/license" file="${basedir}/src/main/license/license.xml" />
<property name="deployment.dir" location="${rhq.deploymentDir}" />
<echo>*** Copying updated files from
target${file.separator}${project.build.finalName}${file.separator} to
diff --git a/modules/enterprise/server/ear/src/main/license/license.xml b/modules/enterprise/server/ear/src/main/license/license.xml
deleted file mode 100644
index 2b4d104..0000000
--- a/modules/enterprise/server/ear/src/main/license/license.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- This license should be uploaded to your RHQ Server in the
- Manage License section of the Administration area. If you have
- not already installed a license, you will be directed to this
- page on your first login to the application.
-
- You must login as an administrator to update your license file.
--->
-
-<!-- License created: Feb-12-2008 17:35 -->
-<license key="f3e30ce3f40d3da5a1b1625f1d8bd253" version="2.0">
-
- <license-owner name="RHQ"
- email="nobody(a)rhq-project.org"
- phone="888-555-1212"
- key="f6a629735537a0ff90c002ada39db105"/>
-
- <license-expiration date="*" key="8a58f1b633e356a321251f2ffdf2c34e" />
- <platform-limit count="*" key="a6ccfd9f9d66f73cff44b5953971166b" />
- <server-ip count="1" address="*" key="945f33206407c7743d205f2b345e8a57" />
- <plugin-enable name="*" key="62fa3b11086463a41abf7daf7fc572ee" />
- <support-level level="3" key="8e820272b1aa2289eb284a47745ab401" />
-
-</license>
diff --git a/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml b/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
index 5c0e3d2..4fc8136 100644
--- a/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
+++ b/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
@@ -9,6 +9,5 @@
<attribute name="AgentPluginDir">${jboss.server.home.dir}/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</attribute>
<attribute name="ServerPluginDir">${jboss.server.home.dir}/deploy/${rhq.earName}/rhq-serverplugins</attribute>
<attribute name="UserPluginDir">${jboss.home.dir}/../plugins</attribute>
- <attribute name="LicenseFile">${jboss.server.home.dir}/deploy/${rhq.earName}/license/license.xml</attribute>
</mbean>
</server>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
index 9f22d2c..b636313 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
@@ -93,14 +93,6 @@ public class PluginDeploymentScanner implements PluginDeploymentScannerMBean {
this.agentPluginScanner.getAgentPluginDeployer().setPluginDir(dir);
}
- public File getLicenseFile() {
- return this.agentPluginScanner.getAgentPluginDeployer().getLicenseFile();
- }
-
- public void setLicenseFile(File file) {
- this.agentPluginScanner.getAgentPluginDeployer().setLicenseFile(file);
- }
-
public void start() throws Exception {
// This will check to see if there are any agent plugin records in the database
// that do not have content associated with them and if so, will stream
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
index cb5c795..88432d9 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
@@ -115,8 +115,4 @@ public interface PluginDeploymentScannerMBean {
* @return agent plugin directory name
*/
File getAgentPluginDir();
-
- void setLicenseFile(File name);
-
- File getLicenseFile();
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
index 61b5a97..f8fef50 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
@@ -44,7 +44,6 @@ import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.core.concurrency.LatchedServiceCircularityException;
import org.rhq.enterprise.server.core.concurrency.LatchedServiceController;
import org.rhq.enterprise.server.core.concurrency.LatchedServiceException;
-import org.rhq.enterprise.server.license.LicenseManager;
import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
import org.rhq.enterprise.server.resource.metadata.PluginManagerLocal;
import org.rhq.enterprise.server.system.SystemManagerLocal;
@@ -57,7 +56,6 @@ public class ProductPluginDeployer {
private Log log = LogFactory.getLog(ProductPluginDeployer.class.getName());
private File pluginDir = null;
- private File licenseFile = null;
private boolean isStarted = false;
private boolean isReady = false;
@@ -87,30 +85,12 @@ public class ProductPluginDeployer {
}
}
- public File getLicenseFile() {
- return this.licenseFile;
- }
-
- public void setLicenseFile(File file) {
- this.licenseFile = file;
-
- // sanity check - log an ugly message if we don't have a license file named as we expect
- String expectedName = LicenseManager.getLicenseFileName();
- if (!file.getPath().endsWith(expectedName)) {
- log.error("License file [" + file + "] is not named what we expect: " + expectedName);
- }
- }
-
/**
* This is called by the server's startup servlet which essentially informs us that
* the server's internal EJB/SLSBs are ready and can be called. This means we are
* allowed to begin registering types from deployed plugins.
*/
public void startDeployment() {
- // Do startup license checking. we should really pull out the licensing code into someplace else
- LicenseManager licenseManager = LicenseManager.instance();
- licenseManager.doStartupCheck(this.licenseFile.getAbsolutePath());
-
// we can now register our initial set of plugins
registerPlugins();
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java
deleted file mode 100644
index e0c3d51..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.license;
-
-import java.util.prefs.BackingStoreException;
-import java.util.prefs.Preferences;
-
-public class BackingStore {
- private static final String BACKING_STORE_AVAIL = "BackingStoreAvail";
-
- private BackingStore() {
- super();
- }
-
- public static boolean isAvailable() {
- Preferences prefs = Preferences.userRoot().node("");
- try {
- boolean oldValue = prefs.getBoolean(BACKING_STORE_AVAIL, false);
- prefs.putBoolean(BACKING_STORE_AVAIL, !oldValue);
- prefs.flush();
- } catch (BackingStoreException e) {
- return false;
- }
-
- return true;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java
deleted file mode 100644
index c85cfa0..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.license;
-
-public class CorruptLicenseException extends LicenseException {
- public CorruptLicenseException() {
- super();
- }
-
- public CorruptLicenseException(String message) {
- super(message);
- }
-
- public CorruptLicenseException(Throwable cause) {
- super(cause);
- }
-
- public CorruptLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java
deleted file mode 100644
index 641c7de..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.license;
-
-public class DuplicateLicenseException extends Exception {
- public DuplicateLicenseException() {
- super();
- }
-
- public DuplicateLicenseException(String message) {
- super(message);
- }
-
- public DuplicateLicenseException(Throwable cause) {
- super(cause);
- }
-
- public DuplicateLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.java
deleted file mode 100644
index a8d7368..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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.license;
-
-import java.text.DateFormat;
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class ExpirationTag extends LicenseTermTag {
- static final DateFormat DFORMAT = new SimpleDateFormat(LRES.get(LRES.DFORMAT));
- static final NumberFormat NFORMAT = new DecimalFormat(LRES.get(LRES.NFORMAT));
-
- static final int PST_OFFSET = -1000 * 60 * 60 * 8;
- static final int DST_OFFSET = 0;
- private boolean trial = false;
-
- protected ExpirationTag(LicenseTag lt) {
- super(lt);
- }
-
- private String _origValue = null;
- private long _expMillis = 0;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_DATE), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_EXPIRATION);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getOriginalExpirationString() {
- return _origValue;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- // LicenseManager.doHalt(LRES.MSG_BADINDEX);
- throw new IllegalArgumentException();
- }
-
- if (attrNumber == 0) {
- if (value.equals(LRES.get(LRES.EXPIRATION_NEVER))) {
- _expMillis = License.EXPIRES_NEVER;
- _origValue = value;
- } else {
- // cal has today as default time
- Calendar cal = Calendar.getInstance();
-
- try {
- // if the expiration parses as a date, set it
- Date expDate = DFORMAT.parse(value);
- cal.setTime(expDate);
- } catch (ParseException e) {
- try {
- // otherwise it parses as a duration
- int days = NFORMAT.parse(value).intValue();
- cal.add(Calendar.DATE, days);
- trial = true;
- } catch (ParseException ee) {
- throw new XmlAttrException(LRES.get(LRES.MSG_ERRPARSE));
- }
- }
-
- cal.set(Calendar.HOUR, 23);
- cal.set(Calendar.MINUTE, 59);
- cal.set(Calendar.SECOND, 59);
-
- // hardcode timezone and DST offsets
- cal.set(Calendar.ZONE_OFFSET, PST_OFFSET);
- cal.set(Calendar.DST_OFFSET, DST_OFFSET);
-
- _expMillis = cal.getTimeInMillis();
- _origValue = value;
- }
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return String.valueOf(_origValue);
- }
-
- protected void termValidated() {
- //getLicense().setExpiration(_expMillis);
- getLicense().setTrial(trial);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java
deleted file mode 100755
index 3d647a6..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.enterprise.server.legacy.common.ApplicationException;
-
-/**
- * Exception thrown when feature is not available to the user
- */
-public class FeatureUnavailableException extends ApplicationException {
- public FeatureUnavailableException() {
- super();
- }
-
- public FeatureUnavailableException(String s) {
- super(s);
- }
-
- public FeatureUnavailableException(Throwable t) {
- super(t);
- }
-
- public FeatureUnavailableException(String s, Throwable t) {
- super(s, t);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java
deleted file mode 100644
index a091337..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * 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.license;
-
-/**
- * Munged error messages and other resource strings used by licensing code. These string are munged because a typical
- * circumvention technique is to search class files (decompiled or not) for strings known to be used by licensing code.
- *
- * <p/>These strings are munged with License.munge
- */
-final class LRES {
- // "license.xml"
- static final String LICENSE_LOCATION = "R73u7y2Fk#:";
-
- // "License Error: "
- static final String HALT_MSG = "=}BS}cW)5,_~mb)";
-
- // "Unexpected exception while initialzing license file"
- static final String ERR_INIT_EXC = "K7 v:<n4h(]S6nuRjUc}IMx}dS-$\\ojUAQN57w]qTnu7y2/,$:h";
-
- // "Unexpected error while initialzing license file"
- static final String ERR_INIT_ERROR = "{rqJEh>]dUbu.z,w^?boGG(7[5w}>RZs\\4XE\\CQ\\m $I7Au";
-
- // "Error reading license file"
- static final String ERR_MSG_INIT = "x1kl@mp% j-]~y=]d[]ls.c/t\\";
-
- // "Error discovering IP addresses on server"
- static final String ERR_MSG_NETIF = "=)X8/P5gIH8`:Ig=(}J_TL'[]A8;nIo8tP;n)3i/";
-
- // "org.rhq.enterprise.server.license.LicenseManager"
- static final String JNDI_NAME = "\\hj+]`Gu.}B#/Xe`KC3~Uem)i_<)eD}BS}cuHWUV<U{hqio:.u.";
-
- // "org.rhq.enterprise.server.license.LicenseManager"
- static final String LOG_NAME = "\\hj+]`Gu.}B#/Xe`KC3~Uem)i_<)eD}BS}cuHWUV<U{hqio:.u.";
-
- // "org.rhq.enterprise.server.license.LicenseStoreManager"
- static final String STORE_LOG_NAME = "}=,Cwnh<m(R3j4LnkBVa^LcIdKOILu(Rt(@<&%^iO^|=j_@|fhDPd_Oc";
-
- // "Unable to get initial JNDI context"
- static final String ERR_MSG_JNDIIC = "HwfYs$J(a)ecpT6J8w.v,'oKgx{RktZwpP>6";
-
- // "Unable to perform JNDI rebind operation"
- static final String ERR_MSG_JNDIBIND = "w<&mBAPT45Ci/]Ix?o&u\\|s)Ry%O%swCi/YTgwW";
-
- // "Unable to perform JNDI lookup"
- static final String ERR_MSG_JNDILOOKUP = "M]=Lro|c?mg5!vl@Dy=^,3{fF9=*<";
-
- // "No licensed IP address found on server"
- static final String ERR_MSG_NOIPS = ":Is`O\"A2/n'ok,\\#r'Xij]7^wsg7\\I<54i/L0x";
-
- // "Error closing SIGAR library"
- static final String ERR_MSG_SIGARCLOSE = ")kJ?ay W6!I/1*_Cj4Iyr]HJ<ad";
-
- // "The time-limited license for this software has expired. Please contact support to renew your license."
- static final String ERR_MSG_EXPIRED = "F,\\mkjq'CO4Gj@'8{fw o)!\\m@9!,c_4?*F61~BWvo,,<ly5CS-@7ziK,FO7WMo,q?/kg2|_6_gtZkc{1F*!'X\\ByqZ.J{fw o)!\\E";
-
- // "Invalid attribute index"
- static final String MSG_BADINDEX = "+( hW/8jQy*1/\"4mf.])8t9";
-
- // "Error parsing expiration date"
- static final String MSG_ERRPARSE = "]@aFvKfS@lwIJ|[#Wwvta-?/y,ta[";
-
- // "Invalid platform count"
- static final String ERR_MSG_BADCOUNT = "\"$hu=]jwQSu*c6*V8:v;)_";
-
- // "Invalid support level"
- static final String ERR_MSG_BADLEVEL = "HTuQ<Xw414uhv1,w2O %W";
-
- // "*"
- static final String IP_ANY = "l";
-
- // "*"
- static final String PLATFORMS_UNLIMITED = "l";
-
- // "*"
- static final String EXPIRATION_NEVER = "l";
-
- // "*"
- static final String PLUGIN_ANY = "l";
-
- // "license"
- static final String TAGNAME_LICENSE = "VrLGr,Q";
-
- // "license-owner"
- static final String TAGNAME_LICENSEE = "A5` 5K<!yFs2_";
-
- // "license-expiration"
- static final String TAGNAME_EXPIRATION = "qTnWTkOF<ld^KQ;T1P";
-
- // "platform-limit"
- static final String TAGNAME_PLATFORMLIMIT = "EDR8z~mLlGU3Tz";
-
- // "support-level"
- static final String TAGNAME_SUPPORTLEVEL = "_^Ri|_.!:hA2q";
-
- // "server-ip"
- static final String TAGNAME_SERVERIP = ";GwnQ;l'B";
-
- // "plugin-enable"
- static final String TAGNAME_PLUGINENABLE = "n:bwUo9Q\\EadS";
-
- // "address"
- static final String ATTR_ADDRESS = "3s54d,_";
-
- // "revokes"
- static final String ATTR_REVOKES = "/:B,Yq_";
-
- // "count"
- static final String ATTR_COUNT = "H8oOX";
-
- // "name"
- static final String ATTR_NAME = "=NFA";
-
- // "email"
- static final String ATTR_EMAIL = "RF3rn";
-
- // "phone"
- static final String ATTR_PHONE = "Co;OD";
-
- // "yyyy-MM-dd"
- static final String DFORMAT = "\"+#L6dqa}U";
-
- // "##0"
- static final String NFORMAT = "A:=";
-
- // "date"
- static final String ATTR_DATE = "'NbA";
-
- // "level"
- static final String ATTR_LEVEL = ">i`:n";
-
- // "key"
- static final String ATTR_KEY = "\"EF";
-
- // "version"
- static final String ATTR_VERSION = "`:I.\\{[";
-
- // "No value to validate"
- static final String ERR_NOVALUE = "rkwuQ<8=4_@8 hu(]qmf";
-
- // "Error validating license: key mismatch"
- static final String ERR_VALIDATION = "SbxwX}`+3g'Nb%2Ps`O\"A2/nfoLA67lt4F3P97";
-
- // "Invalid server-ip element"
- static final String ERR_INVALIDSERVERIP = "LbS2tI.;ark=\\a#X2,[O7n%x|";
-
- // "Invalid license-owner element"
- static final String ERR_INVALIDLICENSEE = "3]gWr8{_O4h549[3MVIo6_\\fsdowc";
-
- // "Key validation error"
- static final String ERR_KEYVALIDATION = "VWVjhu=$Xd{xpbIW*Kac";
-
- // "Key generation error"
- static final String ERR_KEYGENERATION = "VWVj{fb=yd{xpbIW*Kac";
-
- // "Invalid server-ip count"
- static final String ERR_SERVERIPCOUNT = "+( hW/8jJf~S'J\"xh.G6z$m";
-
- // "Warning: software license expires soon! Contact support to renew your license. Current license expires on "
- static final String WARN_EXPIRATION = "kOl8,.6.|Z\"l6Dt6U~s_towZP1$VO;lPHk+Zej[1k-Zwp%W6JF*%r+FlKaH~M$zoEc +~9K[.=T.+o:c~]~9!}jv15{2}jeTk(Cf.?T\"JZwc";
-
- // "Error: software license validation failed. Please contact support to resolve the issue."
- static final String ERR_FAILED_VALIDATION = "7.z|_(I{*;8e:mu)GUV<U{hX:AQ$TEjUc}IjE}dSx&x)~dS:cu)>|o.DYwX*XDGy.j];~I;hy|qG=xw)2/Tc{b +";
-
- // "Error: software license has become corrupt. Please contact support to resolve the issue."
- static final String ERR_CORRUPT_VALIDATION = "sz,c{^4mK.;HDyhXdP0=Pm ]]:c4@ BcY=4`K,_]G,HX]kQ=Gm ]V~U,E>8/|/dRK,;-zk)z2K~uqhX8]<I(my)SL";
-
- // "Error: software license key has become corrupt. Please contact support to resolve the issue."
- static final String ERR_CORRUPT_KEY = "UmyJKX;|1{_LQc<Ih^iO^|=4:tn;/D~wMO:~`Wwiac{/d_38;JuWdkO;01P_qAy-c-qQac.I,Jj|f|1hQt8y/=4^kJj<&";
-
- // "Error: software license trial has become corrupt. Please contact support to resolve the issue."
- static final String ERR_CORRUPT_TRIAL = "T*Kac/z~JymNh1Ww2x:%x~gjmcX hwwQ@.eWR(a)0f.Gk*Kwh*B4wvSfhpWwia^* E_jJj 2k*{8yvzygka<2r4_wO;Xp~ItY";
-
- // "Error: trial software licenses must be updated by term licenses only. Please contact support to solve the issue."
- static final String ERR_TRIAL_VALIDATION = "WX];-\\$(Xf30T.wxbaYIG5>f+:f.E4}9};]5miU}>o&^i7P|\"5^i/ZTEtHit8D.5jgVe?$5.BAY;G5H8t)`&(owo`>,)^}x.T4E48V>D$(5iUr;.7R!";
-
- // salt used to calculate md5 keys for license terms - gibberish munged or not
- private static final String our_salt = "RHQqBr,f{,{XO#P)2di^<}=KaLmhrUB3\"6Q_}E%Z7%d3FP$,E:DN/CEBdW}F\\D)1+5";
-
- // "Cannot register new platform due to licensing restrictions. Contact support to license additional platforms. Current license permits a maximum platform count of "
- static final String ERR_MSG_TOOMANYPLATFORMS = "tR5o~z4. jP|zW.X5SHIdDR8z~m>)()S-zk)GUV<U~osj/{=~wzUV.$k7y+/-'k7jiV.I~biAc{z4wK]qTnW7y2/:)XojUc}Dh)idA._k.N*#-I[bz,S}z4D}BS}cW)i2_Y$,mXi/YD?oN)3-GhEj.c{`4`K)o.Ik8X";
-
- // "[License owner="
- static final String TOSTRING_START = ",WUV<U~hX|e}=y-";
-
- // " email="
- static final String EMAIL = "U:e>\\i]";
-
- // " phone="
- static final String PHONE = "U`P,rq]";
-
- // " expiration="
- static final String EXPIRATION = "^Q@R},A-sy7I";
-
- // "never"
- static final String NEVER = "Wi`:I";
-
- // "any"
- static final String ANY = "L=F";
-
- // "all"
- static final String ALL = "L`>";
-
- // " platforms="
- static final String TOSTRING_PLATFORMS = "(0Anw;|w+_/";
-
- // "unlimited"
- static final String UNLIMITED = "U%R7#5wDo";
-
- // " serverIPs="
- static final String TOSTRING_SERVERIPS = "(,Q;i ,v*_/";
-
- // " plugins="
- static final String TOSTRING_PLUGINS = "TBR$-57;x";
-
- // " support="
- static final String TOSTRING_SUPPORT = "T.T0ny.Xx";
-
- // "]"
- static final String TOSTRING_END = "m";
-
- protected static String get(String res) {
- return License.unmunge(res);
- }
-
- static String getOurSalt() {
- return our_salt;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java
deleted file mode 100644
index c6874e8..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * 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.license;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.rhq.core.clientapi.util.StringUtil;
-
-public final class License implements Serializable {
- public static final int FEATURE_BASIC = 1;
- public static final int FEATURE_MONITOR = FEATURE_BASIC << 1;
- public static final int FEATURE_ALL = FEATURE_BASIC | FEATURE_MONITOR;
-
- private String _masterKey = null;
- private String _version = null;
- private String _licenseeName = null;
- private String _licenseeEmail = null;
- private String _licenseePhone = null;
- private long _expiration = 0;
- private int _platformLimit = 0;
- private List _serverIps = new ArrayList();
- private List _plugins = new ArrayList();
- private int _supportLevel = 1;
- private boolean trial = false;
-
- static final long EXPIRES_NEVER = 9223372036854775307L;
- static final int PLATFORMS_UNLIMITED = 2147483624;
-
- private static final char[] HEX = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-
- private static final String MUNGABLE_CHARS_ALNUM
- // shuffled: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
- = "6JCqLxnjaOSAkyWXsvQ7G4ueNf1hIMgbV2dDEcTU5o9HlRwFPYZBirm8ztK03p";
-
- // DON'T CHANGE THESE MUNGE MAPS, or you will BREAK our licensing code.
- private static final String MUNGABLE_CHARS
- // shuffled: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*()_+-=`[]\\{}|;':\",./<>? "
- = "_{my*K|c~1kJ@apv!6l?MF9ZeH\"+#L&NC3Y`>BV0nERiA:DGdqQuh 2S<=WgtOf%r'[\\7s5o}UPT$(^bx)X]/-I4wj8;.z,";
-
- protected License() {
- _expiration = EXPIRES_NEVER;
- }
-
- protected String getMasterKey() {
- return _masterKey;
- }
-
- protected void setMasterKey(String m) {
- _masterKey = m;
- }
-
- protected String getVersion() {
- return _version;
- }
-
- protected void setVersion(String v) {
- _version = v;
- }
-
- public String getLicenseeName() {
- return _licenseeName;
- }
-
- protected void setLicenseeName(String n) {
- _licenseeName = n;
- }
-
- public String getLicenseeEmail() {
- return _licenseeEmail;
- }
-
- protected void setLicenseeEmail(String e) {
- _licenseeEmail = e;
- }
-
- public String getLicenseePhone() {
- return _licenseePhone;
- }
-
- protected void setLicenseePhone(String p) {
- _licenseePhone = p;
- }
-
- /*
- protected void setExpiration(long ex) {
- _expiration = ex;
- }
- */
-
- public boolean getIsPerpetualLicense() {
- return (_expiration == EXPIRES_NEVER);
- }
-
- public long getLicenseExpiration() {
- return _expiration;
- }
-
- protected void setPlatformLimit(int l) {
- _platformLimit = l;
- }
-
- public boolean getPlatformsUnlimited() {
- return (_platformLimit == PLATFORMS_UNLIMITED);
- }
-
- public int getPlatformLimit() {
- return _platformLimit;
- }
-
- public int getSupportLevel() {
- return _supportLevel;
- }
-
- protected void setSupportLevel(int level) {
- _supportLevel = level;
- }
-
- protected void addServerIp(int count, String addr) {
- if (_serverIps.size() >= count) {
- LicenseManager.doHalt(LRES.ERR_SERVERIPCOUNT);
- return;
- }
-
- _serverIps.add(addr);
- }
-
- public boolean getIsAnyIpOk() {
- return (_serverIps.size() > 0) && _serverIps.get(0).equals(LRES.get(LRES.IP_ANY));
- }
-
- public List getServerIps() {
- return _serverIps;
- }
-
- public boolean getIsAnyPluginOk() {
- return (_plugins.size() > 0) && _plugins.get(0).equals(LRES.get(LRES.PLUGIN_ANY));
- }
-
- protected void addPlugin(String plugin) {
- _plugins.add(plugin);
- }
-
- public List getPlugins() {
- return _plugins;
- }
-
- public boolean equals(Object o) {
- if (!(o instanceof License)) {
- return false;
- }
-
- License l = (License) o;
- return getMasterKey().equals(l.getMasterKey());
- }
-
- public String toString() {
- return LRES.get(LRES.TOSTRING_START)
- + getLicenseeName()
- + LRES.get(LRES.EMAIL)
- + getLicenseeEmail()
- + LRES.get(LRES.PHONE)
- + getLicenseePhone()
- + LRES.get(LRES.EXPIRATION)
- + (getIsPerpetualLicense() ? LRES.get(LRES.NEVER) : ExpirationTag.DFORMAT.format(new java.util.Date(
- _expiration))) + LRES.get(LRES.TOSTRING_PLATFORMS)
- + (getPlatformsUnlimited() ? LRES.get(LRES.UNLIMITED) : String.valueOf(_platformLimit))
- + LRES.get(LRES.TOSTRING_SERVERIPS)
- + (getIsAnyIpOk() ? LRES.get(LRES.ANY) : StringUtil.listToString(_serverIps))
- + LRES.get(LRES.TOSTRING_PLUGINS)
- + (getIsAnyPluginOk() ? LRES.get(LRES.ALL) : StringUtil.listToString(_plugins))
- + LRES.get(LRES.TOSTRING_SUPPORT) + getSupportLevel() + LRES.get(LRES.TOSTRING_END);
- }
-
- /**
- * A simple one-way hash function for strings *
- */
- static String simpleHash(String s) {
- String reverse = (new StringBuffer(s)).reverse().toString();
-
- // Munge the string
- String m = munge(s);
-
- // Ensure the string is long enough to generate enough entropy
- for (int i = 0; m.length() < 1024; i++) {
- String rm = (new StringBuffer(m)).reverse().toString();
-
- // combine in different ways to increase entropy
- switch ((i + m.length()) % 5) {
- case 0: {
- m = munge(reverse + m + s);
- break;
- }
-
- case 1: {
- m = munge(s + reverse + rm);
- break;
- }
-
- case 2: {
- m = munge(rm + reverse);
- break;
- }
-
- case 3: {
- m = munge(s + m);
- break;
- }
-
- case 4: {
- m = munge(reverse + rm + m + rm);
- break;
- }
- }
- }
-
- // Remunge one last time
- m = munge(m);
-
- // Simple accumulator
- int[] accum = new int[32];
- for (int i = 0; i < 32; i++) {
- accum[i] = 0;
- }
-
- for (int i = 0; i < m.length(); i++) {
- accum[i % 32] += (int) m.charAt(i);
- }
-
- // print out as hex, taking the lower 8 bits
- // of each integer in accum, interpret as a hex digit
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < 32; i++) {
- result.append(HEX[accum[i] % 16]);
- }
-
- return result.toString();
- }
-
- /**
- * @return The original form of a string that was munged with the 'munge' method. Uses the default munge map.
- */
- static String unmunge(String s) {
- return unmunge(s, MUNGABLE_CHARS);
- }
-
- static String unmunge(String s, String mungeMap) {
- StringBuffer rstr = new StringBuffer();
- char c;
- int idx;
- int newIdx;
- int mlen = mungeMap.length();
- int lenmod = (s.length() % 37);
- for (int i = 0; i < s.length(); i++) {
- c = s.charAt(i);
- idx = mungeMap.indexOf(c);
- if (idx == -1) {
- rstr.append(c);
- } else {
- newIdx = (idx - 13 - (i % 7) - lenmod + mlen) % mlen;
- rstr.append(mungeMap.charAt(newIdx));
- }
- }
-
- return rstr.toString();
- }
-
- /**
- * Simple munger to make searching for String constants in class files more difficult. Use the unmunge method to get
- * back to the original string. Uses the default munge map.
- */
- static String munge(String s) {
- return munge(s, MUNGABLE_CHARS);
- }
-
- /**
- * Just like the other munge map, but uses a caller-supplied munge map
- */
- static String munge(String s, String mungeMap) {
- StringBuffer rstr = new StringBuffer();
- char c;
- int idx;
- int newIdx;
- int mlen = mungeMap.length();
- int lenmod = (s.length() % 37);
- for (int i = 0; i < s.length(); i++) {
- c = s.charAt(i);
- idx = mungeMap.indexOf(c);
- if (idx == -1) {
- rstr.append(c);
- } else {
- newIdx = (idx + 13 + (i % 7) + lenmod) % mlen;
- rstr.append(mungeMap.charAt(newIdx));
- }
- }
-
- return rstr.toString();
- }
-
- static String shuffle(String s) {
- List chars = new ArrayList();
- for (int i = 0; i < s.length(); i++) {
- chars.add(new Character(s.charAt(i)));
- }
-
- Collections.shuffle(chars);
- StringBuffer rstr = new StringBuffer();
- for (int i = 0; i < chars.size(); i++) {
- rstr.append(((Character) chars.get(i)).charValue());
- }
-
- return rstr.toString();
- }
-
- public boolean isTrial() {
- return trial;
- }
-
- protected void setTrial(boolean trial) {
- this.trial = trial;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java
deleted file mode 100644
index b7a4708..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.license;
-
-public class LicenseException extends Exception {
- public LicenseException() {
- super();
- }
-
- public LicenseException(String message) {
- super(message);
- }
-
- public LicenseException(Throwable cause) {
- super(cause);
- }
-
- public LicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java
deleted file mode 100644
index 3cde0be..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * 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.license;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.naming.InitialContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public final class LicenseManager implements Runnable, Serializable {
- private static final long serialVersionUID = -3229197855347715264L;
-
- public static final int FEATURE_MONITOR = License.FEATURE_MONITOR;
-
- private static final long WARN_EXPIRE_MILLIS = 60L * 60L * 24L * 1000L * 30L;
-
- private static Log log = LogFactory.getLog(LRES.get(LRES.LOG_NAME));
-
- private static LicenseManager _instance = new LicenseManager();
- private static volatile boolean _jndiBound = false;
-
- protected transient InitialContext ic = null;
- protected String JNDI_NAME = LRES.get(LRES.JNDI_NAME);
- private License _license;
- private transient Thread _expirationEnforcementThread = null;
-
- private boolean licenseLoaded = false;
- private boolean licenseExpired = false;
-
- private LicenseManager() {
- try {
- ic = new InitialContext();
- } catch (Exception e) {
- doHalt(LRES.ERR_MSG_JNDIIC, e);
- }
- }
-
- public static LicenseManager instance() {
- if (!_jndiBound) {
- _instance.bind();
- }
-
- try {
- return (LicenseManager) _instance.ic.lookup(_instance.JNDI_NAME);
- } catch (Exception e) {
- doHalt(LRES.ERR_MSG_JNDILOOKUP, e);
- throw new IllegalStateException();
- }
- }
-
- private synchronized void bind() {
- if (_jndiBound) {
- return;
- }
-
- try {
- ic.rebind(JNDI_NAME, _instance);
- } catch (Exception e) {
- doHalt(LRES.ERR_MSG_JNDIBIND, e);
- throw new IllegalStateException();
- }
- }
-
- /**
- * Tests a license file by running it through the parser. Throws an exception if something fails to parse. Proper
- * exceptions should really be integrated at some point.
- */
- public static void checkLicense(InputStream licenseFile) throws LicenseParsingException,
- UnavailableLicenseException, CorruptLicenseException, UpdateTrialLicenseException {
- LicenseParser lp;
- lp = new LicenseParser();
- License license = lp.parse(licenseFile);
-
- LicenseStoreManager.store(license);
- }
-
- /**
- * Read the license data
- */
- private final void initialize(String licenseFile) {
- LicenseParser lp;
- File lfile = new File(licenseFile);
- try {
- if (!lfile.exists()) {
- throw new FileNotFoundException(licenseFile);
- }
-
- lp = new LicenseParser();
- _license = lp.parse(lfile);
- licenseLoaded = true;
- } catch (Exception e) {
- licenseLoaded = false;
- }
- }
-
- protected static final void doHalt(String msg, Exception e) {
- doHaltThrowable(msg, e);
- }
-
- private static final void doHaltThrowable(String msg, Throwable t) {
- if (t != null) {
- log.error(LRES.get(msg) + ": " + t + "\n\n" + LRES.get(LRES.HALT_MSG));
- // t.printStackTrace();
- } else {
- log.error(LRES.get(msg) + "\n\n" + LRES.get(LRES.HALT_MSG));
- // (new Exception("no exception")).printStackTrace();
- }
-
- // Would be nice to obfuscate the call to "halt" here, otherwise
- // it is something easy to search the classfiles for
- //Runtime.getRuntime().halt(0);
-
- // should never get here, but just in case
- throw new IllegalStateException();
- }
-
- protected static final void doHalt(String msg) {
- doHalt(msg, null);
- }
-
- /**
- * Called by ProductPluginDeployer at startup to enforce the following license provisions: <license-expiration> :
- * ensure that the customer's license has not expired <server-ip> : ensure that at least one of the server's IPs
- * matches one of the licensed IPs.
- */
- public final void doStartupCheck(String licenseFile) {
- try {
- initialize(licenseFile);
- log.info(_license.toString());
- enforceExpiration();
- enforceServerIp();
- } catch (Exception e) {
- // doHalt(LRES.ERR_INIT_EXC, e);
- } catch (Throwable t) {
- // doHaltThrowable(LRES.ERR_INIT_ERROR, t);
- throw new IllegalStateException();
- }
- }
-
- public boolean isLicenseExpired() {
- return licenseExpired;
- }
-
- public boolean isLicenseLoaded() {
- return licenseLoaded;
- }
-
- private final void enforceExpiration() {
- licenseExpired = false;
-
- if ((_license == null) || _license.getIsPerpetualLicense()) {
- return;
- }
-
- long ex = 0;
- try {
- ex = LicenseStoreManager.store(_license);
- } catch (LicenseException le) {
- licenseExpired = true;
- log.warn(le.getMessage());
- }
-
- long diff = ex - System.currentTimeMillis();
- if (diff < 0) {
- // doHalt(LRES.ERR_MSG_EXPIRED);
- // throw new IllegalStateException();
- licenseExpired = true;
- } else if (diff < WARN_EXPIRE_MILLIS) {
- log.warn(LRES.get(LRES.WARN_EXPIRATION) + ExpirationTag.DFORMAT.format(new Date(ex)));
- }
-
- // Make sure we continue to check expiration date
- if (_expirationEnforcementThread == null) {
- _expirationEnforcementThread = new Thread(this);
- _expirationEnforcementThread.setDaemon(true);
- _expirationEnforcementThread.start();
- }
- }
-
- public void run() {
- long millisInDay = 1000 * 60 * 60 * 24;
- while (true) {
- try {
- Thread.sleep(millisInDay);
- } catch (InterruptedException e) {
- }
-
- enforceExpiration();
- }
- }
-
- private final void enforceServerIp() {
- // // Easy out
- // if (_license == null || _license.getIsAnyIpOk()) return;
- //
- // List okIps = _license.getServerIps();
- // Sigar sigar = null;
- // try {
- // sigar = new Sigar();
- //
- // String[] netInterfaces = sigar.getNetInterfaceList();
- // String ifaceName = null;
- // NetInterfaceConfig iface = null;
- // String addr;
- //
- // for ( int i=0; i<netInterfaces.length; i++ ) {
- // ifaceName = netInterfaces[i];
- // iface = sigar.getNetInterfaceConfig(ifaceName);
- // addr = iface.getAddress();
- //
- // if (okIps.contains(addr)) return;
- // }
- // doHalt(LRES.ERR_MSG_NOIPS);
- // throw new IllegalStateException();
- //
- // } catch (SigarException e) {
- // doHalt(LRES.ERR_MSG_NETIF, e);
- // throw new IllegalStateException();
- // } finally {
- // if (sigar != null) {
- // sigar.close();
- // }
- // }
- }
-
- public boolean isPluginEnabled(String name) {
- if ((_license == null) || _license.getIsAnyPluginOk()) {
- return true;
- }
-
- boolean enabled = _license.getPlugins().contains(name);
- return enabled;
- }
-
- public void enforcePlatformLimit(int count) throws PlatformLimitException {
- if (_license == null) {
- return; // temporarily ignore limits before license is loaded
- }
-
- if (_license.getPlatformsUnlimited()) {
- return;
- }
-
- if (count > _license.getPlatformLimit()) {
- String msg = LRES.get(LRES.ERR_MSG_TOOMANYPLATFORMS) + _license.getPlatformLimit();
- throw new PlatformLimitException(msg, _license.getPlatformLimit());
- }
- }
-
- public void enforceFeatureLimit(int feature) throws FeatureUnavailableException {
- LicenseManager.enforceFeatureLimit(_license, feature);
- }
-
- public static void enforceFeatureLimit(License license, int feature) throws FeatureUnavailableException {
- if ((license != null) && ((license.getSupportLevel() & feature) == 0)) {
- switch (feature) {
- case FEATURE_MONITOR: {
- throw new FeatureUnavailableException("Monitor feature is not supported");
- }
-
- default: {
- throw new FeatureUnavailableException("Unknown feature " + feature + " is not supported");
- }
- }
- }
- }
-
- public License getLicense() {
- return _license;
- }
-
- public static String getLicenseFileName() {
- return LRES.get(LRES.LICENSE_LOCATION);
- }
-
- /**
- * @return The expiration time in millis, or -1 if there is no expiration.
- */
- public long getExpiration() throws LicenseException {
- if ((_license == null) || _license.getIsPerpetualLicense()) {
- return -1;
- }
-
- //return _license.getLicenseExpiration();
- return LicenseStoreManager.store(_license);
- }
-
- public String getLicenseInfoString() {
- return _license.toString();
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java
deleted file mode 100644
index 7f487a2..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.license;
-
-import java.io.File;
-import java.io.InputStream;
-import org.rhq.core.util.xmlparser.XmlParseException;
-import org.rhq.core.util.xmlparser.XmlParser;
-
-final class LicenseParser {
- protected LicenseParser() {
- }
-
- protected final License parse(File f) throws LicenseParsingException {
- License lic = new License();
- LicenseTag tag = new LicenseTag(lic);
-
- try {
- XmlParser.parse(f, tag);
- } catch (XmlParseException xpe) {
- throw new LicenseParsingException(xpe);
- }
-
- return lic;
- }
-
- protected final License parse(InputStream is) throws LicenseParsingException {
- License lic = new License();
- LicenseTag tag = new LicenseTag(lic);
-
- try {
- XmlParser.parse(is, tag);
- } catch (XmlParseException xpe) {
- throw new LicenseParsingException(xpe);
- }
-
- return lic;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java
deleted file mode 100644
index 541e990..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.license;
-
-public class LicenseParsingException extends Exception {
- public LicenseParsingException() {
- super();
- }
-
- public LicenseParsingException(String message) {
- super(message);
- }
-
- public LicenseParsingException(Throwable cause) {
- super(cause);
- }
-
- public LicenseParsingException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java
deleted file mode 100644
index 1a97e8d..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * 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.license;
-
-import java.util.prefs.Preferences;
-
-public class LicenseStoreManager {
- private static long CUT_POINT = 424242L;
-
- // PREFIX_EXPIRATION := munge("com/jboss/jbossnetwork/expiration");
- private static final String PREFIX_EXPIRATION = " ZQVA`#MFBiY+\"M4}pi+F<>}Yr,Fg@;H8";
-
- // PREFX_DIV := munge("com/jboss/jbossnetwork/quotient");
- private static final String PREFIX_DIV = "uFd>R3\"l?`ECHel-5@EH?2Y_yepz7-J";
-
- // PREFIX_MOD := munge("com/jboss/jbossnetwork/modulus");
- private static final String PREFIX_MOD = "QMG`ECH6lYnNeZ6/sJnel 3G9_*\\,l";
-
- // PREFIX_TRIAL := munge("preference/trial");
- private static final String PREFIX_TRIAL = "i,S,=ygsBSFzy^Rd";
-
- // PREFIX_MAJOR_KEY := munge("major/license/key");
- private static final String PREFIX_MAJOR_KEY = "CA\"1ye2UV<U~gHnS`";
-
- private LicenseStoreManager() {
- super();
- }
-
- /**
- * @param license
- *
- * @return the expiration in the BackingStore, if one exists. Otherwise, it returns the date found in license.
- * Handles duration licenses different than regular licenses (see Exception descriptions below).
- *
- * @throws UnavailableLicenseException if the BackingStore is not available. It must be available to retrieve the
- * expiration date.
- * @throws CorruptLicenseException if the expiration date in the backing store was tampered with
- * @throws UpdateTrialLicenseException if the user is trying to update any previously installed license with a trial
- * license, unless the previous one and the current one match (have the same
- * master keys), in which case the previously calculated date will be used
- */
- public static long store(License license) throws UnavailableLicenseException, CorruptLicenseException,
- UpdateTrialLicenseException {
- if (!BackingStore.isAvailable()) {
- throw new UnavailableLicenseException(LRES.get(LRES.ERR_FAILED_VALIDATION));
- }
-
- // get the various license bits from the backing store
- Preferences prefs = Preferences.userRoot();
- String str_expiration = prefs.get(PREFIX_EXPIRATION, "");
- String str_major_key = prefs.get(PREFIX_MAJOR_KEY, "");
- String str_trial = prefs.get(PREFIX_TRIAL, "");
-
- long expiration = 0;
- long quotient = 0;
- long modulus = 0;
-
- boolean trial = false;
-
- /*
- * Either:
- *
- * 1) RHQ was newly installed, or 2) The user deleted all backing store entries
- *
- * Regardless, it passes the check
- */
- if ("".equals(str_expiration + str_major_key + str_trial)) {
- expiration = storeLicenseBits(license, prefs);
- } else {
- if (license.isTrial()) {
- /*
- * we can't install a new trial license unless it matches up perfectly with the one we have written to
- * the store, which means it: a) the store has record of a trial license b) the master key values
- * match up c) the time hasn't been mangled with
- */
-
- /*
- * we must find the trial value, and ensure that it's true
- */
- try {
- trial = ((Integer.parseInt(str_trial) % 2) == 1);
- } catch (NumberFormatException nfe) {
- throw new CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_TRIAL));
- }
-
- if (trial) {
- /*
- * can't update a trial license with another trial license, unless it's the same one (using master
- * key comparison). thus, if the user tries to mess with the master key from a trial license it'll
- * only break the license features and let us know there was tampering.
- */
- if (!license.getMasterKey().equals(str_major_key)) {
- throw new CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_KEY));
- }
-
- /*
- * furthermore, it can only be updated if it's not corrupt. otherwise, the previous date can't be
- * considered reliable.
- */
- try {
- quotient = decode(prefs.get(PREFIX_DIV, ""));
- modulus = decode(prefs.get(PREFIX_MOD, ""));
- expiration = decode(str_expiration);
- } catch (NumberFormatException nfe) {
- throw new CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_VALIDATION));
- }
-
- if (((quotient * CUT_POINT) + modulus) != expiration) {
- throw new CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_VALIDATION));
- }
-
- return license.getLicenseExpiration();
- } else {
- // can't update a real/regular license with a trial one
- throw new UpdateTrialLicenseException(LRES.get(LRES.ERR_TRIAL_VALIDATION));
- }
- } else {
- /*
- * the simplest logic: forget about everything in the store if you have a real/regular, date-based
- * license; all the fancy rules, regulations, restrictions go away for this case
- */
- expiration = storeLicenseBits(license, prefs);
- }
- }
-
- return expiration;
- }
-
- private static long storeLicenseBits(License license, Preferences prefs) {
- long expiration = license.getLicenseExpiration();
- long quotient = expiration / CUT_POINT;
- long modulus = expiration % CUT_POINT;
-
- prefs.put(PREFIX_EXPIRATION, encode(expiration));
- prefs.put(PREFIX_DIV, encode(quotient));
- prefs.put(PREFIX_MOD, encode(modulus));
-
- int result = getModRandom(license);
- prefs.put(PREFIX_TRIAL, Integer.toString(result));
-
- prefs.put(PREFIX_MAJOR_KEY, license.getMasterKey());
- return expiration;
- }
-
- /*
- * Generate a large random number so that it looks munged on the disk
- *
- * If the license was a trial, make it odd; otherwise, make it even
- */
- private static int getModRandom(License lic) {
- return (2 * (int) (Math.random() * 1000000.0)) + (lic.isTrial() ? 1 : 0);
- }
-
- private static String encode(long value) {
- String temp = String.valueOf(value);
- StringBuffer buff = new StringBuffer();
- int nextNum = 0;
- for (int i = 0, sz = temp.length(); i < sz; i++) {
- nextNum = (int) (temp.charAt(i) - '0');
- nextNum += 2 * i;
- if ((nextNum % 2) == 0) {
- nextNum += 6;
- } else {
- nextNum += 4;
- }
- while (nextNum > 9) {
- nextNum -= 10;
- }
-
- buff.append((char) (nextNum + '0'));
- }
-
- return buff.toString();
- }
-
- private static long decode(String value) {
- String temp = String.valueOf(value);
- StringBuffer buff = new StringBuffer();
- int nextNum = 0;
- for (int i = 0, sz = temp.length(); i < sz; i++) {
- nextNum = (int) (temp.charAt(i) - '0');
- if ((nextNum % 2) == 0) {
- nextNum -= 6;
- } else {
- nextNum -= 4;
- }
-
- nextNum -= 2 * i;
- while (nextNum < 0) {
- nextNum += 10;
- }
-
- buff.append((char) (nextNum + '0'));
- }
-
- return Long.valueOf(buff.toString()).longValue();
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java
deleted file mode 100644
index af37b33..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.license;
-
-import java.io.IOException;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlAttrHandler;
-import org.rhq.core.util.xmlparser.XmlTagHandler;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class LicenseTag implements XmlTagHandler, XmlAttrHandler {
- private License _license;
-
- protected LicenseTag(License lic) {
- _license = lic;
- }
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_VERSION), XmlAttr.OPTIONAL) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_LICENSE);
- }
-
- protected License getLicense() {
- return _license;
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] { new XmlTagInfo(new LicenseeTag(this), XmlTagInfo.REQUIRED),
- new XmlTagInfo(new ExpirationTag(this), XmlTagInfo.REQUIRED),
- new XmlTagInfo(new ServerIpTag(this), XmlTagInfo.ONE_OR_MORE),
- new XmlTagInfo(new PlatformLimitTag(this), XmlTagInfo.REQUIRED),
- new XmlTagInfo(new PluginTag(this), XmlTagInfo.ONE_OR_MORE),
- new XmlTagInfo(new SupportLevelTag(this), XmlTagInfo.REQUIRED), };
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if (attrNumber == 0) { // "key"
- setMasterKey(value);
- } else if (attrNumber == 1) { // "version"
- setVersion(value);
- } else {
- LicenseManager.doHalt(LRES.MSG_BADINDEX);
- throw new IllegalArgumentException();
- }
- }
-
- protected void setMasterKey(String s) {
- _license.setMasterKey(s);
- }
-
- protected void setVersion(String v) {
- _license.setVersion(v);
- }
-
- protected String generateKey() {
- String our_salt = LRES.get(LRES.getOurSalt());
- try {
- return hash(String.valueOf(our_salt + "@" + System.currentTimeMillis()));
- } catch (Exception e) {
- LicenseManager.doHalt(LRES.ERR_KEYGENERATION, e);
- throw new IllegalStateException();
- }
- }
-
- protected String getMasterKey() {
- return _license.getMasterKey();
- }
-
- protected String getVersion() {
- return _license.getVersion();
- }
-
- protected static String hash(String s) throws IOException {
- // Does not work on RedHat AS 3.0
- // return FileMD5.getDigestFromString(s);
-
- // Apparently even this has problems on Windows
- // return FileMD5.getPureJavaMD5(s);
-
- // Let's try something so dumb, so simple,
- // that it just HAS to work on every stinkin' platform.
- return License.simpleHash(s);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java
deleted file mode 100644
index c5626f6..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttrHandler;
-import org.rhq.core.util.xmlparser.XmlTagException;
-import org.rhq.core.util.xmlparser.XmlTagExitHandler;
-import org.rhq.core.util.xmlparser.XmlTagHandler;
-
-abstract class LicenseTermTag implements XmlTagHandler, XmlAttrHandler, XmlTagExitHandler {
- // This is the super secret 'salt' that we use to calculate
- // our MD5. We should really use some PKI here instead, but
- // this is a lot simpler and easier to do right now.
- private String our_salt = null;
-
- private License _license;
- private String _key;
-
- protected LicenseTermTag(LicenseTag lt) {
- _license = lt.getLicense();
- our_salt = LRES.get(LRES.getOurSalt());
- }
-
- protected License getLicense() {
- return _license;
- }
-
- protected void setKey(String key) {
- _key = key;
- }
-
- // Called before validation begins
- protected void preValidate() {
- }
-
- // Called to get the value to compare against the key
- protected abstract String getValidationComparisonValue();
-
- // Called when validation is successful
- protected abstract void termValidated();
-
- public void exit() throws XmlTagException {
- // Validate a value against a key
- String key = generateKey();
- if (!key.equals(_key)) {
- // System.err.println(getClass().getName() + ": given key("+_key+") doesnt match realkey="+key);
- //LicenseManager.doHalt(LRES.ERR_VALIDATION);
- throw new IllegalStateException();
- }
-
- termValidated();
- }
-
- protected String generateKey() {
- String value = getValidationComparisonValue();
- if ((value == null) || (value.length() == 0)) {
- LicenseManager.doHalt(LRES.ERR_NOVALUE);
- throw new IllegalStateException();
- }
-
- try {
- return LicenseTag.hash(value + our_salt + value.charAt(0) + getName() + "$" + _license.getMasterKey());
- } catch (Exception e) {
- LicenseManager.doHalt(LRES.ERR_KEYVALIDATION, e);
- throw new IllegalStateException();
- }
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java
deleted file mode 100644
index 6128cfa..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class LicenseeTag extends LicenseTermTag {
- protected LicenseeTag(LicenseTag lt) {
- super(lt);
- }
-
- protected LicenseeTag(LicenseTag lt, String name, String email, String phone) {
- super(lt);
- _name = name;
- _email = email;
- _phone = phone;
- }
-
- private String _name = null;
- private String _email = null;
- private String _phone = null;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_NAME), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_EMAIL), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_PHONE), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_LICENSEE);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getLicenseeName() {
- return _name;
- }
-
- protected String getLicenseeEmail() {
- return _email;
- }
-
- protected String getLicenseePhone() {
- return _phone;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber < 0) || (attrNumber > (ATTRS.length - 1))) {
- LicenseManager.doHalt(LRES.MSG_BADINDEX);
- throw new IllegalStateException();
- }
-
- if (attrNumber == 0) {
- _name = value;
- } else if (attrNumber == 1) {
- _email = value;
- } else if (attrNumber == 2) {
- _phone = value;
- } else {
- setKey(value);
- }
- }
-
- protected void preValidate() {
- if ((_name == null) || (_email == null) || (_phone == null)) {
- LicenseManager.doHalt(LRES.ERR_INVALIDLICENSEE);
- throw new IllegalStateException();
- }
- }
-
- protected String getValidationComparisonValue() {
- return _name + ":" + _email + ":" + _phone;
- }
-
- protected void termValidated() {
- getLicense().setLicenseeName(_name);
- getLicense().setLicenseeEmail(_email);
- getLicense().setLicenseePhone(_phone);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java
deleted file mode 100644
index 6c436fc..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.enterprise.server.legacy.common.ApplicationException;
-
-public class PlatformLimitException extends ApplicationException {
- private int limit = -1;
-
- public PlatformLimitException(String msg, int limit) {
- super(msg);
- this.limit = limit;
- }
-
- public int getLimit() {
- return limit;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java
deleted file mode 100644
index fb23cbc..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class PlatformLimitTag extends LicenseTermTag {
- protected PlatformLimitTag(LicenseTag lt) {
- super(lt);
- }
-
- private int _count = 0;
- private String _origValue = null;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_COUNT), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_PLATFORMLIMIT);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getOriginalPlatformLimitString() {
- return _origValue;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- if (value.equals(LRES.get(LRES.PLATFORMS_UNLIMITED))) {
- _count = License.PLATFORMS_UNLIMITED;
- _origValue = value;
- } else {
- try {
- _count = Integer.parseInt(value);
- _origValue = value;
- } catch (Exception e) {
- throw new XmlAttrException(LRES.get(LRES.ERR_MSG_BADCOUNT));
- }
- }
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return String.valueOf(_count);
- }
-
- protected void termValidated() {
- getLicense().setPlatformLimit(_count);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java
deleted file mode 100644
index 0dd4cb4..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class PluginTag extends LicenseTermTag {
- protected PluginTag(LicenseTag lt) {
- super(lt);
- }
-
- private String _plugin = "";
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_NAME), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_PLUGINENABLE);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getPlugin() {
- return _plugin;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- _plugin = value;
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return _plugin;
- }
-
- protected void termValidated() {
- getLicense().addPlugin(_plugin);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java
deleted file mode 100644
index 201a922..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class ServerIpTag extends LicenseTermTag {
- protected ServerIpTag(LicenseTag lt) {
- super(lt);
- }
-
- private String _address = null;
- private int _count = 0;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_ADDRESS), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_COUNT), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_SERVERIP);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected int getCount() {
- return _count;
- }
-
- protected String getAddress() {
- return _address;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1) && (attrNumber != 2)) {
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- _address = value;
- } else if (attrNumber == 1) {
- try {
- _count = Integer.parseInt(value);
- } catch (Exception e) {
- throw new XmlAttrException(LRES.get(LRES.ERR_MSG_BADCOUNT));
- }
- } else {
- setKey(value);
- }
- }
-
- protected void preValidate() {
- if ((_address == null) || (_count == 0)) {
- throw new IllegalStateException(LRES.get(LRES.ERR_INVALIDSERVERIP));
- }
- }
-
- protected String getValidationComparisonValue() {
- return _count + ":" + _address;
- }
-
- protected void termValidated() {
- if (_address != null) {
- getLicense().addServerIp(_count, _address);
- }
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java
deleted file mode 100644
index 381f20f..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class SupportLevelTag extends LicenseTermTag {
- protected SupportLevelTag(LicenseTag lt) {
- super(lt);
- }
-
- private int _level = 0;
- private String _origValue = null;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_LEVEL), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_SUPPORTLEVEL);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getOriginalSupportLevelString() {
- return _origValue;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- try {
- _level = Integer.parseInt(value);
- _origValue = value;
- } catch (Exception e) {
- throw new XmlAttrException(LRES.get(LRES.ERR_MSG_BADLEVEL));
- }
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return String.valueOf(_level);
- }
-
- protected void termValidated() {
- getLicense().setSupportLevel(_level);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java
deleted file mode 100644
index b0c2eb3..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.license;
-
-public class UnavailableLicenseException extends LicenseException {
- public UnavailableLicenseException() {
- super();
- }
-
- public UnavailableLicenseException(String message) {
- super(message);
- }
-
- public UnavailableLicenseException(Throwable cause) {
- super(cause);
- }
-
- public UnavailableLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.java
deleted file mode 100644
index 60e0346..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.license;
-
-public class UpdateTrialLicenseException extends LicenseException {
- public UpdateTrialLicenseException() {
- }
-
- public UpdateTrialLicenseException(String message) {
- super(message);
- }
-
- public UpdateTrialLicenseException(Throwable cause) {
- super(cause);
- }
-
- public UpdateTrialLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
index 275f063..ea1e067 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
@@ -22,11 +22,11 @@ import java.util.EnumSet;
import java.util.Set;
import org.jetbrains.annotations.NotNull;
+
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
import org.rhq.enterprise.server.perspective.activator.LicenseFeature;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -52,15 +52,11 @@ public class GlobalActivationContext implements ActivationContext {
// lazy load
if (this.licenseFeatures == null) {
this.licenseFeatures = EnumSet.noneOf(LicenseFeature.class);
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- boolean monitoringEnabled = systemManager.isMonitoringEnabled();
- if (monitoringEnabled) {
- this.licenseFeatures.add(LicenseFeature.MONITORING);
- }
+ this.licenseFeatures.add(LicenseFeature.MONITORING); // always give this permission
}
return this.licenseFeatures;
}
-
+
public Subject getSubject() {
return this.subject;
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.java
deleted file mode 100644
index c4785a3..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.system;
-
-public class LicenseException extends RuntimeException {
- public LicenseException() {
- }
-
- public LicenseException(String message) {
- super(message);
- }
-
- public LicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public LicenseException(Throwable cause) {
- super(cause);
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index 7e4ce9e..dd65ec1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -19,21 +19,17 @@
package org.rhq.enterprise.server.system;
import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.net.URL;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
-import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.Timeout;
@@ -67,10 +63,6 @@ import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.authz.RequiredPermission;
import org.rhq.enterprise.server.core.CoreServerMBean;
import org.rhq.enterprise.server.core.CustomJaasDeploymentServiceMBean;
-import org.rhq.enterprise.server.license.FeatureUnavailableException;
-import org.rhq.enterprise.server.license.License;
-import org.rhq.enterprise.server.license.LicenseManager;
-import org.rhq.enterprise.server.license.LicenseStoreManager;
import org.rhq.enterprise.server.util.LookupUtil;
@Stateless
@@ -103,18 +95,11 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
@javax.annotation.Resource
private TimerService timerService;
- private LicenseManager licenseManager;
-
@EJB
private SystemManagerLocal systemManager;
private static Properties systemConfigurationCache = null;
private final String TIMER_DATA = "SystemManagerBean.reloadConfigCache";
- @PostConstruct
- public void initialize() {
- licenseManager = LicenseManager.instance();
- }
-
@SuppressWarnings("unchecked")
public void scheduleConfigCacheReloader() {
// each time the webapp is reloaded, we don't want to create duplicate jobs
@@ -530,19 +515,6 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
return;
}
- /**
- * See if monitoring feature is enabled for product.
- */
- public boolean isMonitoringEnabled() {
- try {
- LicenseManager.instance().enforceFeatureLimit(LicenseManager.FEATURE_MONITOR);
- return true;
- } catch (FeatureUnavailableException e) {
- log.debug("Monitoring feature is not enabled");
- return false;
- }
- }
-
public boolean isDebugModeEnabled() {
try {
return Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode, "false"));
@@ -560,102 +532,6 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
}
}
- /**
- * Retrieves the currently active license. Returns null if there is no active license. Otherwise it needs to
- * propogate the appropriate error back up to the caller, otherwise the error will be masked, and from a UI
- * perspective the user will think no license has been installed yet.
- *
- * @return The License object
- */
- public License getLicense() {
- // it's legal to return a null license, which then by-passes the check to
- // whether the expirationDate in the backing store has been fiddled with
- License license = LicenseManager.instance().getLicense();
- if (license == null) {
- return license;
- }
-
- // but if the license exists, it can only be returned if the data in the backing store is consistent. so call
- // the get method, which checks the backing store, and returns the license. if there are any errors, they will
- // bubble up as exceptions for the UI to handle appropriately. otherwise, the license will be synced with the
- // backing store appropriately.
- try {
- LicenseStoreManager.store(license);
- } catch (Exception ule) {
- log.error(ule.getMessage());
- throw new LicenseException(ule);
- }
-
- return license;
- }
-
- /**
- * Update the deployed license file by writing it to disk and reinitializing the LicenseManager static singleton.
- *
- * @param licenseData a byte array of the license data
- */
- @RequiredPermission(Permission.MANAGE_SETTINGS)
- public void updateLicense(Subject subject, byte[] licenseData) {
- try {
- File serverHomeDir = LookupUtil.getCoreServer().getJBossServerHomeDir();
-
- File deployDirectory = new File(serverHomeDir, "deploy");
-
- String licenseFileName = LicenseManager.getLicenseFileName();
-
- if (deployDirectory.exists()) {
- String licenseDirectoryName = deployDirectory.getAbsolutePath() + File.separator
- + RHQConstants.EAR_FILE_NAME + File.separator + "license";
- File licenseDir = new File(licenseDirectoryName);
- if (licenseDir.exists()) {
- File licenseFile = saveLicenseFile(licenseDir, licenseFileName, licenseData);
-
- // Now, we've updated the licenses on disk and we'll re-initialize the LicenseManager
- LicenseManager.instance().doStartupCheck(licenseFile.getAbsolutePath());
- } else {
- log.error("Could not update license file in non-existent directory: "
- + licenseDir.getAbsolutePath());
- }
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private File saveLicenseFile(File dataDir, String licenseFileName, byte[] licenseData) throws IOException {
- log.debug("Updating license file in directory: " + dataDir.getAbsolutePath());
-
- // Copy file to data dir
- File licenseFile = new File(dataDir, licenseFileName);
- FileOutputStream fos = new FileOutputStream(licenseFile);
-
- // Writing in a single block since
- // a) we may be writing it twice, and
- // b) the license files are fairly small
- // c) this will be rare
- fos.write(licenseData);
- fos.close();
- return licenseFile;
- }
-
- /**
- * @return the expiration date, or null if the product never expires.
- */
- public Date getExpiration() {
- long exp;
- try {
- exp = licenseManager.getExpiration();
- } catch (Exception e) {
- throw new LicenseException(e);
- }
-
- if (exp == -1) {
- return null;
- }
-
- return new Date(exp);
- }
-
public ServerVersion getServerVersion(Subject subject) throws Exception {
CoreServerMBean coreServer = LookupUtil.getCoreServer();
String version = coreServer.getVersion();
@@ -668,5 +544,5 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
CoreServerMBean coreServer = LookupUtil.getCoreServer();
ProductInfo productInfo = coreServer.getProductInfo();
return productInfo;
- }
+ }
}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
index e044b0a..7aa9b6d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
@@ -18,7 +18,6 @@
*/
package org.rhq.enterprise.server.system;
-import java.util.Date;
import java.util.Properties;
import javax.ejb.Local;
@@ -26,7 +25,6 @@ import javax.ejb.Local;
import org.rhq.core.db.DatabaseType;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.ProductInfo;
-import org.rhq.enterprise.server.license.License;
/**
* Provides access to the server cloud's system configuration as well as some methods
@@ -155,17 +153,6 @@ public interface SystemManagerLocal {
boolean isExperimentalFeaturesEnabled();
- //////////////////////////////////
- // license specific methods follow
-
- boolean isMonitoringEnabled();
-
- License getLicense();
-
- void updateLicense(Subject subject, byte[] licenseData);
-
- Date getExpiration();
-
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// The following are shared with the Remote Interface
diff --git a/modules/enterprise/server/license-gen/jar/pom.xml b/modules/enterprise/server/license-gen/jar/pom.xml
deleted file mode 100644
index 4ccb2ff..0000000
--- a/modules/enterprise/server/license-gen/jar/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../../../../../pom.xml</relativePath>
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-license-gen</artifactId>
- <packaging>jar</packaging>
-
- <name>RHQ Enterprise Server License Generator JAR</name>
- <description>RHQ enterprise server license generator JAR</description>
-
- <scm>
- <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</connection>
- <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</developerConnection>
- </scm>
-
- <properties>
- <scm.module.path>modules/enterprise/server/license-gen/jar/</scm.module.path>
- </properties>
-
- <dependencies>
-
- <!-- Internal Deps -->
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-util</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.rhq.enterprise.server.license.LicenseGenerator</mainClass>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib</classpathPrefix>
- </manifest>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <includeScope>runtime</includeScope>
- <excludeTransitive>true</excludeTransitive>
- <outputDirectory>target/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java b/modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java
deleted file mode 100644
index 397366d..0000000
--- a/modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * 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.license;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.rhq.core.clientapi.util.StringUtil;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-
-public final class LicenseGenerator {
-
- public static final String EVAL_NAME = "Evaluation Customer";
- public static final String EVAL_EMAIL = "johndoe(a)example.com";
- public static final String EVAL_PHONE = "888-555-1212";
-
- public static final String LICENSE_VERSION = "2.0";
-
- public static final String LICENSE_HEADER = "\n<!--"
- + "\n This license should be uploaded to your RHQ Server in the"
- + "\n Manage License section of the Administration area. If you have"
- + "\n not already installed a license, you will be directed to this"
- + "\n page on your first login to the application." + "\n "
- + "\n You must login as an administrator to update your license file." + "\n-->\n";
-
- // max 20 platforms in an eval
- public static final int EVAL_MAXPLATFORMS = 20;
-
- // level 0 support in an eval
- public static final int EVAL_SUPPORT_LEVEL = License.FEATURE_BASIC;
-
- public static final SimpleDateFormat DFORMAT = new SimpleDateFormat("MMM-dd-yyyy HH:mm");
-
- public LicenseGenerator() {
- }
-
- /**
- * Can be used to generate a license file.
- * <p/>
- * Usage: java this-class "<name>" <email> "phone" <expiration> <platform-limit> "<server-ip-list>"
- * "<plugin-name-list>"
- * <p/>
- * Where: "<name>" is the licensee's name <email> is the licensee's email "<phone>" is the licensee's phone
- * <expiration> is in yyyy-MM-dd format, or '*' for no expiration <platform-limit> is an integer "<server-ip-list>"
- * is a whitespace-separated list of ip addresses "<plugin-name-list>" is a whitespace-separated list of plugin
- * names "<support-level" is 1 for no monitoring support or 3 for monitoring support -- OR -- if arg[0] is "EVAL", a
- * license file suitable for evaluation purposes will be generated.
- */
- public static void main(String[] args) {
-
- LicenseGenerator g = new LicenseGenerator();
-
- if (args.length == 1 && args[0].equals("EVAL")) {
- try {
- g.generateEval(System.out);
- } catch (IOException e) {
- System.err.println("Failed to generate license - cause: " + e);
- e.printStackTrace();
- System.exit(1);
- }
- return;
- }
-
- int i = 0;
- if (args.length != 8) {
- System.err.println("Too " + ((args.length < 8) ? "few" : "many") + " arguments.");
- System.err.println();
- System.err.println("Usage: " + LicenseGenerator.class.getSimpleName() + " <Name> <Email> <Phone> <Expiration Date> <Platform Limit> <IP List> <Plugins List> <Support Level>");
- System.err.println("For example: " + LicenseGenerator.class.getSimpleName() +" \"Customer Name\" sales(a)jboss.com 404-467-8555 2009-07-01 \"*\" \"*\" \"*\" 3");
- System.exit(1);
- }
-
- String name = args[i++];
- String email = args[i++];
- String phone = args[i++];
- String expString = args[i++];
- String aLimitString = args[i++];
- List serverIps = StringUtil.explode(args[i++], " \t\n");
- List plugins = StringUtil.explode(args[i++], " \t\n");
- String supportString = args[i++];
-
- try {
- g.generate(name, email, phone, expString, aLimitString, serverIps, plugins, supportString, System.out);
- } catch (IOException e) {
- System.err.println("Failed to generate license - cause: " + e);
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- public void generateEval(OutputStream out) throws IOException {
-
- Calendar expCal = Calendar.getInstance();
- expCal.setTime(new Date());
- expCal.set(Calendar.MONTH, Calendar.NOVEMBER);
- expCal.set(Calendar.DAY_OF_MONTH, 1);
- expCal.set(Calendar.ZONE_OFFSET, ExpirationTag.PST_OFFSET);
- expCal.set(Calendar.DST_OFFSET, ExpirationTag.DST_OFFSET);
- String expiration = ExpirationTag.DFORMAT.format(expCal.getTime());
-
- // String expiration = LRES.get(LRES.EXPIRATION_NEVER);
-
- // no server ip or plugin restrictions
- List serverIps = new ArrayList();
- serverIps.add(LRES.get(LRES.IP_ANY));
- List plugins = new ArrayList();
- plugins.add(LRES.get(LRES.PLUGIN_ANY));
-
- generate(EVAL_NAME, EVAL_EMAIL, EVAL_PHONE, expiration, String.valueOf(EVAL_MAXPLATFORMS), serverIps, plugins,
- String.valueOf(License.FEATURE_ALL), out);
- }
-
- /**
- * From GenericLicenseGenerator, used by ant task
- */
- public void generate(Map licenseData, OutputStream out) throws IOException {
- generate((String) licenseData.get("name"), (String) licenseData.get("email"),
- (String) licenseData.get("phone"), (String) licenseData.get("expiration"), (String) licenseData
- .get("platform-limit"), (List) licenseData.get("server-ips"), (List) licenseData.get("plugins"),
- (String) licenseData.get("support-level"), out);
- }
-
- /**
- * Generate a license file
- *
- * @param name The licensee's name
- * @param email The licensee's email
- * @param phone The licensee's phone
- * @param expiration The expiration in yyyy-MM-dd format, or "*"
- * @param platformLimit The platform limit or "*"
- * @param serverIps a List of Strings that are server IP addresses, or this may a List of length 1, where the
- * element at index zero is the String "*"
- * @param plugins a List of Strings that are plugin names, or this may a List of length 1, where the element
- * at index zero is the String "*"
- * @param supportLevel TODO
- * @param out This is where the license file will get written. NOTE THAT THE CALLER IS RESPONSIBLE FOR
- * OPENING AND CLOSING THIS STREAM.
- */
- public void generate(String name, String email, String phone, String expiration, String platformLimit,
- List serverIps, List plugins, String supportLevel, OutputStream out) throws IOException {
-
- License l = new License();
- LicenseTag lt = new LicenseTag(l);
- String masterKey = lt.generateKey();
- lt.setMasterKey(masterKey);
- lt.setVersion(LICENSE_VERSION);
-
- LicenseeTag licenseeTag = new LicenseeTag(lt, name, email, phone);
- ExpirationTag exTag = new ExpirationTag(lt);
- PlatformLimitTag plTag = new PlatformLimitTag(lt);
- SupportLevelTag slTag = new SupportLevelTag(lt);
-
- try {
- exTag.handleAttribute(0, expiration);
- } catch (XmlAttrException e) {
- throw new IOException("Error setting expiration: " + e);
- }
- try {
- plTag.handleAttribute(0, platformLimit);
- } catch (XmlAttrException e) {
- throw new IOException("Error setting platform-limit: " + e);
- }
-
- ServerIpTag[] ipTags = new ServerIpTag[serverIps.size()];
- for (int i = 0; i < ipTags.length; i++) {
- ipTags[i] = new ServerIpTag(lt);
- try {
- ipTags[i].handleAttribute(0, (String) serverIps.get(i));
- ipTags[i].handleAttribute(1, String.valueOf(i + 1));
- } catch (XmlAttrException e) {
- throw new IOException("Error setting server-ip: " + e);
- }
- }
-
- PluginTag[] pluginTags = new PluginTag[plugins.size()];
- for (int i = 0; i < pluginTags.length; i++) {
- pluginTags[i] = new PluginTag(lt);
- try {
- pluginTags[i].handleAttribute(0, (String) plugins.get(i));
- } catch (XmlAttrException e) {
- throw new IOException("Error setting plugin: " + e);
- }
- }
-
- try {
- slTag.handleAttribute(0, supportLevel);
- } catch (XmlAttrException e) {
- throw new IOException("Error setting support-level: " + e);
- }
-
- StringBuilder sb = new StringBuilder();
- sb.append("<?xml version=\"1.0\"?>\n").append(LICENSE_HEADER).append("\n<!-- License created: ").append(
- DFORMAT.format(new Date())).append(" -->").append("\n<").append(lt.getName()).append(" ").append(
- LRES.get(LRES.ATTR_KEY)).append("=\"").append(lt.getMasterKey()).append("\" ").append(
- LRES.get(LRES.ATTR_VERSION)).append("=\"").append(lt.getVersion()).append("\">\n");
-
- // license-owner
- sb.append("\n\t<").append(licenseeTag.getName()).append(" ").append(LRES.get(LRES.ATTR_NAME)).append("=\"")
- .append(licenseeTag.getLicenseeName()).append("\" ").append("\n\t ").append(
- LRES.get(LRES.ATTR_EMAIL)).append("=\"").append(licenseeTag.getLicenseeEmail()).append("\" ").append(
- "\n\t ").append(LRES.get(LRES.ATTR_PHONE)).append("=\"").append(
- licenseeTag.getLicenseePhone()).append("\" ").append("\n\t ").append(
- LRES.get(LRES.ATTR_KEY)).append("=\"").append(licenseeTag.generateKey()).append("\"/>\n\n");
-
- // expiration
- sb.append("\t<").append(exTag.getName()).append(" ").append(LRES.get(LRES.ATTR_DATE)).append("=\"").append(
- exTag.getOriginalExpirationString()).append("\" ").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- exTag.generateKey()).append("\" ").append("/>\n");
-
- // platform count
- sb.append("\t<").append(plTag.getName()).append(" ").append(LRES.get(LRES.ATTR_COUNT)).append("=\"").append(
- plTag.getOriginalPlatformLimitString()).append("\" ").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- plTag.generateKey()).append("\" ").append("/>\n");
-
- // server ips
- for (int i = 0; i < ipTags.length; i++) {
- sb.append("\t<").append(ipTags[i].getName()).append(" ").append(LRES.get(LRES.ATTR_COUNT)).append("=\"")
- .append(ipTags[i].getCount()).append("\" ").append(LRES.get(LRES.ATTR_ADDRESS)).append("=\"").append(
- ipTags[i].getAddress()).append("\" ").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- ipTags[i].generateKey()).append("\" ").append("/>\n");
- }
-
- // plugins
- for (int i = 0; i < pluginTags.length; i++) {
- sb.append("\t<").append(pluginTags[i].getName()).append(" ").append(LRES.get(LRES.ATTR_NAME)).append("=\"")
- .append(pluginTags[i].getPlugin()).append("\" ").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- pluginTags[i].generateKey()).append("\" ").append("/>\n");
- }
-
- // support level
- sb.append("\t<").append(slTag.getName()).append(" ").append(LRES.get(LRES.ATTR_LEVEL)).append("=\"").append(
- slTag.getOriginalSupportLevelString()).append("\" ").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- slTag.generateKey()).append("\" ").append("/>\n");
-
- sb.append("\n</license>\n");
-
- // write to stream
- BufferedWriter bw;
- bw = new BufferedWriter(new OutputStreamWriter(out));
- bw.write(sb.toString());
- bw.flush();
- }
-}
diff --git a/modules/enterprise/server/license-gen/maven-plugin/pom.xml b/modules/enterprise/server/license-gen/maven-plugin/pom.xml
deleted file mode 100644
index dceb54d..0000000
--- a/modules/enterprise/server/license-gen/maven-plugin/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../../../../../pom.xml</relativePath>
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <packaging>maven-plugin</packaging>
-
- <name>RHQ Enterprise Server License Generator Maven Plugin</name>
- <description>a Maven plugin for generating license files for RHQ Enterprise Server</description>
-
- <scm>
- <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</connection>
- <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</developerConnection>
- </scm>
-
- <properties>
- <scm.module.path>modules/enterprise/server/license-gen/</scm.module.path>
- </properties>
-
- <dependencies>
-
- <!-- Internal Deps -->
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-license-gen</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- 3rd Party Deps -->
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact-ant</artifactId>
- <version>2.0.4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-script-ant</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- <!-- Note: v2.5 is not compatible with maven-plugin-tools-ant v2.1+. -->
- <version>2.3</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-tools-ant</artifactId>
- <version>2.0.4</version>
- </dependency>
- </dependencies>
-
- <configuration>
- <goalPrefix>license</goalPrefix>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml b/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml
deleted file mode 100644
index 5d44177..0000000
--- a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="license-gen" default="generateLicense" basedir="." xmlns:artifact="urn:maven-artifact-ant">
-
- <target name="generateLicense">
-
- <echo>ant.version: ${ant.version}</echo>
-
- <property name="rhq.version" value="1.3.0-SNAPSHOT" />
- <echo>rhq.version: ${rhq.version}</echo>
- <echo/>
-
- <property name="default.rhq.license.name" value="RHQ User" />
- <property name="default.rhq.license.email" value="sales(a)jboss.com" />
- <property name="default.rhq.license.phone" value="888-555-1212" />
- <property name="default.rhq.license.max-platforms" value="*" />
- <property name="default.rhq.license.ip-addresses" value="*" />
- <property name="default.rhq.license.plugins" value="*" />
- <property name="default.rhq.license.support-level" value="3" />
-
- <property name="localRepository" location="${user.home}/.m2/repository" />
- <!--<echo>localRepository: ${localRepository}</echo>-->
-
- <property name="alt.localRepository" location="C:/.m2-repo" />
- <!--<echo>alt.localRepository: ${alt.localRepository}</echo>-->
-
- <tstamp>
- <format property="default.rhq.license.expire-date" pattern="yyyy-MM-dd" offset="1" unit="month" />
- </tstamp>
-
- <echo>Please enter the following license parameters (hit Enter to accept defaults)...</echo>
-
- <input message="Name [${default.rhq.license.name}]:" addproperty="rhq.license.name" defaultvalue="${default.rhq.license.name}" />
- <input message="Email address [${default.rhq.license.email}]:" addproperty="rhq.license.email" defaultvalue="${default.rhq.license.email}" />
- <input message="Phone number [${default.rhq.license.phone}]:" addproperty="rhq.license.phone" defaultvalue="${default.rhq.license.phone}" />
- <input message="Expiration date (yyyy-MM-dd) (*=never) [${default.rhq.license.expire-date}]:" addproperty="rhq.license.expire-date" defaultvalue="${default.rhq.license.expire-date}" />
- <input message="Maximum platforms (*=unlimited) [${default.rhq.license.max-platforms}]:" addproperty="rhq.license.max-platforms" defaultvalue="${default.rhq.license.max-platforms}" />
- <input message="Allowed IP addresses (*=any) [${default.rhq.license.ip-addresses}]:" addproperty="rhq.license.ip-addresses" defaultvalue="${default.rhq.license.ip-addresses}" />
- <input message="Allowed plugins (*=any) [${default.rhq.license.plugins}]:" addproperty="rhq.license.plugins" defaultvalue="${default.rhq.license.plugins}" />
- <input message="Support level (1-3) [${default.rhq.license.support-level}]:" addproperty="rhq.license.support-level" defaultvalue="${default.rhq.license.support-level}" />
-
- <echo>Generating license...</echo>
-
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
- <classpath>
- <pathelement location="${localRepository}/org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4.jar" />
- <pathelement location="${alt.localRepository}/org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4.jar" />
- </classpath>
- </typedef>
-
- <artifact:dependencies pathId="license-generator.classpath">
- <dependency groupId="org.rhq" artifactId="rhq-enterprise-server-license-gen" version="${rhq.version}"/>
- </artifact:dependencies>
-
- <mkdir dir="target" />
- <property name="license.file" value="target${file.separator}rhq-license.xml" />
-
- <java classname="org.rhq.enterprise.server.license.LicenseGenerator" classpathref="license-generator.classpath" output="${license.file}" logError="true">
- <arg value="${rhq.license.name}" />
- <arg value="${rhq.license.email}" />
- <arg value="${rhq.license.phone}" />
- <arg value="${rhq.license.expire-date}" />
- <arg value="${rhq.license.max-platforms}" />
- <arg value="${rhq.license.ip-addresses}" />
- <arg value="${rhq.license.plugins}" />
- <arg value="${rhq.license.support-level}" />
- </java>
-
- <echo>Done. License file written to ${license.file}</echo>
-
- </target>
-
-</project>
\ No newline at end of file
diff --git a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml b/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml
deleted file mode 100644
index 2db63ad..0000000
--- a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-
-<pluginMetadata>
-
- <mojos>
-
- <mojo>
- <goal>generateLicense</goal>
-
- <!-- this element refers to the Ant target M2 should invoke -->
- <call>generateLicense</call>
-
- <description>
- Generate an RHQ license file
- </description>
-
- <parameters>
- <parameter>
- <name>rhq.version</name>
- <property>rhq.version</property>
- <required>true</required>
- <readonly>true</readonly>
- <defaultValue>${project.version}</defaultValue>
- <type>java.lang.String</type>
- <description>The RHQ version</description>
- </parameter>
- </parameters>
- </mojo>
-
- </mojos>
-
-</pluginMetadata>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
index 0ea6e12..26806e9 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -318,18 +318,6 @@
name="administration.reports"
placement="after" />
</menu-item>
- <menu-item
- name="administration.license"
- displayName="License"
- url="/admin/license/LicenseAdmin.do?mode=view">
- <position
- name="administration.downloads"
- placement="after" />
- <activators>
- <global-permission
- name="MANAGE_SETTINGS" />
- </activators>
- </menu-item>
<!-- Core Menu: Debug -->
<menu-item
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index a012753..b2df029 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -39,8 +39,6 @@
<module>plugins</module>
<module>ear</module>
<module>safe-invoker</module>
- <module>license-gen/jar</module>
- <module>license-gen/maven-plugin</module>
</modules>
</profile>
13 years, 3 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/pom.xml | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 86 +++-------
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties | 52 ++++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties | 52 ++++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 11 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 12 -
7 files changed, 149 insertions(+), 70 deletions(-)
New commits:
commit fbde2b7f3a1955bbd78645b39d573aff26f76c43
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Feb 8 17:59:44 2011 -0500
Improve the Help View
Migrate the urls to I18N properties for easy modification. Moreover, make
the help sections table-driven from properties. To do this defined the necessary
properties in a new file, MessageConstants.properties. This file is used
to generate a ConstantsWithLookup interface, which allows for querying for
properties at runtime, when you may not know the method name at compile
time.
- added generation of new MessageConstants.java to the pom
- added public accessor in CoreGUI
- Changed HelpView to be table-driven off new props
- added new propertis file
- tried my best at keeping the German translation in sync
= Make the Help sections
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index fc41629..ee8fa77 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -277,6 +277,7 @@
<debugSuspend>false</debugSuspend>
<servicePattern>**/gwt/*GWTService.java</servicePattern>
<i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle>
+ <i18nConstantsWithLookupBundle>org.rhq.enterprise.gui.coregui.client.MessageConstants</i18nConstantsWithLookupBundle>
<compileSourcesArtifacts>org.rhq:rhq-core-domain</compileSourcesArtifacts>
<style>DETAILED</style>
</configuration>
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index d523ab9..fb04a3b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -68,6 +68,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
// This must come first to ensure proper I18N class loading for dev mode
private static final Messages MSG = GWT.create(Messages.class);
+ private static final MessageConstants MSGCONST = GWT.create(MessageConstants.class);
private static final String DEFAULT_VIEW_PATH = DashboardsView.VIEW_ID.getName();
@@ -309,6 +310,10 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
return MSG;
}
+ public static MessageConstants getMessageConstants() {
+ return MSGCONST;
+ }
+
private class RootCanvas extends VLayout implements BookmarkableView {
private ViewId currentViewId;
private Canvas currentCanvas;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index d5380a8..47865a8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.client.help;
import java.util.ArrayList;
import java.util.List;
+import java.util.MissingResourceException;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
@@ -31,6 +32,7 @@ import com.smartgwt.client.widgets.HTMLFlow;
import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.MessageConstants;
import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow;
import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.view.AbstractSectionedLeftNavigationView;
@@ -48,9 +50,8 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
public class HelpView extends AbstractSectionedLeftNavigationView {
public static final ViewName VIEW_ID = new ViewName("Help", MSG.common_title_help());
- private static final ViewName SECTION_DOC_VIEW_ID = new ViewName("Documentation", MSG
- .view_helpSection_documentation());
- private static final ViewName SECTION_TUTORIAL_VIEW_ID = new ViewName("Tutorial", MSG.view_helpSection_tutorial());
+ private static final ViewName SECTION_PRODUCT_VIEW_ID = new ViewName("Product", MSG.view_help_section_product());
+
private static ProductInfo PRODUCT_INFO;
public HelpView() {
@@ -62,11 +63,10 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
protected List<NavigationSection> getNavigationSections() {
List<NavigationSection> sections = new ArrayList<NavigationSection>();
- NavigationSection docSection = buildDocSection();
+ NavigationSection docSection = buildProductSection();
sections.add(docSection);
- NavigationSection tutorialSection = buildTutorialSection();
- sections.add(tutorialSection);
+ addUrlSections(sections);
return sections;
}
@@ -79,9 +79,9 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
return flow;
}
- private NavigationSection buildDocSection() {
+ private NavigationSection buildProductSection() {
- NavigationItem aboutItem = new NavigationItem(new ViewName("AboutBox", MSG.view_help_docAbout()),
+ NavigationItem aboutItem = new NavigationItem(new ViewName("AboutBox", MSG.view_help_section_product_about()),
"[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow();
@@ -104,58 +104,40 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
}
});
- NavigationItem docItem = new NavigationItem(new ViewName("TOC", MSG.view_help_docToc()),
- "[SKIN]/../headerIcons/document.png", new ViewFactory() {
- public Canvas createView() {
- return new FullHTMLPane(extendLocatorId("TOC"), "http://www.rhq-project.org/display/JOPR2/Home");
- }
- });
-
- NavigationItem faqItem = new NavigationItem(new ViewName("FAQ", MSG.view_help_docFaq()),
- "[SKIN]/../headerIcons/document.png", new ViewFactory() {
- public Canvas createView() {
- return new FullHTMLPane(extendLocatorId("FAQ"), "http://www.rhq-project.org/display/JOPR2/FAQ");
- }
- });
-
- return new NavigationSection(SECTION_DOC_VIEW_ID, aboutItem, docItem, faqItem);
+ return new NavigationSection(SECTION_PRODUCT_VIEW_ID, aboutItem);
}
- private NavigationSection buildTutorialSection() {
+ private void addUrlSections(List<NavigationSection> sections) {
- NavigationItem searchItem = new NavigationItem(new ViewName("TutorialSearch", MSG.view_help_tutorialSearch()),
- "[SKIN]/../actions/help.png", new ViewFactory() {
- public Canvas createView() {
- return new FullHTMLPane(extendLocatorId("TutorialSearch"),
- "http://www.rhq-project.org/display/JOPR2/Search");
- }
- });
+ MessageConstants mc = CoreGUI.getMessageConstants();
+ int numSections = Integer.valueOf(mc.view_help_section_count());
- NavigationItem dynaGroupItem = new NavigationItem(new ViewName("TutorialDynaGroup", MSG
- .view_help_tutorialDynaGroup()), "[SKIN]/../actions/help.png", new ViewFactory() {
- public Canvas createView() {
- return new FullHTMLPane(
- extendLocatorId("TutorialDynaGroup"),
- "http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/2.4/html/Basic...");
- }
- });
+ for (int i = 1; i <= numSections; ++i) {
+ int numItems = Integer.valueOf(mc.getString("view_help_section_" + i + "_item_count"));
+ NavigationItem[] items = new NavigationItem[numItems];
+ String sectionTitle = mc.getString("view_help_section_" + i + "_title");
- NavigationItem demoAllItem = new NavigationItem(new ViewName("DemoAll", MSG.view_help_tutorialDemoAll()),
- "[SKIN]/../headerIcons/document.png", new ViewFactory() {
- public Canvas createView() {
- return new FullHTMLPane(extendLocatorId("DemoAll"),
- "http://www.rhq-project.org/display/JOPR2/Demos");
+ for (int j = 1; j <= numItems; ++j) {
+ String title = mc.getString("view_help_section_" + i + "_propTitle_" + j);
+ final String url = mc.getString("view_help_section_" + i + "_propUrl_" + j);
+ String icon;
+ try {
+ icon = mc.getString("view_help_section_" + i + "_propIcon_" + j);
+ } catch (MissingResourceException e) {
+ icon = "[SKIN]/../headerIcons/document.png";
}
- });
- NavigationItem demoBundleItem = new NavigationItem(new ViewName("DemoBundle", MSG
- .view_help_tutorialDemoBundle()), "[SKIN]/../headerIcons/document.png", new ViewFactory() {
- public Canvas createView() {
- return new FullHTMLPane(extendLocatorId("DemoBundle"),
- "http://mazz.fedorapeople.org/demos/provisioning_beta/prov-beta.htm");
+ final String itemName = "Section" + i + "Item" + j;
+ NavigationItem item = new NavigationItem(new ViewName(itemName, title), icon, new ViewFactory() {
+ public Canvas createView() {
+ return new FullHTMLPane(extendLocatorId(itemName), url);
+ }
+ });
+ items[j - 1] = item;
}
- });
- return new NavigationSection(SECTION_TUTORIAL_VIEW_ID, searchItem, dynaGroupItem, demoAllItem, demoBundleItem);
+ NavigationSection section = new NavigationSection(new ViewName("Section" + i, sectionTitle), items);
+ sections.add(section);
+ }
}
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties
new file mode 100644
index 0000000..5eedb0a
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties
@@ -0,0 +1,52 @@
+#
+# RHQ GUI i18n Message Constants - English
+# This is used specifically for properties needing lookup by name, at runtime. These
+# constant properties can be localized but can not have arguments.
+###################################
+
+#=================== Help URLs =====================
+# The Help sections and entries are table driven via property lookups. The following property
+# names are expected:
+#
+# The number of help sections:
+#
+# view_help_section_count = numSectionsInteger
+#
+# For each section:
+# N = 1..numSections
+#
+# view_help_section_N_title = localized title for section in the sectionStack
+# view_help_section_N_item_count = numSectionItemsInteger
+#
+# For each url entry in the section N:
+# M = 1..numSectionItems
+#
+# view_help_section_N_propTitle_M = localized title for the help (required)
+# view_help_section_N_propIcon_M = icon path (optional, defaults to document icon)
+# view_help_section_N_propUrl_M = url for the help (required)
+#
+view_help_section_count = 2
+
+view_help_section_1_title = Documentation
+view_help_section_1_item_count = 3
+
+view_help_section_1_propTitle_1 = Frequently Asked Questions (FAQ)
+view_help_section_1_propUrl_1 = http://www.rhq-project.org/display/JOPR2/FAQ
+view_help_section_1_propTitle_2 = Documentation Set
+view_help_section_1_propUrl_2 = http://www.rhq-project.org/display/JOPR2/Home
+view_help_section_1_propTitle_3 = API Javadoc
+view_help_section_1_propUrl_3 = http://www.rhq-project.org/display/JOPR2/API+Documentation
+
+view_help_section_2_title = Tutorial
+view_help_section_2_item_count = 4
+
+view_help_section_2_propTitle_1 = Demo: All Demos
+view_help_section_2_propUrl_1 = http://www.rhq-project.org/display/JOPR2/Demos
+view_help_section_2_propTitle_2 = Demo: Bundle Provisioning
+view_help_section_2_propUrl_2 = http://management-platform.blogspot.com/2011/01/bundle-provisioning-via-r...
+view_help_section_2_propTitle_3 = How to build Group Definitions
+view_help_section_2_propIcon_3 = [SKIN]/../actions/help.png
+view_help_section_2_propUrl_3 = http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/2.4/html/Basic...
+view_help_section_2_propTitle_4 = How to use the Search Bar
+view_help_section_2_propIcon_4 = [SKIN]/../actions/help.png
+view_help_section_2_propUrl_4 = http://www.rhq-project.org/display/JOPR2/Search
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties
new file mode 100644
index 0000000..f864527
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties
@@ -0,0 +1,52 @@
+#
+# RHQ GUI i18n Message Constants - English
+# This is used specifically for properties needing lookup by name, at runtime. These
+# constant properties can be localized but can not have arguments.
+###################################
+
+#=================== Help URLs =====================
+# The Help sections and entries are table driven via property lookups. The following property
+# names are expected:
+#
+# The number of help sections:
+#
+# view_help_section_count = numSectionsInteger
+#
+# For each section:
+# N = 1..numSections
+#
+# view_help_section_N_title = localized title for section in the sectionStack
+# view_help_section_N_item_count = numSectionItemsInteger
+#
+# For each url entry in the section N:
+# M = 1..numSectionItems
+#
+# view_help_section_N_propTitle_M = localized title for the help (required)
+# view_help_section_N_propIcon_M = icon path (optional, defaults to document icon)
+# view_help_section_N_propUrl_M = url for the help (required)
+#
+view_help_section_count = 2
+
+view_help_section_1_title = Dokumentation
+view_help_section_1_item_count = 3
+
+view_help_section_1_propTitle_1 = Frequently Asked Questions (FAQ)
+view_help_section_1_propUrl_1 = http://www.rhq-project.org/display/JOPR2/FAQ
+view_help_section_1_propTitle_2 = Dokumentation
+view_help_section_1_propUrl_2 = http://www.rhq-project.org/display/JOPR2/Home
+view_help_section_1_propTitle_3 = API Javadoc
+view_help_section_1_propUrl_3 = http://www.rhq-project.org/display/JOPR2/API+Documentation
+
+view_help_section_2_title = Tutorium
+view_help_section_2_item_count = 4
+
+view_help_section_2_propTitle_1 = Demo: Alles
+view_help_section_2_propUrl_1 = http://www.rhq-project.org/display/JOPR2/Demos
+view_help_section_2_propTitle_2 = Demo: Bundles Installieren
+view_help_section_2_propUrl_2 = http://management-platform.blogspot.com/2011/01/bundle-provisioning-via-r...
+view_help_section_2_propTitle_3 = Wie erstellt man Gruppen-Definitionen
+view_help_section_2_propIcon_3 = [SKIN]/../actions/help.png
+view_help_section_2_propUrl_3 = http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/2.4/html/Basic...
+view_help_section_2_propTitle_4 = Wie benutzt man die Suchleiste
+view_help_section_2_propIcon_4 = [SKIN]/../actions/help.png
+view_help_section_2_propUrl_4 = http://www.rhq-project.org/display/JOPR2/Search
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index ff8d7bd..f6d33a2 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -1654,16 +1654,9 @@ view_taggedResources_title = Tagged Resources
#==================== Help ======================
-view_help_docAbout = About
-view_help_docFaq = Frequently Asked Questions (FAQ)
-view_help_docToc = Documentation
-view_help_tutorialDemoAll = Demo: All
-view_help_tutorialDemoBundle = Demo: Bundle Provisioning
-view_help_tutorialDynaGroup = How to build Group Definitions
-view_help_tutorialSearch = How to use the Search Bar
-view_helpSection_documentation = Documentation
-view_helpSection_tutorial = Tutorial
view_helpTop_description = This section provides access to documentation, tutorials, version, and other helpful information.
+view_help_section_product = Product
+view_help_section_product_about = About
#===================== Test =======================
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 35de497..a2223fa 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -1406,16 +1406,10 @@ view_taggedResources_title = Markierte Ressourcen
#==================== Help ======================
-view_help_docAbout = Über
-view_help_docFaq = Frequently Asked Questions (FAQ)
-view_help_docToc = Dockumentation
-view_help_tutorialDemoAll = Demo: Alles
-view_help_tutorialDemoBundle = Demo: Bundles Installieren
-view_help_tutorialDynaGroup = Wie erstellt man Gruppen-Definitionen
-view_help_tutorialSearch = Wie benutzt man die Suchleiste
-view_helpSection_documentation = Dokumentation
-view_helpSection_tutorial = Tutorium
view_helpTop_description = Dieser Abschnitt bietet Zugang zu Dokumentation, Tutorien, Versions- und anderer hilfreicher Information.
+view_help_section_product = Produkt
+view_help_section_product_about = Über
+
#===================== Test =======================
view_testTop_title = Test
view_testTop_description = This section contains pages for testing various GUI components.~
13 years, 3 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java | 260 +++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/ResourceOperationHistoryDetailsView.java | 263 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java | 58 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java | 76 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java | 4
8 files changed, 400 insertions(+), 270 deletions(-)
New commits:
commit 29f4c410f21b253faeb32ded5ea9157fb2758f72
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Feb 8 17:43:12 2011 -0500
fix layout issues for Resource operations history details view and implement initial version of group operations history details view (note these views now share a common base class)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index 45bf782..23b0f5e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -255,7 +255,7 @@ public class ConfigurationEditor extends LocatableVLayout {
EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition),
new ResourceTypeRepository.TypesLoadedCallback() {
public void onTypesLoaded(Map<Integer, ResourceType> types) {
- com.allen_sauer.gwt.log.client.Log.debug("ConfigDef retreived in: "
+ com.allen_sauer.gwt.log.client.Log.debug("ConfigDef retrieved in: "
+ (System.currentTimeMillis() - start));
configurationDefinition = types.get(resourceTypeId).getResourceConfigurationDefinition();
if (configurationDefinition == null) {
@@ -282,7 +282,7 @@ public class ConfigurationEditor extends LocatableVLayout {
EnumSet.of(ResourceTypeRepository.MetadataType.pluginConfigurationDefinition),
new ResourceTypeRepository.TypesLoadedCallback() {
public void onTypesLoaded(Map<Integer, ResourceType> types) {
- Log.debug("ConfigDef retreived in: " + (System.currentTimeMillis() - start));
+ Log.debug("ConfigDef retrieved in: " + (System.currentTimeMillis() - start));
configurationDefinition = types.get(resourceTypeId).getPluginConfigurationDefinition();
if (configurationDefinition == null) {
showError(MSG.view_configEdit_error_2());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
new file mode 100644
index 0000000..0d7681a
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/AbstractOperationHistoryDetailsView.java
@@ -0,0 +1,260 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2010 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.gui.coregui.client.inventory.common.detail.operation.history;
+
+import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.CloseClientEvent;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.LinkItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
+import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.operation.OperationHistory;
+import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
+
+import java.util.Date;
+
+/**
+ * @author Greg Hinkle
+ */
+public abstract class AbstractOperationHistoryDetailsView<T extends OperationHistory> extends LocatableVLayout
+ implements BookmarkableView {
+
+ private OperationDefinition definition;
+ private T operationHistory;
+
+ private DynamicForm form;
+
+ public AbstractOperationHistoryDetailsView(String locatorId) {
+ this(locatorId, null, null);
+ }
+
+ public AbstractOperationHistoryDetailsView(String locatorId, OperationDefinition definition,
+ T operationHistory) {
+ super(locatorId);
+
+ this.definition = definition;
+ this.operationHistory = operationHistory;
+
+ setWidth100();
+ setHeight100();
+ setOverflow(Overflow.AUTO);
+ setLayoutMargin(0);
+ setMembersMargin(16);
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ destroyMembers();
+
+ if (this.operationHistory != null) {
+ displayDetails(operationHistory);
+ }
+ }
+
+ protected void displayDetails(final T operationHistory) {
+
+ for (Canvas child : getMembers()) {
+ removeChild(child);
+ }
+
+ this.definition = operationHistory.getOperationDefinition();
+ this.operationHistory = operationHistory;
+
+ // Information Form
+
+ form = new DynamicForm();
+ form.setWidth100();
+ form.setWrapItemTitles(false);
+
+ OperationRequestStatus status = operationHistory.getStatus();
+
+ StaticTextItem operationItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.OPERATION_NAME, MSG
+ .view_operationHistoryDetails_operation());
+ operationItem.setValue(definition.getDisplayName());
+
+ StaticTextItem submittedItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STARTED_TIME, MSG
+ .view_operationHistoryDetails_dateSubmitted());
+ submittedItem.setValue(new Date(operationHistory.getStartedTime()));
+
+ StaticTextItem completedItem = new StaticTextItem("completed", MSG.view_operationHistoryDetails_dateCompleted());
+ if (status == OperationRequestStatus.INPROGRESS) {
+ completedItem.setValue(MSG.common_val_na());
+ } else if (status == OperationRequestStatus.CANCELED) {
+ completedItem.setValue(MSG.common_val_never());
+ } else {
+ completedItem.setValue(new Date(operationHistory.getStartedTime() + operationHistory.getDuration()));
+ }
+
+ StaticTextItem requesterItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.SUBJECT, MSG
+ .view_operationHistoryDetails_requestor());
+ requesterItem.setValue(operationHistory.getSubjectName());
+
+ LinkItem errorLinkItem = null;
+
+ StaticTextItem statusItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STATUS, MSG
+ .view_operationHistoryDetails_status());
+ String icon = ImageManager.getFullImagePath(ImageManager.getOperationResultsIcon(status));
+ statusItem.setValue("<img src='" + icon + "'/>");
+ switch (status) {
+ case SUCCESS:
+ statusItem.setTooltip(MSG.common_status_success());
+ break;
+ case FAILURE:
+ statusItem.setTooltip(MSG.common_status_failed());
+ errorLinkItem = new LinkItem("errorLink");
+ errorLinkItem.setTitle(MSG.common_title_error());
+ errorLinkItem.setLinkTitle(getShortErrorMessage(operationHistory));
+ errorLinkItem.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ final Window winModal = new LocatableWindow(AbstractOperationHistoryDetailsView.this
+ .extendLocatorId("errorWin"));
+ winModal.setTitle(MSG.common_title_details());
+ winModal.setOverflow(Overflow.VISIBLE);
+ winModal.setShowMinimizeButton(false);
+ winModal.setShowMaximizeButton(true);
+ winModal.setIsModal(true);
+ winModal.setShowModalMask(true);
+ winModal.setAutoSize(true);
+ winModal.setAutoCenter(true);
+ winModal.setShowResizer(true);
+ winModal.setCanDragResize(true);
+ winModal.centerInPage();
+ winModal.addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClientEvent event) {
+ winModal.markForDestroy();
+ }
+ });
+
+ LocatableHTMLPane htmlPane = new LocatableHTMLPane(AbstractOperationHistoryDetailsView.this
+ .extendLocatorId("statusDetailsPane"));
+ htmlPane.setMargin(10);
+ htmlPane.setDefaultWidth(500);
+ htmlPane.setDefaultHeight(400);
+ String errorMsg = operationHistory.getErrorMessage();
+ if (errorMsg == null) {
+ errorMsg = MSG.common_status_failed();
+ }
+ htmlPane.setContents("<pre>" + errorMsg + "</pre>");
+ winModal.addItem(htmlPane);
+ winModal.show();
+ }
+ });
+
+ break;
+ case INPROGRESS:
+ statusItem.setTooltip(MSG.common_status_inprogress());
+ break;
+ case CANCELED:
+ statusItem.setTooltip(MSG.common_status_canceled());
+ break;
+ }
+
+ /*
+ Operation: View Process List
+ Date Submitted: 3/11/10, 12:24:02 PM, EST
+ Date Completed: 3/11/10, 12:24:03 PM, EST
+ Requester: rhqadmin
+ Status: Failure
+ Error Message: __Exception: Cannot connect...__
+ */
+
+ if (errorLinkItem != null) {
+ form.setItems(operationItem, submittedItem, completedItem, requesterItem, statusItem, errorLinkItem);
+ } else {
+ form.setItems(operationItem, submittedItem, completedItem, requesterItem, statusItem);
+ }
+
+ addMember(form);
+
+ // params/results
+
+ if (operationHistory.getParameters() != null) {
+ LocatableVLayout parametersSection = new LocatableVLayout(extendLocatorId("ParametersSection"));
+
+ Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_parameters() + "</h4>");
+ title.setHeight(27);
+ parametersSection.addMember(title);
+
+ ConfigurationDefinition parametersConfigurationDefinition = definition
+ .getParametersConfigurationDefinition();
+ if (parametersConfigurationDefinition != null &&
+ !parametersConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
+ ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("params"),
+ parametersConfigurationDefinition, operationHistory.getParameters());
+ editor.setReadOnly(true);
+ parametersSection.addMember(editor);
+ } else {
+ Label noParametersLabel = new Label("This operation does not take any parameters.");
+ noParametersLabel.setHeight(17);
+ parametersSection.addMember(noParametersLabel);
+ }
+
+ addMember(parametersSection);
+ }
+
+ Canvas resultsSection = buildResultsSection(operationHistory);
+ if (resultsSection != null) {
+ addMember(resultsSection);
+ }
+
+ VLayout verticalSpacer = new VLayout();
+ verticalSpacer.setHeight100();
+ addMember(verticalSpacer);
+ }
+
+ protected abstract Canvas buildResultsSection(T operationHistory);
+
+ protected abstract void lookupDetails(int historyId);
+
+ @Override
+ public void renderView(ViewPath viewPath) {
+ int historyId = viewPath.getCurrentAsInt();
+ lookupDetails(historyId);
+ }
+
+ private static String getShortErrorMessage(OperationHistory operationHistory) {
+ String errMsg = operationHistory.getErrorMessage();
+ if (errMsg == null) {
+ errMsg = MSG.common_status_failed();
+ } else if (errMsg.length() > 80) {
+ errMsg = errMsg.substring(0, 80) + "...";
+ }
+ return errMsg;
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/ResourceOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/ResourceOperationHistoryDetailsView.java
deleted file mode 100644
index 09fc8d2..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/history/ResourceOperationHistoryDetailsView.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 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.gui.coregui.client.inventory.common.detail.operation.history;
-
-import java.util.Date;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.Overflow;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.Label;
-import com.smartgwt.client.widgets.Window;
-import com.smartgwt.client.widgets.events.CloseClickHandler;
-import com.smartgwt.client.widgets.events.CloseClientEvent;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
-import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
-
-import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
-import org.rhq.core.domain.operation.OperationDefinition;
-import org.rhq.core.domain.operation.OperationRequestStatus;
-import org.rhq.core.domain.operation.ResourceOperationHistory;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.ImageManager;
-import org.rhq.enterprise.gui.coregui.client.ViewPath;
-import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
-import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
-
-/**
- * @author Greg Hinkle
- */
-public class ResourceOperationHistoryDetailsView extends LocatableVLayout implements BookmarkableView {
-
- private OperationDefinition definition;
- private ResourceOperationHistory operationHistory;
-
- private DynamicForm form;
-
- public ResourceOperationHistoryDetailsView(String locatorId) {
- super(locatorId);
- }
-
- public ResourceOperationHistoryDetailsView(String locatorId, OperationDefinition definition,
- ResourceOperationHistory operationHistory) {
- super(locatorId);
-
- this.definition = definition;
- this.operationHistory = operationHistory;
- }
-
- @Override
- protected void onDraw() {
- super.onDraw();
-
- destroyMembers();
-
- if (this.operationHistory != null) {
- displayDetails(operationHistory);
- }
- }
-
- private void displayDetails(final ResourceOperationHistory operationHistory) {
-
- for (Canvas child : getMembers()) {
- removeChild(child);
- }
-
- this.definition = operationHistory.getOperationDefinition();
- this.operationHistory = operationHistory;
-
- // Information Form
-
- form = new DynamicForm();
- form.setWidth100();
- form.setWrapItemTitles(false);
-
- OperationRequestStatus status = operationHistory.getStatus();
-
- StaticTextItem operationItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.OPERATION_NAME, MSG
- .view_operationHistoryDetails_operation());
- operationItem.setValue(definition.getDisplayName());
-
- StaticTextItem submittedItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STARTED_TIME, MSG
- .view_operationHistoryDetails_dateSubmitted());
- submittedItem.setValue(new Date(operationHistory.getStartedTime()));
-
- StaticTextItem completedItem = new StaticTextItem("completed", MSG.view_operationHistoryDetails_dateCompleted());
- if (status == OperationRequestStatus.INPROGRESS) {
- completedItem.setValue(MSG.common_val_na());
- } else if (status == OperationRequestStatus.CANCELED) {
- completedItem.setValue(MSG.common_val_never());
- } else {
- completedItem.setValue(new Date(operationHistory.getStartedTime() + operationHistory.getDuration()));
- }
-
- StaticTextItem requesterItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.SUBJECT, MSG
- .view_operationHistoryDetails_requestor());
- requesterItem.setValue(operationHistory.getSubjectName());
-
- LinkItem errorLinkItem = null;
-
- StaticTextItem statusItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STATUS, MSG
- .view_operationHistoryDetails_status());
- String icon = ImageManager.getFullImagePath(ImageManager.getOperationResultsIcon(status));
- statusItem.setValue("<img src='" + icon + "'/>");
- switch (status) {
- case SUCCESS:
- statusItem.setTooltip(MSG.common_status_success());
- break;
- case FAILURE:
- statusItem.setTooltip(MSG.common_status_failed());
- errorLinkItem = new LinkItem("errorLink");
- errorLinkItem.setTitle(MSG.common_title_error());
- errorLinkItem.setLinkTitle(getShortErrorMessage(operationHistory));
- errorLinkItem.addClickHandler(new ClickHandler() {
- @Override
- public void onClick(ClickEvent event) {
- final Window winModal = new LocatableWindow(ResourceOperationHistoryDetailsView.this
- .extendLocatorId("errorWin"));
- winModal.setTitle(MSG.common_title_details());
- winModal.setOverflow(Overflow.VISIBLE);
- winModal.setShowMinimizeButton(false);
- winModal.setShowMaximizeButton(true);
- winModal.setIsModal(true);
- winModal.setShowModalMask(true);
- winModal.setAutoSize(true);
- winModal.setAutoCenter(true);
- winModal.setShowResizer(true);
- winModal.setCanDragResize(true);
- winModal.centerInPage();
- winModal.addCloseClickHandler(new CloseClickHandler() {
- @Override
- public void onCloseClick(CloseClientEvent event) {
- winModal.markForDestroy();
- }
- });
-
- LocatableHTMLPane htmlPane = new LocatableHTMLPane(ResourceOperationHistoryDetailsView.this
- .extendLocatorId("statusDetailsPane"));
- htmlPane.setMargin(10);
- htmlPane.setDefaultWidth(500);
- htmlPane.setDefaultHeight(400);
- String errorMsg = operationHistory.getErrorMessage();
- if (errorMsg == null) {
- errorMsg = MSG.common_status_failed();
- }
- htmlPane.setContents("<pre>" + errorMsg + "</pre>");
- winModal.addItem(htmlPane);
- winModal.show();
- }
- });
-
- break;
- case INPROGRESS:
- statusItem.setTooltip(MSG.common_status_inprogress());
- break;
- case CANCELED:
- statusItem.setTooltip(MSG.common_status_canceled());
- break;
- }
-
- /*
- Operation: View Process List
- Date Submitted: 3/11/10, 12:24:02 PM, EST
- Date Completed: 3/11/10, 12:24:03 PM, EST
- Requester: rhqadmin
- Status: Failure
- Error Message: __Exception: Cannot connect...__
- */
-
- if (errorLinkItem != null) {
- form.setItems(operationItem, submittedItem, completedItem, requesterItem, statusItem, errorLinkItem);
- } else {
- form.setItems(operationItem, submittedItem, completedItem, requesterItem, statusItem);
- }
-
- addMember(form);
-
- // params/results
-
- if (operationHistory.getParameters() != null) {
- Label title = new Label(MSG.view_operationHistoryDetails_parameters());
- addMember(title);
-
- ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("params"), definition
- .getParametersConfigurationDefinition(), operationHistory.getParameters());
- editor.setReadOnly(true);
- addMember(editor);
- }
-
- if (status == OperationRequestStatus.SUCCESS && operationHistory.getResults() != null) {
- Label title = new Label(MSG.view_operationHistoryDetails_results());
- addMember(title);
-
- ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("results"), definition
- .getResultsConfigurationDefinition(), operationHistory.getResults());
- editor.setReadOnly(true);
- addMember(editor);
- }
- }
-
- private void lookupDetails(int historyId) {
- ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
-
- criteria.addFilterId(historyId);
-
- criteria.fetchOperationDefinition(true);
- criteria.fetchParameters(true);
- criteria.fetchResults(true);
-
- GWTServiceLookup.getOperationService().findResourceOperationHistoriesByCriteria(criteria,
- new AsyncCallback<PageList<ResourceOperationHistory>>() {
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler()
- .handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
- }
-
- public void onSuccess(PageList<ResourceOperationHistory> result) {
- ResourceOperationHistory item = result.get(0);
- displayDetails(item);
- }
- });
- }
-
- @Override
- public void renderView(ViewPath viewPath) {
- int historyId = viewPath.getCurrentAsInt();
- lookupDetails(historyId);
- }
-
- private String getShortErrorMessage(ResourceOperationHistory operationHistory) {
- String errMsg = operationHistory.getErrorMessage();
- if (errMsg == null) {
- errMsg = MSG.common_status_failed();
- } else if (errMsg.length() > 80) {
- errMsg = errMsg.substring(0, 80) + "...";
- }
- return errMsg;
- }
-
-}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java
new file mode 100644
index 0000000..937c163
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryDetailsView.java
@@ -0,0 +1,58 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.history;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.Label;
+import org.rhq.core.domain.criteria.GroupOperationHistoryCriteria;
+import org.rhq.core.domain.operation.GroupOperationHistory;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDetailsView;
+
+/**
+ * @author Ian Springer
+ */
+public class GroupOperationHistoryDetailsView extends AbstractOperationHistoryDetailsView<GroupOperationHistory> {
+
+ public GroupOperationHistoryDetailsView(String locatorId) {
+ super(locatorId);
+ }
+
+ public GroupOperationHistoryDetailsView(String locatorId, OperationDefinition definition,
+ GroupOperationHistory operationHistory) {
+ super(locatorId, definition, operationHistory);
+ }
+
+ protected void lookupDetails(int historyId) {
+ GroupOperationHistoryCriteria criteria = new GroupOperationHistoryCriteria();
+
+ criteria.addFilterId(historyId);
+
+ criteria.fetchOperationDefinition(true);
+ criteria.fetchParameters(true);
+
+ GWTServiceLookup.getOperationService().findGroupOperationHistoriesByCriteria(criteria,
+ new AsyncCallback<PageList<GroupOperationHistory>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler()
+ .handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
+ }
+
+ public void onSuccess(PageList<GroupOperationHistory> result) {
+ GroupOperationHistory item = result.get(0);
+ displayDetails(item);
+ }
+ });
+ }
+
+ @Override
+ protected Canvas buildResultsSection(GroupOperationHistory operationHistory) {
+ OperationRequestStatus status = operationHistory.getStatus();
+
+ return new Label("<h5>TODO</h5>");
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java
index 887e313..af0e786 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/history/GroupOperationHistoryListView.java
@@ -45,7 +45,7 @@ public class GroupOperationHistoryListView extends AbstractOperationHistoryListV
@Override
public Canvas getDetailsView(int id) {
- return new Canvas();
+ return new GroupOperationHistoryDetailsView(extendLocatorId("DetailsView"));
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
new file mode 100644
index 0000000..f9de542
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryDetailsView.java
@@ -0,0 +1,76 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.Label;
+import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.operation.OperationRequestStatus;
+import org.rhq.core.domain.operation.ResourceOperationHistory;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDetailsView;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+/**
+ * @author Ian Springer
+ */
+public class ResourceOperationHistoryDetailsView extends AbstractOperationHistoryDetailsView<ResourceOperationHistory> {
+
+ public ResourceOperationHistoryDetailsView(String locatorId) {
+ super(locatorId);
+ }
+
+ public ResourceOperationHistoryDetailsView(String locatorId, OperationDefinition definition,
+ ResourceOperationHistory operationHistory) {
+ super(locatorId, definition, operationHistory);
+ }
+
+ protected void lookupDetails(int historyId) {
+ ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
+
+ criteria.addFilterId(historyId);
+
+ criteria.fetchOperationDefinition(true);
+ criteria.fetchParameters(true);
+ criteria.fetchResults(true);
+
+ GWTServiceLookup.getOperationService().findResourceOperationHistoriesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceOperationHistory>>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler()
+ .handleError(MSG.view_operationHistoryDetails_error_fetchFailure(), caught);
+ }
+
+ public void onSuccess(PageList<ResourceOperationHistory> result) {
+ ResourceOperationHistory item = result.get(0);
+ displayDetails(item);
+ }
+ });
+ }
+
+ @Override
+ protected Canvas buildResultsSection(ResourceOperationHistory operationHistory) {
+ OperationRequestStatus status = operationHistory.getStatus();
+ if (status == OperationRequestStatus.SUCCESS && operationHistory.getResults() != null) {
+ LocatableVLayout resultsSection = new LocatableVLayout(extendLocatorId("ResultsSection"));
+
+ Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_results() + "</h4>");
+ title.setHeight(27);
+ resultsSection.addMember(title);
+
+ OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
+ ConfigurationEditor editor = new ConfigurationEditor(extendLocatorId("results"), operationDefinition
+ .getResultsConfigurationDefinition(), operationHistory.getResults());
+ editor.setReadOnly(true);
+ resultsSection.addMember(editor);
+
+ return resultsSection;
+ } else {
+ return null;
+ }
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java
index 3b0f747..3cd24ce 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/history/ResourceOperationHistoryListView.java
@@ -23,7 +23,6 @@ import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryListView;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.ResourceOperationHistoryDetailsView;
/**
* @author Ian Springer
@@ -46,7 +45,7 @@ public class ResourceOperationHistoryListView extends AbstractOperationHistoryLi
@Override
public Canvas getDetailsView(int id) {
- return new ResourceOperationHistoryDetailsView(this.extendLocatorId("Details"));
+ return new ResourceOperationHistoryDetailsView(this.extendLocatorId("DetailsView"));
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java
index 81ebb94..b4c3091 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/operation/SubsystemOperationHistoryListView.java
@@ -37,8 +37,8 @@ import org.rhq.enterprise.gui.coregui.client.PermissionsLoader;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryDataSource;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.AbstractOperationHistoryListView;
-import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.history.ResourceOperationHistoryDetailsView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDataSource;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryDetailsView;
/**
* @author Ian Springer
@@ -102,7 +102,7 @@ public class SubsystemOperationHistoryListView extends AbstractOperationHistoryL
@Override
public Canvas getDetailsView(int id) {
- return new ResourceOperationHistoryDetailsView(this.extendLocatorId("Details"));
+ return new ResourceOperationHistoryDetailsView(this.extendLocatorId("DetailsView"));
}
}
13 years, 3 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java | 30 ++++++++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 4 +
2 files changed, 34 insertions(+)
New commits:
commit 9df33c58f5b07e04aafa37c9b06fe15212762e7c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 8 14:30:58 2011 -0500
add admin->content section with appropriate links to the JSF UI
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index b0078d6..6e8da99 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -52,6 +52,7 @@ public class AdministrationView extends AbstractSectionedLeftNavigationView {
public static final ViewName SECTION_TOPOLOGY_VIEW_ID = new ViewName("Topology", MSG.view_admin_topology());
public static final ViewName SECTION_CONFIGURATION_VIEW_ID = new ViewName("Configuration", MSG
.view_admin_configuration());
+ public static final ViewName SECTION_CONTENT_VIEW_ID = new ViewName("Content", MSG.view_admin_content());
// TODO these iframe page view ids should go away in favor of the gwt view page view_id, when available
private static final ViewName PAGE_SERVERS_VIEW_ID = new ViewName("Servers", MSG.view_adminTopology_servers());
@@ -69,6 +70,12 @@ public class AdministrationView extends AbstractSectionedLeftNavigationView {
private static final ViewName PAGE_LICENSE_VIEW_ID = new ViewName("License", MSG.view_adminConfig_license());
private static final ViewName PAGE_PLUGINS_VIEW_ID = new ViewName("Plugins", MSG.view_adminConfig_plugins());
+ // TODO these iframe page view ids should go away in favor of the gwt view page view_id, when available
+ private static final ViewName PAGE_CONTENT_SOURCES_VIEW_ID = new ViewName("ContentSources", MSG
+ .view_adminContent_contentSources());
+ private static final ViewName PAGE_REPOS_VIEW_ID = new ViewName("Repositories", MSG
+ .view_adminContent_repositories());
+
public AdministrationView() {
// This is a top level view, so our locator id can simply be our view id.
super(VIEW_ID.getName());
@@ -87,6 +94,9 @@ public class AdministrationView extends AbstractSectionedLeftNavigationView {
NavigationSection configurationSection = buildConfigurationSection();
sections.add(configurationSection);
+ NavigationSection contentSection = buildContentSection();
+ sections.add(contentSection);
+
return sections;
}
@@ -208,4 +218,24 @@ public class AdministrationView extends AbstractSectionedLeftNavigationView {
return new NavigationSection(SECTION_CONFIGURATION_VIEW_ID, systemSettingsItem, templatesItem, downloadsItem,
licenseItem, pluginsItem);
}
+
+ private NavigationSection buildContentSection() {
+ NavigationItem contentSourcesItem = new NavigationItem(PAGE_CONTENT_SOURCES_VIEW_ID,
+ "subsystems/content/Content_16.png", new ViewFactory() {
+ public Canvas createView() {
+ return new FullHTMLPane(extendLocatorId(PAGE_CONTENT_SOURCES_VIEW_ID.getName()),
+ "/rhq/content/listContentProviders.xhtml");
+ }
+ });
+
+ NavigationItem reposItem = new NavigationItem(PAGE_REPOS_VIEW_ID, "subsystems/content/Content_16.png",
+ new ViewFactory() {
+ public Canvas createView() {
+ return new FullHTMLPane(extendLocatorId(PAGE_REPOS_VIEW_ID.getName()),
+ "/rhq/content/listRepos.xhtml");
+ }
+ });
+
+ return new NavigationSection(SECTION_CONTENT_VIEW_ID, contentSourcesItem, reposItem);
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index cd939a9..ff8d7bd 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -513,6 +513,7 @@ view_admin_landing = From this section, the RHQ global settings can be administe
view_admin_configuration = Configuration
view_admin_security = Security
view_admin_topology = Topology
+view_admin_content = Content
view_adminSecurity_users = Users
view_adminSecurity_roles = Roles
@@ -529,6 +530,9 @@ view_adminConfig_plugins = Plugins
view_adminConfig_systemSettings = System Settings
view_adminConfig_templates = Templates
+view_adminContent_contentSources = Content Sources
+view_adminContent_repositories = Repositories
+
# Administration/Security/Users
#--------------------------------
view_adminUsersList_dataTypeName = user
13 years, 3 months
[rhq] modules/enterprise
by mazz
modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java | 11 +++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 4be191bf8b18df445f197f939bb4d2b5fc09571f
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 8 13:17:59 2011 -0500
redirect the user to the GWT UI, not the JSF UI
diff --git a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
index c183b2a..8ffe182 100644
--- a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
+++ b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java
@@ -26,8 +26,8 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.operation.JobId;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.operation.OperationRequestStatus;
-import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.operation.bean.ResourceOperationSchedule;
+import org.rhq.core.domain.resource.Resource;
import org.rhq.enterprise.server.plugin.pc.alert.AlertSender;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -38,8 +38,9 @@ import org.rhq.enterprise.server.util.LookupUtil;
*/
public class OperationsSender extends AlertSender {
- private static final String URL_RESOURCE_OPERATION_HISTORY = "/rhq/resource/operation/resourceOperationHistory.xhtml";
- private static final String URL_RESOURCE_OPERATION_HISTORY_DETAILS = "/rhq/resource/operation/resourceOperationHistoryDetails.xhtml";
+ private static String getResourceOperationHistoryURL(int resourceId) {
+ return "/coregui/CoreGUI.html#Resource/" + resourceId + "/Operations/History";
+ }
@Override
public SenderResult send(Alert alert) {
@@ -141,8 +142,8 @@ public class OperationsSender extends AlertSender {
return "Status was " + decorate(status) + ", see operation details "
+ link("here", URL_RESOURCE_OPERATION_HISTORY_DETAILS + "?id=" + resourceId + "&opId=" + history.getId());
*/
- return "Check the corresponding "
- + link("operation history", URL_RESOURCE_OPERATION_HISTORY + "?id=" + resourceId) + " for more details.";
+ return "Check the corresponding " + link("operation history", getResourceOperationHistoryURL(resourceId))
+ + " for more details.";
}
public String decorate(OperationRequestStatus status) {
13 years, 3 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java | 5 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java | 24 ++++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java | 3 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java | 2
4 files changed, 22 insertions(+), 12 deletions(-)
New commits:
commit ba72ae4dd8d032d635c3957560fc7e492e2feeaa
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Feb 8 13:11:52 2011 -0500
add support for viewing the trigger for existing operation schedules
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
index 76ec2e0..de409c9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java
@@ -32,6 +32,7 @@ import com.smartgwt.client.widgets.form.fields.CanvasItem;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.form.fields.HiddenItem;
+import com.smartgwt.client.widgets.form.fields.SpacerItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -102,7 +103,7 @@ public class EnhancedDynamicForm extends LocatableDynamicForm {
hasIdField = true;
}
if (this.isReadOnly) {
- if ((item instanceof StaticTextItem) || (item instanceof CanvasItem)) {
+ if ((item instanceof StaticTextItem) || (item instanceof CanvasItem) || (item instanceof SpacerItem)) {
// note: EditableFormItem is a subclass of CanvasItem
if (item instanceof EditableFormItem) {
((EditableFormItem) item).setReadOnly(true);
@@ -110,6 +111,8 @@ public class EnhancedDynamicForm extends LocatableDynamicForm {
itemsList.add(item);
} else {
StaticTextItem staticItem = new StaticTextItem(item.getName(), item.getTitle());
+ Boolean showTitle = (item.getShowTitle() != null) ? item.getShowTitle() : true;
+ staticItem.setShowTitle(showTitle);
staticItem.setTooltip(item.getTooltip());
staticItem.setValue(item.getValue());
staticItem.setColSpan(item.getAttribute("colSpan"));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
index 4531c34..eba0a2e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
@@ -98,8 +98,10 @@ public class JobTriggerEditor extends LocatableVLayout {
*
* @param locatorId
*/
- public JobTriggerEditor(String locatorId) {
+ public JobTriggerEditor(String locatorId, boolean isReadOnly) {
super(locatorId);
+
+ this.isReadOnly = isReadOnly;
}
/**
@@ -117,6 +119,7 @@ public class JobTriggerEditor extends LocatableVLayout {
public void setJobTrigger(JobTrigger jobTrigger) {
this.jobTrigger = jobTrigger;
+ this.isReadOnly = true;
if (isDrawn()) {
refresh();
}
@@ -124,23 +127,24 @@ public class JobTriggerEditor extends LocatableVLayout {
private void refresh() {
if (this.jobTrigger != null) {
- RadioGroupItem modeItem = (RadioGroupItem) this.modeForm.getItem(FIELD_MODE);
+ FormItem modeItem = this.modeForm.getItem(FIELD_MODE);
if (this.jobTrigger.getRecurrenceType() == JobTrigger.RecurrenceType.CRON_EXPRESSION) {
modeItem.setValue("cron");
changeMode("cron");
this.cronForm.setValue("cronExpression", this.jobTrigger.getCronExpression());
} else {
modeItem.setValue("calendar");
+ this.calendarTypeForm.hide();
changeMode("calendar");
- RadioGroupItem startTypeItem = (RadioGroupItem) this.laterForm.getItem(FIELD_START_TYPE);
+ FormItem startTypeItem = this.laterForm.getItem(FIELD_START_TYPE);
startTypeItem.setValue("on");
DurationItem startDelayItem = (DurationItem) this.laterForm.getItem(FIELD_START_DELAY);
- DateTimeItem startTimeItem = (DateTimeItem)this.laterForm.getField(FIELD_START_TIME);
+ FormItem startTimeItem = this.laterForm.getField(FIELD_START_TIME);
changeStartType("on", startDelayItem, startTimeItem);
startTimeItem.setValue(this.jobTrigger.getStartDate());
- RadioGroupItem calendarTypeItem = (RadioGroupItem) this.calendarTypeForm.getField("calendarType");
+ FormItem calendarTypeItem = this.calendarTypeForm.getField("calendarType");
if (this.jobTrigger.getRecurrenceType() == JobTrigger.RecurrenceType.REPEAT_INTERVAL) {
calendarTypeItem.setValue("laterAndRepeat");
changeCalendarType("laterAndRepeat");
@@ -148,9 +152,9 @@ public class JobTriggerEditor extends LocatableVLayout {
DurationItem repeatIntervalItem = (DurationItem) this.repeatForm.getItem(FIELD_REPEAT_INTERVAL);
repeatIntervalItem.setValue(this.jobTrigger.getRepeatInterval().intValue(), UnitType.TIME);
- DateTimeItem endTimeItem = (DateTimeItem)this.repeatForm.getField(FIELD_END_TIME);
+ FormItem endTimeItem = this.repeatForm.getField(FIELD_END_TIME);
DurationItem repeatDurationItem = (DurationItem) this.repeatForm.getItem(FIELD_REPEAT_DURATION);
- RadioGroupItem recurrenceTypeItem = (RadioGroupItem) this.repeatForm.getField(FIELD_RECURRENCE_TYPE);
+ FormItem recurrenceTypeItem = this.repeatForm.getField(FIELD_RECURRENCE_TYPE);
if (this.jobTrigger.getRepeatCount() != null) {
recurrenceTypeItem.setValue("for");
changeRecurrenceType("for", endTimeItem, repeatDurationItem);
@@ -185,6 +189,7 @@ public class JobTriggerEditor extends LocatableVLayout {
modeValueMap.put("cron", "Cron Expression");
modeItem.setValueMap(modeValueMap);
modeItem.setVertical(false);
+ modeItem.setShowTitle(true);
this.modeForm.setFields(modeItem);
addMember(this.modeForm);
@@ -652,7 +657,7 @@ public class JobTriggerEditor extends LocatableVLayout {
return repeatForm;
}
- private void changeRecurrenceType(String recurrenceType, DateTimeItem endTimeItem, DurationItem repeatDurationItem) {
+ private void changeRecurrenceType(String recurrenceType, FormItem endTimeItem, DurationItem repeatDurationItem) {
if (recurrenceType.equals("for")) {
this.isEndTime = false;
this.isRepeatDuration = true;
@@ -689,6 +694,7 @@ public class JobTriggerEditor extends LocatableVLayout {
startTypeValueMap.put("on", "on");
startTypeValueMap.put("in", "in");
startTypeItem.setValueMap(startTypeValueMap);
+ startTypeItem.setShowTitle(true);
final DateTimeItem startTimeItem = createDateTimeItem(FIELD_START_TIME);
@@ -721,7 +727,7 @@ public class JobTriggerEditor extends LocatableVLayout {
return laterForm;
}
- private void changeStartType(String startType, DurationItem startDelayItem, DateTimeItem startTimeItem) {
+ private void changeStartType(String startType, DurationItem startDelayItem, FormItem startTimeItem) {
if (startType.equals("on")) {
this.isStartDelay = false;
this.isStartTime = true;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
index d3e2e88..b4754ec 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
@@ -123,6 +123,7 @@ public abstract class AbstractOperationScheduleDetailsView extends AbstractRecor
}
SelectItem operationNameItem = new SelectItem(AbstractOperationScheduleDataSource.Field.OPERATION_NAME);
+ operationNameItem.setShowTitle(true);
items.add(operationNameItem);
operationNameItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
@@ -153,7 +154,7 @@ public abstract class AbstractOperationScheduleDetailsView extends AbstractRecor
HTMLFlow hr = new HTMLFlow("<p/><hr/><p/>");
contentPane.addMember(hr);
- this.triggerEditor = new JobTriggerEditor(extendLocatorId("TriggerEditor"));
+ this.triggerEditor = new JobTriggerEditor(extendLocatorId("TriggerEditor"), isReadOnly());
contentPane.addMember(this.triggerEditor);
hr = new HTMLFlow("<p/><hr/><p/>");
contentPane.addMember(hr);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java
index 11e802f..74dee5a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/operation/schedule/GroupOperationScheduleDetailsView.java
@@ -22,7 +22,6 @@ import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm
import org.rhq.enterprise.gui.coregui.client.components.sorter.ReorderableList;
import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.operation.schedule.AbstractOperationScheduleDetailsView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.schedule.ResourceOperationScheduleDataSource;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
import java.util.LinkedHashMap;
@@ -95,6 +94,7 @@ public class GroupOperationScheduleDetailsView extends AbstractOperationSchedule
haltOnFailureItem.setDefaultValue(false);
haltOnFailureItem.setVisible(false);
haltOnFailureItem.setLabelAsTitle(true);
+ haltOnFailureItem.setShowTitle(true);
executionModeForm.setFields(executionModeItem, haltOnFailureItem);
13 years, 3 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 35 +++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 12 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java | 45 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java | 18 +++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java | 6 -
5 files changed, 77 insertions(+), 39 deletions(-)
New commits:
commit 348d8f46e560785c13afe53c230b96587f89d4fb
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Feb 8 11:10:18 2011 -0500
Yet more destroy logic for selenium testing
- In CoreGUI, destroy the existing canvas prior to creating the new content
- In Table, don't let post-destroy async data arrivals muck with destruction
of the ListGrid.
- In Wizards, keep buttons disabled until the step's canvas is drawn, then
enable as required.
- In Dashboard, if locators are enabled thenm, when removing a portlet,
perform a full if redraw. The removal changes portlet positions, and
portlet locators contain positional info (the same logic applies to
drag/drop).
-- trivial: removed some commented code.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 71171fb..d523ab9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -258,23 +258,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
return DEFAULT_VIEW_PATH;
}
- public static void setContent(Canvas newContent) {
- // A call to destroy (e.g. certain IFrames/FullHTMLPane) can actually remove multiple children of the
- // contentCanvas. As such, we need to query for the children after each destroy to ensure only valid children
- // are in the array.
- Canvas contentCanvas = Canvas.getById(CONTENT_CANVAS_ID);
- Canvas[] children;
- while ((children = contentCanvas.getChildren()).length > 0) {
- children[0].destroy();
- }
-
- if (newContent != null) {
- //content = newContent;
- contentCanvas.addChild(newContent);
- }
- contentCanvas.markForRedraw();
- }
-
public static void goToView(String viewPath) {
goToView(viewPath, null, false);
}
@@ -380,9 +363,25 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
ViewId topLevelViewId = viewPath.getCurrent(); // e.g. Administration
if (!topLevelViewId.equals(this.currentViewId)) {
+ // Destroy the current canvas before creating the new one. This helps prevent locator
+ // conflicts if the old and new content share (logical) widgets. A call to destroy (e.g. certain
+ // IFrames/FullHTMLPane) can actually remove multiple children of the contentCanvas. As such, we
+ // need to query for the children after each destroy to ensure only valid children are in the array.
+ Canvas contentCanvas = Canvas.getById(CONTENT_CANVAS_ID);
+ Canvas[] children;
+ while ((children = contentCanvas.getChildren()).length > 0) {
+ children[0].destroy();
+ }
+
+ // Set the new content and redraw
this.currentViewId = topLevelViewId;
this.currentCanvas = createContent(this.currentViewId.getPath());
- setContent(this.currentCanvas);
+
+ if (null != this.currentCanvas) {
+ contentCanvas.addChild(this.currentCanvas);
+ }
+
+ contentCanvas.markForRedraw();
}
if (this.currentCanvas instanceof BookmarkableView) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 8a9ab88..8c0a28a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -313,6 +313,10 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
@Override
public void destroy() {
+ // immediately null out the listGrid to stop async refresh requests from executing during the destroy
+ // logic. This happens in selenium testing or when a user navs away prior to the refresh.
+ this.listGrid = null;
+
SeleniumUtility.destroyMembers(contents);
super.destroy();
}
@@ -420,8 +424,10 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
listGrid.addDataArrivedHandler(new DataArrivedHandler() {
public void onDataArrived(DataArrivedEvent dataArrivedEvent) {
- refreshTableInfo();
- fieldSizes.clear();
+ if (null != listGrid) {
+ refreshTableInfo();
+ fieldSizes.clear();
+ }
}
});
@@ -668,7 +674,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
}
protected void refreshTableInfo() {
- if (showFooter) {
+ if (showFooter && null != this.listGrid) {
if (this.tableActionDisableOverride) {
this.listGrid.setSelectionType(SelectionStyle.NONE);
} else {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
index 8d1ba38..2ce842f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java
@@ -31,6 +31,8 @@ import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.events.CloseClientEvent;
+import com.smartgwt.client.widgets.events.DrawEvent;
+import com.smartgwt.client.widgets.events.DrawHandler;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.LayoutSpacer;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
@@ -199,14 +201,14 @@ public class WizardView extends LocatableVLayout {
}
- private void setStep(int stepIndex) {
+ private void setStep(final int stepIndex) {
if (stepIndex < 0) {
this.previousButton.setDisabled(true);
return;
}
// determine if we are "finished" - that is, going past our last step
- List<WizardStep> wizardSteps = wizard.getSteps();
+ final List<WizardStep> wizardSteps = wizard.getSteps();
if (stepIndex >= wizardSteps.size()) {
closeDialog();
return;
@@ -222,14 +224,9 @@ public class WizardView extends LocatableVLayout {
stepTitleLabel.setContents(step.getName());
- previousButton.setDisabled(stepIndex == 0);
-
- boolean last = (stepIndex == (wizardSteps.size() - 1));
- if (last) {
- nextButton.setTitle(MSG.common_button_finish());
- } else {
- nextButton.setTitle(MSG.common_button_next());
- }
+ cancelButton.setDisabled(true);
+ previousButton.setDisabled(true);
+ nextButton.setDisabled(true);
for (IButton button : customButtons) {
buttonBar.removeMember(button);
@@ -238,6 +235,7 @@ public class WizardView extends LocatableVLayout {
List<IButton> cbs = wizard.getCustomButtons(currentStep);
if (cbs != null) {
for (IButton button : cbs) {
+ button.setDisabled(true);
buttonBar.addMember(button);
customButtons.add(button);
}
@@ -247,8 +245,33 @@ public class WizardView extends LocatableVLayout {
contentLayout.removeMember(currentCanvas);
}
currentCanvas = wizardSteps.get(currentStep).getCanvas(this);
- createdCanvases.add(currentCanvas);
+ // after the canvas is drawn, enable the wizard buttons (unlikely a user will notice, but useful
+ // for keeping automated testing from advancing too quickly).
+ currentCanvas.addDrawHandler(new DrawHandler() {
+
+ @Override
+ public void onDraw(DrawEvent event) {
+ boolean last = (stepIndex == (wizardSteps.size() - 1));
+ if (last) {
+ nextButton.setTitle(MSG.common_button_finish());
+ } else {
+ nextButton.setTitle(MSG.common_button_next());
+ }
+
+ cancelButton.setDisabled(false);
+ previousButton.setDisabled(stepIndex == 0);
+ nextButton.setDisabled(false);
+
+ for (IButton button : customButtons) {
+ button.setDisabled(false);
+ }
+
+ markForRedraw();
+ }
+ });
+
+ createdCanvases.add(currentCanvas);
contentLayout.addMember(currentCanvas);
// clean any message from a previous step
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index 55cacda..5a59b9d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -61,6 +61,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIMenuButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableMenu;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* @author Greg Hinkle
@@ -414,7 +415,22 @@ public class DashboardView extends LocatableVLayout {
public void removePortlet(DashboardPortlet portlet) {
storedDashboard.removePortlet(portlet);
- save();
+
+ // portlet remove means the portlet locations may have changed. The selenium testing locators include
+ // positioning info. So, in this case we have to take the hit and completely redraw the dash.
+ AsyncCallback<Dashboard> callback = SeleniumUtility.getUseDefaultIds() ? null : new AsyncCallback<Dashboard>() {
+
+ @Override
+ public void onFailure(Throwable caught) {
+ redraw();
+ }
+
+ @Override
+ public void onSuccess(Dashboard result) {
+ redraw();
+ }
+ };
+ save(callback);
}
public void save(Dashboard dashboard) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
index 025e92e..87c3328 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java
@@ -149,10 +149,4 @@ public class PortalLayout extends LocatableHLayout {
}
}
- // @Override
- // protected void onDestroy() {
- // destroyMembers();
- // super.onDestroy();
- // }
-
}
\ No newline at end of file
13 years, 3 months