Author: thomas.heute(a)jboss.com
Date: 2007-05-30 07:40:55 -0400 (Wed, 30 May 2007)
New Revision: 7359
Modified:
docs/trunk/referenceGuide/en/modules/contentIntegration.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/FSContentDrivenPortlet.java
trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java
trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java
Log:
JBPORTAL-1413: The Portlet Instance list should have a field label describing what it is
Modified: docs/trunk/referenceGuide/en/modules/contentIntegration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/contentIntegration.xml 2007-05-30 10:58:35 UTC
(rev 7358)
+++ docs/trunk/referenceGuide/en/modules/contentIntegration.xml 2007-05-30 11:40:55 UTC
(rev 7359)
@@ -61,10 +61,12 @@
<para>Content providers must be able to allow the user or administrator to
chose content from the external resource
it integrates in the portal in order to properly configure a portal window. A few
interactions between the portal, the content
provider and the portal user are necessary to achieve that goal. Here again it is
possible to provide content
- customization using a JSR 168 Portlet. For that purpose a special portlet mode
called
- <emphasis>edit_content</emphasis> has been introduced. It signals to
the portlet that it is editing the content portion
- of the state of a portlet. The traditional edit mode is not used because the edit
mode is more targetted to configure how
- the portlet show content to the end user rather than what content it
shows.</para>
+ customization using a JSR 168 Portlet. For that purpose two special portlet modes
called
+ <emphasis>edit_content</emphasis> and
<emphasis>select_content</emphasis> has been introduced. It signals to the
portlet
+ that it is selecting or editing the content portion of the state of a portlet.
<emphasis>select_content</emphasis> is
+ used to select a new content to put in a window while
<emphasis>edit_content</emphasis> is used to modify the previously
+ defined content, often the two modes will display the same thing. The traditional
edit mode is not used because the edit mode
+ is more targetted to configure how the portlet show content to the end user rather
than what content it shows.</para>
<imageobject>
<imagedata align="center"
fileref="images/content/cms.png" format="png"/>
</imageobject>
@@ -123,6 +125,9 @@
/** The edit_content mode. */
public static final PortletMode EDIT_CONTENT_MODE = new
PortletMode("edit_content");
+ /** The select_content mode. */
+ public static final PortletMode SELECT_CONTENT_MODE = new
PortletMode("select_content");
+
...
}
@@ -136,7 +141,7 @@
protected void doDispatch(RenderRequest req, RenderResponse resp)
throws PortletException, PortletSecurityException, IOException
{
- if (EDIT_CONTENT_MODE.equals(req.getPortletMode()))
+ if (EDIT_CONTENT_MODE.equals(req.getPortletMode()) ||
SELECT_CONTENT_MODE.equals(req.getPortletMode()))
{
doEditContent(req, resp);
}
Modified:
trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java 2007-05-30
10:58:35 UTC (rev 7358)
+++
trunk/core/src/main/org/jboss/portal/core/ui/content/portlet/PortletContentEditorPortlet.java 2007-05-30
11:40:55 UTC (rev 7359)
@@ -53,6 +53,8 @@
/** . */
private final PortletMode EDIT_CONTENT = new PortletMode("edit_content");
+ private final PortletMode SELECT_CONTENT = new
PortletMode("select_content");
+
/** . */
private InstanceContainer instanceContainer;
@@ -63,7 +65,7 @@
public void processAction(ActionRequest req, ActionResponse resp) throws
PortletException, PortletSecurityException, IOException
{
- if (req.getPortletMode().equals(EDIT_CONTENT))
+ if ((req.getPortletMode().equals(EDIT_CONTENT)) ||
(req.getPortletMode().equals(SELECT_CONTENT)))
{
String uri = req.getParameter("content.uri");
if (uri != null)
@@ -79,14 +81,30 @@
{
doEditContent(req, resp);
}
+ else if (SELECT_CONTENT.equals(req.getPortletMode()))
+ {
+ doCreateContent(req, resp);
+ }
+
else
{
super.doDispatch(req, resp);
}
}
+ protected void doCreateContent(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
+ {
+ getContent(req, resp, true);
+ }
+
+
protected void doEditContent(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
{
+ getContent(req, resp, false);
+ }
+
+ protected void getContent(RenderRequest req, RenderResponse resp, boolean newContent)
throws PortletException, PortletSecurityException, IOException
+ {
String selectedURI = req.getParameter("content.uri");
//
@@ -112,6 +130,16 @@
Collections.sort(available_instances, simpleComparator);
Instance selectedInstance = null;
+
+ if (!newContent)
+ {
+ writer.print("<span class=\"portlet-font\">Portlet instance
associated to this window:</span>");
+ }
+ else
+ {
+ writer.print("<span class=\"portlet-font\">Select a portlet
instance to associate to this window:</span>");
+ }
+
writer.print("<form action=\"");
writer.print(actionURL);
writer.print("\" method=\"post\">\n");
@@ -138,7 +166,9 @@
writer.println("</option>\n");
}
writer.println("</select><br />");
- writer.println("<input type=\"submit\"
name=\"content.action.select\" value=\"Select\"
class=\"portlet-form-button\"/>");
+
+ String buttonText = (newContent) ? "Select" : "Update";
+ writer.println("<input type=\"submit\"
name=\"content.action.select\" value=\"" + buttonText + "\"
class=\"portlet-form-button\"/>");
writer.println("<input type=\"submit\" value=\"Info\"
class=\"portlet-form-button\"/>");
writer.print("</form>");
@@ -168,4 +198,7 @@
//
writer.close();
}
+
+
+
}
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-05-30
10:58:35 UTC (rev 7358)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-05-30
11:40:55 UTC (rev 7359)
@@ -140,9 +140,9 @@
portletId="#{pageManager.selectedEditorPortletId}"
portletInvoker="#{pageManager.portletInvoker}"
actionListener="#{pageManager.assignWindow}"
- supportedModes="edit_content"
+ supportedModes="select_content"
supportedWindowStates="normal"
- initialMode="edit_content"
+ initialMode="select_content"
initialWindowState="normal"
onClick="url.setParameter('windowName',
document.getElementById('windowForm:windowName').value).setParameter('targetRegion',
document.getElementById('regionForm:targetRegion').value);"/>
</div>
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-05-30
10:58:35 UTC (rev 7358)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-05-30
11:40:55 UTC (rev 7359)
@@ -135,6 +135,9 @@
private static final PortletMode EDIT_CONTENT = new
PortletMode("edit_content");
/** . */
+ private static final PortletMode SELECT_CONTENT = new
PortletMode("select_content");
+
+ /** . */
private CMS CMSService;
/** . */
@@ -304,7 +307,7 @@
protected void doDispatch(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
{
- if (EDIT_CONTENT.equals(req.getPortletMode()))
+ if (EDIT_CONTENT.equals(req.getPortletMode()) ||
SELECT_CONTENT.equals(req.getPortletMode()))
{
doEditContent(req, resp);
}
Modified:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/FSContentDrivenPortlet.java
===================================================================
---
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/FSContentDrivenPortlet.java 2007-05-30
10:58:35 UTC (rev 7358)
+++
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/FSContentDrivenPortlet.java 2007-05-30
11:40:55 UTC (rev 7359)
@@ -55,13 +55,16 @@
/** The edit_content mode. */
public static final PortletMode EDIT_CONTENT_MODE = new
PortletMode("edit_content");
+
+ private final PortletMode SELECT_CONTENT = new
PortletMode("select_content");
+
/**
* Additional dispatch that will call the
<code>doEditContent(RenderRequest,RenderResponse)</code> method.
*/
protected void doDispatch(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
{
- if (EDIT_CONTENT_MODE.equals(req.getPortletMode()))
+ if (EDIT_CONTENT_MODE.equals(req.getPortletMode()) ||
SELECT_CONTENT.equals(req.getPortletMode()))
{
doEditContent(req, resp);
}
@@ -194,7 +197,7 @@
public void processAction(ActionRequest req, ActionResponse resp) throws
PortletException, PortletSecurityException, IOException
{
- if (EDIT_CONTENT_MODE.equals(req.getPortletMode()))
+ if (EDIT_CONTENT_MODE.equals(req.getPortletMode()) ||
SELECT_CONTENT.equals(req.getPortletMode()))
{
String contentURI = req.getParameter("content.uri");
Modified: trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java
===================================================================
--- trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java 2007-05-30 10:58:35
UTC (rev 7358)
+++ trunk/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java 2007-05-30 11:40:55
UTC (rev 7359)
@@ -48,6 +48,8 @@
/** . */
private final PortletMode EDIT_CONTENT = new PortletMode("edit_content");
+ private final PortletMode SELECT_CONTENT = new
PortletMode("select_content");
+
/** . */
private GGProvider provider = new GGProvider();
@@ -81,7 +83,7 @@
protected void doDispatch(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
{
- if (EDIT_CONTENT.equals(req.getPortletMode()))
+ if (EDIT_CONTENT.equals(req.getPortletMode()) ||
SELECT_CONTENT.equals(req.getPortletMode()))
{
doEditContent(req, resp);
}