From: <cl...@hy...> - 2007-12-19 20:27:32
|
Author: clee Date: 2007-12-19 12:27:22 -0800 (Wed, 19 Dec 2007) New Revision: 7319 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=7319 Modified: trunk/src/org/hyperic/hq/ui/action/attach/TabBodyAction.java trunk/web/WEB-INF/tiles/resource-service-def.xml trunk/web/resource/Views.jsp Log: [HHQ-1220] Use the right tile for the service views tabs Modified: trunk/src/org/hyperic/hq/ui/action/attach/TabBodyAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/attach/TabBodyAction.java 2007-12-19 19:07:35 UTC (rev 7318) +++ trunk/src/org/hyperic/hq/ui/action/attach/TabBodyAction.java 2007-12-19 20:27:22 UTC (rev 7319) @@ -1,3 +1,28 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004-2007], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + package org.hyperic.hq.ui.action.attach; import java.util.Collection; @@ -3,5 +28,4 @@ import java.util.Iterator; -import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -12,17 +36,13 @@ import org.apache.struts.action.ActionMapping; import org.hyperic.hq.appdef.shared.AppdefEntityID; import org.hyperic.hq.bizapp.server.session.ProductBossEJBImpl; -import org.hyperic.hq.bizapp.shared.ProductBoss; import org.hyperic.hq.bizapp.shared.ProductBossLocal; import org.hyperic.hq.hqu.AttachmentDescriptor; import org.hyperic.hq.hqu.server.session.Attachment; -import org.hyperic.hq.hqu.server.session.UIPluginManagerEJBImpl; import org.hyperic.hq.hqu.server.session.ViewResourceCategory; -import org.hyperic.hq.hqu.shared.UIPluginManagerLocal; import org.hyperic.hq.ui.Constants; import org.hyperic.hq.ui.Portal; import org.hyperic.hq.ui.action.BaseAction; -import org.hyperic.hq.ui.util.ContextUtils; import org.hyperic.hq.ui.util.RequestUtils; public class TabBodyAction extends BaseAction { @@ -39,8 +59,7 @@ } AppdefEntityID eid = RequestUtils.getEntityId(request); ProductBossLocal pBoss = ProductBossEJBImpl.getOne(); - UIPluginManagerLocal pluginManager = UIPluginManagerEJBImpl.getOne(); - int sessionId = RequestUtils.getSessionIdInt(request); + int sessionId = RequestUtils.getSessionIdInt(request); Collection availAttachents = pBoss.findAttachments(sessionId, eid, ViewResourceCategory.VIEWS); Modified: trunk/web/WEB-INF/tiles/resource-service-def.xml =================================================================== --- trunk/web/WEB-INF/tiles/resource-service-def.xml 2007-12-19 19:07:35 UTC (rev 7318) +++ trunk/web/WEB-INF/tiles/resource-service-def.xml 2007-12-19 20:27:22 UTC (rev 7319) @@ -106,12 +106,12 @@ </putList> </definition> - <definition name=".tabs.resource.service.view" + <definition name=".tabs.resource.service.views" extends=".tabs.resource.service"> <put name="selectedIndex" value="4" /> </definition> - <definition name=".tabs.resource.service.view.nocontrol" + <definition name=".tabs.resource.service.views.nocontrol" extends=".tabs.resource.service.nocontrol"> <put name="selectedIndex" value="3" /> </definition> Modified: trunk/web/resource/Views.jsp =================================================================== --- trunk/web/resource/Views.jsp 2007-12-19 19:07:35 UTC (rev 7318) +++ trunk/web/resource/Views.jsp 2007-12-19 20:27:22 UTC (rev 7319) @@ -116,69 +116,49 @@ </c:choose> </c:when> - <c:when test="${CONST_PLATFORM == entityId.type}"> - - <tiles:insert definition=".page.title.resource.platform.full"> + <c:otherwise> + <c:choose> + <c:when test="${CONST_PLATFORM == entityId.type}"> + <c:set var="fullDef" value=".page.title.resource.platform.full"/> + <c:set var="viewsDef" value=".tabs.resource.platform.views"/> + </c:when> + <c:when test="${CONST_SERVER == entityId.type}"> + <c:set var="fullDef" value=".page.title.resource.server.full"/> + <c:choose> + <c:when test="${canControl}"> + <c:set var="viewsDef" value=".tabs.resource.server.views"/> + </c:when> + <c:otherwise> + <c:set var="viewsDef" value=".tabs.resource.server.views.nocontrol"/> + </c:otherwise> + </c:choose> + </c:when> + <c:when test="${CONST_SERVICE == entityId.type}"> + <c:set var="fullDef" value=".page.title.resource.service.full"/> + <c:choose> + <c:when test="${ canControl }"> + <c:set var="viewsDef" value=".tabs.resource.service.views"/> + </c:when> + <c:otherwise> + <c:set var="viewsDef" value=".tabs.resource.service.views.nocontrol"/> + </c:otherwise> + </c:choose> + </c:when> + </c:choose> + + <tiles:insert beanName="fullDef"> <tiles:put name="titleName"><hq:inventoryHierarchy resource="${entityId.appdefKey}" /></tiles:put> <tiles:put name="resource" beanName="Resource"/> <tiles:put name="resourceOwner" beanName="ResourceOwner"/> <tiles:put name="resourceModifier" beanName="ResourceModifier"/> </tiles:insert> - <tiles:insert definition=".tabs.resource.platform.views"> + <tiles:insert beanName="viewsDef"> <tiles:put name="resourceId" beanName="Resource" beanProperty="id"/> <tiles:put name="resourceType" beanName="entityId" beanProperty="type"/> </tiles:insert> - - </c:when> - <c:when test="${CONST_SERVER == entityId.type}"> - - <tiles:insert definition=".page.title.resource.server.full"> - <tiles:put name="titleName"><hq:inventoryHierarchy resource="${entityId.appdefKey}" /></tiles:put> - <tiles:put name="resource" beanName="Resource"/> - <tiles:put name="resourceOwner" beanName="ResourceOwner"/> - <tiles:put name="resourceModifier" beanName="ResourceModifier"/> - </tiles:insert> - <c:choose> - <c:when test="${canControl}"> - <tiles:insert definition=".tabs.resource.server.views"> - <tiles:put name="resourceId" beanName="Resource" beanProperty="id"/> - <tiles:put name="resourceType" beanName="entityId" beanProperty="type"/> - </tiles:insert> - </c:when> - <c:otherwise> - <tiles:insert definition=".tabs.resource.server.views.nocontrol"> - <tiles:put name="resourceId" beanName="Resource" beanProperty="id"/> - <tiles:put name="resourceType" beanName="entityId" beanProperty="type"/> - </tiles:insert> - </c:otherwise> - </c:choose> - - </c:when> - <c:when test="${CONST_SERVICE == entityId.type}"> - - <tiles:insert definition=".page.title.resource.service.full"> - <tiles:put name="titleName"><hq:inventoryHierarchy resource="${entityId.appdefKey}" /></tiles:put> - <tiles:put name="resource" beanName="Resource"/> - <tiles:put name="resourceOwner" beanName="ResourceOwner"/> - <tiles:put name="resourceModifier" beanName="ResourceModifier"/> - </tiles:insert> - <c:choose> - <c:when test="${ canControl }"> - <tiles:insert definition=".tabs.resource.service.monitor.visibility"> - <tiles:put name="resourceId" beanName="Resource" beanProperty="id"/> - <tiles:put name="resourceType" beanName="entityId" beanProperty="type"/> - </tiles:insert> - </c:when> - <c:otherwise> - <tiles:insert definition=".tabs.resource.service.monitor.visibility.nocontrol"> - <tiles:put name="resourceId" beanName="Resource" beanProperty="id"/> - <tiles:put name="resourceType" beanName="entityId" beanProperty="type"/> - </tiles:insert> - </c:otherwise> - </c:choose> - - </c:when> + + </c:otherwise> </c:choose> <tiles:insert definition=".portlet.error"/> |