Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:27:51 -0400 (Mon, 21 Apr 2008)
New Revision: 10685
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
Log:
- Re-applied some changes that got lost in the last couple of commits...
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2008-04-21
22:26:06 UTC (rev 10684)
+++
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2008-04-21
22:27:51 UTC (rev 10685)
@@ -1,9 +1,9 @@
+<%@ page import="org.jboss.portal.common.i18n.LocalizedString" %>
<%@ page import="org.jboss.portal.common.util.IteratorStatus" %>
<%@ page import="org.jboss.portal.core.model.instance.Instance" %>
-<%@ page import="org.jboss.portal.portlet.Portlet" %>
-<%@ page import="org.jboss.portal.portlet.PortletInvokerException" %>
-<%@ page import="org.jboss.portal.portlet.info.MetaInfo" %>
-<%@ page import="java.util.Collection" %>
+<%@ page import="org.jboss.portal.core.portlet.info.PortletIconInfo" %>
+<%@ page import="org.jboss.portal.core.portlet.info.PortletInfoInfo" %>
+<%@ page
import="org.jboss.portal.core.ui.content.portlet.PortletContentEditorPortlet"
%>
<%@ page language="java" %>
<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
@@ -11,14 +11,12 @@
Collection instances = (Collection)request.getAttribute("INSTANCES");
Instance selectedInstance =
(Instance)request.getAttribute("SELECTED_INSTANCE");
%>
-<%@page import="org.jboss.portal.portlet.info.PortletInfo"%>
-<%@page import="org.jboss.portal.core.portlet.info.PortletInfoInfo"%>
-<%@page import="org.jboss.portal.core.portlet.info.PortletIconInfo"%>
-<%@page
import="org.jboss.portal.core.ui.content.portlet.PortletContentEditorPortlet"%>
-<%@ page import="javax.portlet.PortletURL" %>
-<%@ page import="java.net.URLEncoder" %>
-<%@page
import="org.jboss.portal.portlet.impl.info.ContainerPortletInfo"%>
-<%@page
import="org.jboss.portal.core.metadata.portlet.PortletInfoMetaData"%>
+<%@page import="org.jboss.portal.portlet.Portlet" %>
+<%@page import="org.jboss.portal.portlet.PortletInvokerException" %>
+<%@page import="org.jboss.portal.portlet.info.MetaInfo" %>
+<%@page import="org.jboss.portal.portlet.info.PortletInfo" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="java.util.Locale" %>
<portlet:defineObjects/>
<script type='text/javascript'
src='/portal-admin/js/domLib.js'></script>
<script type="text/javascript"
src="/portal-admin/js/fadomatic.js"></script>
@@ -49,7 +47,7 @@
jsfForm =
document.getElementById('bilto').previousSibling.previousSibling;
}
}catch(e){
-
+
}
if (jsfForm.nodeName.toLowerCase() == 'form'){
@@ -67,17 +65,15 @@
<td><h3 class="sectionTitle tenpx-top-bottom">Portlet instance
associated to this window:</h3></td>
</tr>
<%
+ Locale locale = renderRequest.getLocale();
if (selectedInstance != null)
{
- String displayName =
selectedInstance.getDisplayName().getString(renderRequest.getLocale(), true);
+ String displayName = selectedInstance.getDisplayName().getString(locale, true);
if (displayName == null)
{
displayName = selectedInstance.getId();
}
-%>
-
- <%
Portlet portlet = null;
try
{
@@ -89,114 +85,118 @@
}
if (portlet != null)
{
- MetaInfo metaInfo = portlet.getInfo().getMeta();
-
PortletInfo info = portlet.getInfo();
-
+ MetaInfo metaInfo = info.getMeta();
String iconLocation = getIcon(info);
-
- %>
+%>
<tr class="portlet-section-selected">
- <td >
- <img src="<%= iconLocation %>" align="middle"
style="margin:0 4px 0 0"/>
- <span><%= displayName %></span>
+ <td>
+ <img src="<%= iconLocation %>" align="middle"
style="margin:0 4px 0 0" alt="icon"/>
+ <span><%= displayName %></span>
- <div>
- <span class="portlet-form-field-label">Portlet
name:</span><%= metaInfo.getMetaValue(MetaInfo.DISPLAY_NAME).getDefaultString()
%>
- </div>
- <div>
- <span class="portlet-form-field-label">Portlet
description:</span><%=
metaInfo.getMetaValue(MetaInfo.DESCRIPTION).getDefaultString() %>
- </div>
-
+ <div>
+ <span class="portlet-form-field-label">Portlet
name:</span><%= displayName %>
+ </div>
+ <div>
+ <span class="portlet-form-field-label">Portlet
description:</span>
+ <%= getLocalizedValue(metaInfo.getMetaValue(MetaInfo.DESCRIPTION), locale)
%>
+ </div>
+
</td>
- </tr>
- <%
- }
+</tr>
+<%
}
+ }
+%>
- %>
+<tr>
+ <td>
- <tr>
-<td>
+ <div style="height:300px; width:500px; overflow: auto; overflow-x: hidden;
border: 1px solid #333;">
+ <table style="width:100%;" cellspacing="0"
cellpadding="0">
+ <%
+ for (IteratorStatus i = new IteratorStatus(instances); i.hasNext();)
+ {
+ Instance instance = (Instance)i.next();
+ String rowClass = instance == selectedInstance ?
"portlet-section-selected" : (i.getIndex() % 2 == 0 ?
"portlet-section-body" : "portlet-section-alternate");
+ String displayName = instance.getDisplayName().getString(locale,
true);
+ PortletInfo info = instance.getPortlet().getInfo();
+ MetaInfo portletMetaInfo = info.getMeta();
-<div style="height:300px; width:500px; overflow: auto; overflow-x: hidden;
border: 1px solid #333;">
+ if (displayName == null)
+ {
+ displayName = instance.getId();
+ }
- <table style="width:100%;" cellspacing="0"
cellpadding="0">
- <%
- for (IteratorStatus i = new IteratorStatus(instances); i.hasNext();)
- {
- Instance instance = (Instance)i.next();
- String rowClass = instance == selectedInstance ?
"portlet-section-selected" : (i.getIndex() % 2 == 0 ?
"portlet-section-body" : "portlet-section-alternate");
- String displayName =
instance.getDisplayName().getString(renderRequest.getLocale(), true);
- MetaInfo portletMetaInfo = instance.getPortlet().getInfo().getMeta();
+ String iconLocation = getIcon(info);
+ %>
+ <portlet:actionURL var="url">
+ <portlet:param name="content.action.select"
value="true"/>
+ <portlet:param name="content.uri" value="<%=
instance.getId() %>"/>
+ </portlet:actionURL>
- if (displayName == null)
- {
- displayName = instance.getId();
- }
-
- PortletInfo info = instance.getPortlet().getInfo();
+ <div style="display:none">
+ <div class="darktip" id="info-container-<%=
displayName %>">
+ <div class="toolbar" style="width: 250px;">
+ <div class="title"><%=
getLocalizedValue(portletMetaInfo.getMetaValue(MetaInfo.TITLE), locale) %>
+ </div>
+ </div>
+ <div class="content">
+ <div><span
class="portlet-form-field-label">Portlet name:</span><%= displayName
%>
+ </div>
+ <div><span
class="portlet-form-field-label">Portlet description:</span>
+ <%=
getLocalizedValue(portletMetaInfo.getMetaValue(MetaInfo.DESCRIPTION), locale) %>
+ </div>
+ </div>
+ </div>
+ </div>
- String iconLocation = getIcon(info);
-
- %>
- <portlet:actionURL var="test">
- <portlet:param name="content.action.select"
value="true"/>
- <portlet:param name="content.uri" value="<%=
instance.getId() %>"/>
- </portlet:actionURL>
-
- <div style="display:none">
- <div class="darktip" id="info-container-<%= displayName
%>">
- <div class="toolbar" style="width: 250px;">
- <div class="title"><%=
portletMetaInfo.getMetaValue(MetaInfo.TITLE).getDefaultString() %></div>
- </div>
- <div class="content">
-
- <div>
- <span class="portlet-form-field-label">Portlet
name:</span><%=
portletMetaInfo.getMetaValue(MetaInfo.DISPLAY_NAME).getDefaultString() %>
- </div>
- <div>
- <span class="portlet-form-field-label">Portlet
description:</span><%=
portletMetaInfo.getMetaValue(MetaInfo.DESCRIPTION).getDefaultString() %>
- </div>
- </div>
+ <tr class="<%= rowClass %>">
+ <td>
+ <img src="<%= iconLocation %>"
align="middle" style="margin:0 4px 0 0" alt="icon"/>
+ <span
+ onmouseover="domTT_activate(this, event, 'content',
document.getElementById('info-container-<%= displayName
%>'),'delay', 0, 'trail', false, 'fade', 'both',
'fadeMax', 95, 'styleClass', 'none');"><a
+ href="javascript:void(0);"
onclick="submitForm('<%= url %>');return false"
+ id="portlet-instance-link"><%= displayName %>
+ </a></span>
+ </td>
+ </tr>
+ <%
+ }
+ %>
+ </table>
</div>
-
- </div>
-
- <tr class="<%= rowClass %>" >
- <td >
- <img src="<%= iconLocation %>" align="middle"
style="margin:0 4px 0 0"/>
- <span onmouseover="domTT_activate(this, event, 'content',
document.getElementById('info-container-<%= displayName
%>'),'delay', 0, 'trail', false, 'fade', 'both',
'fadeMax', 95, 'styleClass', 'none');"><a
href="javascript:void(0);" onclick="submitForm('<%= test
%>');return false" id="portlet-instance-link"><%= displayName
%></a></span>
- </td>
- </tr>
- <%
- }
- %>
- </table>
-</div>
- </td>
- </tr>
+ </td>
+</tr>
</table>
<%!
private String getIcon(PortletInfo info)
{
- String iconLocation = null;
- if (info instanceof ContainerPortletInfo)
+ String iconLocation = PortletContentEditorPortlet.DEFAULT_PORTLET_ICON;
+ PortletInfoInfo portletInfo = info.getAttachment(PortletInfoInfo.class);
+
+ if (portletInfo != null)
{
- ContainerPortletInfo cInfo = (ContainerPortletInfo)info;
- PortletInfoInfo portletInfo = cInfo.getAttachment(PortletInfoInfo.class);
- if (portletInfo != null && portletInfo.getPortletIconInfo() != null
- &&
portletInfo.getPortletIconInfo().getIconLocation(PortletIconInfo.SMALL) != null)
+ PortletIconInfo iconInfo = portletInfo.getPortletIconInfo();
+ if (iconInfo != null && iconInfo.getIconLocation(PortletIconInfo.SMALL)
!= null)
{
- iconLocation =
portletInfo.getPortletIconInfo().getIconLocation(PortletIconInfo.SMALL);
+ iconLocation = iconInfo.getIconLocation(PortletIconInfo.SMALL);
}
}
- if (iconLocation == null)
+
+ return iconLocation;
+ }
+
+ private String getLocalizedValue(LocalizedString locString, Locale locale)
+ {
+ String value = "";
+ if (locString != null)
{
- iconLocation = PortletContentEditorPortlet.DEFAULT_PORTLET_ICON;
+ value = locString.getString(locale, true);
}
- return iconLocation;
+
+ return value;
}
%>
\ No newline at end of file