weaver 2004/08/05 17:31:58
Modified: portal/src/java/org/apache/jetspeed/velocity
JetspeedVelocityViewServlet.java
portal/src/webapp/WEB-INF/templates/layout/html/columns
layout.vm
layout-portlets/src/webapp/WEB-INF portlet.xml
Log:
Fixed issue with the "Done" url moving portlets around (doh!)
Revision Changes Path
1.3 +9 -1
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
Index: JetspeedVelocityViewServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JetspeedVelocityViewServlet.java 20 Jul 2004 13:56:15 -0000 1.2
+++ JetspeedVelocityViewServlet.java 6 Aug 2004 00:31:58 -0000 1.3
@@ -11,8 +11,10 @@
import java.io.UnsupportedEncodingException;
import javax.portlet.PortletConfig;
+import javax.portlet.PortletMode;
import javax.portlet.PortletRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -64,6 +66,12 @@
ctx.put("renderRequest", renderRequest);
ctx.put("renderResponse", renderResponse);
ctx.put("portletConfig", portletConfig);
+ ctx.put("portletModeView", PortletMode.VIEW);
+ ctx.put("portletModeEdit", PortletMode.EDIT);
+ ctx.put("portletModeHelp", PortletMode.HELP);
+ ctx.put("windowStateNormal", WindowState.NORMAL);
+ ctx.put("windowStateMinimized", WindowState.MINIMIZED);
+ ctx.put("windowStateMaximized", WindowState.MAXIMIZED);
return super.handleRequest(request, response, ctx);
}
1.8 +12 -7
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm
Index: layout.vm
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- layout.vm 5 Aug 2004 23:36:46 -0000 1.7
+++ layout.vm 6 Aug 2004 00:31:58 -0000 1.8
@@ -39,14 +39,17 @@
#parse($jetspeed.getDecoration($decoTop, "layout").appRelativePath)
#end
-
+#set($layoutType =$portletConfig.getInitParameter("layoutType"))
#if($jetspeed.portletMode.toString() == "edit")
#set($editing = true)
#set($lastColumn = $renderRequest.getAttribute("numberOfColumns") - 1)
- #set($layoutType =$portletConfig.getInitParameter("layoutType"))
- <a href="$jetspeed.createAction(3).action">Done</a>
+ #set($viewUrl = $renderResponse.createRenderURL())
+ $!viewUrl.setPortletMode($portletModeView)
+ <a href="$viewUrl">Done</a>
#else
- <a href="$jetspeed.createAction(4).action">Customize</a>
+ #set($editUrl = $renderResponse.createRenderURL())
+ $!editUrl.setPortletMode($portletModeEdit)
+ <a href="$editUrl">Customize</a>
#end
<table id="portal-layout-${myPage.id}" width="100%" cellspacing="0" cellpadding="0"
class="portal-layout">
@@ -58,12 +61,14 @@
#foreach($f in $entry)
<tr>
<td width="100%">
+ #set($row = $f.getProperties($layoutType).get(0).intValue)
+ #set($col = $f.getProperties($layoutType).get(1).intValue)
+ Row: $row<br/>
+ Column:$col
#if($editing)<div id="_$f.id">
<div style="position:relative; top:10px; left:0; width:100%;
height:100%; border: solid thin blue; ">
- #set($row = $f.getProperties($layoutType).get(0).intValue)
- #set($col = $f.getProperties($layoutType).get(1).intValue)
-
+
#if($col > 0)
#set($leftUrl = $renderResponse.createRenderURL())
$!leftUrl.setParameter("moveBy","-1,0")
1.3 +1 -1
jakarta-jetspeed-2/layout-portlets/src/webapp/WEB-INF/portlet.xml
Index: portlet.xml
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/layout-portlets/src/webapp/WEB-INF/portlet.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- portlet.xml 5 Aug 2004 23:36:11 -0000 1.2
+++ portlet.xml 6 Aug 2004 00:31:58 -0000 1.3
@@ -1 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<portlet-app id="jetspeed" version="1.0">
<portlet id="TwoColumns">
<portlet-name>TwoColumns</portlet-name>
<display-name>Two Columns Layout</display-name>
<init-param>
<name>ViewPage</name>
<value>/WEB-INF/layout/columns.jsp</value>
</init-param>
<init-param>
<name>columns</name>
<value>2</value>
</init-param>
<init-param>
<name>sizes</name>
<value>50%,50%</value>
</init-param>
<init-param>
<name>layoutType</name>
<value>TwoColumns</value>
</init-param>
<portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>TwoColumns</title>
<short-title>TwoColumns</short-title>
</portlet-info>
</portlet>
<portlet id="VelocityTwoColumns">
<portlet-name>VelocityTwoColumns</portlet-name>
<display-name>Two Columns Layout Using Velocity</display-name>
<init-param>
<name>ViewPage</name>
<value>columns</value>
</init-param>
<init-param>
<name>MaxPage</name>
<value>maximized</value>
</init-param>
<init-param>
<name>columns</name>
<value>2</value>
</init-param>
<init-param>
<name>sizes</name>
<value>50%,50%</value>
</init-param>
<init-param>
<name>layoutType</name>
<value>TwoColumns</value>
</init-param>
<portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>VelocityTwoColumns</title>
<short-title>TwoColumns</short-title>
</portlet-info>
</portlet>
</portlet-app>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<portlet-app id="jetspeed" version="1.0">
<portlet id="TwoColumns">
<portlet-name>TwoColumns</portlet-name>
<display-name>Two Columns Layout</display-name>
<init-param>
<name>ViewPage</name>
<value>/WEB-INF/layout/columns.jsp</value>
</init-param>
<init-param>
<name>columns</name>
<value>2</value>
</init-param>
<init-param>
<name>sizes</name>
<value>50%,50%</value>
</init-param>
<init-param>
<name>layoutType</name>
<value>TwoColumns</value>
</init-param>
<portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<mime-type>text/html</mime-type>
<portlet-mode>EDIT</portlet-mode>
</supports>
<portlet-info>
<title>TwoColumns</title>
<short-title>TwoColumns</short-title>
</portlet-info>
</portlet>
<portlet id="VelocityTwoColumns">
<portlet-name>VelocityTwoColumns</portlet-name>
<display-name>Two Columns Layout Using Velocity</display-name>
<init-param>
<name>ViewPage</name>
<value>columns</value>
</init-param>
<init-param>
<name>MaxPage</name>
<value>maximized</value>
</init-param>
<init-param>
<name>columns</name>
<value>2</value>
</init-param>
<init-param>
<name>sizes</name>
<value>50%,50%</value>
</init-param>
<init-param>
<name>layoutType</name>
<value>TwoColumns</value>
</init-param>
<portlet-class>org.apache.jetspeed.portlets.layout.MultiColumnPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<mime-type>text/html</mime-type>
<portlet-mode>EDIT</portlet-mode>
</supports>
<portlet-info>
<title>VelocityTwoColumns</title>
<short-title>TwoColumns</short-title>
</portlet-info>
</portlet>
</portlet-app>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]