You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by wo...@apache.org on 2009/11/24 17:56:29 UTC
svn commit: r883780 - in
/portals/jetspeed-2/applications/j2-admin/trunk/src/main:
java/org/apache/jetspeed/portlets/custom/ webapp/WEB-INF/
webapp/WEB-INF/view/custom/
Author: woonsan
Date: Tue Nov 24 16:56:28 2009
New Revision: 883780
URL: http://svn.apache.org/viewvc?rev=883780&view=rev
Log:
JS2-1086: Adding custom preview delegatee portlet
Added:
portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java (with props)
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp (with props)
Modified:
portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomConfigModePortlet.java
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml
Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomConfigModePortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomConfigModePortlet.java?rev=883780&r1=883779&r2=883780&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomConfigModePortlet.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomConfigModePortlet.java Tue Nov 24 16:56:28 2009
@@ -37,7 +37,6 @@
import org.apache.jetspeed.om.common.SecurityConstraint;
import org.apache.jetspeed.om.common.SecurityConstraints;
import org.apache.jetspeed.om.page.BaseFragmentElement;
-import org.apache.jetspeed.om.page.Fragment;
import org.apache.jetspeed.om.page.Page;
import org.apache.jetspeed.page.PageManager;
import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
@@ -46,8 +45,7 @@
/**
* Common Custom Config Mode Portlet
*
- * @author <a href="mailto:woonsan@apache.org">Woonsan Ko</a>
- * @version $Id: $
+ * @version $Id$
*/
public class CustomConfigModePortlet extends GenericVelocityPortlet
{
Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java?rev=883780&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java Tue Nov 24 16:56:28 2009
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.jetspeed.portlets.custom;
+
+import java.io.IOException;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+
+/**
+ * Common Custom Preview Mode Portlet
+ *
+ * @version $Id$
+ */
+public class CustomPreviewModePortlet extends GenericVelocityPortlet
+{
+ private static final PortletMode PREVIEW_MODE = new PortletMode("preview");
+
+ private String previewPage;
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ this.previewPage = config.getInitParameter("PreviewPage");
+ }
+
+ protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException
+ {
+ if (!request.getWindowState().equals(WindowState.MINIMIZED))
+ {
+ PortletMode curMode = request.getPortletMode();
+
+ if (PREVIEW_MODE.equals(curMode))
+ {
+ request.setAttribute(PARAM_VIEW_PAGE, previewPage);
+ doView(request, response);
+ }
+ else
+ {
+ super.doDispatch(request, response);
+ }
+ }
+ }
+
+}
\ No newline at end of file
Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/custom/CustomPreviewModePortlet.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml?rev=883780&r1=883779&r2=883780&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml Tue Nov 24 16:56:28 2009
@@ -1100,7 +1100,30 @@
<keywords>admin,config,custom</keywords>
</portlet-info>
</portlet>
-
+
+ <portlet id="CustomPreviewModePortlet">
+ <description>Provides common custom preview mode portlet.</description>
+ <portlet-name>CustomPreviewModePortlet</portlet-name>
+ <display-name>Custom Preview Mode Portlet</display-name>
+ <portlet-class>
+ org.apache.jetspeed.portlets.custom.CustomPreviewModePortlet</portlet-class>
+ <init-param>
+ <name>PreviewPage</name>
+ <value>/WEB-INF/view/custom/preview-mode.jsp</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>preview</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <portlet-info>
+ <title>Custom Preview Mode</title>
+ <short-title>Preview</short-title>
+ <keywords>admin,preview,custom</keywords>
+ </portlet-info>
+ </portlet>
+
<portlet>
<description>Content Viewer displays the content of an HTML,
PDF, or other file types from any where on the file system, or
@@ -2284,8 +2307,18 @@
</portlet>
<custom-portlet-mode>
+ <description>a Custom Config Mode</description>
+ <portlet-mode>config</portlet-mode>
+ </custom-portlet-mode>
+
+ <custom-portlet-mode>
<description>a Custom Edit_defaults Mode</description>
<portlet-mode>edit_defaults</portlet-mode>
</custom-portlet-mode>
-
+
+ <custom-portlet-mode>
+ <description>a Custom Preview Mode</description>
+ <portlet-mode>preview</portlet-mode>
+ </custom-portlet-mode>
+
</portlet-app>
Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp?rev=883780&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp Tue Nov 24 16:56:28 2009
@@ -0,0 +1,16 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+--%>
+<%@ page language="java" %>
+<img src="/demo/images/preview/pickanumber.png"/>
Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/custom/preview-mode.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org