Update of 
/var/cvs/contributions/CMSContainer/cmsc/portlets/src/java/com/finalist/cmsc/portlets
In directory james.mmbase.org:/tmp/cvs-serv13087

Modified Files:
        CmscPortlet.java 
Log Message:
CMSC-824,according to the Content-Type attribute ,include different jsp page.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/portlets/src/java/com/finalist/cmsc/portlets
See also: http://www.mmbase.org/jira/browse/CMSC-824


Index: CmscPortlet.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/portlets/src/java/com/finalist/cmsc/portlets/CmscPortlet.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- CmscPortlet.java    17 Dec 2007 20:30:52 -0000      1.16
+++ CmscPortlet.java    2 Apr 2008 10:23:49 -0000       1.17
@@ -1,6 +1,7 @@
 package com.finalist.cmsc.portlets;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.*;
 
 import javax.portlet.*;
@@ -35,7 +36,7 @@
 
    private static final String CONTENT_TYPE = "contenttype";
    private static final String CONTENT_TYPE_DEFAULT = "text/html";
-
+   private static final String CONTENT_TYPE_PLAIN = "text/plain";
    private Log log;
 
 
@@ -338,8 +339,14 @@
    protected void doView(RenderRequest req, RenderResponse res) throws 
PortletException, java.io.IOException {
       PortletPreferences preferences = req.getPreferences();
       String template = 
preferences.getValue(PortalConstants.CMSC_PORTLET_VIEW_TEMPLATE, null);
+      
+      if (req.getAttribute("Content-Type") != null && 
req.getAttribute("Content-Type").equals(CONTENT_TYPE_PLAIN)) {
+         doInclude("plain", template, req, res);
+      }
+      else {
       doInclude("view", template, req, res);
    }
+   }
 
 
    @Override
@@ -404,7 +411,6 @@
          contentType = CONTENT_TYPE_DEFAULT;
       }
       response.setContentType(contentType);
-
       PortletRequestDispatcher rd = getRequestDispatcher(type, template);
       rd.include(request, response);
    }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to