portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r883706 - in /portals/applications/demo/trunk/src/main: java/org/apache/portals/applications/demo/simple/PickANumberPortlet.java webapp/WEB-INF/portlet.xml webapp/images/ webapp/images/preview/ webapp/images/preview/pickanumber.png
Date Tue, 24 Nov 2009 14:46:04 GMT
Author: woonsan
Date: Tue Nov 24 14:46:03 2009
New Revision: 883706

URL: http://svn.apache.org/viewvc?rev=883706&view=rev
Log:
JS2-1086: Adding preview mode example

Added:
    portals/applications/demo/trunk/src/main/webapp/images/
    portals/applications/demo/trunk/src/main/webapp/images/preview/
    portals/applications/demo/trunk/src/main/webapp/images/preview/pickanumber.png   (with
props)
Modified:
    portals/applications/demo/trunk/src/main/java/org/apache/portals/applications/demo/simple/PickANumberPortlet.java
    portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml

Modified: portals/applications/demo/trunk/src/main/java/org/apache/portals/applications/demo/simple/PickANumberPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/demo/trunk/src/main/java/org/apache/portals/applications/demo/simple/PickANumberPortlet.java?rev=883706&r1=883705&r2=883706&view=diff
==============================================================================
--- portals/applications/demo/trunk/src/main/java/org/apache/portals/applications/demo/simple/PickANumberPortlet.java
(original)
+++ portals/applications/demo/trunk/src/main/java/org/apache/portals/applications/demo/simple/PickANumberPortlet.java
Tue Nov 24 14:46:03 2009
@@ -43,6 +43,7 @@
 {
     private static final PortletMode ABOUT_MODE = new PortletMode("about");
     private static final PortletMode EDIT_DEFAULTS_MODE = new PortletMode("edit_defaults");
+    private static final PortletMode PREVIEW_MODE = new PortletMode("preview");
     private static final PortletMode PRINT_MODE = new PortletMode("print");
     
     /**
@@ -151,6 +152,11 @@
                 request.setAttribute(PARAM_EDIT_PAGE, DEFAULT_EDIT_DEFAULTS_PAGE);
                 doEdit(request, response);
             }
+            else if (PREVIEW_MODE.equals(curMode))
+            {
+                response.setContentType("text/html");
+                response.getWriter().println("<img src=\"" + request.getContextPath()
+ "/images/preview/pickanumber.png" + "\"/>");
+            }
             else
             {
                 super.doDispatch(request, response);

Modified: portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml?rev=883706&r1=883705&r2=883706&view=diff
==============================================================================
--- portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/applications/demo/trunk/src/main/webapp/WEB-INF/portlet.xml Tue Nov 24 14:46:03
2009
@@ -264,6 +264,8 @@
       <portlet-mode>about</portlet-mode>
       <!--  support custom edit_defaults mode -->
       <portlet-mode>edit_defaults</portlet-mode>
+      <!--  support custom preview mode -->
+      <portlet-mode>preview</portlet-mode>
       <!--  support custom print mode -->
       <portlet-mode>print</portlet-mode>
     </supports>
@@ -1081,6 +1083,10 @@
     <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>
+  <custom-portlet-mode>
     <description>a Custom Print Mode</description>
     <portlet-mode>print</portlet-mode>
   </custom-portlet-mode>

Added: portals/applications/demo/trunk/src/main/webapp/images/preview/pickanumber.png
URL: http://svn.apache.org/viewvc/portals/applications/demo/trunk/src/main/webapp/images/preview/pickanumber.png?rev=883706&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/applications/demo/trunk/src/main/webapp/images/preview/pickanumber.png
------------------------------------------------------------------------------
    svn:mime-type = image/png



Mime
View raw message