[jboss-user] [JBoss Portal] - Re: problem when deploying IPC portlet

matt4400 do-not-reply at jboss.com
Tue Jun 26 11:50:40 EDT 2007


What does it means ? because there is that in my ResourceListePortlet.java :


  | public class ResourceListePortlet extends GenericPortlet {
  | 
  | 	public void init(PortletConfig pConfig)throws PortletException{
  | 		super.init(pConfig);
  | 	}
  | 		
  | 	public void processAction(ActionRequest request,ActionResponse response)throws PortletException, PortletSecurityException, IOException{				String color = request.getParameter("color");
  | 	      String text = request.getParameter("sometext");
  | 	      if(color != null && text != null)
  | 	      {
  | 	         response.setRenderParameter("color", color);
  | 	         response.setRenderParameter("sometext", text);
  | 	      }
  | 	}
  | 	
  | 	protected void doView(RenderRequest request,RenderResponse response)throws PortletException, PortletSecurityException, IOException{				String color = request.getParameter("color");
  | 	      String text = request.getParameter("sometext");
  | 	      response.setContentType("text/html");
  | 	      PrintWriter writer = response.getWriter();
  | 	      if(text != null)
  | 	      {
  | 	         writer.write("<div style=\"color:" + color + ";\">");
  | 	         writer.write(text);
  | 	         writer.write("</div>");
  | 	      }
  | 	      else
  | 	      {
  | 	         writer.write("Use the portlet on the left to affect behaviour in this portlet");
  | 	      }
  | 
  | 	      writer.close();
  | 	}
  | 	
  | 	public static class Listener implements PortalNodeEventListener{
  | 
  | 		public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event) {
  | 			PortalNode node = event.getNode();
  | 			
  | 	        // Get node name
  | 	        String nodeName = node.getName();
  | 
  | 	        // See if we need to create a new event or not
  | 	        WindowActionEvent newEvent = null;
  | 	        if(nodeName.equals("AddResourcePortlet") && event instanceof WindowActionEvent){
  | 	        	WindowActionEvent wae = (WindowActionEvent)event;
  | 	        	PortalNode me = node.resolve("../ResourceListePortlet");
  | 	        	if(me != null){
  | 	        		newEvent = new WindowActionEvent(me);
  | 	        		newEvent.setMode(wae.getMode());
  | 	        		newEvent.setParameters(wae.getParameters());
  | 	        	}
  | 	        }
  | 	        if(newEvent != null){
  | 	        	return newEvent;
  | 	        }else{
  | 	        	return context.dispatch();
  | 	        }			
  | 		}
  | 		
  | 	}
  | }
  | 

I have juste copy and paste the HelloWolrdIPC with my own classes

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057768#4057768

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057768



More information about the jboss-user mailing list