JBoss Portal SVN: r10688 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-04-21 19:09:28 -0400 (Mon, 21 Apr 2008)
New Revision: 10688
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/ldap.xml
Log:
19.2.1. Connection Pooling
minor revisions as per boleslaw.dawidowicz request
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/ldap.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/ldap.xml 2008-04-21 22:51:37 UTC (rev 10687)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/ldap.xml 2008-04-21 23:09:28 UTC (rev 10688)
@@ -102,8 +102,7 @@
<title>Configuration of LDAP connection</title>
<sect2>
<title>Connection Pooling</title>
- <para>Portal uses connection pooling provided by <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html">JNDI</ulink>.
- It is enabled by default. You can configure connection pooling settings using following options:</para>
+ <para>JBoss Portal uses <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html">connection pooling</ulink> provided by <ulink url="http://java.sun.com/products/jndi/">JNDI</ulink>, and is enabled by default. Use the following options to configure connection pooling settings:</para>
<programlisting><![CDATA[
<datasource>
<name>LDAP</name>
@@ -155,7 +154,7 @@
</config>
</datasource>]]></programlisting>
<para>
- Please refer to the <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/config.html">JNDI Documentation</ulink> to learn about option values.
+ Remember, as it is described in the <ulink url="http://java.sun.com/products/jndi/tutorial/ldap/connect/config.html">JNDI documentation</ulink>, these options are system values, not environment properties, and affect all connection pooling requests in the Java runtime.
</para>
</sect2>
16 years
JBoss Portal SVN: r10687 - branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:51:37 -0400 (Mon, 21 Apr 2008)
New Revision: 10687
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
Log:
- Added locale in alt attribute.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2008-04-21 22:30:39 UTC (rev 10686)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2008-04-21 22:51:37 UTC (rev 10687)
@@ -31,8 +31,8 @@
<li class="third-width"><label>Keywords: </label>#{portlet.keywords.value}</li>
<f:subview id="locales" rendered="#{not empty portlet.locales}">
<li class="third-width"><label>Locales: </label>
- <c:forEach items="#{portlet.locales}" var="locale"> <h:graphicImage style="margin: 0 3px 0 3px 0;"
- value="/img/locales/#{locale}.gif"/>  
+ <c:forEach items="#{portlet.locales}" var="locale">
+ <h:graphicImage style="margin: 0 3px 0 3px 0;" value="/img/locales/#{locale}.gif" alt="#{locale}"/>  
</c:forEach>
</li>
</f:subview>
16 years
JBoss Portal SVN: r10686 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-04-21 18:30:39 -0400 (Mon, 21 Apr 2008)
New Revision: 10686
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migration.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
4.1.4. CMS
minor corrections for JBPORTAL-1972
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migration.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migration.xml 2008-04-21 22:27:51 UTC (rev 10685)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/migration.xml 2008-04-21 22:30:39 UTC (rev 10686)
@@ -359,7 +359,7 @@
</listitem>
<listitem>
<para>
- rows containing <emphasis>ExceptionPortletinstance</emphasis> in the <emphasis>INSTANCE_REF</emphasis> column.
+ rows containing <emphasis>ExceptionPortletInstance</emphasis> in the <emphasis>INSTANCE_REF</emphasis> column.
</para>
</listitem>
<listitem>
@@ -517,7 +517,7 @@
</itemizedlist>
</para>
<para>
- For CMS migrations, back up the <computeroutput>jbp_cms_*</computeroutput> tables, and recreate them in the JBoss Portal 2.6 database. There were no schema changes for the CMS between JBoss Portal 2.4 and JBoss Portal 2.6.
+ As well, the CMS can be migrated by backing up the <computeroutput>jbp_cms_*</computeroutput> tables, and recreating them in a JBoss Portal 2.6 database. There were no schema changes for the CMS between JBoss Portal 2.4 and JBoss Portal 2.6.
</para>
<para>
<note>
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-04-21 22:27:51 UTC (rev 10685)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-04-21 22:30:39 UTC (rev 10686)
@@ -1928,7 +1928,7 @@
</para>
</sect2>
<sect2 id="desc_example_portal">
- <title>Defining a new portal instance</title>
+ <title>Defining a new Portal Instance</title>
<para>To illustrate our example, we have made available a portlet that you can download
here:
<ulink
16 years
JBoss Portal SVN: r10685 - branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-war/WEB-INF/jsp/content.
by portal-commits@lists.jboss.org
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
16 years
JBoss Portal SVN: r10684 - in branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core: impl/model/instance/persistent and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:26:06 -0400 (Mon, 21 Apr 2008)
New Revision: 10684
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerImpl.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/InstanceContainer.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java
Log:
- Generification
- Why is InstanceContainerContext referencing an abstract class instead of the InstanceDefinition interface?
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java 2008-04-21 22:23:21 UTC (rev 10683)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java 2008-04-21 22:26:06 UTC (rev 10684)
@@ -23,6 +23,7 @@
package org.jboss.portal.core.impl.model.instance;
import org.jboss.portal.core.model.instance.DuplicateInstanceException;
+import org.jboss.portal.core.model.instance.InstanceDefinition;
import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.core.model.instance.metadata.InstanceMetaData;
import org.jboss.portal.portlet.PortletContext;
@@ -37,7 +38,7 @@
public interface InstanceContainerContext
{
- Collection getInstanceDefinitions();
+ Collection<InstanceDefinition> getInstanceDefinitions();
AbstractInstanceDefinition getInstanceDefinition(String id);
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerImpl.java 2008-04-21 22:23:21 UTC (rev 10683)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerImpl.java 2008-04-21 22:26:06 UTC (rev 10684)
@@ -393,9 +393,9 @@
containerContext.destroyInstanceDefinition(definition);
}
- public Collection getDefinitions()
+ public Collection<InstanceDefinition> getDefinitions()
{
- Collection list = containerContext.getInstanceDefinitions();
+ Collection<InstanceDefinition> list = containerContext.getInstanceDefinitions();
// Filter the list
if (performSecurityChecks)
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java 2008-04-21 22:23:21 UTC (rev 10683)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java 2008-04-21 22:26:06 UTC (rev 10684)
@@ -35,6 +35,7 @@
import org.jboss.portal.core.impl.model.instance.InstanceContainerImpl;
import org.jboss.portal.core.impl.model.instance.JBossInstanceContainerContext;
import org.jboss.portal.core.model.instance.DuplicateInstanceException;
+import org.jboss.portal.core.model.instance.InstanceDefinition;
import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.core.model.instance.metadata.InstanceMetaData;
import org.jboss.portal.jems.hibernate.ObjectContextualizer;
@@ -142,7 +143,7 @@
sessionFactory = null;
}
- public Collection getInstanceDefinitions()
+ public Collection<InstanceDefinition> getInstanceDefinitions()
{
Session session = sessionFactory.getCurrentSession();
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/InstanceContainer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/InstanceContainer.java 2008-04-21 22:23:21 UTC (rev 10683)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/instance/InstanceContainer.java 2008-04-21 22:26:06 UTC (rev 10684)
@@ -99,7 +99,7 @@
*
* @return a collection containing the instances in the container
*/
- Collection getDefinitions();
+ Collection<InstanceDefinition> getDefinitions();
/**
* Return the AuthorizationDomain
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java 2008-04-21 22:23:21 UTC (rev 10683)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java 2008-04-21 22:26:06 UTC (rev 10684)
@@ -37,7 +37,6 @@
import javax.portlet.PortletMode;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import java.io.IOException;
@@ -45,7 +44,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
-import java.util.Iterator;
import java.util.List;
/**
@@ -105,30 +103,24 @@
String selectedURI = req.getParameter("content.uri");
//
- PortletURL actionURL = resp.createActionURL();
-
- //
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
// load instances this user has access to.
// Remove content editors
- List available_instances = new ArrayList();
+ List<Instance> available_instances = new ArrayList<Instance>();
nextInstance:
- for (Iterator i = instanceContainer.getDefinitions().iterator(); i.hasNext();)
+ for (Instance instance : instanceContainer.getDefinitions())
{
- Instance instance = (Instance)i.next();
-
//
try
{
// Filter portlets that are editors
Portlet portlet = instance.getPortlet();
PortletInfo info = portlet.getInfo();
- for (Iterator j = info.getCapabilities().getAllModes().iterator(); j.hasNext();)
+ for (ModeInfo modeInfo : info.getCapabilities().getAllModes())
{
- ModeInfo modeInfo = (ModeInfo)j.next();
if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
{
continue nextInstance;
@@ -144,12 +136,10 @@
}
// Sort alphabetically
- Comparator simpleComparator = new Comparator()
+ Comparator<Instance> simpleComparator = new Comparator<Instance>()
{
- public int compare(Object o1, Object o2)
+ public int compare(Instance i1, Instance i2)
{
- Instance i1 = (Instance)o1;
- Instance i2 = (Instance)o2;
return i1.getId().compareToIgnoreCase(i2.getId());
}
};
@@ -157,9 +147,8 @@
//
Instance selectedInstance = null;
- for (int i = 0; i < available_instances.size(); i++)
+ for (Instance instance : available_instances)
{
- Instance instance = (Instance)available_instances.get(i);
if (instance.getId().equals(selectedURI))
{
selectedInstance = instance;
@@ -169,7 +158,7 @@
//
req.setAttribute("INSTANCES", available_instances);
req.setAttribute("SELECTED_INSTANCE", selectedInstance);
- req.setAttribute("NEW_CONTENT", Boolean.valueOf(newContent));
+ req.setAttribute("NEW_CONTENT", newContent);
//
PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/content/portlet_editor.jsp");
16 years
JBoss Portal SVN: r10683 - branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:23:21 -0400 (Mon, 21 Apr 2008)
New Revision: 10683
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java
Log:
- If a content provider is not found, failure happens: need a proper way to bubble the error up without crashing Portal.
- Added logging.
- Minor refactoring.
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java 2008-04-21 22:21:25 UTC (rev 10682)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java 2008-04-21 22:23:21 UTC (rev 10683)
@@ -22,35 +22,38 @@
******************************************************************************/
package org.jboss.portal.core.controller.portlet;
+import org.apache.log4j.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.impl.model.content.InternalContentProviderRegistry;
+import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
+import org.jboss.portal.core.model.content.Content;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.spi.ContentProvider;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.navstate.NavigationalStateContext;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.core.model.content.spi.ContentProvider;
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
-import org.jboss.portal.core.impl.model.content.InternalContentProviderRegistry;
-import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.navstate.NavigationalStateContext;
-import org.jboss.portal.Mode;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import javax.servlet.http.Cookie;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
/**
@@ -59,6 +62,7 @@
*/
public class ControllerPortletControllerContext implements PortletControllerContext
{
+ private final static Logger log = Logger.getLogger(ControllerPortletControllerContext.class);
/** . */
private final ControllerContext controllerContext;
@@ -108,25 +112,43 @@
else
{
InternalContentProviderRegistry registry = controllerContext.getController().getContentProviderRegistry();
- ContentProvider provider = registry.getContentProvider(window.getContentType());
- instanceId = provider.getPortletInfo().getPortletName(Mode.VIEW);
+ ContentType contentType = window.getContentType();
+ ContentProvider provider = registry.getContentProvider(contentType);
+ if (provider != null)
+ {
+ instanceId = provider.getPortletInfo().getPortletName(Mode.VIEW);
+ }
+ else
+ {
+ log.debug("Couldn't find a ContentProvider for content type '" + contentType + "'");
+ instanceId = null;
+ // todo: this condition should bubble up, this would happen when trying to access a page referencing portlets
+ // for which no content provider is deployed (e.g. default page when cms is not deployed)
+ }
}
- //
- Instance instance = instanceContainer.getDefinition(instanceId);
- if (instance != null)
+ if (instanceId != null)
{
- try
+ Instance instance = instanceContainer.getDefinition(instanceId);
+ if (instance != null)
{
- Portlet portlet = instance.getPortlet();
- infos.put(window.getName(), portlet.getInfo());
- instances.put(window.getName(), instance);
- windows.put(window.getName(), window);
+ try
+ {
+ Portlet portlet = instance.getPortlet();
+ infos.put(window.getName(), portlet.getInfo());
+ instances.put(window.getName(), instance);
+ windows.put(window.getName(), window);
+ }
+ catch (PortletInvokerException ignore)
+ {
+ log.debug("Couldn't get portlet from instance '" + instance + "'", ignore);
+ }
}
- catch (PortletInvokerException ignore)
- {
- }
}
+ else
+ {
+ log.debug("Couldn't resolve instance id for window '" + window.getName() + "'");
+ }
}
// State controller context
@@ -172,47 +194,18 @@
public PortletInvocationResponse invoke(ActionInvocation actionInvocation) throws PortletInvokerException
{
- PortletInvocationFactory.contextualize(actionInvocation);
-
- //
- Window window = PortletInvocationFactory.getTargetWindow(actionInvocation);
-
- //
- Instance instance = instances.get(window.getName());
-
- //
- return instance.invoke(actionInvocation);
+ return internalInvoke(actionInvocation);
}
- /**
- * todo : handle cookies redistribution
- */
+ /** todo : handle cookies redistribution */
public PortletInvocationResponse invoke(List<Cookie> cookies, EventInvocation eventInvocation) throws PortletInvokerException
{
- PortletInvocationFactory.contextualize(eventInvocation);
-
- //
- Window window = PortletInvocationFactory.getTargetWindow(eventInvocation);
-
- //
- Instance instance = instances.get(window.getName());
-
- //
- return instance.invoke(eventInvocation);
+ return internalInvoke(eventInvocation);
}
public PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws PortletInvokerException
{
- PortletInvocationFactory.contextualize(resourceInvocation);
-
- //
- Window window = PortletInvocationFactory.getTargetWindow(resourceInvocation);
-
- //
- Instance instance = instances.get(window.getName());
-
- //
- return instance.invoke(resourceInvocation);
+ return internalInvoke(resourceInvocation);
}
public EventControllerContext getEventControllerContext()
@@ -224,4 +217,18 @@
{
return stateControllerContext;
}
+
+ private PortletInvocationResponse internalInvoke(PortletInvocation actionInvocation) throws PortletInvokerException
+ {
+ PortletInvocationFactory.contextualize(actionInvocation);
+
+ //
+ Window window = PortletInvocationFactory.getTargetWindow(actionInvocation);
+
+ //
+ Instance instance = instances.get(window.getName());
+
+ //
+ return instance.invoke(actionInvocation);
+ }
}
16 years
JBoss Portal SVN: r10682 - branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:21:25 -0400 (Mon, 21 Apr 2008)
New Revision: 10682
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
Log:
- Fixed an NPE if returned locales were null (which could have happened under some conditions with WSRP).
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2008-04-21 22:21:13 UTC (rev 10681)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2008-04-21 22:21:25 UTC (rev 10682)
@@ -187,7 +187,15 @@
public Object getValue(Object bean) throws IllegalArgumentException
{
Portlet portlet = (Portlet)bean;
- return new ArrayList(portlet.getInfo().getCapabilities().getAllLocales());
+ Set<Locale> locales = portlet.getInfo().getCapabilities().getAllLocales();
+ if (locales != null)
+ {
+ return new ArrayList<Locale>(locales);
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
}
});
portletDecorator.setProperty("smallIconLocation", new PortletIconPropertyDecorator(PortletIconInfo.SMALL));
16 years
JBoss Portal SVN: r10681 - branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:21:13 -0400 (Mon, 21 Apr 2008)
New Revision: 10681
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
Log:
- Fixed an NPE if returned locales were null (which could have happened under some conditions with WSRP).
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2008-04-21 22:20:27 UTC (rev 10680)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2008-04-21 22:21:13 UTC (rev 10681)
@@ -194,7 +194,15 @@
public Object getValue(Object bean) throws IllegalArgumentException
{
Portlet portlet = (Portlet)bean;
- return new ArrayList(portlet.getInfo().getCapabilities().getAllLocales());
+ Set<Locale> locales = portlet.getInfo().getCapabilities().getAllLocales();
+ if (locales != null)
+ {
+ return new ArrayList<Locale>(locales);
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
}
});
portletDecorator.setProperty("smallIconLocation", new PortletIconPropertyDecorator(PortletIconInfo.SMALL));
16 years
JBoss Portal SVN: r10680 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:20:27 -0400 (Mon, 21 Apr 2008)
New Revision: 10680
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
Log:
- add* methods now properly create a collection even if the given collection is empty.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-04-21 22:13:52 UTC (rev 10679)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-04-21 22:20:27 UTC (rev 10680)
@@ -491,15 +491,12 @@
if (modes != null)
{
int size = modes.size();
- if (size != 0)
+ if (this.modes == null)
{
- if (this.modes == null)
- {
- this.modes = new HashSet(size);
- }
-
- this.modes.addAll(modes);
+ this.modes = new HashSet(size);
}
+
+ this.modes.addAll(modes);
}
}
@@ -508,15 +505,12 @@
if (windowStates != null)
{
int size = windowStates.size();
- if (size != 0)
+ if (this.windowStates == null)
{
- if (this.windowStates == null)
- {
- this.windowStates = new HashSet(size);
- }
-
- this.windowStates.addAll(windowStates);
+ this.windowStates = new HashSet(size);
}
+
+ this.windowStates.addAll(windowStates);
}
}
@@ -525,15 +519,12 @@
if (locales != null)
{
int size = locales.size();
- if (size != 0)
+ if (this.locales == null)
{
- if (this.locales == null)
- {
- this.locales = new HashSet(size);
- }
-
- this.locales.addAll(locales);
+ this.locales = new HashSet(size);
}
+
+ this.locales.addAll(locales);
}
}
}
16 years
JBoss Portal SVN: r10679 - branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:13:52 -0400 (Mon, 21 Apr 2008)
New Revision: 10679
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
Log:
- Implemented getCache and getSecurity. getSecurity might need improvements pending clarification of SecurityInfo contract.
- add* methods now properly create a collection even if the given collection is empty.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-04-21 22:11:19 UTC (rev 10678)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-04-21 22:13:52 UTC (rev 10679)
@@ -27,6 +27,7 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.common.net.media.MediaType;
import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.portlet.TransportGuarantee;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
import org.jboss.portal.portlet.info.EventingInfo;
@@ -184,12 +185,31 @@
public SecurityInfo getSecurity()
{
- throw new UnsupportedOperationException("getSecurity currently not supported!");
+ // todo: get more details on the SecurityInfo contract...
+ return new SecurityInfo()
+ {
+ public boolean containsTransportGuarantee(TransportGuarantee transportGuarantee)
+ {
+ return TransportGuarantee.NONE.equals(transportGuarantee);
+ }
+
+ public Set<TransportGuarantee> getTransportGuarantees()
+ {
+ return Collections.singleton(TransportGuarantee.NONE);
+ }
+ };
}
public CacheInfo getCache()
{
- throw new UnsupportedOperationException("getCache currently not supported!");
+ return new CacheInfo()
+ {
+ public int getExpirationSecs()
+ {
+ Integer expirationCacheSeconds = originatingProducer.getExpirationCacheSeconds();
+ return expirationCacheSeconds != null ? expirationCacheSeconds : 0;
+ }
+ };
}
public Boolean isRemotable()
@@ -512,15 +532,12 @@
if (modes != null)
{
int size = modes.size();
- if (size != 0)
+ if (this.modes == null)
{
- if (this.modes == null)
- {
- this.modes = new HashSet<ModeInfo>(size);
- }
+ this.modes = new HashSet<ModeInfo>(size);
+ }
- this.modes.addAll(modes);
- }
+ this.modes.addAll(modes);
}
}
@@ -529,15 +546,12 @@
if (windowStates != null)
{
int size = windowStates.size();
- if (size != 0)
+ if (this.windowStates == null)
{
- if (this.windowStates == null)
- {
- this.windowStates = new HashSet<WindowStateInfo>(size);
- }
+ this.windowStates = new HashSet<WindowStateInfo>(size);
+ }
- this.windowStates.addAll(windowStates);
- }
+ this.windowStates.addAll(windowStates);
}
}
@@ -546,15 +560,12 @@
if (locales != null)
{
int size = locales.size();
- if (size != 0)
+ if (this.locales == null)
{
- if (this.locales == null)
- {
- this.locales = new HashSet<Locale>(size);
- }
+ this.locales = new HashSet<Locale>(size);
+ }
- this.locales.addAll(locales);
- }
+ this.locales.addAll(locales);
}
}
}
16 years