Author: chris.laprun(a)jboss.com
Date: 2007-05-04 23:27:54 -0400 (Fri, 04 May 2007)
New Revision: 7196
Removed:
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java
Log:
- Removed unused portlet.
Deleted:
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java 2007-05-05
03:27:23 UTC (rev 7195)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java 2007-05-05
03:27:54 UTC (rev 7196)
@@ -1,205 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.wsrp.portlet.consumers;
-
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
-import org.jboss.portal.wsrp.consumer.ProducerInfo;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class WSRPConsumerConfigurationPortlet extends GenericPortlet
-{
- private ConsumerRegistry registry;
- private static final String NOT_SUPPORTED = "notSupported";
- private static final String JSP_PATH = "/WEB-INF/jsp/consumers/";
-
- public static final String OP = "op";
- public static final String OP_LIST = "list";
- public static final String OP_ACTIVATE = "activate";
- public static final String OP_CONFIGURE = "configure";
- public static final String OP_REGISTER = "register";
- private static final String OP_ERROR = "error";
- public static final String ID = "id";
- public static final String ACTIVATE = "activate";
- public static final String REGISTER = "register";
- public static final String CONSUMER = "consumer";
- public static final String CONSUMERS_REGISTRY = "ConsumersRegistry";
- public static final String OP_EDIT = "editConsumer";
-
- public void init() throws PortletException
- {
- super.init();
- registry = (ConsumerRegistry)getPortletContext().getAttribute(CONSUMERS_REGISTRY);
- if (registry == null)
- {
- throw new PortletException("Couldn't initialize Consumers
registry");
- }
- }
-
- protected void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
- {
- response.setContentType("text/html");
-
- String op = request.getParameter(OP);
- if (op == null)
- {
- op = OP_LIST;
- }
-
- // list consumers
- if (OP_LIST.equals(op))
- {
- PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(JSP_PATH
+ "view.jsp");
- rd.include(request, response);
- return;
- }
-
- // configure a specific consumer
- if (OP_CONFIGURE.equals(op))
- {
- String id = request.getParameter(ID);
-
- if (id == null)
- {
- response.getWriter().println("Cannot configure a Consumer without a
valid identifier!");
- }
-
-
- PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(JSP_PATH
+ "consumer.jsp");
- rd.include(request, response);
- return;
- }
-
- if (NOT_SUPPORTED.equals(op))
- {
- PrintWriter printWriter = response.getWriter();
- printWriter.print(request.getParameter("method") + " not yet
supported<br/>");
- PortletURL url = response.createRenderURL();
- url.setParameter(OP, OP_LIST);
- printWriter.println("<a href='" + url +
"'>back</a>");
- return;
- }
-
- if (OP_ERROR.equals(op))
- {
- PrintWriter printWriter = response.getWriter();
- printWriter.print(request.getParameter("message"));
- PortletURL url = response.createRenderURL();
- url.setParameter(OP, OP_LIST);
- printWriter.println("<br/><a href='" + url +
"'>back</a>");
- return;
- }
- }
-
- public void processAction(ActionRequest request, ActionResponse response) throws
PortletException, PortletSecurityException, IOException
- {
- String op = request.getParameter(OP);
- if (op == null)
- {
- return;
- }
-
- String id = request.getParameter(ID);
- if (id == null)
- {
- response.setRenderParameter(OP, OP_ERROR);
- response.setRenderParameter("message", "No Consumer identifier
was provided for the request!");
- return;
- }
-
- if (OP_ACTIVATE.equals(op))
- {
- String activate = request.getParameter(ACTIVATE);
- if (activate != null)
- {
- boolean start = Boolean.valueOf(activate).booleanValue();
- if (start)
- {
- registry.activateConsumerWith(id);
- }
- else
- {
- registry.deactivateConsumerWith(id);
- }
- }
-
- return;
- }
-
- if (OP_REGISTER.equals(op))
- {
- String regString = request.getParameter(REGISTER);
- if (regString != null)
- {
- boolean register = Boolean.valueOf(regString).booleanValue();
-
- try
- {
- ProducerInfo info = registry.getConsumer(id).getProducerInfo();
- if (register)
- {
- info.register();
- }
- else
- {
- info.deregister();
- }
-
- response.setRenderParameter(OP, OP_CONFIGURE);
- response.setRenderParameter(ID, id);
- }
- catch (PortletInvokerException e)
- {
- response.setRenderParameter(OP, OP_ERROR);
- response.setRenderParameter("message",
e.getLocalizedMessage());
- }
- }
-
- return;
- }
-
- if (OP_EDIT.equals(op))
- {
- response.setRenderParameter(OP, NOT_SUPPORTED);
- response.setRenderParameter("method", "modifying consumer
information");
- return;
- }
- }
-}
\ No newline at end of file