From: <jma...@rh...> - 2009-08-07 05:35:36
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [4790] [RHQ-2300] - UI support for marking resource-level alert definitions spawns from templates or group alert definitions as readOnly</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>4790</dd> <dt>Author</dt> <dd>jmarques</dd> <dt>Date</dt> <dd>2009-08-07 00:35:25 -0500 (Fri, 07 Aug 2009)</dd> </dl> <h3>Log Message</h3> <pre>[RHQ-2300] - UI support for marking resource-level alert definitions spawns from templates or group alert definitions as readOnly</pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguilegacyactionresourcecommonmonitoralertsconfigConditionBeanjava">rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ConditionBean.java</a></li> <li><a href="#rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguilegacyactionresourcecommonmonitoralertsconfigDefinitionFormjava">rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionForm.java</a></li> <li><a href="#rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguilegacyactionresourcecommonmonitoralertsconfigEditDefinitionPropertiesActionjava">rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionPropertiesAction.java</a></li> <li><a href="#rhqtrunkmodulesenterpriseguiportalwarsrcmainwebappresourcecommonmonitoralertsconfigDefinitionPropertiesjsp">rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/DefinitionProperties.jsp</a></li> <li><a href="#rhqtrunkmodulesenterpriseguiportalwarsrcmainwebappresourcecommonmonitoralertsconfigViewDefinitionPropertiesjsp">rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/ViewDefinitionProperties.jsp</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguilegacyactionresourcecommonmonitoralertsconfigConditionBeanjava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ConditionBean.java (4789 => 4790)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ConditionBean.java 2009-08-07 04:35:43 UTC (rev 4789) +++ rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ConditionBean.java 2009-08-07 05:35:25 UTC (rev 4790) </span><span class="lines">@@ -207,7 +207,7 @@ </span><span class="cx"> this.traitName = traitName; } </span><span class="rem">- public void importProperties(AlertCondition cond, boolean isTypeAlert, Subject subject) throws Exception { </span><span class="add">+ public void importProperties(AlertCondition cond, Subject subject) throws Exception { </span><span class="cx"> ConverterValidatorManager.importProperties(subject, cond, this); } </span></pre></div> <a id="rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguilegacyactionresourcecommonmonitoralertsconfigDefinitionFormjava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionForm.java (4789 => 4790)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionForm.java 2009-08-07 04:35:43 UTC (rev 4789) +++ rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionForm.java 2009-08-07 05:35:25 UTC (rev 4790) </span><span class="lines">@@ -52,7 +52,6 @@ </span><span class="cx"> import org.rhq.enterprise.server.alert.AlertDefinitionManagerLocal; import org.rhq.enterprise.server.alert.AlertTemplateManagerLocal; import org.rhq.enterprise.server.alert.GroupAlertDefinitionManagerLocal; </span><span class="rem">-import org.rhq.enterprise.server.legacy.events.EventConstants; </span><span class="cx"> import org.rhq.enterprise.server.util.LookupUtil; /** </span><span class="lines">@@ -534,8 +533,6 @@ </span><span class="cx"> this.setConditionExpression(alertDef.getConditionExpression().name()); </span><span class="rem">- boolean isTypeAlert = EventConstants.TYPE_ALERT_DEF_ID.equals(alertDef.getParentId()); - </span><span class="cx"> /* * conditions */ </span><span class="lines">@@ -544,7 +541,7 @@ </span><span class="cx"> int i = 0; for (AlertCondition cond : conds) { ConditionBean condBean = conditions.get(i++); </span><span class="rem">- condBean.importProperties(cond, isTypeAlert, subject); </span><span class="add">+ condBean.importProperties(cond, subject); </span><span class="cx"> } /* </span><span class="lines">@@ -759,6 +756,10 @@ </span><span class="cx"> return readOnly; } </span><span class="add">+ public boolean getReadOnly() { + return readOnly; + } + </span><span class="cx"> public void setReadOnly(boolean readOnly) { this.readOnly = readOnly; } </span></pre></div> <a id="rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguilegacyactionresourcecommonmonitoralertsconfigEditDefinitionPropertiesActionjava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionPropertiesAction.java (4789 => 4790)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionPropertiesAction.java 2009-08-07 04:35:43 UTC (rev 4789) +++ rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionPropertiesAction.java 2009-08-07 05:35:25 UTC (rev 4790) </span><span class="lines">@@ -88,17 +88,15 @@ </span><span class="cx"> try { if (context == FormContext.Type) { AlertTemplateManagerLocal alertTemplateManager = LookupUtil.getAlertTemplateManager(); </span><span class="rem">- // this will disallow updates if the alert definition has been deleted - alertDef.setReadOnly(defForm.isReadOnly()); </span><span class="cx"> alertTemplateManager.updateAlertTemplate(subject, alertDef, false); } else if (context == FormContext.Resource) { AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager(); </span><span class="add">+ // this will disallow updates if the alert definition has been deleted + alertDef.setReadOnly(defForm.isReadOnly()); </span><span class="cx"> alertDefinitionManager.updateAlertDefinition(subject, alertDef.getId(), alertDef, false); } else if (context == FormContext.Group) { GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil .getGroupAlertDefinitionManager(); </span><span class="rem">- // this will disallow updates if the alert definition has been deleted - alertDef.setReadOnly(defForm.isReadOnly()); </span><span class="cx"> groupAlertDefinitionManager.updateGroupAlertDefinitions(subject, alertDef, false); } else { throw new IllegalArgumentException("Unsupported context: " + context); </span></pre></div> <a id="rhqtrunkmodulesenterpriseguiportalwarsrcmainwebappresourcecommonmonitoralertsconfigDefinitionPropertiesjsp"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/DefinitionProperties.jsp (4789 => 4790)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/DefinitionProperties.jsp 2009-08-07 04:35:43 UTC (rev 4789) +++ rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/DefinitionProperties.jsp 2009-08-07 05:35:25 UTC (rev 4790) </span><span class="lines">@@ -103,7 +103,7 @@ </span><span class="cx"> </td> </logic:messagesNotPresent> </tr> </span><span class="rem">- <c:if test="${alertDef.parentId > 0}"> </span><span class="add">+ <c:if test="${alertDef.parentId > 0 or not empty alertDef.groupAlertDefinition}"> </span><span class="cx"> <tr> <td width="20%" class="BlockLabel"> <fmt:message key="common.label.ReadOnly"/> </span></pre></div> <a id="rhqtrunkmodulesenterpriseguiportalwarsrcmainwebappresourcecommonmonitoralertsconfigViewDefinitionPropertiesjsp"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/ViewDefinitionProperties.jsp (4789 => 4790)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/ViewDefinitionProperties.jsp 2009-08-07 04:35:43 UTC (rev 4789) +++ rhq/trunk/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/config/ViewDefinitionProperties.jsp 2009-08-07 05:35:25 UTC (rev 4790) </span><span class="lines">@@ -34,7 +34,7 @@ </span><span class="cx"> </tr> <tr valign="top"> <c:choose> </span><span class="rem">- <c:when test="${alertDef.parentId > 0}"> </span><span class="add">+ <c:when test="${alertDef.parentId > 0 or not empty alertDef.groupAlertDefinition}"> </span><span class="cx"> <td width="20%" class="BlockLabel"><fmt:message key="common.label.ReadOnly"/></td> <td width="30%" class="BlockContent" rowspan="2"><c:out value="${alertDef.readOnly}"/></td> </c:when> </span><span class="lines">@@ -66,8 +66,25 @@ </span><span class="cx"> </td> </tr> </c:if> </span><span class="add">+ </c:if> </span><span class="cx"> </span><span class="add">+ <c:if test="${not empty alertDef.groupAlertDefinition}"> + <tr> + <td colspan="4" class="BlockContent"><span style="height: 3px;"></span></td> + </tr> + <c:if test="${!alertDef.deleted}"> + <tr> + <td colspan="4" class="BlockContent"> + <span class="red" style="padding-left: 15px;"> + <fmt:message key="alerts.config.service.DefinitionList.isResourceAlert.false"/> + </span> + <fmt:message key="alert.config.props.PB.IsGroupAlert"/> + (<html:link page="/alerts/Config.do?mode=viewRoles&group=${alertDef.groupAlertDefinition.resourceGroup.id}&ad=${alertDef.groupAlertDefinition.id}"><fmt:message key="alert.config.props.ViewGroupAlertDefinition"/></html:link>) + </td> + </tr> </span><span class="cx"> </c:if> </span><span class="add">+ </c:if> + </span><span class="cx"> <tr> <td colspan="4" class="BlockContent"><span style="height: 1px;"></span></td> </tr> </span> </pre> </div> </div> </body> </html> |