1 23 24 package com.sun.enterprise.tools.guiframework.view; 25 26 import com.iplanet.jato.ApplicationServletBase; 27 import com.iplanet.jato.RequestContext; 28 import com.iplanet.jato.RequestManager; 29 import com.iplanet.jato.model.DefaultModel; 30 import com.iplanet.jato.model.Model; 31 import com.iplanet.jato.view.ContainerView; 32 import com.iplanet.jato.view.View; 33 import com.iplanet.jato.view.ViewBean; 34 35 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 36 37 import com.sun.web.ui.view.wizard.CCWizardPage; 38 39 import javax.servlet.http.HttpServletRequest ; 40 41 42 public class DescriptorCCWizardPage extends DescriptorRequestHandlingViewBase implements CCWizardPage { 43 44 52 public DescriptorCCWizardPage(View view, Model model) { 53 this( 54 RequestManager.getRequestContext(), 55 (ContainerView)view, 56 ((DefaultModel)model).getName(), 57 ViewDescriptorManager.getInstance().getViewDescriptor(RequestManager.getRequestContext().getRequest().getAttribute(VIEW_DESCRIPTOR_NAME).toString()), 58 model); 59 } 60 61 62 67 public ViewBean getParentViewBean() { 68 RequestContext rc = RequestManager.getRequestContext(); 70 HttpServletRequest request = rc.getRequest(); 71 String pageName = request.getParameter(ApplicationServletBase.PARAM_HANDLER_BEAN); 72 if (pageName == null) { 73 pageName = request.getPathInfo(); 74 } 75 if (pageName != null) { 76 pageName = pageName.trim(); 77 while (pageName.charAt(0) == '/') { 78 pageName = pageName.substring(1); 79 } 80 try { 81 return rc.getViewBeanManager().getViewBean(pageName); 82 } catch (ClassNotFoundException ex) { 83 } 85 } 86 return null; 87 } 88 89 90 93 public DescriptorCCWizardPage(RequestContext ctx, ContainerView container, String name, ViewDescriptor desc) { 94 this(ctx, container, name, desc, null); 95 } 96 97 98 101 public DescriptorCCWizardPage(RequestContext ctx, ContainerView container, String name, ViewDescriptor desc, Model model) { 102 super(ctx, container, name, desc, model); 103 } 104 105 106 107 111 117 public String getPageletUrl() { 118 return getViewDescriptor().getDisplayURL(); 119 } 120 121 122 127 public static final String VIEW_DESCRIPTOR_NAME = "_VD_NAME"; 128 129 132 public static final String WIZARD_MODEL = "_wizModel"; 133 } 134 | Popular Tags |